Conversation
🦋 Changeset detectedLatest commit: db97bea The changes in this PR will be included in the next version bump. This PR includes changesets to release 0 packagesWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Preview deployments for this pull request: storybook - |
There was a problem hiding this comment.
Pull request overview
Refactors token creation/formatting to centralize token set “dimensions” (color schemes + size modes) and reduce duplicated constants across CLI token generation flows.
Changes:
- Introduces
tokenSetDimensionsand threads it through$themes/$metadatagenerators and call sites. - Adds
colorNamesByCategory()helper and updates generators to consume precomputed color-name arrays. - Splits token file generation into
createSystemTokenFiles()(system files) +tokenSetsToFiles()(per token set) and updates CLI/script usage.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/cli/src/tokens/utils.ts | Adds colorNamesByCategory() helper for deriving color name lists. |
| packages/cli/src/tokens/types.ts | Adds ColorNamesByCategory + TokenSetDimensions types. |
| packages/cli/src/tokens/format.ts | Uses tokenSetDimensions and derived color-name lists when generating $themes. |
| packages/cli/src/tokens/create/generators/$themes.ts | Updates $themes generation API to take token dimensions + color-name arrays. |
| packages/cli/src/tokens/create/generators/$metadata.ts | Updates $metadata generation API similarly and adds doc comment. |
| packages/cli/src/tokens/create/files.ts | Splits system token files from token set files and returns file lists. |
| packages/cli/src/tokens/create.ts | Centralizes color schemes/size modes into tokenSetDimensions. |
| packages/cli/src/scripts/update-preview-tokens.ts | Aligns preview token generation with new $themes API. |
| packages/cli/bin/designsystemet.ts | Updates CLI create command to use new file generation functions and shared dimensions. |
| .changeset/warm-streets-clap.md | Adds a new changeset file (currently empty content). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
f4c8891 to
cbc1f8b
Compare
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
cbc1f8b to
db97bea
Compare
Waiting for #4763 to have tests for this refactor.
This is a small refactor to reduce duplicate constants, faster execution and cleaner separation of concern.
This was originally done in #4639, but since we putting that on hold I have extracted those improvements into here.