Repository navigation
v2.4.0 — Runtime/Tools/Node Core Split, Modern CSS Export & Adapter Unification
TokiForge 2.4.0 splits @tokiforge/core into three purpose-built entry points with CI-enforced bundle budgets, adds modern CSS export, moves every remaining framework adapter onto the shared ThemeController, and aligns all packages and docs to 2.4.0.
Highlights
Lean, enforced core entry points
| Import | What you get | Use from |
|---|---|---|
@tokiforge/core/runtime |
ThemeRuntime, ThemeController, TokenExporter, ColorUtils, AccessibilityUtils |
Browser bundles, framework adapters |
@tokiforge/core/tools |
SSRUtils, TokenAnalytics, AnalyticsReporter, SemanticTokenManager, TokenVersioning, ResponsiveTokens, BrandManager, ComponentTheming, TokenRegistry, IDESupport, pluginManager, iOS/Android/RN exporters |
Build scripts, Storybook, docs sites (browser-safe, no fs) |
@tokiforge/core/node |
Everything above + TokenParser, FigmaDiff, CICDValidator |
CLI, Node tooling, VS Code |
@tokiforge/core |
Same as /node |
Backwards-compatible default |
Theme switching ({ ThemeRuntime, ThemeController }) measures 2.71 KB gzipped. Budgets are enforced in CI with size-limit on real tree-shaken imports: /runtime ≤ 3 KB, full /runtime ≤ 6 KB, /tools ≤ 14 KB, React/Vue/Svelte adapters ≤ 4 KB. Run pnpm size or pnpm size:why locally (Node 22+).
Modern CSS export
TokenExporteremitscolor-mix(),@layer, and@containeralongside CSS variables andlight-dark().- Deeper DTCG composite handling;
prefers-*and container-query breakpoints for responsive tokens.
Adapter unification
- Vue, Angular, Emotion, and styled-components now wrap
ThemeController, matching React, Next.js, Remix, Solid, Svelte, and SvelteKit. - React, Next.js, Remix expose
watchSystemThemeandstorageKey; Next.js and Remix re-exportSSRUtils. - Storybook ships an official
registerexport; Astro's injected script usesThemeControllerandgenerateStaticCSSwrites files to disk. - Tailwind peer widened to
tailwindcss@^3 || ^4.
CLI & tooling
tokiforge buildemits responsive and interactive-state CSS.- CLI and Tailwind read files via
@tokiforge/core/node. - Figma plugin
ui.html+manifest.jsonpackaged intodist; VS Code extension gains apackagescript for VSIX builds.
Docs site
- Resolves
@tokiforge/core/runtimefrom the prebuiltdist(source fallback);predev/prebuildbuild core + vue. ApiPlaygroundand seasonal overlay lazy-loaded; config split intoconfig.ts/head.ts/nav.ts; unusedvite/vitestdeps and Node stubs removed.- New Performance guide table with measured vs. budgeted sizes; Troubleshooting covers moved
/toolssymbols and Vite alias pitfalls.
Fixes
- Emotion / styled-components
switchThemenow applies the requested theme name. - Docs for
ResponsiveTokens,FigmaDiff, andCICDValidatormatch the shipped APIs. - Root
tsconfigmaps/runtime,/tools,/nodeto source so typecheck works before a build.
Tests & CI
- New suites for
FigmaDiff,CICDValidator,IDESupport; Angular tests enabled. 303 tests passing. size-limitreplaces the ad-hoc gzip script; runs once per CI matrix (ubuntu / Node 22).
Migration
// Browser bundles
import { ThemeRuntime, ThemeController } from '@tokiforge/core/runtime';
// Moved from /runtime → /tools in 2.4.0
import { SSRUtils, TokenAnalytics, IOSExporter } from '@tokiforge/core/tools';
// Node / CLI
import { TokenParser, CICDValidator } from '@tokiforge/core/node';@tokiforge/core (default) is unchanged and still exports everything. No other breaking changes.
Install
npm install @tokiforge/core@^2.4.0
# with an adapter
npm install @tokiforge/react@^2.4.0Full details in CHANGELOG.md.