Fix token parsing for Studio edge cases#3859
Draft
cursor[bot] wants to merge 1 commit into
Draft
Conversation
Co-authored-by: Jan Six <six.jan@gmail.com>
|
Contributor
|
|
Contributor
|
Commit SHA:7171f5393a3ae96c4fba4490d24cef3a0ef3f749 Test coverage results 🧪
|
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.
Why does this PR exist?
Closes #3854
Closes #3856
Closes #3857
Recent issues reported token-loading/rendering failures and incorrect type buckets for tokens coming from Studio or malformed JSON.
What does this pull request do?
namemetadata when normalizing parsed token JSON, so token paths still come from the JSON hierarchy.isSingleTokenso groups with child tokens namednameandvalueare not misidentified as leaf tokens.space->spacingandsize->sizingduring token conversion, including inherited group types.namecase, thename/valuechild-token group case, and Studio type aliases.Testing this change
node,npm,yarn, or installednode_modules, so Jest/lint commands cannot start here.yarn test --runTestsByPath src/utils/convertTokens.test.ts src/app/components/utils.test.ts --runInBand.Additional Notes (if any)
The code changes are intentionally scoped to token conversion/type guarding and should be low-risk for existing valid token JSON.