Skip to content

feat: improve tokens validation#99

Draft
lifaon74 wants to merge 10 commits intomainfrom
feat/improve-tokens-validation
Draft

feat: improve tokens validation#99
lifaon74 wants to merge 10 commits intomainfrom
feat/improve-tokens-validation

Conversation

@lifaon74
Copy link
Copy Markdown
Collaborator

@lifaon74 lifaon74 commented Apr 9, 2026

PR Checklist

Please check if your PR fulfills the following requirements:

Problem

Tokens must be validated to follow our rules.

It must:

  1. Tokens
  • check if the token json files follow the DTCG format (validation against zod schema)
  • check if t2 and t3 contains only references (=> no values)
  1. Modifiers
  • check if the modifiers contains only existing tokens (present in t2 and t3)
  • check if modifiers contains only references (=> no values)
  • check that contexts of a single modifier contain the same list of tokens
  • check if many modifiers do not modify the same token

Solution

Implement better validation

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 9, 2026

⏭️ Storybook build skipped

  • Reason: pull request is still in draft
  • Changed files inspected: 58
  • Workflow run: View details

Storybook build was intentionally skipped for this PR event.

Relevant files

  • packages/assets/images/svg/package.json
  • packages/tokens/scripts/scripts/build-tokens/src/build/build-tokens.ts
  • packages/tokens/scripts/scripts/build-tokens/src/constants/design-token-tiers.ts
  • packages/tokens/scripts/scripts/validate-tokens/validate-tokens.script.ts
  • packages/tokens/scripts/shared/dtcg/design-token/reference/value-or/expect/expect-design-token-reference.ts
  • ...and 53 more

@lifaon74 lifaon74 changed the title Feat/improve tokens validation feat: improve tokens validation Apr 10, 2026
Copy link
Copy Markdown
Collaborator

@vjo vjo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread packages/tokens/scripts/shared/dtcg/resolver/design-tokens-collection.ts Outdated
…n--check-t2-t3-refs

feat(tokens): improve tokens validation -> checks that t2. t3, and mo…
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.

2 participants