Fix token parsing for Studio edge cases#3859
Conversation
Co-authored-by: Jan Six <six.jan@gmail.com>
|
|
|
|
Commit SHA:7171f5393a3ae96c4fba4490d24cef3a0ef3f749 Test coverage results 🧪
|
|
🛡️ Hyma Compliance Check ✅ No compliance-relevant changes detected 2 file(s) scanned · 0 findings
|
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.