Skip to content

feat(cli): accept FIGMA_SYNTAX_* token profiles (ADR 051)#110

Merged
nathanacurtis merged 2 commits into
release/schema-0.21.0-cli-0.16.0from
feature/cli-variable-code-syntax
May 20, 2026
Merged

feat(cli): accept FIGMA_SYNTAX_* token profiles (ADR 051)#110
nathanacurtis merged 2 commits into
release/schema-0.21.0-cli-0.16.0from
feature/cli-variable-code-syntax

Conversation

@nathanacurtis
Copy link
Copy Markdown
Member

Summary

Implements the specs-cli side of ADR 051 — Platform Code-Syntax Token Profiles, which additively extends the format.tokens enum with three platform code-syntax profiles: FIGMA_SYNTAX_WEB, FIGMA_SYNTAX_IOS, and FIGMA_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 the TOKEN default.

Changes

  • Config/ConfigLoader.ts — add the three values to the validTokens allow-list. Uppercase normalization already handles FIGMA_SYNTAX_IOS correctly.
  • Config/ConfigTemplates.ts — list the new values in the init scaffold comment.
  • tests/unit/config/ConfigLoader.test.ts — accept-all-valid test covering all eight values + lowercase-normalization test for figma_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

  • generate passes the resolved ResolvedConfig straight to the transformer — no CLI-side token validation there, so the values flow through once the loader accepts them.
  • applyCustomTokens uses a MinimalConfig and never reads format.tokens — unaffected.
  • Config (config/tokens.md) and command doc sections were already up to date; only the guide needed the new profiles.
  • Fall-back-to-TOKEN for 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

nathanacurtis and others added 2 commits May 20, 2026 15:05
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>
@nathanacurtis nathanacurtis merged commit 7ee249c into release/schema-0.21.0-cli-0.16.0 May 20, 2026
@nathanacurtis nathanacurtis deleted the feature/cli-variable-code-syntax branch May 20, 2026 19:39
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