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 🙏

© 2026 – Pkg Stats / Ryan Hefner

bxbt-theme-build

v1.1.1

Published

Build UI theme presets from Figma token JSON exports

Readme

bxbt-theme-build

Dev-tool: JSON from the PrimeUI Figma plugin → PrimeVue / PrimeUIX preset (.ts) and optional --p-* CSS variables.

It does not run in the browser. The app imports the generated files. Aura comes from the app (@primeuix/themes peer).

Daily flow

  1. Designers export plugin JSON.
  2. Replace the old file in tokensDir.
  3. diff — what would change vs the current generated preset (does not write).
  4. build — write the new .ts and store the delta (last 3) in reportsDir/diff-history/.
  5. css-vars — only if the app also needs a SCSS/CSS variable sheet (editor hints). Runtime --p-* come from the generated preset + definePreset. Semantic tokens that Aura has no slot for are extra CSS variables (form.field.success.* → --p-form-field-success-*), not new Aura keys.

Install

npm i -D bxbt-theme-build
npm i @primeuix/themes

Local path while developing the builder:

"devDependencies": {
  "bxbt-theme-build": "file:../prime-theme-build"
}

CLI

All commands need --config theme.config.js.

| Command | Writes files? | What it is for | |---------|---------------|----------------| | bxbt-theme-build --config … | yes: outDir/*.ts | build — generate the preset the app imports | | diff --config … | no | compare new JSON with the current .ts (+ added, - removed, ~ changed) | | diff --history --config … | no | print the last 3 build deltas | | css-vars --config … | yes: cssVariables.out | CSS/SCSS sheet of --{prefix}-* (default --p-*) | | report --config … | yes: reportsDir/*.report.json | build diagnostics (unused tokens, inherited Aura fields) — not a value diff |

bxbt-theme-build diff --config theme.config.js
bxbt-theme-build --config theme.config.js
bxbt-theme-build css-vars --config theme.config.js

First build in an empty outDir has nothing to compare: no diff, no history file.

theme.config.js

| Field | For | |-------|-----| | tokensDir | folder with Figma JSON exports | | outDir | generated preset .ts (imported by the app) | | reportsDir | report JSON and, by default, diff history | | diffHistoryDir | override history folder (default {reportsDir}/diff-history) | | presets | file in tokensDir → out in outDir | | pixelsPerRem | Figma scale.* → rem | | cssVariables.out | generated variable sheet filename | | cssVariables.prefix | CSS prefix (p → --p-*). Must be the same prefix the app uses when attaching the theme | | extendTemplate | extra preset slots the app needs that Aura does not have | | aura | optional; otherwise Aura is loaded from the app node_modules |

export default {
  tokensDir: './theme/tokens',
  outDir: './theme/generated',
  reportsDir: './theme/reports',
  pixelsPerRem: 14,
  presets: [
    { file: 'design-tokens.json', out: 'prime-preset.ts' },
  ],
  cssVariables: {
    out: '_primevue-theme.variables.scss',
    prefix: 'p', // must match the prefix used when attaching the theme in the app

  },
};

API

If you do not want the CLI, call the same two steps from a Node script.

  • buildPreset(tokenExport, { aura, pixelsPerRem, extendTemplate }) — like CLI build: JSON object in, { preset, report } out. aura is required here (pass Aura from @primeuix/themes/aura).
  • writeCssVariables(preset, file, { prefix }) — like CLI css-vars: write --{prefix}-* to a file. prefix must match the prefix used when attaching the theme in the app.

The app still imports the generated .ts / CSS, not this package.

import { buildPreset, writeCssVariables } from 'bxbt-theme-build';
import Aura from '@primeuix/themes/aura';

const { preset, report } = buildPreset(tokenExport, {
  aura: Aura,
  pixelsPerRem: 14,
});

await writeCssVariables(preset, './theme.variables.scss', { prefix: 'p' });