npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@diskette/vex

v0.20.0

Published

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

Readme

@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

| Option | Alias | Description | Default | | -------------------- | ----- | ------------------------------------------------------ | ------- | | --output <dir> | -o | Directory for compiled CSS, JS, and .d.ts output | dist | | --namespace <name> | | Namespace for CSS scoping | * | | --tsconfig <path> | -p | Path to tsconfig.json for TypeScript resolution | | | --dry-run | -n | Process files without writing output | | | --watch | -w | Watch for file changes and recompile | | | --quiet | -q | Suppress non-error output | | | --debug | -d | Show 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

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

License

MIT