feat(tokens): add seed-driven token foundations#128
Merged
wangdicoder merged 3 commits intomasterfrom Apr 21, 2026
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
{seed.*}, enforcingprimitive -> semantic -> componentin both build-time validation and theme-runtime checks.compileBrandThemevia the new@tiny-design/tokens/compile-brand-themeexport, 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.resolvedValueto the registry so downstream tooling (@tiny-design/extract,@tiny-design/mcp) surfaces concrete default values;defaultValuestays the unresolved source reference perREGISTRY_SPEC.md.packages/mcp/src/data/tokens.jsonso 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 groupTest 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{seed.*}reference in a semantic slot and confirm the runtime validator emits the expected warning