feat(cli): accept FIGMA_SYNTAX_* token profiles (ADR 051)#110
Merged
nathanacurtis merged 2 commits intoMay 20, 2026
Merged
Conversation
Implement the CLI side of ADR 051, which adds three additive `format.tokens` serialization profiles: FIGMA_SYNTAX_WEB, FIGMA_SYNTAX_IOS, and FIGMA_SYNTAX_ANDROID. - ConfigLoader: add the three values to the validTokens allow-list so they are no longer reset to the TOKEN default during validation. - ConfigTemplates: list the new values in the init scaffold comment. - Tests: cover all eight valid token values plus lowercase normalization for FIGMA_SYNTAX_IOS. - Docs: document the platform code-syntax profiles in the token format guide (profile section, comparison table, when-to-use list). The schema package and config/commands doc sections already carried the new enum; generate passes the resolved config through unchanged and applyCustomTokens is unaffected. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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
Implements the specs-cli side of ADR 051 — Platform Code-Syntax Token Profiles, which additively extends the
format.tokensenum with three platform code-syntax profiles:FIGMA_SYNTAX_WEB,FIGMA_SYNTAX_IOS, andFIGMA_SYNTAX_ANDROID.The schema package (
types/Config.ts,component.schema.json) and the config/schema doc sections already carried these values; this PR closes the CLI gap where the loader independently re-validates the enum and would silently reset the new values to theTOKENdefault.Changes
Config/ConfigLoader.ts— add the three values to thevalidTokensallow-list. Uppercase normalization already handlesFIGMA_SYNTAX_IOScorrectly.Config/ConfigTemplates.ts— list the new values in theinitscaffold comment.tests/unit/config/ConfigLoader.test.ts— accept-all-valid test covering all eight values + lowercase-normalization test forfigma_syntax_ios.site/.../guides/token-format.md— document the platform code-syntax profiles (new profile section, comparison-table rows, when-to-use entry).Scope notes
generatepasses the resolvedResolvedConfigstraight to the transformer — no CLI-side token validation there, so the values flow through once the loader accepts them.applyCustomTokensuses aMinimalConfigand never readsformat.tokens— unaffected.config/tokens.md) and command doc sections were already up to date; only the guide needed the new profiles.TOKENfor tokens lacking platform code syntax is the transformer's responsibility per the ADR, not the CLI's.Testing
npm run build --workspace=packages/schema✅npm run build --workspace=packages/cli✅npm test --workspace=packages/cli✅ (212 passed, 2 skipped)🤖 Generated with Claude Code