Skip to content

fix(codemods): codemods for two entries the catalogue called manual - #3047

Open
mfal wants to merge 3 commits into
mainfrom
claude/migration-fixes-3041-69b531
Open

fix(codemods): codemods for two entries the catalogue called manual#3047
mfal wants to merge 3 commits into
mainfrom
claude/migration-fixes-3041-69b531

Conversation

@mfal

@mfal mfal commented Sep 1, 2026

Copy link
Copy Markdown
Member

Two published catalogue entries said action: manual while their change is
mechanically decidable. Both corrections were reported from the same real
upgrade run, and both are extracted from #3041 — that PR targets
next for its package-manager work, but a codemod for a migration that is
already in main is a fix to a published entry, not a feature.

renamed-css-export

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, exact match
rather than prefix, since ./styles had nothing underneath it (all-layered.css
beside it stays untouched). It cannot reach an @import in a .css/.scss, and
apply says so rather than implying full coverage.

catalog.test.ts used renamed-css-export as its example of a manual entry, so
adding the codemod broke a test that was only ever 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.

table-column-width-props

Follows the accent-box-color-to-background-color template: a codemod for the
decidable subset, with apply naming what it will not touch.

  • maxWidth always goes. The prop was removed from the type, so an explicit
    attribute is wrong at any value, maxWidth={computed} included.
  • width/minWidth go only where the source literally says null.
    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.

Verification

  • 301 unit tests pass (16 of them the two new fixture files), test:compile
    clean, pnpm lint clean (0 errors, prettier green)
  • pnpm nx build codemods regenerates nothing further — MIGRATION.md and
    migrations.generated.ts in this branch are current

Follow-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 feat on next.

fixes #3061

🤖 Generated with Claude Code

@mfal mfal self-assigned this Sep 1, 2026
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for ./packages/components/

Status Category Percentage Covered / Total
🔵 Lines 78.69% 746 / 948
🔵 Statements 78.57% 763 / 971
🔵 Functions 80.09% 165 / 206
🔵 Branches 70.33% 377 / 536
File CoverageNo changed files found.
Generated in workflow #6618 for commit 099de7c by the Vitest Coverage Report Action

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

🚀 Preview Deployment

Preview environments are ready:

Type URL
docs pr-3047.docs.review.flow-components.de
storybook pr-3047.storybook.review.flow-components.de

Images:

  • docs: ghcr.io/mittwald/flow/docs:pr-3047
  • storybook: ghcr.io/mittwald/flow/storybook:pr-3047

@mfal
mfal marked this pull request as ready for review September 1, 2026 09:57
@mfal
mfal requested a review from a team September 1, 2026 09:57
@mfal mfal changed the title fix(codemods): codemods for two entries the catalogue called manual fix(codemods): codemods for two entries the catalogue called manual (fixes #3061) Sep 2, 2026
@mfal mfal changed the title fix(codemods): codemods for two entries the catalogue called manual (fixes #3061) fix(codemods): codemods for two entries the catalogue called manual Sep 2, 2026
mfal and others added 2 commits September 2, 2026 13:51
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
mfal force-pushed the claude/migration-fixes-3041-69b531 branch from a312221 to 399dae3 Compare September 2, 2026 11:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

codemods: renamed-css-export and table-column-width-props look mechanically decidable but are manual

1 participant