Skip to content

v2.4.0 — Runtime/Tools/Node Core Split, Modern CSS Export & Adapter Unification

Choose a tag to compare

@toozuuu toozuuu released this 26 Sep 18:19
· 3 commits to main since this release
f11ae0e

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

  • TokenExporter emits color-mix(), @layer, and @container alongside CSS variables and light-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 watchSystemTheme and storageKey; Next.js and Remix re-export SSRUtils.
  • Storybook ships an official register export; Astro's injected script uses ThemeController and generateStaticCSS writes files to disk.
  • Tailwind peer widened to tailwindcss@^3 || ^4.

CLI & tooling

  • tokiforge build emits responsive and interactive-state CSS.
  • CLI and Tailwind read files via @tokiforge/core/node.
  • Figma plugin ui.html + manifest.json packaged into dist; VS Code extension gains a package script for VSIX builds.

Docs site

  • Resolves @tokiforge/core/runtime from the prebuilt dist (source fallback); predev/prebuild build core + vue.
  • ApiPlayground and seasonal overlay lazy-loaded; config split into config.ts / head.ts / nav.ts; unused vite/vitest deps and Node stubs removed.
  • New Performance guide table with measured vs. budgeted sizes; Troubleshooting covers moved /tools symbols and Vite alias pitfalls.

Fixes

  • Emotion / styled-components switchTheme now applies the requested theme name.
  • Docs for ResponsiveTokens, FigmaDiff, and CICDValidator match the shipped APIs.
  • Root tsconfig maps /runtime, /tools, /node to source so typecheck works before a build.

Tests & CI

  • New suites for FigmaDiff, CICDValidator, IDESupport; Angular tests enabled. 303 tests passing.
  • size-limit replaces 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.0

Full details in CHANGELOG.md.