Repository navigation
fix(codemod): Map the regular font weight to system.fontWeight.normal - #4227
akshita317 wants to merge 1 commit into
Conversation
The v13.2 type token codemod rewrote type.properties.fontWeights.regular, and the font weight of every body and subtext type level, to system.fontWeight.regular. @workday/canvas-tokens-web has no such token: its font weights are light, normal, medium and bold. Migrated code failed to type-check, and cssVar received undefined. Map regular to normal, as the System mapping table already documents, and fix the same token in the migration overview and LLM migration guides. Add a spec that resolves the mapped type tokens against @workday/canvas-tokens-web. Fixes Workday#3688
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Update mapping and migration references modules/codemod/lib/v13.2/mapping/index.ts, modules/codemod/lib/v13.2/utils/generateLevelTokens.ts, modules/codemod/lib/v13.2/spec/*, modules/docs/llm/llm-token-migration-13.2.txt, modules/docs/llm/llm-token-migration-14.txt, modules/docs/mdx/tokens/TokenMigrationOverview.mdx |
The regular font-weight mapping and generated non-heading type-level tokens now use normal. Tests and migration examples use system.fontWeight.normal. Added tests that check configured font-weight and type-level paths against the token system. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Low
Suggested labels: documentation
Suggested reviewers: rayredgoose
Merge Risk: 
Minimal · up to cbc7a
-
The PR consistently corrects the regular font-weight token without an identified merge-blocking risk.
Pre-merge checks: 
5
-
Full details: Title check
-
Explanation
The title states the main change: the regular font weight is now mapped to system.fontWeight.normal in the v13.2 codemod. The raw summary confirms the mapping, generated level tokens, spec updates, and docs all change from regular to normal, matching the title. The linked issue
#3688describes the same naming mismatch. The title uses the fix(codemod) prefix and stays within one sentence.
Full details: Linked Issues check
-
Explanation
Issue
#3688requires correction of the regular font-weight token name. The PR mapsfontWeights.regularand non-heading type levels tosystem.fontWeight.normal. It updates the related migration documentation and adds token-resolution tests. These changes satisfy the linked issue coding requirement.
Full details: Out of Scope Changes check
-
Explanation
The changes stay within issue
#3688. The implementation fixes the font-weight mapping, the tests verify configured token paths, and the documentation updates remove the same incorrect token name. No unrelated behavior or feature change is shown.
Full details: Docstring Coverage
-
Explanation
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 4 files. (3 skipped: 3 unsupported.)
-
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
Summary
Fixes: #3688
The v13.2 type token codemod migrates the regular font weight to a token that does not exist.
@workday/canvas-tokens-webdefinessystem.fontWeight.light,normal,mediumandbold, but the codemod writessystem.fontWeight.regularin two places:type.properties.fontWeights.regular(thefontWeightsmapping)fontWeightof every body and subtext type level (generateLevelTokens)This maps regular to
normal, which is what the System mapping table already documents. It also fixes the same token inTokenMigrationOverview.mdxand in the v13.2 and v14 LLM migration guides, which still showedregular.It adds
modules/codemod/lib/v13.2/spec/mapping.spec.ts, which resolves every font weight and type level token the mapping produces against@workday/canvas-tokens-web, so a token name that does not exist fails a test rather than reaching migrated code.Release Category
Codemods
Checklist
For the Reviewer
Where Should the Reviewer Start?
modules/codemod/lib/v13.2/utils/generateLevelTokens.tsandmodules/codemod/lib/v13.2/mapping/index.tsAreas for Feedback? (optional)
Targets
support, like other patches.Testing Manually
yarn vitest run modules/codemod/lib/v13.2passes (43 tests). Without the fix, the two new mapping specs and five existing type token specs fail.Summary by CodeRabbit
system.fontWeight.normal, while headings and titles remain bold.system.fontWeight.normalfor regular text.