migrate-button-priority-to-variant
Migrates selected React button APIs from priority to variant in TypeScript and TSX codebases.
What It Changes
- Renames JSX prop
prioritytovariantonOverlayTrigger.Button. - Renames JSX prop
prioritytovariantonOverlayTrigger.IconButton. - Renames JSX prop
prioritytovariantonReplayPlayPauseButton. - Renames ReplayPlayPauseButton-local
*Prioritybindings to*Variantwhen they are directly used by the migrated prop expression. - Renames matching type/object property signatures such as
playPausePrioritytoplayPauseVariantwhen they useComponentProps<typeof ReplayPlayPauseButton>['priority']. - Renames
ComponentProps<typeof ReplayPlayPauseButton>['priority']to['variant']. - Rewrites ReplayPlayPauseButton fallback literals from
'default'to'secondary'inside migrated nullish-coalescing expressions.
Safety
- Targets only
**/*.{ts,tsx,mts,cts}. - Does not rewrite arbitrary
priorityprops on unrelated components. - Does not rename unrelated identifiers that merely end with
Priority. - Keeps the transform intentionally narrow to the button APIs named in the spec.
Workflow Parameter
runAiCleanup: boolean, defaulttrue.- When enabled, the workflow runs an optional
AI review and cleanupstep after the AST transform. - The AI step is for judgment-based cleanup of remaining local
*Priorityto*Variantcases tied to this migration, while avoiding unrelated rewrites.
Installation
bash
To run the local package:
bash
To disable the optional AI cleanup step:
bash
Example
tsx
becomes:
tsx
Development
bash
License
MIT