fix(codemods): codemods for two entries the catalogue called manual - #3047
Open
mfal wants to merge 3 commits into
Open
fix(codemods): codemods for two entries the catalogue called manual#3047mfal wants to merge 3 commits into
mfal wants to merge 3 commits into
Conversation
Contributor
Coverage Report for ./packages/components/
File CoverageNo changed files found. |
Contributor
🚀 Preview DeploymentPreview environments are ready:
Images:
|
mfal
marked this pull request as ready for review
September 1, 2026 09:57
The entry said `action: manual` while being the same shape as `password-tools-subpath-renamed`, which ships a codemod — one exact module specifier, swapped. Two entries with the same shape and different `action` values is hard to explain to a reader budgeting manual review. Modelled on that neighbour: every JS/TS form that names a module, and an exact match rather than a prefix, since `./styles` had nothing underneath it (so `all-layered.css` beside it is untouched). What it cannot reach is an `@import` in a `.css`/`.scss`, and `apply` says so rather than implying full coverage. `catalog.test.ts` named `renamed-css-export` as its example of a manual entry; adding the codemod broke a test that was only checking that the parser reads a non-codemod `action`. Made it id-independent — the correspondence between `action` and the transform file is enforced separately, over every entry. Reported from a real upgrade run. Extracted from #3041, which targets `next` for its package-manager work; this one corrects a catalogue entry that is already published, so it belongs on `main`. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The entry said `action: manual` while its change is mechanically decidable for
the cases the source spells out. `accent-box-color-to-background-color` is the
template: ship a codemod for the decidable subset and say in `apply` what it
will not touch.
Two changes with different decidability, and the transform treats them
differently:
- `maxWidth` always goes. The prop was removed from the type, so an explicit
attribute is wrong at any value — `maxWidth={computed}` included. Decidable
without reading the value.
- `width`/`minWidth` go only where the source literally says `null`, which is
what "no explicit width" is spelled as now. `width={maybeNull}` could be
anything at runtime and is left alone, exactly as
`accent-box-color-to-background-color` leaves `color={expression}`.
Scoped like its neighbours: only elements resolving to `TableColumn` through a
Flow import, named, aliased or namespace, subpath entries included. A spread
that might carry `maxWidth` is invisible and stays — `apply` names both gaps
rather than implying full coverage.
Reported from a real upgrade run. Extracted from #3041 for the
same reason as the entry before it: the catalogue entry is already published.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
mfal
force-pushed
the
claude/migration-fixes-3041-69b531
branch
from
September 2, 2026 11:53
a312221 to
399dae3
Compare
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.
Two published catalogue entries said
action: manualwhile their change ismechanically decidable. Both corrections were reported from the same real
upgrade run, and both are extracted from #3041 — that PR targets
nextfor its package-manager work, but a codemod for a migration that isalready in
mainis a fix to a published entry, not a feature.renamed-css-exportSame shape as
password-tools-subpath-renamed, which ships a codemod: one exactmodule specifier, swapped. Two entries with the same shape and different
actionvalues is hard to explain to a reader budgeting manual review.Modelled on that neighbour — every JS/TS form that names a module, exact match
rather than prefix, since
./styleshad nothing underneath it (all-layered.cssbeside it stays untouched). It cannot reach an
@importin a.css/.scss, andapplysays so rather than implying full coverage.catalog.test.tsusedrenamed-css-exportas its example of a manual entry, soadding the codemod broke a test that was only ever checking that the parser reads
a non-codemod
action. Made it id-independent; the correspondence betweenactionand the transform file is enforced separately, over every entry.table-column-width-propsFollows the
accent-box-color-to-background-colortemplate: a codemod for thedecidable subset, with
applynaming what it will not touch.maxWidthalways goes. The prop was removed from the type, so an explicitattribute is wrong at any value,
maxWidth={computed}included.width/minWidthgo only where the source literally saysnull.width={maybeNull}could be anything at runtime and is left alone, exactly asaccent-box-color-to-background-colorleavescolor={expression}.Scoped like its neighbours: only elements resolving to
TableColumnthrough aFlow import — named, aliased or namespace, subpath entries included. A spread
that might carry
maxWidthis invisible and stays.applynames both gaps.Verification
test:compileclean,
pnpm lintclean (0 errors, prettier green)pnpm nx build codemodsregenerates nothing further —MIGRATION.mdandmigrations.generated.tsin this branch are currentFollow-up
#3041 still carries these two commits. Once this merges, that PR
should drop them; what remains there is the package-manager install work, which
stays a
featonnext.fixes #3061
🤖 Generated with Claude Code