Skip to content

feat(tokens): add seed-driven token foundations#128

Merged
wangdicoder merged 3 commits intomasterfrom
upgrade-tokens-package
Apr 21, 2026
Merged

feat(tokens): add seed-driven token foundations#128
wangdicoder merged 3 commits intomasterfrom
upgrade-tokens-package

Conversation

@wangdicoder
Copy link
Copy Markdown
Owner

Summary

  • Add an internal primitive seed layer (brand, surface, typography, size, effects) and rewrite semantic tokens to reference seeds via {seed.*}, enforcing primitive -> semantic -> component in both build-time validation and theme-runtime checks.
  • Share a single compileBrandTheme via the new @tiny-design/tokens/compile-brand-theme export, generated from a source file with staleness verification. Remove ~600 lines of duplicated compile logic from the docs theme studio and rework the sidebar around seed groups.
  • Add resolvedValue to the registry so downstream tooling (@tiny-design/extract, @tiny-design/mcp) surfaces concrete default values; defaultValue stays the unresolved source reference per REGISTRY_SPEC.md.
  • Regenerate packages/mcp/src/data/tokens.json so MCP clients receive concrete values instead of {seed.*} references.

Release

  • @tiny-design/tokens: minor (new public export, new primitive category, new registry field, stricter validation)
  • @tiny-design/mcp: patch (token-extraction fix)
  • @tiny-design/react, @tiny-design/icons, @tiny-design/charts: version along via the fixed group

Test plan

  • pnpm --filter @tiny-design/tokens test (runtime token validation)
  • pnpm --filter @tiny-design/tokens build (registry + runtime artifacts regenerate cleanly)
  • pnpm --filter @tiny-design/mcp build (extracted tokens show resolved values)
  • pnpm dev — open the theme studio, verify seed groups render, Seed JSON view works, preset import remaps to seed fields, and no console errors
  • Import a theme doc containing a {seed.*} reference in a semantic slot and confirm the runtime validator emits the expected warning

Introduce an internal primitive seed layer (brand, surface, typography,
size, effects) and rewrite semantic tokens to reference seeds via
{seed.*}. Enforce the primitive -> semantic -> component flow in both
build-time validation and theme-runtime checks.

Share a single compileBrandTheme via the new
@tiny-design/tokens/compile-brand-theme export, generated from a source
file with staleness verification. Remove the duplicated compile logic
from the docs theme studio and rework its sidebar around seed groups.

Add resolvedValue to the registry so downstream tooling (extract/MCP)
can surface concrete default values while defaultValue stays the
unresolved source reference.
@wangdicoder wangdicoder merged commit 4444b58 into master Apr 21, 2026
1 check passed
@wangdicoder wangdicoder deleted the upgrade-tokens-package branch April 21, 2026 12:00
@github-actions github-actions Bot mentioned this pull request Apr 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant