Skip to content

feat: add v1.52.0 codemods#103

Merged
schultzp2020 merged 1 commit into
mainfrom
feat/v1.52.0-codemods
Jun 17, 2026
Merged

feat: add v1.52.0 codemods#103
schultzp2020 merged 1 commit into
mainfrom
feat/v1.52.0-codemods

Conversation

@schultzp2020

@schultzp2020 schultzp2020 commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Five packages for the Backstage 1.52.0 migration, implementing issues #97#101.

Codemods

# Package Type Tests Description
#97 @backstage/migrate-bui-props-to-intersection breaking 6 Convert interface extends ComboboxProps/SelectProps → type intersection + CSS SelectPopover TODO
#98 @backstage/remove-stitching-strategy-mode breaking 5 Remove deprecated catalog.stitchingStrategy.mode from app-config YAML
#99 @backstage/rename-bui-css-tokens-v1-52 deprecation 7 Rename 20 deprecated BUI semantic color tokens + 12 neutral interaction TODO markers
#100 @backstage/migrate-select-combobox-deprecated-props deprecation 7 Migrate deprecated Select/Combobox search props + inline option valueid
#101 @backstage/v1-52-0-migration-recipe recipe workflow validate Chains all 4 codemods in order (breaking first, deprecations last)

Total: 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 matching
  • rootNode.commitEdits(edits) for atomic edit application
  • Regex is only used for text replacement within already-matched AST nodes (CSS token renames in string_fragment/plain_value nodes)

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:

  • C1 (critical): Added collision check — if search prop already exists, skip (don't produce duplicate props)
  • I1 (important): Added TODO marker for variable-defined options (options={myOptions})
  • I2 (important): Distinguish searchable={true} (static literal, handle normally) from searchable={someVar} (dynamic, add TODO)

Pre-existing test failures

3 test failures in v1.50.0/catalog-node-alpha-to-stable are pre-existing and unrelated to this PR.

Closes #97, closes #98, closes #99, closes #100, closes #101

@schultzp2020 schultzp2020 force-pushed the feat/v1.52.0-codemods branch from 482c2d3 to 79a3eaf Compare June 17, 2026 16:47
@schultzp2020 schultzp2020 changed the title feat: add v1.52.0 codemods (#97, #98, #99, #100) feat: add v1.52.0 codemods Jun 17, 2026
@schultzp2020 schultzp2020 force-pushed the feat/v1.52.0-codemods branch 3 times, most recently from e065f11 to 59421bd Compare June 17, 2026 16:57
@schultzp2020 schultzp2020 requested a review from Copilot June 17, 2026 16:58

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 valueid 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.

Comment thread codemods/v1.52.0/remove-stitching-strategy-mode/scripts/codemod.ts Outdated
Comment thread codemods/v1.52.0/remove-stitching-strategy-mode/scripts/codemod.ts Outdated
Comment thread codemods/v1.52.0/remove-stitching-strategy-mode/scripts/codemod.ts Outdated
Comment thread codemods/v1.52.0/remove-stitching-strategy-mode/tests/mode-only/expected.yaml Outdated
Comment thread codemods/v1.52.0/migrate-bui-props-to-intersection/scripts/codemod.ts Outdated
Comment thread codemods/v1.52.0/migrate-bui-props-to-intersection/scripts/codemod.ts Outdated
Comment thread codemods/v1.52.0/migrate-select-combobox-deprecated-props/scripts/codemod.ts Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 103 out of 104 changed files in this pull request and generated 4 comments.

Comment thread codemods/v1.52.0/migrate-bui-props-to-intersection/scripts/codemod-css.ts Outdated
Comment thread codemods/v1.52.0/remove-stitching-strategy-mode/scripts/codemod.ts
Comment thread codemods/v1.52.0/remove-stitching-strategy-mode/scripts/codemod.ts
Comment thread codemods/v1.52.0/remove-stitching-strategy-mode/tests/mode-only/expected.yaml Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 106 out of 107 changed files in this pull request and generated 2 comments.

Comment thread codemods/v1.52.0/remove-stitching-strategy-mode/scripts/codemod.ts
Comment thread codemods/v1.52.0/migrate-bui-props-to-intersection/scripts/codemod.ts Outdated
@schultzp2020 schultzp2020 force-pushed the feat/v1.52.0-codemods branch from a9561f0 to a37cf0b Compare June 17, 2026 17:34
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
@schultzp2020 schultzp2020 force-pushed the feat/v1.52.0-codemods branch from a37cf0b to eeaf3d8 Compare June 17, 2026 17:36
@schultzp2020 schultzp2020 merged commit 5d5482f into main Jun 17, 2026
2 checks passed
@schultzp2020 schultzp2020 deleted the feat/v1.52.0-codemods branch June 17, 2026 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment