feat: add v1.52.0 codemods#103
Merged
Merged
Conversation
482c2d3 to
79a3eaf
Compare
e065f11 to
59421bd
Compare
There was a problem hiding this comment.
Pull request overview
Adds the Backstage v1.52.0 migration set to this repo: four new codemod packages plus a registry-based migration recipe that chains them in order, along with README index updates, lockfile entries, and Changesets.
Changes:
- Add 4 new v1.52.0 codemod packages (TS/TSX, CSS/SCSS, YAML) with workflows, scripts, and fixtures.
- Add a v1.52.0 migration recipe workflow + README that runs the codemods from the registry in a safe order.
- Update root README codemod index, yarn.lock workspace entries, and add Changesets for publishing.
Reviewed changes
Copilot reviewed 100 out of 101 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| yarn.lock | Adds workspace entries for the new v1.52.0 packages. |
| README.md | Adds v1.52.0 section and links to new codemods/recipe. |
| codemods/v1.52.0/rename-bui-css-tokens-v1-52/workflow.yaml | New workflow to run TSX + CSS token renames. |
| codemods/v1.52.0/rename-bui-css-tokens-v1-52/tsconfig.json | TS config for the token rename codemod scripts. |
| codemods/v1.52.0/rename-bui-css-tokens-v1-52/tests/semantic-renames/metrics.json | Metrics fixture for semantic token renames. |
| codemods/v1.52.0/rename-bui-css-tokens-v1-52/tests/semantic-renames/input.tsx | Input fixture for semantic token renames (TSX). |
| codemods/v1.52.0/rename-bui-css-tokens-v1-52/tests/semantic-renames/expected.tsx | Expected output fixture for semantic token renames (TSX). |
| codemods/v1.52.0/rename-bui-css-tokens-v1-52/tests/noop-no-tokens/input.tsx | No-op TSX fixture with no deprecated tokens. |
| codemods/v1.52.0/rename-bui-css-tokens-v1-52/tests/noop-no-tokens/expected.tsx | Expected no-op TSX fixture output. |
| codemods/v1.52.0/rename-bui-css-tokens-v1-52/tests/neutral-interaction-todo/metrics.json | Metrics fixture for neutral interaction TODO markers. |
| codemods/v1.52.0/rename-bui-css-tokens-v1-52/tests/neutral-interaction-todo/input.tsx | Input fixture for neutral interaction tokens (TSX). |
| codemods/v1.52.0/rename-bui-css-tokens-v1-52/tests/neutral-interaction-todo/expected.tsx | Expected output with TODO markers for neutral interaction tokens (TSX). |
| codemods/v1.52.0/rename-bui-css-tokens-v1-52/tests/foreground-renames/metrics.json | Metrics fixture for foreground token renames. |
| codemods/v1.52.0/rename-bui-css-tokens-v1-52/tests/foreground-renames/input.tsx | Input fixture for foreground token renames (TSX). |
| codemods/v1.52.0/rename-bui-css-tokens-v1-52/tests/foreground-renames/expected.tsx | Expected output fixture for foreground token renames (TSX). |
| codemods/v1.52.0/rename-bui-css-tokens-v1-52/tests/accent-renames/metrics.json | Metrics fixture for accent token renames. |
| codemods/v1.52.0/rename-bui-css-tokens-v1-52/tests/accent-renames/input.tsx | Input fixture for accent token renames (TSX). |
| codemods/v1.52.0/rename-bui-css-tokens-v1-52/tests/accent-renames/expected.tsx | Expected output fixture for accent token renames (TSX). |
| codemods/v1.52.0/rename-bui-css-tokens-v1-52/tests-css/token-renames/metrics.json | Metrics fixture for CSS token renames. |
| codemods/v1.52.0/rename-bui-css-tokens-v1-52/tests-css/token-renames/input.css | Input fixture for CSS token renames. |
| codemods/v1.52.0/rename-bui-css-tokens-v1-52/tests-css/token-renames/expected.css | Expected output fixture for CSS token renames. |
| codemods/v1.52.0/rename-bui-css-tokens-v1-52/tests-css/noop-no-tokens/input.css | No-op CSS fixture with no deprecated tokens. |
| codemods/v1.52.0/rename-bui-css-tokens-v1-52/tests-css/noop-no-tokens/expected.css | Expected no-op CSS fixture output. |
| codemods/v1.52.0/rename-bui-css-tokens-v1-52/scripts/codemod.ts | TSX implementation to rename deprecated BUI tokens in string fragments. |
| codemods/v1.52.0/rename-bui-css-tokens-v1-52/scripts/codemod-css.ts | CSS implementation to rename deprecated BUI tokens across CSS/SCSS sources. |
| codemods/v1.52.0/rename-bui-css-tokens-v1-52/package.json | New package definition + tests for the token rename codemod. |
| codemods/v1.52.0/rename-bui-css-tokens-v1-52/codemod.yaml | Codemod manifest for token renames. |
| codemods/v1.52.0/remove-stitching-strategy-mode/workflow.yaml | New YAML workflow to remove catalog.stitchingStrategy.mode from app-config. |
| codemods/v1.52.0/remove-stitching-strategy-mode/tsconfig.json | TS config for YAML transform script. |
| codemods/v1.52.0/remove-stitching-strategy-mode/tests/quoted-mode/metrics.json | Metrics fixture for quoted mode removal case. |
| codemods/v1.52.0/remove-stitching-strategy-mode/tests/quoted-mode/input.yaml | Input fixture with quoted mode. |
| codemods/v1.52.0/remove-stitching-strategy-mode/tests/quoted-mode/expected.yaml | Expected output fixture for quoted mode removal. |
| codemods/v1.52.0/remove-stitching-strategy-mode/tests/no-mode-noop/input.yaml | No-op fixture where mode is absent. |
| codemods/v1.52.0/remove-stitching-strategy-mode/tests/no-mode-noop/expected.yaml | Expected no-op output when mode is absent. |
| codemods/v1.52.0/remove-stitching-strategy-mode/tests/mode-with-siblings/metrics.json | Metrics fixture for removing mode while keeping siblings. |
| codemods/v1.52.0/remove-stitching-strategy-mode/tests/mode-with-siblings/input.yaml | Input fixture with mode plus sibling keys. |
| codemods/v1.52.0/remove-stitching-strategy-mode/tests/mode-with-siblings/expected.yaml | Expected output fixture keeping sibling keys. |
| codemods/v1.52.0/remove-stitching-strategy-mode/tests/mode-only/metrics.json | Metrics fixture for removing an entire stitchingStrategy block. |
| codemods/v1.52.0/remove-stitching-strategy-mode/tests/mode-only/input.yaml | Input fixture where stitchingStrategy only contains mode. |
| codemods/v1.52.0/remove-stitching-strategy-mode/tests/mode-only/expected.yaml | Expected fixture for “mode-only” case. |
| codemods/v1.52.0/remove-stitching-strategy-mode/tests/deferred-mode-only/metrics.json | Metrics fixture for mode: deferred block removal case. |
| codemods/v1.52.0/remove-stitching-strategy-mode/tests/deferred-mode-only/input.yaml | Input fixture with mode: deferred only. |
| codemods/v1.52.0/remove-stitching-strategy-mode/tests/deferred-mode-only/expected.yaml | Expected output fixture for deferred mode-only removal. |
| codemods/v1.52.0/remove-stitching-strategy-mode/scripts/codemod.ts | YAML implementation removing catalog.stitchingStrategy.mode. |
| codemods/v1.52.0/remove-stitching-strategy-mode/package.json | New package definition + tests for YAML codemod. |
| codemods/v1.52.0/remove-stitching-strategy-mode/codemod.yaml | Codemod manifest for config key removal. |
| codemods/v1.52.0/migration-recipe/workflow.yaml | New v1.52.0 recipe workflow chaining 4 registry codemods in order. |
| codemods/v1.52.0/migration-recipe/README.md | Recipe README documenting steps, usage, and out-of-scope items. |
| codemods/v1.52.0/migration-recipe/package.json | New recipe package definition + workflow validation test. |
| codemods/v1.52.0/migration-recipe/codemod.yaml | Recipe codemod manifest. |
| codemods/v1.52.0/migrate-select-combobox-deprecated-props/workflow.yaml | New workflow to migrate Select/Combobox deprecated props. |
| codemods/v1.52.0/migrate-select-combobox-deprecated-props/tsconfig.json | TS config for TSX transform script. |
| codemods/v1.52.0/migrate-select-combobox-deprecated-props/tests/variable-options-todo/metrics.json | Metrics fixture for variable options TODO marker. |
| codemods/v1.52.0/migrate-select-combobox-deprecated-props/tests/variable-options-todo/input.tsx | Input fixture with variable-defined options array. |
| codemods/v1.52.0/migrate-select-combobox-deprecated-props/tests/variable-options-todo/expected.tsx | Expected output fixture with TODO marker on options prop. |
| codemods/v1.52.0/migrate-select-combobox-deprecated-props/tests/select-searchable/metrics.json | Metrics fixture for Select search props migration. |
| codemods/v1.52.0/migrate-select-combobox-deprecated-props/tests/select-searchable/input.tsx | Input fixture for searchable + searchPlaceholder. |
| codemods/v1.52.0/migrate-select-combobox-deprecated-props/tests/select-searchable/expected.tsx | Expected output fixture producing search={{ ... }}. |
| codemods/v1.52.0/migrate-select-combobox-deprecated-props/tests/noop-table-searchplaceholder/input.tsx | No-op fixture ensuring Table searchPlaceholder isn’t migrated. |
| codemods/v1.52.0/migrate-select-combobox-deprecated-props/tests/noop-table-searchplaceholder/expected.tsx | Expected no-op output for Table case. |
| codemods/v1.52.0/migrate-select-combobox-deprecated-props/tests/noop-non-bui/input.tsx | No-op fixture for non-BUI Select import. |
| codemods/v1.52.0/migrate-select-combobox-deprecated-props/tests/noop-non-bui/expected.tsx | Expected no-op output for non-BUI Select import. |
| codemods/v1.52.0/migrate-select-combobox-deprecated-props/tests/inline-options-value-to-id/metrics.json | Metrics fixture for inline option value → id rename. |
| codemods/v1.52.0/migrate-select-combobox-deprecated-props/tests/inline-options-value-to-id/input.tsx | Input fixture for inline options array objects. |
| codemods/v1.52.0/migrate-select-combobox-deprecated-props/tests/inline-options-value-to-id/expected.tsx | Expected output fixture renaming value keys to id. |
| codemods/v1.52.0/migrate-select-combobox-deprecated-props/tests/existing-search-prop/metrics.json | Metrics fixture for skipping when search already exists. |
| codemods/v1.52.0/migrate-select-combobox-deprecated-props/tests/existing-search-prop/input.tsx | Input fixture with existing search prop. |
| codemods/v1.52.0/migrate-select-combobox-deprecated-props/tests/existing-search-prop/expected.tsx | Expected output fixture (no changes when search exists). |
| codemods/v1.52.0/migrate-select-combobox-deprecated-props/tests/combobox-input-value/metrics.json | Metrics fixture for Combobox search prop migration. |
| codemods/v1.52.0/migrate-select-combobox-deprecated-props/tests/combobox-input-value/input.tsx | Input fixture for Combobox inputValue/onInputChange. |
| codemods/v1.52.0/migrate-select-combobox-deprecated-props/tests/combobox-input-value/expected.tsx | Expected output fixture producing search={{ inputValue, onInputChange }}. |
| codemods/v1.52.0/migrate-select-combobox-deprecated-props/scripts/codemod.ts | TSX implementation migrating deprecated props + inline option keys. |
| codemods/v1.52.0/migrate-select-combobox-deprecated-props/package.json | New package definition + tests for Select/Combobox prop codemod. |
| codemods/v1.52.0/migrate-select-combobox-deprecated-props/codemod.yaml | Codemod manifest for Select/Combobox prop migration. |
| codemods/v1.52.0/migrate-bui-props-to-intersection/workflow.yaml | New workflow to rewrite interface extends to type intersection + CSS TODO pass. |
| codemods/v1.52.0/migrate-bui-props-to-intersection/tsconfig.json | TS config for TSX + CSS scripts. |
| codemods/v1.52.0/migrate-bui-props-to-intersection/tests/noop-non-bui/input.tsx | No-op fixture for non-@backstage/ui SelectProps import. |
| codemods/v1.52.0/migrate-bui-props-to-intersection/tests/noop-non-bui/expected.tsx | Expected no-op output for non-@backstage/ui case. |
| codemods/v1.52.0/migrate-bui-props-to-intersection/tests/named-import/metrics.json | Metrics fixture for named import interface→type conversion. |
| codemods/v1.52.0/migrate-bui-props-to-intersection/tests/named-import/input.tsx | Input fixture for named import interface extends ComboboxProps. |
| codemods/v1.52.0/migrate-bui-props-to-intersection/tests/named-import/expected.tsx | Expected output fixture converting interface to type intersection. |
| codemods/v1.52.0/migrate-bui-props-to-intersection/tests/multi-extends/metrics.json | Metrics fixture for multi-extends conversion. |
| codemods/v1.52.0/migrate-bui-props-to-intersection/tests/multi-extends/input.tsx | Input fixture for multi-extends interface. |
| codemods/v1.52.0/migrate-bui-props-to-intersection/tests/multi-extends/expected.tsx | Expected output fixture for multi-extends conversion. |
| codemods/v1.52.0/migrate-bui-props-to-intersection/tests/empty-body/metrics.json | Metrics fixture for empty interface body conversion. |
| codemods/v1.52.0/migrate-bui-props-to-intersection/tests/empty-body/input.tsx | Input fixture for empty interface body. |
| codemods/v1.52.0/migrate-bui-props-to-intersection/tests/empty-body/expected.tsx | Expected output fixture producing type X = ComboboxProps;. |
| codemods/v1.52.0/migrate-bui-props-to-intersection/tests-css/select-popover-child/metrics.json | Metrics fixture for SelectPopover > selector TODO insertion. |
| codemods/v1.52.0/migrate-bui-props-to-intersection/tests-css/select-popover-child/input.css | Input fixture containing .bui-SelectPopover > .... |
| codemods/v1.52.0/migrate-bui-props-to-intersection/tests-css/select-popover-child/expected.css | Expected output fixture with prepended TODO comment. |
| codemods/v1.52.0/migrate-bui-props-to-intersection/tests-css/noop-no-child-combinator/input.css | No-op fixture without direct child combinator. |
| codemods/v1.52.0/migrate-bui-props-to-intersection/tests-css/noop-no-child-combinator/expected.css | Expected no-op CSS fixture output. |
| codemods/v1.52.0/migrate-bui-props-to-intersection/scripts/codemod.ts | TSX implementation converting interface-extends to type intersection. |
| codemods/v1.52.0/migrate-bui-props-to-intersection/scripts/codemod-css.ts | CSS implementation adding TODO for SelectPopover direct-child selectors. |
| codemods/v1.52.0/migrate-bui-props-to-intersection/package.json | New package definition + tests for interface→type codemod. |
| codemods/v1.52.0/migrate-bui-props-to-intersection/codemod.yaml | Codemod manifest for interface→type + CSS TODO pass. |
| .changeset/v1-52-0-migration-recipe.md | Changeset for publishing the v1.52.0 migration recipe. |
| .changeset/rename-bui-css-tokens-v1-52.md | Changeset for publishing token rename codemod. |
| .changeset/remove-stitching-strategy-mode.md | Changeset for publishing stitchingStrategy mode removal codemod. |
| .changeset/migrate-select-combobox-deprecated-props.md | Changeset for publishing Select/Combobox prop migration codemod. |
| .changeset/migrate-bui-props-to-intersection.md | Changeset for publishing interface→type intersection codemod. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
59421bd to
38073f7
Compare
38073f7 to
a9561f0
Compare
a9561f0 to
a37cf0b
Compare
Five packages for the Backstage 1.52.0 migration: - migrate-bui-props-to-intersection (#97): Convert interface extends ComboboxProps/SelectProps to type intersection. CSS pass adds TODO for .bui-SelectPopover > selectors. 6 tests. - remove-stitching-strategy-mode (#98): Remove deprecated catalog.stitchingStrategy.mode from app-config YAML. 5 tests. - rename-bui-css-tokens-v1-52 (#99): Rename 20 deprecated BUI semantic color tokens + 12 neutral interaction TODO markers. Two-pass workflow (TS + CSS). 7 tests. - migrate-select-combobox-deprecated-props (#100): Migrate deprecated Select searchable/searchPlaceholder and Combobox inputValue/onInputChange to nested search config. Rename inline option value to id. 7 tests. - v1-52-0-migration-recipe (#101): Chains all 4 codemods in order (breaking first, deprecations last). No aiFixup on any step. All transforms use AST-based detection via ast-grep JSSG. Regex is only used for text replacement within already-matched AST nodes. Includes changesets for all 5 packages (minor bump). Closes #97, closes #98, closes #99, closes #100, closes #101
a37cf0b to
eeaf3d8
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.
Summary
Five packages for the Backstage 1.52.0 migration, implementing issues #97–#101.
Codemods
@backstage/migrate-bui-props-to-intersectioninterface extends ComboboxProps/SelectProps→ type intersection + CSS SelectPopover TODO@backstage/remove-stitching-strategy-modecatalog.stitchingStrategy.modefrom app-config YAML@backstage/rename-bui-css-tokens-v1-52@backstage/migrate-select-combobox-deprecated-propsvalue→id@backstage/v1-52-0-migration-recipeTotal: 25 tests + 5 workflow validations, all passing.
AST over regex verification
All transforms use AST-based detection via ast-grep JSSG:
rootNode.findAll({ rule: { kind: '...', ... } })for structural matchingrootNode.commitEdits(edits)for atomic edit applicationstring_fragment/plain_valuenodes)Verified by code review agent (
backstage.codemod-code-reviewer) and AST expert agent (backstage.codemod-ast-expert).Review fixes applied
The code review team identified 3 issues in #100, all fixed:
searchprop already exists, skip (don't produce duplicate props)options={myOptions})searchable={true}(static literal, handle normally) fromsearchable={someVar}(dynamic, add TODO)Pre-existing test failures
3 test failures in
v1.50.0/catalog-node-alpha-to-stableare pre-existing and unrelated to this PR.Closes #97, closes #98, closes #99, closes #100, closes #101