New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@diskette/vex

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@diskette/vex

Compiles vanilla-extract .css.ts files into CSS, JS, and TypeScript declarations

latest
Source
npmnpm
Version
0.20.0
Version published
Maintainers
1
Created
Source

@diskette/vex

Compiles vanilla-extract .css.ts files into CSS, JavaScript, and TypeScript declarations.

Installation

npm install @diskette/vex
# or
pnpm add @diskette/vex

Peer dependency: Requires @vanilla-extract/css

npm install @vanilla-extract/css

CLI Usage

vex <patterns...> [options]

Examples

# Process all .css.ts files in src/ and output to dist/
vex "src"

# Use a custom output directory
vex "src" --output build

# Preview what would be processed without writing files
vex "src" --dry-run

# Watch for changes and recompile
vex "src" --watch

# Use a specific tsconfig
vex "src" --tsconfig tsconfig.build.json

# Combine options
vex "src/components" -o dist/css -n

Options

OptionAliasDescriptionDefault
--output <dir>-oDirectory for compiled CSS, JS, and .d.ts outputdist
--namespace <name>Namespace for CSS scoping*
--tsconfig <path>-pPath to tsconfig.json for TypeScript resolution
--dry-run-nProcess files without writing output
--watch-wWatch for file changes and recompile
--quiet-qSuppress non-error output
--debug-dShow configuration and matched files before processing

* Defaults to name in package.json, or the current directory name

Output

For each .css.ts source file, Vex generates three files:

  • .css - Compiled CSS
  • .js - JavaScript module with exported class names and style references
  • .d.ts - TypeScript declarations

Example

vex "src" -o dist
src/                          dist/
├── components/               ├── components/
│   ├── button.css.ts    →    │   ├── button.css
│   │                         │   ├── button.js
│   │                         │   ├── button.d.ts
│   │                         │   │
│   └── card.css.ts      →    │   ├── card.css
│                             │   ├── card.js
│                             │   └── card.d.ts
│                             │
└── theme.css.ts         →    ├── theme.css
                              ├── theme.js
                              └── theme.d.ts

Programmatic API

import { Vex } from '@diskette/vex'

const vex = new Vex({
  namespace: 'my-app',
  compilerOptions: { outDir: 'dist' },
})

vex.addSource('src/styles.css.ts')

// Full build with async iteration
for await (const event of vex.build()) {
  switch (event.type) {
    case 'transpile':
      console.log(`Transpiling: ${event.file.path}`)
      break
    case 'complete':
      // event.result.outputs.css, .js, .dts
      break
    case 'done':
      console.log(`Built ${event.results.length} files in ${event.totalDuration}ms`)
      break
  }
}

// Or compile a single file
const result = vex.compile('src/styles.css.ts')
// result.outputs.css, result.outputs.js, result.outputs.dts

How It Works

  • Transpile - Wraps source with vanilla-extract file scope and transpiles to CommonJS via TypeScript
  • Execute - Runs transpiled code in a Node VM with a custom adapter that captures CSS definitions
  • Output - Generates .css from collected styles, .js with serialized exports, and .d.ts declarations

License

MIT

Keywords

vanilla-extract

FAQs

Package last updated on 14 Dec 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts