Repository navigation
feat(cli): codemod Badge dot mode → StatusDot - #949
Conversation
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR No new or modified components detected. Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
Adds migrate-badge-dot-to-statusdot codemod that converts XDSBadge shape="dot" usages to XDSStatusDot with proper variant mapping (success→positive, error→negative). - Detects shape="dot" prop as the dot mode signal - Maps variants, passes through label and other props - Handles import addition/removal - 12 test cases covering all edge cases - Dogfooded on repo: Badge.stories.tsx dot examples migrated Closes #945 Co-authored-by: Navi <[email protected]>
f711059 to
6c07ef8
Compare
Dogfooding notesThe codemod was run against the XDS repo itself. It correctly transformed:
It also transformed This will also serve as a smoke test for the codemod CI validation pipeline (#912) — the storybook dogfood change should be reproducible by the codemod. |
Badge dot mode is migrated to StatusDot via codemod (#949). Remove the DotIndicators story, StatusDot import, and shape argType control from Badge storybook. Co-authored-by: Navi <[email protected]>
Badge dot mode is migrated to StatusDot via codemod (#949). Remove the DotIndicators story, StatusDot import, and shape argType control from Badge storybook. Co-authored-by: Navi <[email protected]>
- Fix token names: --color-background-{color} / --color-text-{color}
- Remove shape prop and dot mode (codemod shipped in #949)
- Add non-semantic colors to XDSBadgeVariantMap
- Remove dot references from docs, tests, and stories
Co-authored-by: Navi <[email protected]>
- Fix token names: --color-background-{color} / --color-text-{color}
- Remove shape prop and dot mode (codemod shipped in #949)
- Add non-semantic colors to XDSBadgeVariantMap
- Remove dot references from docs, tests, and stories
Co-authored-by: Navi <[email protected]>
Adds migrate-badge-dot-to-statusdot codemod that converts XDSBadge shape="dot" usages to XDSStatusDot with proper variant mapping (success→positive, error→negative). - Detects shape="dot" prop as the dot mode signal - Maps variants, passes through label and other props - Handles import addition/removal - 12 test cases covering all edge cases - Dogfooded on repo: Badge.stories.tsx dot examples migrated Closes #945 Co-authored-by: Navi <[email protected]>
Badge dot mode is migrated to StatusDot via codemod (#949). Remove the DotIndicators story, StatusDot import, and shape argType control from Badge storybook. Co-authored-by: Navi <[email protected]>
Adds migrate-badge-dot-to-statusdot codemod that converts XDSBadge shape="dot" usages to XDSStatusDot with proper variant mapping (success→positive, error→negative). - Detects shape="dot" prop as the dot mode signal - Maps variants, passes through label and other props - Handles import addition/removal - 12 test cases covering all edge cases - Dogfooded on repo: Badge.stories.tsx dot examples migrated Closes #945 Co-authored-by: Navi <[email protected]>
Badge dot mode is migrated to StatusDot via codemod (#949). Remove the DotIndicators story, StatusDot import, and shape argType control from Badge storybook. Co-authored-by: Navi <[email protected]>
Adds migrate-badge-dot-to-statusdot codemod that converts XDSBadge shape="dot" usages to XDSStatusDot with proper variant mapping (success→positive, error→negative). - Detects shape="dot" prop as the dot mode signal - Maps variants, passes through label and other props - Handles import addition/removal - 12 test cases covering all edge cases - Dogfooded on repo: Badge.stories.tsx dot examples migrated Closes #945
Badge dot mode is migrated to StatusDot via codemod (#949). Remove the DotIndicators story, StatusDot import, and shape argType control from Badge storybook.
Summary
Adds a codemod that migrates
XDSBadgedot mode (shape="dot") toXDSStatusDot.What it does
shape="dot"prop on XDSBadgesuccess→positive,error→negative, others unchangedlabeldirectly (no placeholder needed — Badge already has it)shapeprop (StatusDot doesn't have it)Scope
This codemod only converts
shape="dot"Badge usages to StatusDot. It does not:shapeprop from XDSBadge itself (separate breaking change)success/errorstay as-is on pill badges)The variant mapping (
success→positive,error→negative) only applies during the Badge→StatusDot migration, since StatusDot uses different variant names.Test coverage
12 test cases covering: basic transform, variant mapping, pill badge exclusion, icon badge exclusion, import handling, mixed usage, prop passthrough, default variant, label passthrough.
Dogfooding
Ran on the XDS repo —
Badge.stories.tsxdot examples migrated correctly. Badge's own test file was also transformed (expected) but reverted since those tests should keep testingshape="dot"until the prop is removed.Closes #945