Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 10 additions & 0 deletions .changeset/ast-first-mui-helpers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'@backstage/migrate-mui-dialog-to-bui-dialog': patch
'@backstage/migrate-mui-autocomplete-to-combobox': patch
'@backstage/migrate-mui-tabs-to-bui-tabs': patch
'@backstage/migrate-mui-textfield-to-bui-textfield': patch
'@backstage/migrate-mui-select-family-to-bui-select': patch
'@backstage/migrate-mui-styles-to-bui-css-modules': patch
---

Rewrite remaining MUI→BUI helper transforms to be AST-first (no regex source rewriting).
9 changes: 9 additions & 0 deletions .changeset/density-mui-bui-size-medium.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
'@backstage/migrate-mui-button-to-bui-button': patch
'@backstage/migrate-mui-icon-button-to-button-icon': patch
'@backstage/migrate-mui-textfield-to-bui-textfield': patch
'@backstage/migrate-mui-chip-to-tag': patch
'@backstage/mui4-to-bui-migration-recipe': patch
---

Preserve MUI medium density on BUI migrations by emitting size="medium" when size is omitted (BUI defaults to small).
7 changes: 7 additions & 0 deletions .changeset/density-select-autocomplete-size.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@backstage/migrate-mui-select-family-to-bui-select': patch
'@backstage/migrate-mui-autocomplete-to-combobox': patch
'@backstage/mui4-to-bui-migration-recipe': patch
---

Preserve MUI medium density for Select and Autocomplete→Combobox/SearchAutocomplete, including FormControl and renderInput size fallbacks.
9 changes: 9 additions & 0 deletions .changeset/density-textfield-form-control-size.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
'@backstage/migrate-mui-textfield-to-bui-textfield': patch
'@backstage/migrate-mui-select-family-to-bui-select': patch
'@backstage/migrate-mui-autocomplete-to-combobox': patch
'@backstage/migrate-mui-chip-to-tag': patch
'@backstage/mui4-to-bui-migration-recipe': patch
---

Fall back to parent FormControl size for TextField density, and treat ternary/expression size props as dynamic across Select/Autocomplete/Chip/TextField.
16 changes: 16 additions & 0 deletions .changeset/docs-mui4-bui-readme-stubs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
'@backstage/migrate-mui-accordion-to-bui-accordion': patch
'@backstage/migrate-mui-alert-to-bui-alert': patch
'@backstage/migrate-mui-bootstrap-to-bui': patch
'@backstage/migrate-mui-chip-to-tag': patch
'@backstage/migrate-mui-dialog-to-bui-dialog': patch
'@backstage/migrate-mui-icons-to-remix-icons': patch
'@backstage/migrate-mui-list-family-to-bui-list': patch
'@backstage/migrate-mui-select-family-to-bui-select': patch
'@backstage/migrate-mui-slider-to-bui-slider': patch
'@backstage/migrate-mui-tabs-to-bui-tabs': patch
'@backstage/migrate-mui-tooltip-to-bui-tooltip': patch
'@backstage/remove-mui-dependencies': patch
---

Add thin operator README stubs (covers / TODOs / won't-do) for existing MUI 4 → BUI packages.
10 changes: 10 additions & 0 deletions .changeset/followup-mui4-bui-review-gaps.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'@backstage/migrate-mui-link-to-bui-link': patch
'@backstage/migrate-mui-layout-to-bui-layout': patch
'@backstage/migrate-mui-button-to-bui-button': patch
'@backstage/migrate-mui-typography-to-text': patch
'@backstage/migrate-mui-styles-to-bui-css-modules': patch
'@backstage/mui4-to-bui-migration-recipe': patch
---

Close remaining MUI→BUI review gaps: Link coexistence/aliasing + path skip, Paper default-elevation TODO, outlined→secondary metric, README/recipe operator docs.
8 changes: 8 additions & 0 deletions .changeset/harden-mui4-to-bui-codemods.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@backstage/migrate-mui-button-to-bui-button': minor
'@backstage/migrate-mui-textfield-to-bui-textfield': minor
'@backstage/migrate-mui-menu-popover-to-bui-menu': minor
'@backstage/migrate-mui-radio-checkbox-to-bui': minor
---

Harden MUI 4 → BUI migrations: Button icons/href/onPress, TextField specialized variants, Popover vs Menu heuristic, and standalone Checkbox.
11 changes: 11 additions & 0 deletions .changeset/minor-mui4-bui-new-packages.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
'@backstage/migrate-mui-switch-to-bui-switch': minor
'@backstage/migrate-mui-avatar-to-bui-avatar': minor
'@backstage/migrate-mui-skeleton-to-bui-skeleton': minor
'@backstage/migrate-mui-card-to-bui-card': minor
'@backstage/migrate-mui-autocomplete-to-combobox': minor
'@backstage/migrate-mui-link-to-bui-link': minor
'@backstage/mui4-to-bui-migration-recipe': minor
---

Add Avatar, Skeleton, Link, Card, Autocomplete→Combobox, and Switch codemods; update the MUI 4 → BUI recipe order and local workflow for pre-publish dry-runs.
6 changes: 6 additions & 0 deletions .changeset/parse-generic-tsx-helpers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@backstage/migrate-permissioned-route': patch
'@backstage/render-test-app-nav-migration': patch
---

Use `parse<TSX>(...)` instead of casting `SgRoot` when parsing synthetic TSX sources.
7 changes: 7 additions & 0 deletions .changeset/patch-mui4-bui-bugfixes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@backstage/migrate-mui-typography-to-text': patch
'@backstage/migrate-mui-layout-to-bui-layout': patch
'@backstage/migrate-mui-icon-button-to-button-icon': patch
---

Fix MUI 4 → BUI transforms: Typography maps only valid TextVariants, Paper never becomes Surface (Box bg=neutral / Card / TODO), and IconButton defaults to tertiary with color + onPress mapping.
6 changes: 6 additions & 0 deletions .changeset/typography-heading-as.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@backstage/migrate-mui-typography-to-text': patch
'@backstage/mui4-to-bui-migration-recipe': patch
---

Keep MUI heading weight for h5/h6 (title scale) and emit matching as elements so Text stays block-level in stacks and cards.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ Thumbs.db

# Package bundles
*.tar.gz
*.tgz
*.tgz .scratch/
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,27 @@ Older versions are available in the [`codemods/`](./codemods) directory.
| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| [migrate-mui-accordion-to-bui-accordion](./codemods/misc/migrate-mui-accordion-to-bui-accordion) | MUI 4 to BUI: Replace Accordion with BUI Accordion (packaged with form-control codemods; Accordion is a complex component) |
| [migrate-mui-alert-to-bui-alert](./codemods/misc/migrate-mui-alert-to-bui-alert) | MUI 4 to BUI: Replace MUI Alert with BUI Alert |
| [migrate-mui-autocomplete-to-combobox](./codemods/misc/migrate-mui-autocomplete-to-combobox) | MUI 4 to BUI: Replace Autocomplete with BUI Combobox or SearchAutocomplete |
| [migrate-mui-avatar-to-bui-avatar](./codemods/misc/migrate-mui-avatar-to-bui-avatar) | MUI 4 to BUI: Replace Avatar with BUI Avatar |
| [migrate-mui-bootstrap-to-bui](./codemods/misc/migrate-mui-bootstrap-to-bui) | MUI 4 to BUI: Bootstrap app dependencies and root CSS |
| [migrate-mui-button-to-bui-button](./codemods/misc/migrate-mui-button-to-bui-button) | MUI 4 to BUI: Replace MUI Button with BUI Button |
| [migrate-mui-button-to-bui-button](./codemods/misc/migrate-mui-button-to-bui-button) | MUI 4 to BUI: Replace MUI Button with BUI Button / ButtonLink |
| [migrate-mui-card-to-bui-card](./codemods/misc/migrate-mui-card-to-bui-card) | MUI 4 to BUI: Replace Card family with BUI Card |
| [migrate-mui-chip-to-tag](./codemods/misc/migrate-mui-chip-to-tag) | MUI 4 to BUI: Replace Chip with Tag (omits -bui-; BUI export is Tag) |
| [migrate-mui-dialog-to-bui-dialog](./codemods/misc/migrate-mui-dialog-to-bui-dialog) | MUI 4 to BUI: Replace Dialog shell with BUI Dialog |
| [migrate-mui-icon-button-to-button-icon](./codemods/misc/migrate-mui-icon-button-to-button-icon) | MUI 4 to BUI: Replace IconButton with ButtonIcon. Package name omits -bui- because ButtonIcon is the BUI export name. |
| [migrate-mui-icons-to-remix-icons](./codemods/misc/migrate-mui-icons-to-remix-icons) | MUI 4 to BUI: Replace MUI icons with Remix icons |
| [migrate-mui-layout-to-bui-layout](./codemods/misc/migrate-mui-layout-to-bui-layout) | MUI 4 to BUI: Convert common MUI layout primitives to BUI layout |
| [migrate-mui-link-to-bui-link](./codemods/misc/migrate-mui-link-to-bui-link) | MUI 4 to BUI: Replace Material-UI Link with BUI Link |
| [migrate-mui-list-family-to-bui-list](./codemods/misc/migrate-mui-list-family-to-bui-list) | MUI 4 to BUI: Replace List family primitives with BUI List |
| [migrate-mui-menu-popover-to-bui-menu](./codemods/misc/migrate-mui-menu-popover-to-bui-menu) | MUI 4 to BUI: Replace Menu and Popover patterns with BUI Menu |
| [migrate-mui-radio-checkbox-to-bui](./codemods/misc/migrate-mui-radio-checkbox-to-bui) | MUI 4 to BUI: Replace radio and checkbox group patterns with BUI groups |
| [migrate-mui-menu-popover-to-bui-menu](./codemods/misc/migrate-mui-menu-popover-to-bui-menu) | MUI 4 to BUI: Replace Menu with BUI Menu; Popover with MenuList/MenuItem becomes Menu, otherwise BUI Popover |
| [migrate-mui-radio-checkbox-to-bui](./codemods/misc/migrate-mui-radio-checkbox-to-bui) | MUI 4 to BUI: Replace radio/checkbox groups and standalone Checkbox patterns with BUI |
| [migrate-mui-select-family-to-bui-select](./codemods/misc/migrate-mui-select-family-to-bui-select) | MUI 4 to BUI: Replace Select wrapper patterns with BUI Select |
| [migrate-mui-skeleton-to-bui-skeleton](./codemods/misc/migrate-mui-skeleton-to-bui-skeleton) | MUI 4 to BUI: Replace Skeleton with BUI Skeleton |
| [migrate-mui-slider-to-bui-slider](./codemods/misc/migrate-mui-slider-to-bui-slider) | MUI 4 to BUI: Replace Slider with BUI Slider |
| [migrate-mui-styles-to-bui-css-modules](./codemods/misc/migrate-mui-styles-to-bui-css-modules) | MUI 4 to BUI: Migrate makeStyles usage to BUI CSS modules |
| [migrate-mui-switch-to-bui-switch](./codemods/misc/migrate-mui-switch-to-bui-switch) | MUI 4 to BUI: Replace Switch with BUI Switch |
| [migrate-mui-tabs-to-bui-tabs](./codemods/misc/migrate-mui-tabs-to-bui-tabs) | MUI 4 to BUI: Replace MUI Tabs with BUI Tabs |
| [migrate-mui-textfield-to-bui-textfield](./codemods/misc/migrate-mui-textfield-to-bui-textfield) | MUI 4 to BUI: Replace TextField with BUI TextField |
| [migrate-mui-textfield-to-bui-textfield](./codemods/misc/migrate-mui-textfield-to-bui-textfield) | MUI 4 to BUI: Replace TextField with BUI TextField / TextAreaField / PasswordField / NumberField |
| [migrate-mui-tooltip-to-bui-tooltip](./codemods/misc/migrate-mui-tooltip-to-bui-tooltip) | MUI 4 to BUI: Replace Tooltip with TooltipTrigger |
| [migrate-mui-typography-to-text](./codemods/misc/migrate-mui-typography-to-text) | MUI 4 to BUI: Replace Typography with Text. Package name omits -bui- because Text is the BUI export name. |
| [mui4-to-bui-migration-recipe](./codemods/misc/mui4-to-bui-migration-recipe) | MUI 4 to BUI: Migration recipe that runs every deterministic MUI→BUI codemod from the registry in a safe order. |
Expand Down
6 changes: 4 additions & 2 deletions codemods/misc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ Prefer the ordered recipe:
### Ordering

1. **Bootstrap first** — `@backstage/migrate-mui-bootstrap-to-bui`
2. **Transforms** — icons, styles/CSS modules, core and complex components, form controls, then layout (see the [recipe README](./mui4-to-bui-migration-recipe/README.md) for the full ordered list)
2. **Transforms** — iconsstyles/CSS modulescore (Typography, Alert, Avatar, Skeleton, Button, IconButton, Link, Tooltip) → complex (Dialog, Tabs, Menu/Popover, List, Chip, Card) → forms (Select, TextField, Autocomplete, Accordion, radio/checkbox, Switch, Slider) → layout last
3. **Cleanup last** — `@backstage/remove-mui-dependencies`

See the [recipe README](./mui4-to-bui-migration-recipe/README.md) for registry links, domain coverage, out-of-scope items, and notes on intentional package names that omit `-bui-` in the target segment (`Text`, `Tag`, `ButtonIcon`, Remix).
New packages in this family: Avatar, Skeleton, Link, Card, Autocomplete→Combobox, Switch. Pre-publish dry-runs use [`workflow.local.yaml`](./mui4-to-bui-migration-recipe/workflow.local.yaml) against a sibling `../backstage` checkout.

See the [recipe README](./mui4-to-bui-migration-recipe/README.md) for the full ordered table, Paper heuristic notes, registry links, out-of-scope items (Badge overlays, Progress, Drawer, Snackbar, Stepper, Timeline, material-table), and intentional package names that omit `-bui-` in the target segment (`Text`, `Tag`, `ButtonIcon`, Remix).
21 changes: 21 additions & 0 deletions codemods/misc/migrate-mui-accordion-to-bui-accordion/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# @backstage/migrate-mui-accordion-to-bui-accordion

Migrates MUI 4 Accordion patterns to Backstage UI Accordion.

## Covers

- Named barrel / partial barrel `@material-ui/core` Accordion imports
- Simple Accordion → BUI Accordion shell
- Merging into an existing `@backstage/ui` import

## TODOs / won't-do

- Complex summary content (`complex-summary-todo`)
- Controlled Accordion edge cases (`controlled-todo`)
- Custom Accordion wrappers / theme overrides

## Test

```bash
yarn test
```
20 changes: 20 additions & 0 deletions codemods/misc/migrate-mui-alert-to-bui-alert/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# @backstage/migrate-mui-alert-to-bui-alert

Migrates MUI 4 `Alert` to Backstage UI `Alert`.

## Covers

- Deep `@material-ui/core/Alert` and barrel imports
- Common severity / children patterns
- Merging into an existing `@backstage/ui` import

## TODOs / won't-do

- Unsupported MUI Alert props and action layouts beyond the happy path
- Custom Alert wrappers

## Test

```bash
yarn test
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# @backstage/migrate-mui-autocomplete-to-combobox

## 0.1.0

### Minor Changes

- Initial release: heuristically migrate MUI `Autocomplete` to Backstage UI `Combobox` or `SearchAutocomplete` during the MUI 4 to BUI migration.
24 changes: 24 additions & 0 deletions codemods/misc/migrate-mui-autocomplete-to-combobox/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# @backstage/migrate-mui-autocomplete-to-combobox

Heuristically migrates MUI 4 `Autocomplete` to Backstage UI `Combobox` or `SearchAutocomplete`.

## Covers

- Form-like option pickers with string[] literal `options` → `Combobox`
- Clear free-text search (`onInputChange` + word-boundary search/find/filter cue, no selection value) → `SearchAutocomplete`
- Deep and barrel imports from `@material-ui/lab`
- Best-effort option literal flattening for string arrays
- Prunes unused `TextField` imports left behind by `renderInput`
- Maps MUI `size` to BUI `size` (`small` preserved; `medium`/`large`/omitted → `medium`; falls back to static `size` on the `renderInput` `TextField`)

## TODOs left for humans

- Ambiguous Autocomplete usage (left as MUI with a TODO)
- Object `options` / `getOptionLabel` shapes (not safe for BUI Combobox)
- `freeSolo`, custom `renderOption`, and other complex cases
- Non-trivial `onChange` / options shapes
- Dynamic `size` on Autocomplete

## Won't do

- Perfect API parity for every Autocomplete prop
20 changes: 20 additions & 0 deletions codemods/misc/migrate-mui-autocomplete-to-combobox/codemod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
schema_version: '1.0'

name: '@backstage/migrate-mui-autocomplete-to-combobox'
version: '0.1.0'
description: 'MUI 4 to BUI: Replace Autocomplete with BUI Combobox or SearchAutocomplete'
author: 'Paul Schultz<pschultz@redhat.com>'
license: 'Apache-2.0'
repository: 'https://github.com/backstage/codemods'
workflow: 'workflow.yaml'

targets:
languages: ['tsx', 'ts']

keywords: ['backstage', 'migration', 'mui', 'bui', 'autocomplete', 'combobox']

registry:
access: 'public'
visibility: 'public'

capabilities: []
13 changes: 13 additions & 0 deletions codemods/misc/migrate-mui-autocomplete-to-combobox/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "@backstage/migrate-mui-autocomplete-to-combobox",
"version": "0.1.0",
"description": "MUI 4 to BUI: Replace Autocomplete with BUI Combobox or SearchAutocomplete",
"type": "module",
"scripts": {
"test": "yarn exec codemod jssg test -l tsx ./scripts/codemod.ts ./tests && yarn exec codemod workflow validate -w workflow.yaml"
},
"devDependencies": {
"@codemod.com/jssg-types": "1.6.2",
"codemod": "1.12.13"
}
}
Loading