mui-to-shadcn 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -0
- package/LICENSE +21 -0
- package/README.de.md +78 -0
- package/README.md +112 -0
- package/dist/attributes.d.ts +5 -0
- package/dist/attributes.d.ts.map +1 -0
- package/dist/attributes.js +57 -0
- package/dist/attributes.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +114 -0
- package/dist/cli.js.map +1 -0
- package/dist/composites.d.ts +7 -0
- package/dist/composites.d.ts.map +1 -0
- package/dist/composites.js +272 -0
- package/dist/composites.js.map +1 -0
- package/dist/containers.d.ts +28 -0
- package/dist/containers.d.ts.map +1 -0
- package/dist/containers.js +881 -0
- package/dist/containers.js.map +1 -0
- package/dist/edits.d.ts +12 -0
- package/dist/edits.d.ts.map +1 -0
- package/dist/edits.js +38 -0
- package/dist/edits.js.map +1 -0
- package/dist/handlers.d.ts +6 -0
- package/dist/handlers.d.ts.map +1 -0
- package/dist/handlers.js +66 -0
- package/dist/handlers.js.map +1 -0
- package/dist/icon-map.d.ts +3 -0
- package/dist/icon-map.d.ts.map +1 -0
- package/dist/icon-map.js +732 -0
- package/dist/icon-map.js.map +1 -0
- package/dist/icons.d.ts +9 -0
- package/dist/icons.d.ts.map +1 -0
- package/dist/icons.js +306 -0
- package/dist/icons.js.map +1 -0
- package/dist/imports.d.ts +12 -0
- package/dist/imports.d.ts.map +1 -0
- package/dist/imports.js +121 -0
- package/dist/imports.js.map +1 -0
- package/dist/infra.d.ts +8 -0
- package/dist/infra.d.ts.map +1 -0
- package/dist/infra.js +149 -0
- package/dist/infra.js.map +1 -0
- package/dist/mappings.d.ts +3 -0
- package/dist/mappings.d.ts.map +1 -0
- package/dist/mappings.js +464 -0
- package/dist/mappings.js.map +1 -0
- package/dist/nodes.d.ts +26 -0
- package/dist/nodes.d.ts.map +1 -0
- package/dist/nodes.js +61 -0
- package/dist/nodes.js.map +1 -0
- package/dist/paths.d.ts +8 -0
- package/dist/paths.d.ts.map +1 -0
- package/dist/paths.js +37 -0
- package/dist/paths.js.map +1 -0
- package/dist/plan.d.ts +20 -0
- package/dist/plan.d.ts.map +1 -0
- package/dist/plan.js +207 -0
- package/dist/plan.js.map +1 -0
- package/dist/render.d.ts +5 -0
- package/dist/render.d.ts.map +1 -0
- package/dist/render.js +20 -0
- package/dist/render.js.map +1 -0
- package/dist/resolvers.d.ts +7 -0
- package/dist/resolvers.d.ts.map +1 -0
- package/dist/resolvers.js +122 -0
- package/dist/resolvers.js.map +1 -0
- package/dist/run.d.ts +15 -0
- package/dist/run.d.ts.map +1 -0
- package/dist/run.js +87 -0
- package/dist/run.js.map +1 -0
- package/dist/setup.d.ts +11 -0
- package/dist/setup.d.ts.map +1 -0
- package/dist/setup.js +153 -0
- package/dist/setup.js.map +1 -0
- package/dist/sx.d.ts +8 -0
- package/dist/sx.d.ts.map +1 -0
- package/dist/sx.js +804 -0
- package/dist/sx.js.map +1 -0
- package/dist/types.d.ts +94 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +73 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented here. This project adheres to [Semantic Versioning](https://semver.org).
|
|
4
|
+
|
|
5
|
+
## [Unreleased]
|
|
6
|
+
|
|
7
|
+
## [0.1.0] - 2026-06-17
|
|
8
|
+
|
|
9
|
+
First public release.
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- Multi-pass codemod (component mapping → infrastructure removal → event handlers → icons → `sx`/system-props). Pure AST transformation with ts-morph (no LLM). Targets shadcn CLI v4 + Tailwind CSS v4, and works with both the Radix and Base UI variants of shadcn.
|
|
14
|
+
- **Icons**: `@mui/icons-material` → `lucide-react` (~700 names mapped, validated against the installed lucide-react in CI); `fontSize`/`color` become classes; variant suffixes (Outlined/Rounded/Sharp/TwoTone) resolve to the base icon; bare references use an aliased import so the build never breaks; unmapped icons are left in place with a note.
|
|
15
|
+
- **Infrastructure removal**: `ThemeProvider`, `StyledEngineProvider`, `CssVarsProvider`, the MUI/Emotion cache providers (`CacheProvider`, `AppRouterCacheProvider`), `ScopedCssBaseline` are unwrapped; `CssBaseline`/`GlobalStyles` dropped; `createTheme`/`styled`/`makeStyles`/`keyframes` flagged with a warning.
|
|
16
|
+
- **Event handlers**: inline `onChange` bodies are rewritten when safe — `(e) => setX(e.target.value/checked)` → `(e) => setX(e)`, and MUI `(event, value) => …` → `(value) => …`; handlers that also use the event are left with a warning.
|
|
17
|
+
- **Grid**: converted to a real CSS grid (`grid grid-cols-12` + `col-span-*`, `gap`, breakpoint prefixes), including the v6/v7 `size`/`offset` props.
|
|
18
|
+
- Expanded `sx` coverage: letterSpacing, textTransform, fontStyle, textDecoration, objectFit, visibility, boxSizing, pointerEvents, userSelect, order, flexBasis, alignSelf/justifySelf/justifyItems, gridColumn/gridRow/gridTemplateColumns, verticalAlign, listStyleType, plus success/warning/info/grey/common color tokens.
|
|
19
|
+
- **Button**: `startIcon`/`endIcon` move into the children (then get icon-converted); `href`/`component` become `asChild` (with an anchor for `href`).
|
|
20
|
+
- Component mapping for Button, IconButton, Checkbox, Switch, Slider, RadioGroup, TextField, Select (+ MenuItem), Divider, LinearProgress, CircularProgress (lucide spinner), Skeleton, Paper, the Card family, Alert, Link, Typography, Avatar, Chip, Badge, Tooltip, Tabs (incl. the MUI Lab TabContext/TabList/TabPanel), Accordion, Dialog, Modal, Menu (DropdownMenu), Popover/Popper, Collapse (Collapsible), ToggleButtonGroup, Drawer/SwipeableDrawer (Sheet), Breadcrumbs, Pagination, the Table family, the List family, the Stepper family, Rating (lucide stars), the Transition components (Grow/Fade/Slide/Zoom, unwrapped), Fab, AppBar/Toolbar, ImageList, the Input/Form primitives, and Box/Stack/Grid/Container.
|
|
21
|
+
- `sx` and system-props pass: spacing, sizing, color, flex, position and more to Tailwind classes; MUI 8px spacing mapped to the Tailwind 4px scale; Box/Stack/Grid/Container rewritten to `div`. Output targets Tailwind v4 (v4 shadow scale and container max-width).
|
|
22
|
+
- Coverage: 89 of 106 catalogued components convert fully, 8 inside their parent, 4 partial (Grid/Grid2/GridLegacy, Slider), 5 manual with a note (DataGrid, Autocomplete, SpeedDial, Timeline, BottomNavigationAction).
|
|
23
|
+
- `--setup` orchestrator: collects the required shadcn components, runs `shadcn init`/`add`, writes the converted files, runs Prettier. Package-manager auto-detection and `--dry-run`.
|
|
24
|
+
- `--base radix|base` to target Radix or Base UI (omits `asChild` for Base UI).
|
|
25
|
+
- Programmatic API via `runMigration` and `buildRegistry`; `@mui/lab` import support.
|
|
26
|
+
- Generated component status overview (`docs/COMPONENTS.md`, regenerated with `npm run docs`).
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Marcel Baklouti
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.de.md
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# mui-to-shadcn
|
|
2
|
+
|
|
3
|
+
Codemod, der React-Code von Material UI (MUI) nach shadcn/ui konvertiert. Reine AST-Transformation mit ts-morph, kein LLM.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
npm install
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Nutzung
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
npm run migrate -- <pfad> --report # Probelauf, schreibt nichts, listet benoetigte shadcn-Komponenten
|
|
15
|
+
npm run migrate -- <pfad> --write # schreibt Aenderungen in die Dateien
|
|
16
|
+
npm run migrate -- <pfad> --skip-sx # ueberspringt den sx/System-Props-Pass
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
`<pfad>` kann eine einzelne Datei oder ein Verzeichnis sein (rekursiv `**/*.{ts,tsx}`, ohne node_modules).
|
|
20
|
+
|
|
21
|
+
### Vollautomatik: --setup
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
npm run migrate -- <pfad> --setup [--base radix|base] [--pm pnpm|npm|yarn|bun] [--dry-run]
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
`--setup` fuehrt im Projektverzeichnis nacheinander aus:
|
|
28
|
+
|
|
29
|
+
1. ermittelt in einem Probelauf alle benoetigten shadcn-Komponenten
|
|
30
|
+
2. `shadcn init --base <radix|base>` (nur wenn keine components.json existiert)
|
|
31
|
+
3. `shadcn add <alle benoetigten Komponenten>`
|
|
32
|
+
4. schreibt die konvertierten Dateien
|
|
33
|
+
5. `prettier --write`
|
|
34
|
+
|
|
35
|
+
Der Paketmanager wird aus der Lockfile erkannt (oder per `--pm` gesetzt). `--base base` waehlt Base UI, `--base radix` (Default) waehlt Radix. Mit `--dry-run` werden nur die geplanten Befehle ausgegeben, nichts ausgefuehrt.
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
npm test # Tests
|
|
39
|
+
npm run typecheck # tsc --noEmit
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Radix oder Base UI
|
|
43
|
+
|
|
44
|
+
Die erzeugte JSX-Ausgabe nutzt die oeffentliche shadcn-API (`@/components/ui/*`, onValueChange, type single/multiple, AccordionItem). Diese API ist bei Radix und Base UI identisch; nur die Primitive darunter unterscheiden sich. Ausnahmen bei Base UI: kein `asChild` (render-Prop), `checked` strikt boolean, `value` bei Slider/Select strikt Array. Mit `--base base` wird `asChild` nicht emittiert und ein Hinweis ausgegeben.
|
|
45
|
+
|
|
46
|
+
## Zwei Paesse
|
|
47
|
+
|
|
48
|
+
1. **Komponenten-Mapping**: MUI-Komponenten werden strukturell zu shadcn umgebaut, Importe umgeschrieben.
|
|
49
|
+
2. **sx / System-Props**: `sx={{ ... }}` und MUI-Shorthand-Props (m, p, display, gap, width, color, ...) werden zu Tailwind-Klassen. MUI-Spacing (8px) wird auf die Tailwind-Skala (4px) umgerechnet (z. B. `p: 2` -> `p-4`). Box/Stack/Grid/Container werden zu `div` mit passenden Klassen.
|
|
50
|
+
|
|
51
|
+
## Vollstaendig konvertierte Komponenten
|
|
52
|
+
|
|
53
|
+
Vollstaendige, stets aktuelle Statusuebersicht (89 voll, 8 im Elternelement, 4 teilweise, 5 manuell): [docs/COMPONENTS.md](./docs/COMPONENTS.md) (neu erzeugen mit `npm run docs`).
|
|
54
|
+
|
|
55
|
+
Button, IconButton, Checkbox, Switch, Slider, RadioGroup (+ FormControlLabel/Radio), TextField (-> Label + Input/Textarea), Select (+ MenuItem), TextareaAutosize, Divider, LinearProgress, Skeleton, Paper, Card-Familie, Alert (+ AlertTitle), Link, Typography, Avatar, Chip (-> Badge), Tooltip, Tabs (+ Tab), Accordion-Familie, Dialog-Familie, ToggleButtonGroup (+ ToggleButton), Drawer (-> Sheet), Breadcrumbs, Table-Familie, Box/Stack/Grid/Container.
|
|
56
|
+
|
|
57
|
+
## Bewusst manuell (mit Notiz im Report)
|
|
58
|
+
|
|
59
|
+
Komponenten mit grundlegend anderem Paradigma oder ohne shadcn-Pendant: DataGrid, Stepper, Rating, SpeedDial, Autocomplete, Menu (anchorEl), Popover/Popper, Modal, Pagination, CircularProgress, MUI Badge, Snackbar, List-Familie, ImageList, Fab, AppBar/Toolbar, Transitions (Grow/Fade/Slide/Zoom/Collapse) u. a.
|
|
60
|
+
|
|
61
|
+
## Was --setup nicht abnimmt
|
|
62
|
+
|
|
63
|
+
Auch mit `--setup` bleibt prinzipbedingt Handarbeit, weil sie Absicht erfordert:
|
|
64
|
+
|
|
65
|
+
- **Handler-Signaturen**: onChange wird zu onValueChange/onCheckedChange/onValueChange; der Callback erhaelt jetzt einen Wert/boolean/Array statt eines Events. Code wie `e.target.value` oder `e.target.checked` muss angepasst werden.
|
|
66
|
+
- **Komponenten ohne Pendant** (siehe Liste oben) manuell umbauen.
|
|
67
|
+
- **MUI entfernen**: ThemeProvider, CssBaseline, createTheme, Emotion-Cache sowie `@mui/*`- und `@emotion/*`-Abhaengigkeiten, sobald alles migriert ist.
|
|
68
|
+
- **Base UI** (falls gewaehlt): `asChild` durch render-Prop ersetzen, strikte boolean/Array-Props.
|
|
69
|
+
- **Layout und Optik**: Grid wird best-effort konvertiert; Whitespace verschachtelter Bloecke ist nicht perfekt. Nach der Migration pruefen.
|
|
70
|
+
|
|
71
|
+
Die Ausgabe ist gueltiges TSX. Prettier/ESLint werden von `--setup` bereits ausgefuehrt; ohne `--setup`:
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
npx prettier --write <pfad>
|
|
75
|
+
npx eslint --fix <pfad>
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Der Report zeigt geaenderte Handler-Signaturen und alle manuell zu pruefenden Stellen.
|
package/README.md
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# mui-to-shadcn
|
|
2
|
+
|
|
3
|
+
[](https://github.com/marcelbaklouti/mui-to-shadcn/actions/workflows/ci.yml)
|
|
4
|
+
[](https://www.npmjs.com/package/mui-to-shadcn)
|
|
5
|
+
[](./LICENSE)
|
|
6
|
+
|
|
7
|
+
A codemod that converts [Material UI](https://mui.com) (MUI) React code to [shadcn/ui](https://ui.shadcn.com). Pure AST transformation with [ts-morph](https://ts-morph.com), no LLM. Targets shadcn CLI v4 and Tailwind CSS v4, and works with both the Radix and Base UI variants of shadcn.
|
|
8
|
+
|
|
9
|
+
> Deutsche Version: [README.de.md](./README.de.md)
|
|
10
|
+
|
|
11
|
+
## What it does
|
|
12
|
+
|
|
13
|
+
Several passes over your `.ts`/`.tsx` files, designed to leave as little manual work as possible — even on large codebases:
|
|
14
|
+
|
|
15
|
+
1. **Component mapping** — MUI components are restructured into their shadcn equivalents and imports are rewritten.
|
|
16
|
+
2. **Infrastructure removal** — `ThemeProvider`, `CssBaseline`, `StyledEngineProvider`, the MUI/Emotion cache providers and `GlobalStyles` are unwrapped or dropped (Tailwind's preflight replaces the baseline). `createTheme`/`styled`/`makeStyles` are flagged with a warning since they wrap arbitrary CSS.
|
|
17
|
+
3. **Event handlers** — when `onChange` becomes `onValueChange`/`onCheckedChange`, simple inline handlers are rewritten too: `(e) => setX(e.target.value)` becomes `(e) => setX(e)`, and MUI's `(event, value) => …` becomes `(value) => …`. Handlers that also use the event are left untouched with a warning.
|
|
18
|
+
4. **Icons** — `@mui/icons-material` imports and usages are converted to [lucide-react](https://lucide.dev) (what shadcn uses), e.g. `DeleteIcon` → `Trash2`. ~700 icon names are mapped; `fontSize`/`color` become classes. Unmapped icons are left in place with a note.
|
|
19
|
+
5. **`sx` / system props** — `sx={{ ... }}` and MUI shorthand props (`m`, `p`, `display`, `gap`, `width`, `color`, ...) become Tailwind classes. MUI spacing (8px) is converted to the Tailwind scale (4px), e.g. `p: 2` becomes `p-4`. `Box`/`Stack`/`Container` become `div`; `Grid` becomes a real CSS grid (`grid grid-cols-12` + `col-span-*`, including the v6/v7 `size`/`offset` props).
|
|
20
|
+
|
|
21
|
+
## Quick start
|
|
22
|
+
|
|
23
|
+
Run it without installing:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
# dry run, prints the changes and the shadcn components it needs
|
|
27
|
+
npx mui-to-shadcn src --report
|
|
28
|
+
|
|
29
|
+
# write the changes
|
|
30
|
+
npx mui-to-shadcn src --write
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Or as a one-command setup in your project (installs the shadcn components, then migrates):
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npx mui-to-shadcn src --setup --base radix # or --base base for Base UI
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
`--setup` will, in your project directory:
|
|
40
|
+
|
|
41
|
+
1. collect every shadcn component the migration needs,
|
|
42
|
+
2. run `shadcn init` (only if there is no `components.json`),
|
|
43
|
+
3. run `shadcn add <components>`,
|
|
44
|
+
4. write the converted files,
|
|
45
|
+
5. run `prettier --write`.
|
|
46
|
+
|
|
47
|
+
The package manager is detected from your lockfile (override with `--pm pnpm|npm|yarn|bun`). Use `--dry-run` to print the planned commands without running anything.
|
|
48
|
+
|
|
49
|
+
## CLI
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
mui-to-shadcn <path...> [options]
|
|
53
|
+
|
|
54
|
+
--write write changes (default is a dry run)
|
|
55
|
+
--report print every warning and manual item
|
|
56
|
+
--skip-sx skip the sx / system-props pass
|
|
57
|
+
--setup install shadcn components and run the full pipeline
|
|
58
|
+
--base <b> radix (default) or base (Base UI)
|
|
59
|
+
--pm <m> pnpm | npm | yarn | bun (otherwise auto-detected)
|
|
60
|
+
--dry-run with --setup: print planned commands only
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
`<path>` can be a file or a directory (globbed as `**/*.{ts,tsx}`, excluding node_modules).
|
|
64
|
+
|
|
65
|
+
## Programmatic API
|
|
66
|
+
|
|
67
|
+
```ts
|
|
68
|
+
import { Project } from "ts-morph";
|
|
69
|
+
import { runMigration } from "mui-to-shadcn";
|
|
70
|
+
|
|
71
|
+
const project = new Project();
|
|
72
|
+
const file = project.addSourceFileAtPath("Component.tsx");
|
|
73
|
+
const result = runMigration(file, { base: "radix" });
|
|
74
|
+
console.log(result.text, result.warnings, result.manual, result.components);
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Component support
|
|
78
|
+
|
|
79
|
+
106 MUI components are catalogued. As of the current version: **89 fully converted**, **8 converted inside their parent**, **4 partial**, **5 left manual** with a note. The full, always-current table is generated from the registry:
|
|
80
|
+
|
|
81
|
+
- [docs/COMPONENTS.md](./docs/COMPONENTS.md) — full status table (regenerate with `npm run docs`)
|
|
82
|
+
|
|
83
|
+
Fully converted include Button, IconButton, Checkbox, Switch, RadioGroup, TextField, Select, the Form/Input primitives, Divider, LinearProgress, CircularProgress (lucide spinner), Skeleton, Paper, the Card family, Alert, Link, Typography, Avatar, Chip, Badge, Tooltip, Tabs (incl. the MUI Lab TabContext/TabList/TabPanel), Accordion, Dialog, Modal, Menu (DropdownMenu), Popover/Popper, Collapse (Collapsible), ToggleButtonGroup, Drawer/SwipeableDrawer (Sheet), Breadcrumbs, Pagination, the Table family, the List family, the Stepper family, Rating (lucide stars), the Transition components (unwrapped), Fab, AppBar/Toolbar, ImageList, and Box/Stack/Container.
|
|
84
|
+
|
|
85
|
+
Plus icons: `@mui/icons-material` → `lucide-react` (~700 names mapped).
|
|
86
|
+
|
|
87
|
+
Partial (best-effort, needs review): Grid / Grid2 / GridLegacy (real CSS grid; `size="grow"`/`"auto"` are flagged) and Slider.
|
|
88
|
+
|
|
89
|
+
Still manual on purpose (different paradigm or no shadcn equivalent, with a recipe in the report): DataGrid (TanStack Table + shadcn Table), Autocomplete (Combobox = Popover + Command), SpeedDial, Timeline, and BottomNavigationAction. These need React state/hooks the codemod can't safely synthesize, so it leaves your working code in place rather than emit a build-breaking stub.
|
|
90
|
+
|
|
91
|
+
## What the tool does not do
|
|
92
|
+
|
|
93
|
+
Even with `--setup`, some work needs human judgement:
|
|
94
|
+
|
|
95
|
+
- **Complex handlers**: simple inline `onChange` bodies are rewritten automatically, but a handler that also uses the event (e.g. `e.preventDefault()`) or a named function reference is left as-is with a warning — adjust it by hand.
|
|
96
|
+
- **Custom theming**: `createTheme`/`extendTheme` palettes, `styled()`, `makeStyles`, and `keyframes` wrap arbitrary CSS, so they are flagged (not converted). Port custom tokens to your Tailwind/shadcn theme, then remove the remaining `@mui/*` / `@emotion/*` dependencies (listed by `--setup`).
|
|
97
|
+
- **Base UI** (if selected): replace `asChild` with the render prop; `checked` is strictly boolean and `value` strictly an array; the Base UI `Select` also needs an `items` prop on the root and `nativeButton={false}` on non-button triggers.
|
|
98
|
+
- **Layout and visuals**: Grid maps to CSS grid best-effort and nested whitespace is not perfect, so review the result.
|
|
99
|
+
|
|
100
|
+
Radix or Base UI: the generated JSX uses the public shadcn API (`@/components/ui/*`, `onValueChange`, `type single/multiple`, `AccordionItem`), which is identical across both; only the underlying primitives differ.
|
|
101
|
+
|
|
102
|
+
## Compatibility
|
|
103
|
+
|
|
104
|
+
Targets shadcn CLI v4 (`shadcn init`/`add`, `--base radix|base`) and Tailwind CSS v4 (v4 shadow scale, container widths). Icons require [lucide-react](https://lucide.dev) (shadcn installs it). Output is valid TSX; run Prettier/ESLint afterwards (done automatically by `--setup`).
|
|
105
|
+
|
|
106
|
+
## Contributing
|
|
107
|
+
|
|
108
|
+
See [CONTRIBUTING.md](./CONTRIBUTING.md). Most contributions are component mappings in `src/mappings.ts`; the architecture and extension points are documented there.
|
|
109
|
+
|
|
110
|
+
## License
|
|
111
|
+
|
|
112
|
+
MIT (c) Marcel Baklouti. See [LICENSE](./LICENSE).
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { JsxElement, JsxSelfClosingElement, JsxOpeningElement } from "ts-morph";
|
|
2
|
+
import type { ParsedElement } from "./types.js";
|
|
3
|
+
export declare function getOpeningElement(node: JsxElement | JsxSelfClosingElement): JsxOpeningElement | JsxSelfClosingElement;
|
|
4
|
+
export declare function parseElement(node: JsxElement | JsxSelfClosingElement, fullText: string): ParsedElement;
|
|
5
|
+
//# sourceMappingURL=attributes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attributes.d.ts","sourceRoot":"","sources":["../src/attributes.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AACrF,OAAO,KAAK,EAAmC,aAAa,EAAgB,MAAM,YAAY,CAAC;AAE/F,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,UAAU,GAAG,qBAAqB,GACvC,iBAAiB,GAAG,qBAAqB,CAE3C;AAcD,wBAAgB,YAAY,CAC1B,IAAI,EAAE,UAAU,GAAG,qBAAqB,EACxC,QAAQ,EAAE,MAAM,GACf,aAAa,CAyCf"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Node } from "ts-morph";
|
|
2
|
+
export function getOpeningElement(node) {
|
|
3
|
+
return Node.isJsxElement(node) ? node.getOpeningElement() : node;
|
|
4
|
+
}
|
|
5
|
+
function parseAttributeValue(initializer) {
|
|
6
|
+
if (!initializer)
|
|
7
|
+
return { kind: "boolean" };
|
|
8
|
+
if (Node.isStringLiteral(initializer)) {
|
|
9
|
+
return { kind: "string", value: initializer.getLiteralValue() };
|
|
10
|
+
}
|
|
11
|
+
if (Node.isJsxExpression(initializer)) {
|
|
12
|
+
const expression = initializer.getExpression();
|
|
13
|
+
return { kind: "expression", expression: expression ? expression.getText() : "" };
|
|
14
|
+
}
|
|
15
|
+
return { kind: "expression", expression: initializer.getText() };
|
|
16
|
+
}
|
|
17
|
+
export function parseElement(node, fullText) {
|
|
18
|
+
const opening = getOpeningElement(node);
|
|
19
|
+
const tagName = opening.getTagNameNode().getText();
|
|
20
|
+
const attributes = [];
|
|
21
|
+
const spreads = [];
|
|
22
|
+
for (const attribute of opening.getAttributes()) {
|
|
23
|
+
if (Node.isJsxAttribute(attribute)) {
|
|
24
|
+
attributes.push({
|
|
25
|
+
name: attribute.getNameNode().getText(),
|
|
26
|
+
value: parseAttributeValue(attribute.getInitializer()),
|
|
27
|
+
start: attribute.getStart(),
|
|
28
|
+
end: attribute.getEnd(),
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
spreads.push({
|
|
33
|
+
text: attribute.getText(),
|
|
34
|
+
start: attribute.getStart(),
|
|
35
|
+
end: attribute.getEnd(),
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
let innerText = "";
|
|
40
|
+
let hasChildren = false;
|
|
41
|
+
if (Node.isJsxElement(node)) {
|
|
42
|
+
const closing = node.getClosingElement();
|
|
43
|
+
innerText = fullText.slice(node.getOpeningElement().getEnd(), closing.getStart());
|
|
44
|
+
hasChildren = innerText.trim().length > 0;
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
tagName,
|
|
48
|
+
attributes,
|
|
49
|
+
spreads,
|
|
50
|
+
innerText,
|
|
51
|
+
selfClosing: Node.isJsxSelfClosingElement(node),
|
|
52
|
+
hasChildren,
|
|
53
|
+
start: node.getStart(),
|
|
54
|
+
end: node.getEnd(),
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=attributes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attributes.js","sourceRoot":"","sources":["../src/attributes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAIhC,MAAM,UAAU,iBAAiB,CAC/B,IAAwC;IAExC,OAAO,IAAI,CAAC,YAAY,CAA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AmB,CAAC,SAAS,CAAC,cAAc,EAAE,CAAC;gBACtD,KAAK,EAAE,SAAS,CAAC,QAAQ,EAAE;gBAC3B,GAAG,EAAE,SAAS,CAAC,MAAM,EAAE;aACxB,CAAC,CAAC;QACL,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,IAAI,CAAC;gBACX,IAAI,EAAE,SAAS,CAAC,OAAO,EAAE;gBACzB,KAAK,EAAE,SAAS,CAAC,QAAQ,EAAE;gBAC3B,GAAG,EAAE,SAAS,CAAC,MAAM,EAAE;aACxB,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,IAAI,SAAS,GAAG,EAAE,CAAC;IACnB,IAAI,WAAW,GAAG,KAAK,CAAC;IACxB,IAAI,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC;QAC5B,MAAM,OAAO,GAAG,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACzC,SAAS,GAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC,MAAM,EAAE,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;QAClF,WAAW,GAAG,SAAS,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;IAC5C,CAAC;IAED,OAAO;QACL,OAAO;QACP,UAAU;QACV,OAAO;QACP,SAAS;QACT,WAAW,EAAE,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC;QAC/C,WAAW;QACX,KAAK,EAAE,IAAI,CAAC,QAAQ,EAAE;QACtB,GAAG,EAAE,IAAI,CAAC,MAAM,EAAE;KACnB,CAAC;AACJ,CAAC"}
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { parseArgs } from "node:util";
|
|
3
|
+
import { writeFileSync } from "node:fs";
|
|
4
|
+
import { relative } from "node:path";
|
|
5
|
+
import { Project } from "ts-morph";
|
|
6
|
+
import { runMigration } from "./run.js";
|
|
7
|
+
import { collectSourceFiles } from "./paths.js";
|
|
8
|
+
import { runSetup } from "./setup.js";
|
|
9
|
+
function parseBase(value) {
|
|
10
|
+
return value === "base" ? "base" : "radix";
|
|
11
|
+
}
|
|
12
|
+
function parsePackageManager(value) {
|
|
13
|
+
if (value === "pnpm" || value === "npm" || value === "yarn" || value === "bun")
|
|
14
|
+
return value;
|
|
15
|
+
return undefined;
|
|
16
|
+
}
|
|
17
|
+
function main() {
|
|
18
|
+
const { values, positionals } = parseArgs({
|
|
19
|
+
allowPositionals: true,
|
|
20
|
+
options: {
|
|
21
|
+
write: { type: "boolean", default: false },
|
|
22
|
+
report: { type: "boolean", default: false },
|
|
23
|
+
"skip-sx": { type: "boolean", default: false },
|
|
24
|
+
setup: { type: "boolean", default: false },
|
|
25
|
+
"dry-run": { type: "boolean", default: false },
|
|
26
|
+
base: { type: "string" },
|
|
27
|
+
pm: { type: "string" },
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
if (positionals.length === 0) {
|
|
31
|
+
console.error("Usage: mui-to-shadcn <path...> [--write] [--report] [--skip-sx] [--setup [--base radix|base] [--pm pnpm|npm|yarn|bun] [--dry-run]]");
|
|
32
|
+
process.exit(1);
|
|
33
|
+
}
|
|
34
|
+
const applySx = values["skip-sx"] !== true;
|
|
35
|
+
const base = parseBase(values.base);
|
|
36
|
+
if (values.setup === true) {
|
|
37
|
+
const status = runSetup({
|
|
38
|
+
target: positionals,
|
|
39
|
+
base,
|
|
40
|
+
packageManager: parsePackageManager(values.pm),
|
|
41
|
+
dryRun: values["dry-run"] === true,
|
|
42
|
+
skipSx: !applySx,
|
|
43
|
+
cwd: process.cwd(),
|
|
44
|
+
});
|
|
45
|
+
process.exit(status);
|
|
46
|
+
}
|
|
47
|
+
const project = new Project({
|
|
48
|
+
skipAddingFilesFromTsConfig: true,
|
|
49
|
+
useInMemoryFileSystem: false,
|
|
50
|
+
});
|
|
51
|
+
const files = collectSourceFiles(project, positionals);
|
|
52
|
+
if (files.length === 0) {
|
|
53
|
+
console.error("No matching files found");
|
|
54
|
+
process.exit(1);
|
|
55
|
+
}
|
|
56
|
+
const write = values.write === true;
|
|
57
|
+
const report = values.report === true;
|
|
58
|
+
let changedCount = 0;
|
|
59
|
+
let warningCount = 0;
|
|
60
|
+
const manualTotals = new Map();
|
|
61
|
+
const components = new Set();
|
|
62
|
+
for (const file of files) {
|
|
63
|
+
const result = runMigration(file, { sx: applySx, base });
|
|
64
|
+
const rel = relative(process.cwd(), file.getFilePath());
|
|
65
|
+
warningCount += result.warnings.length;
|
|
66
|
+
for (const slug of result.components)
|
|
67
|
+
components.add(slug);
|
|
68
|
+
for (const hit of result.manual) {
|
|
69
|
+
manualTotals.set(hit.component, (manualTotals.get(hit.component) ?? 0) + 1);
|
|
70
|
+
}
|
|
71
|
+
if (result.changed) {
|
|
72
|
+
changedCount += 1;
|
|
73
|
+
if (write) {
|
|
74
|
+
writeFileSync(file.getFilePath(), result.text);
|
|
75
|
+
console.log(`changed: ${rel}`);
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
console.log(`would change: ${rel}`);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
if (report) {
|
|
82
|
+
for (const warning of result.warnings)
|
|
83
|
+
console.log(` warning: ${warning}`);
|
|
84
|
+
for (const hit of result.manual) {
|
|
85
|
+
console.log(` manual: line ${hit.line} <${hit.component}> ${hit.message}`);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
console.log("");
|
|
90
|
+
console.log(`Files checked: ${files.length}`);
|
|
91
|
+
if (write) {
|
|
92
|
+
console.log(`Files changed: ${changedCount}`);
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
console.log(`Files with changes: ${changedCount} (dry run, nothing written)`);
|
|
96
|
+
}
|
|
97
|
+
console.log(`Warnings: ${warningCount}`);
|
|
98
|
+
const componentList = [...components].sort();
|
|
99
|
+
if (componentList.length) {
|
|
100
|
+
console.log(`Required shadcn components (${componentList.length}): ${componentList.join(" ")}`);
|
|
101
|
+
console.log("Install: use --setup or manually: pnpm dlx shadcn@latest add " + componentList.join(" "));
|
|
102
|
+
}
|
|
103
|
+
if (manualTotals.size) {
|
|
104
|
+
console.log("Migrate manually:");
|
|
105
|
+
const sorted = [...manualTotals].sort((a, b) => b[1] - a[1]);
|
|
106
|
+
for (const [name, count] of sorted)
|
|
107
|
+
console.log(` ${name}: ${count}`);
|
|
108
|
+
}
|
|
109
|
+
if (!report && (warningCount > 0 || manualTotals.size > 0)) {
|
|
110
|
+
console.log("Show details with --report");
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
main();
|
|
114
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGtC,SAAS,SAAS,CAAC,KAAyB;IAC1C,OAAO,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC;AAC7C,CAAC;AAED,SAAS,mBAAmB,CAAC,KAAyB;IACpD,IAAI,KAAK,KAAK,MAAM,IAAI,KAAK,KAAK,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ChF,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,aAAa,YAAY,EAAE,CAAC,CAAC;IAEzC,MAAM,aAAa,GAAG,CAAC,GAAG,UAAU,CAAC,CAAC,IAAI,EAAE,CAAC;IAC7C,IAAI,aAAa,CAAC,MAAM,EAAE,CAAC;QACzB,OAAO,CAAC,GAAG,CAAC,+BAA+B,aAAa,CAAC,MAAM,MAAM,aAAa,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChG,OAAO,CAAC,GAAG,CAAC,+DAA+D,GAAG,aAAa,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IACzG,CAAC;IAED,IAAI,YAAY,CAAC,IAAI,EAAE,CAAC;QACtB,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;QACjC,MAAM,MAAM,GAAG,CAAC,GAAG,YAAY,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC7D,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM;YAAE,OAAO,CAAC,GAAG,CAAC,KAAK,IAAI,KAAK,KAAK,EAAE,CAAC,CAAC;IACzE,CAAC;IAED,IAAI,CAAC,MAAM,IAAI,CAAC,YAAY,GAAG,CAAC,IAAI,YAAY,CAAC,IAAI,GAAG,CAAC,CAAC,EAAE,CAAC;QAC3D,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;IAC5C,CAAC;AACH,CAAC;AAED,IAAI,EAAE,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { CompositeTransform } from "./types.js";
|
|
2
|
+
export declare const typographyTransform: CompositeTransform;
|
|
3
|
+
export declare const avatarTransform: CompositeTransform;
|
|
4
|
+
export declare const cardHeaderTransform: CompositeTransform;
|
|
5
|
+
export declare const chipTransform: CompositeTransform;
|
|
6
|
+
export declare const buttonTransform: CompositeTransform;
|
|
7
|
+
//# sourceMappingURL=composites.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"composites.d.ts","sourceRoot":"","sources":["../src/composites.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAoC,kBAAkB,EAAmB,MAAM,YAAY,CAAC;AA6ExG,eAAO,MAAM,mBAAmB,EAAE,kBA6CjC,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,kBAkB7B,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,kBA2BjC,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,kBAkC3B,CAAC;AAWF,eAAO,MAAM,eAAe,EAAE,kBAkE7B,CAAC"}
|