@mui/codemod 5.12.3 → 5.14.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/README.md +90 -77
- package/codemod.js +0 -0
- package/node/v5.0.0/jss-to-styled.test/eighth.actual.js +8 -6
- package/node/v5.0.0/jss-to-styled.test/eighth.expected.js +7 -5
- package/node/v5.0.0/jss-to-styled.test/eleventh.actual.js +3 -1
- package/node/v5.0.0/jss-to-styled.test/eleventh.expected.js +3 -1
- package/node/v5.0.0/jss-to-styled.test/fifth.actual.js +3 -1
- package/node/v5.0.0/jss-to-styled.test/fifth.expected.js +3 -1
- package/node/v5.0.0/jss-to-styled.test/first.actual.js +4 -2
- package/node/v5.0.0/jss-to-styled.test/first.expected.js +4 -2
- package/node/v5.0.0/jss-to-styled.test/multipleWithStyles.actual.js +4 -2
- package/node/v5.0.0/jss-to-styled.test/multipleWithStyles.expected.js +3 -1
- package/node/v5.0.0/jss-to-styled.test/second.actual.js +3 -1
- package/node/v5.0.0/jss-to-styled.test/second.expected.js +3 -1
- package/node/v5.0.0/jss-to-styled.test/seventh.actual.js +6 -4
- package/node/v5.0.0/jss-to-styled.test/seventh.expected.js +6 -4
- package/node/v5.0.0/jss-to-styled.test/sixth.actual.js +2 -2
- package/node/v5.0.0/jss-to-styled.test/sixth.expected.js +2 -2
- package/node/v5.0.0/jss-to-styled.test/tenth.actual.js +3 -1
- package/node/v5.0.0/jss-to-styled.test/tenth.expected.js +3 -2
- package/node/v5.0.0/jss-to-styled.test/twelfth.actual.js +4 -2
- package/node/v5.0.0/preset-safe.test/actual.js +9 -7
- package/node/v5.0.0/preset-safe.test/expected.js +9 -7
- package/node/v5.0.0/styled-engine-provider.test/mui-theme-provider.actual.js +3 -1
- package/node/v5.0.0/styled-engine-provider.test/mui-theme-provider.expected.js +3 -1
- package/node/v5.0.0/styled-engine-provider.test/theme-provider.actual.js +3 -1
- package/node/v5.0.0/styled-engine-provider.test/theme-provider.expected.js +3 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -43,7 +43,7 @@ Examples:
|
|
|
43
43
|
|
|
44
44
|
To pass more options directly to jscodeshift, use `--jscodeshift="..."`. For example:
|
|
45
45
|
|
|
46
|
-
```
|
|
46
|
+
```bash
|
|
47
47
|
npx @mui/codemod --jscodeshift="--run-in-band --verbose=2"
|
|
48
48
|
```
|
|
49
49
|
|
|
@@ -54,7 +54,7 @@ See all available options [here](https://github.com/facebook/jscodeshift#usage-c
|
|
|
54
54
|
Options to [recast](https://github.com/benjamn/recast)'s printer can be provided
|
|
55
55
|
through jscodeshift's `printOptions` command line argument
|
|
56
56
|
|
|
57
|
-
```
|
|
57
|
+
```bash
|
|
58
58
|
npx @mui/codemod <transform> <path> --jscodeshift="--printOptions='{\"quote\":\"double\"}'"
|
|
59
59
|
```
|
|
60
60
|
|
|
@@ -62,6 +62,19 @@ npx @mui/codemod <transform> <path> --jscodeshift="--printOptions='{\"quote\":\"
|
|
|
62
62
|
|
|
63
63
|
### v5.0.0
|
|
64
64
|
|
|
65
|
+
### `base-remove-unstyled-suffix`
|
|
66
|
+
|
|
67
|
+
The `Unstyled` suffix has been removed from all Base UI component names, including names of types and other related identifiers.
|
|
68
|
+
|
|
69
|
+
```diff
|
|
70
|
+
- <Input component='a' href='url' />;
|
|
71
|
+
+ <Input slots={{ root: 'a' }} href='url' />;
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
npx @mui/codemod v5.0.0/base-remove-unstyled-suffix <path>
|
|
76
|
+
```
|
|
77
|
+
|
|
65
78
|
#### `base-remove-component-prop`
|
|
66
79
|
|
|
67
80
|
Remove `component` prop from all Base UI components by transferring its value into `slots.root`.
|
|
@@ -73,7 +86,7 @@ This change only affects Base UI components.
|
|
|
73
86
|
+ <Input slots={{ root: CustomRoot }} />
|
|
74
87
|
```
|
|
75
88
|
|
|
76
|
-
```
|
|
89
|
+
```bash
|
|
77
90
|
npx @mui/codemod v5.0.0/base-remove-component-prop <path>
|
|
78
91
|
```
|
|
79
92
|
|
|
@@ -88,7 +101,7 @@ Updates the names of the CSS variables of the Joy UI components to adapt to the
|
|
|
88
101
|
+ <Switch sx={{ '--Switch-trackWidth': '40px' }}>
|
|
89
102
|
```
|
|
90
103
|
|
|
91
|
-
```
|
|
104
|
+
```bash
|
|
92
105
|
npx @mui/codemod v5.0.0/rename-css-variables <path>
|
|
93
106
|
```
|
|
94
107
|
|
|
@@ -101,7 +114,7 @@ Updates the sources of the imports of the Base UI hooks to adapt to the new dire
|
|
|
101
114
|
+ import useBadge from '@mui/base/useBadge';
|
|
102
115
|
```
|
|
103
116
|
|
|
104
|
-
```
|
|
117
|
+
```bash
|
|
105
118
|
npx @mui/codemod v5.0.0/base-hook-imports <path>
|
|
106
119
|
```
|
|
107
120
|
|
|
@@ -116,7 +129,7 @@ Renames the classname prefix from `'Joy'` to `'Mui'` for Joy UI components.
|
|
|
116
129
|
/>;
|
|
117
130
|
```
|
|
118
131
|
|
|
119
|
-
```
|
|
132
|
+
```bash
|
|
120
133
|
npx @mui/codemod v5.0.0/joy-rename-classname-prefix <path>
|
|
121
134
|
```
|
|
122
135
|
|
|
@@ -131,7 +144,7 @@ Transforms `row` prop to `orientation` prop across `Card`, `List` and `RadioGrou
|
|
|
131
144
|
/>;
|
|
132
145
|
```
|
|
133
146
|
|
|
134
|
-
```
|
|
147
|
+
```bash
|
|
135
148
|
npx @mui/codemod v5.0.0/joy-rename-row-prop <path>
|
|
136
149
|
```
|
|
137
150
|
|
|
@@ -149,7 +162,7 @@ This change only affects Joy UI Avatar component.
|
|
|
149
162
|
/>;
|
|
150
163
|
```
|
|
151
164
|
|
|
152
|
-
```
|
|
165
|
+
```bash
|
|
153
166
|
npx @mui/codemod v5.0.0/joy-avatar-remove-imgProps <path>
|
|
154
167
|
```
|
|
155
168
|
|
|
@@ -207,7 +220,7 @@ This change only affects Joy UI components.
|
|
|
207
220
|
+</FormControl>
|
|
208
221
|
```
|
|
209
222
|
|
|
210
|
-
```
|
|
223
|
+
```bash
|
|
211
224
|
npx @mui/codemod v5.0.0/joy-text-field-to-input <path>
|
|
212
225
|
```
|
|
213
226
|
|
|
@@ -226,7 +239,7 @@ This change only affects Joy UI components.
|
|
|
226
239
|
/>;
|
|
227
240
|
```
|
|
228
241
|
|
|
229
|
-
```
|
|
242
|
+
```bash
|
|
230
243
|
npx @mui/codemod v5.0.0/joy-rename-components-to-slots <path>
|
|
231
244
|
```
|
|
232
245
|
|
|
@@ -236,7 +249,7 @@ The associated breaking change was done in [#34997](https://github.com/mui/mater
|
|
|
236
249
|
|
|
237
250
|
Rename the imports of date and time pickers from `@mui/lab` to `@mui/x-date-pickers` and `@mui/x-date-pickers-pro`.
|
|
238
251
|
|
|
239
|
-
```
|
|
252
|
+
```bash
|
|
240
253
|
npx @mui/codemod v5.0.0/date-pickers-moved-to-x <path>
|
|
241
254
|
```
|
|
242
255
|
|
|
@@ -244,7 +257,7 @@ npx @mui/codemod v5.0.0/date-pickers-moved-to-x <path>
|
|
|
244
257
|
|
|
245
258
|
A combination of all important transformers for migrating v4 to v5. ⚠️ This codemod should be run only once.
|
|
246
259
|
|
|
247
|
-
```
|
|
260
|
+
```bash
|
|
248
261
|
npx @mui/codemod v5.0.0/preset-safe <path|folder>
|
|
249
262
|
```
|
|
250
263
|
|
|
@@ -311,7 +324,7 @@ Imports and inserts `adaptV4Theme` into `createTheme` (or `createMuiTheme`)
|
|
|
311
324
|
+createTheme(adaptV4Theme({ palette: { ... }}))
|
|
312
325
|
```
|
|
313
326
|
|
|
314
|
-
```
|
|
327
|
+
```bash
|
|
315
328
|
npx @mui/codemod v5.0.0/adapter-v4 <path>
|
|
316
329
|
```
|
|
317
330
|
|
|
@@ -328,7 +341,7 @@ Renames `Autocomplete`'s `closeIcon` prop to `clearIcon`.
|
|
|
328
341
|
|
|
329
342
|
<!-- #default-branch-switch -->
|
|
330
343
|
|
|
331
|
-
```
|
|
344
|
+
```bash
|
|
332
345
|
npx @mui/codemod v5.0.0/autocomplete-rename-closeicon <path>
|
|
333
346
|
```
|
|
334
347
|
|
|
@@ -347,7 +360,7 @@ Renames `Autocomplete`'s `getOptionSelected` to `isOptionEqualToValue`.
|
|
|
347
360
|
|
|
348
361
|
<!-- #default-branch-switch -->
|
|
349
362
|
|
|
350
|
-
```
|
|
363
|
+
```bash
|
|
351
364
|
npx @mui/codemod v5.0.0/autocomplete-rename-option <path>
|
|
352
365
|
```
|
|
353
366
|
|
|
@@ -366,7 +379,7 @@ Updates the `Avatar`'s `variant` value and `classes` key from 'circle' to 'circu
|
|
|
366
379
|
|
|
367
380
|
<!-- #default-branch-switch -->
|
|
368
381
|
|
|
369
|
-
```
|
|
382
|
+
```bash
|
|
370
383
|
npx @mui/codemod v5.0.0/avatar-circle-circular <path>
|
|
371
384
|
```
|
|
372
385
|
|
|
@@ -401,7 +414,7 @@ Renames the badge's props.
|
|
|
401
414
|
|
|
402
415
|
<!-- #default-branch-switch -->
|
|
403
416
|
|
|
404
|
-
```
|
|
417
|
+
```bash
|
|
405
418
|
npx @mui/codemod v5.0.0/badge-overlap-value <path>
|
|
406
419
|
```
|
|
407
420
|
|
|
@@ -425,7 +438,7 @@ This change only affects Base UI components.
|
|
|
425
438
|
|
|
426
439
|
<!-- #default-branch-switch -->
|
|
427
440
|
|
|
428
|
-
```
|
|
441
|
+
```bash
|
|
429
442
|
npx @mui/codemod v5.0.0/base-rename-components-to-slots <path>
|
|
430
443
|
```
|
|
431
444
|
|
|
@@ -444,7 +457,7 @@ Updates the Box API from separate system props to `sx`.
|
|
|
444
457
|
|
|
445
458
|
<!-- #default-branch-switch -->
|
|
446
459
|
|
|
447
|
-
```
|
|
460
|
+
```bash
|
|
448
461
|
npx @mui/codemod v5.0.0/box-borderradius-values <path>
|
|
449
462
|
```
|
|
450
463
|
|
|
@@ -459,7 +472,7 @@ Renames the Box `css` prop to `sx`
|
|
|
459
472
|
+<Box sx={{ m: 2 }}>
|
|
460
473
|
```
|
|
461
474
|
|
|
462
|
-
```
|
|
475
|
+
```bash
|
|
463
476
|
npx @mui/codemod v5.0.0/box-rename-css <path>
|
|
464
477
|
```
|
|
465
478
|
|
|
@@ -480,7 +493,7 @@ Renames the Box `grid*Gap` props.
|
|
|
480
493
|
|
|
481
494
|
<!-- #default-branch-switch -->
|
|
482
495
|
|
|
483
|
-
```
|
|
496
|
+
```bash
|
|
484
497
|
npx @mui/codemod v5.0.0/box-rename-gap <path>
|
|
485
498
|
```
|
|
486
499
|
|
|
@@ -497,7 +510,7 @@ Removes the outdated `color` prop values.
|
|
|
497
510
|
|
|
498
511
|
<!-- #default-branch-switch -->
|
|
499
512
|
|
|
500
|
-
```
|
|
513
|
+
```bash
|
|
501
514
|
npx @mui/codemod v5.0.0/button-color-prop <path>
|
|
502
515
|
```
|
|
503
516
|
|
|
@@ -514,7 +527,7 @@ Removes the Chip `variant` prop if the value is `"default"`.
|
|
|
514
527
|
|
|
515
528
|
<!-- #default-branch-switch -->
|
|
516
529
|
|
|
517
|
-
```
|
|
530
|
+
```bash
|
|
518
531
|
npx @mui/codemod v5.0.0/chip-variant-prop <path>
|
|
519
532
|
```
|
|
520
533
|
|
|
@@ -531,7 +544,7 @@ Renames the CircularProgress `static` variant to `determinate`.
|
|
|
531
544
|
|
|
532
545
|
<!-- #default-branch-switch -->
|
|
533
546
|
|
|
534
|
-
```
|
|
547
|
+
```bash
|
|
535
548
|
npx @mui/codemod v5.0.0/circularprogress-variant <path>
|
|
536
549
|
```
|
|
537
550
|
|
|
@@ -550,7 +563,7 @@ Renames `Collapse`'s `collapsedHeight` prop to `collapsedSize`.
|
|
|
550
563
|
|
|
551
564
|
<!-- #default-branch-switch -->
|
|
552
565
|
|
|
553
|
-
```
|
|
566
|
+
```bash
|
|
554
567
|
npx @mui/codemod v5.0.0/collapse-rename-collapsedheight <path>
|
|
555
568
|
```
|
|
556
569
|
|
|
@@ -569,7 +582,7 @@ A generic codemod to rename any component prop.
|
|
|
569
582
|
|
|
570
583
|
<!-- #default-branch-switch -->
|
|
571
584
|
|
|
572
|
-
```
|
|
585
|
+
```bash
|
|
573
586
|
npx @mui/codemod v5.0.0/component-rename-prop <path> -- --component=Grid --from=prop --to=newProp
|
|
574
587
|
```
|
|
575
588
|
|
|
@@ -582,7 +595,7 @@ Renames private import from `core/styles/*` to `core/styles`
|
|
|
582
595
|
+import { darken, lighten } from '@material-ui/core/styles';
|
|
583
596
|
```
|
|
584
597
|
|
|
585
|
-
```
|
|
598
|
+
```bash
|
|
586
599
|
npx @mui/codemod v5.0.0/core-styles-import <path>
|
|
587
600
|
```
|
|
588
601
|
|
|
@@ -595,7 +608,7 @@ Renames the function `createMuiTheme` to `createTheme`
|
|
|
595
608
|
+import { createTheme } from '@material-ui/core/styles';
|
|
596
609
|
```
|
|
597
610
|
|
|
598
|
-
```
|
|
611
|
+
```bash
|
|
599
612
|
npx @mui/codemod v5.0.0/create-theme <path>
|
|
600
613
|
```
|
|
601
614
|
|
|
@@ -608,7 +621,7 @@ Remove `disableBackdropClick` prop from `<Dialog>`
|
|
|
608
621
|
+<Dialog />
|
|
609
622
|
```
|
|
610
623
|
|
|
611
|
-
```
|
|
624
|
+
```bash
|
|
612
625
|
npx @mui/codemod v5.0.0/dialog-props <path>
|
|
613
626
|
```
|
|
614
627
|
|
|
@@ -623,7 +636,7 @@ Remove `disableTypography` prop from `<DialogTitle>`
|
|
|
623
636
|
+<DialogTitle />
|
|
624
637
|
```
|
|
625
638
|
|
|
626
|
-
```
|
|
639
|
+
```bash
|
|
627
640
|
npx @mui/codemod v5.0.0/dialog-title-props <path>
|
|
628
641
|
```
|
|
629
642
|
|
|
@@ -640,7 +653,7 @@ Adds `prepend: true` to Emotion `createCache`
|
|
|
640
653
|
});
|
|
641
654
|
```
|
|
642
655
|
|
|
643
|
-
```
|
|
656
|
+
```bash
|
|
644
657
|
npx @mui/codemod v5.0.0/create-theme <path>
|
|
645
658
|
```
|
|
646
659
|
|
|
@@ -648,7 +661,7 @@ npx @mui/codemod v5.0.0/create-theme <path>
|
|
|
648
661
|
|
|
649
662
|
Renames `ExpansionPanel*` to `Accordion*`
|
|
650
663
|
|
|
651
|
-
```
|
|
664
|
+
```bash
|
|
652
665
|
npx @mui/codemod v5.0.0/expansion-panel-component <path>
|
|
653
666
|
```
|
|
654
667
|
|
|
@@ -661,7 +674,7 @@ You can find more details about this breaking change in [the migration guide](ht
|
|
|
661
674
|
+<Fab variant="circular" />
|
|
662
675
|
```
|
|
663
676
|
|
|
664
|
-
```
|
|
677
|
+
```bash
|
|
665
678
|
npx @mui/codemod v5.0.0/fab-variant <path>
|
|
666
679
|
```
|
|
667
680
|
|
|
@@ -681,7 +694,7 @@ Renames the `fade` style utility import and calls to `alpha`.
|
|
|
681
694
|
|
|
682
695
|
<!-- #default-branch-switch -->
|
|
683
696
|
|
|
684
|
-
```
|
|
697
|
+
```bash
|
|
685
698
|
npx @mui/codemod v5.0.0/fade-rename-alpha <path>
|
|
686
699
|
```
|
|
687
700
|
|
|
@@ -698,7 +711,7 @@ Renames `Grid`'s `justify` prop to `justifyContent`.
|
|
|
698
711
|
|
|
699
712
|
<!-- #default-branch-switch -->
|
|
700
713
|
|
|
701
|
-
```
|
|
714
|
+
```bash
|
|
702
715
|
npx @mui/codemod v5.0.0/grid-justify-justifycontent <path>
|
|
703
716
|
```
|
|
704
717
|
|
|
@@ -708,7 +721,7 @@ You can find more details about this breaking change in [the migration guide](ht
|
|
|
708
721
|
|
|
709
722
|
Renames `GridList*` to `ImageList*`
|
|
710
723
|
|
|
711
|
-
```
|
|
724
|
+
```bash
|
|
712
725
|
npx @mui/codemod v5.0.0/grid-list-component <path>
|
|
713
726
|
```
|
|
714
727
|
|
|
@@ -725,7 +738,7 @@ Adds `size="large"` if `size` is not defined to get the same appearance as v4.
|
|
|
725
738
|
+<IconButton size="large" />
|
|
726
739
|
```
|
|
727
740
|
|
|
728
|
-
```
|
|
741
|
+
```bash
|
|
729
742
|
npx @mui/codemod v5.0.0/icon-button-size <path>
|
|
730
743
|
```
|
|
731
744
|
|
|
@@ -790,7 +803,7 @@ Replace JSS styling with `makeStyles` or `withStyles` to `styled` API.
|
|
|
790
803
|
}
|
|
791
804
|
```
|
|
792
805
|
|
|
793
|
-
```
|
|
806
|
+
```bash
|
|
794
807
|
npx @mui/codemod v5.0.0/jss-to-styled <path>
|
|
795
808
|
```
|
|
796
809
|
|
|
@@ -862,7 +875,7 @@ Migrate JSS styling with `makeStyles` or `withStyles` to the corresponding `tss-
|
|
|
862
875
|
export default App;
|
|
863
876
|
```
|
|
864
877
|
|
|
865
|
-
```
|
|
878
|
+
```bash
|
|
866
879
|
npx @mui/codemod v5.0.0/jss-to-tss-react <path>
|
|
867
880
|
```
|
|
868
881
|
|
|
@@ -890,7 +903,7 @@ Apply `underline="hover"` to `<Link />` that does not define `underline` prop (t
|
|
|
890
903
|
+<Link underline="hover" />
|
|
891
904
|
```
|
|
892
905
|
|
|
893
|
-
```
|
|
906
|
+
```bash
|
|
894
907
|
npx @mui/codemod v5.0.0/link-underline-hover <path>
|
|
895
908
|
```
|
|
896
909
|
|
|
@@ -928,7 +941,7 @@ Moves JSS imports to `@material-ui/styles`
|
|
|
928
941
|
import mergeClasses from '@material-ui/styles/mergeClasses';
|
|
929
942
|
```
|
|
930
943
|
|
|
931
|
-
```
|
|
944
|
+
```bash
|
|
932
945
|
npx @mui/codemod v5.0.0/material-ui-styles <path>
|
|
933
946
|
```
|
|
934
947
|
|
|
@@ -941,7 +954,7 @@ Renames `Omit` import from `@material-ui/types` to `DistributiveOmit`
|
|
|
941
954
|
+import { DistributiveOmit } from '@material-ui/types';
|
|
942
955
|
```
|
|
943
956
|
|
|
944
|
-
```
|
|
957
|
+
```bash
|
|
945
958
|
npx @mui/codemod v5.0.0/material-ui-types <path>
|
|
946
959
|
```
|
|
947
960
|
|
|
@@ -958,7 +971,7 @@ Removes `disableBackdropClick` and `onEscapeKeyDown` from `<Modal>`
|
|
|
958
971
|
/>
|
|
959
972
|
```
|
|
960
973
|
|
|
961
|
-
```
|
|
974
|
+
```bash
|
|
962
975
|
npx @mui/codemod v5.0.0/modal-props <path>
|
|
963
976
|
```
|
|
964
977
|
|
|
@@ -982,7 +995,7 @@ or
|
|
|
982
995
|
|
|
983
996
|
<!-- #default-branch-switch -->
|
|
984
997
|
|
|
985
|
-
```
|
|
998
|
+
```bash
|
|
986
999
|
npx @mui/codemod v5.0.0/moved-lab-modules <path>
|
|
987
1000
|
```
|
|
988
1001
|
|
|
@@ -1007,7 +1020,7 @@ Renames `Pagination*`'s `shape` values from 'round' to 'circular'.
|
|
|
1007
1020
|
+<PaginationItem shape="circular" />
|
|
1008
1021
|
```
|
|
1009
1022
|
|
|
1010
|
-
```
|
|
1023
|
+
```bash
|
|
1011
1024
|
npx @mui/codemod v5.0.0/pagination-round-circular <path>
|
|
1012
1025
|
```
|
|
1013
1026
|
|
|
@@ -1026,7 +1039,7 @@ Fix private import paths.
|
|
|
1026
1039
|
|
|
1027
1040
|
<!-- #default-branch-switch -->
|
|
1028
1041
|
|
|
1029
|
-
```
|
|
1042
|
+
```bash
|
|
1030
1043
|
npx @mui/codemod v5.0.0/optimal-imports <path>
|
|
1031
1044
|
```
|
|
1032
1045
|
|
|
@@ -1034,7 +1047,7 @@ npx @mui/codemod v5.0.0/optimal-imports <path>
|
|
|
1034
1047
|
|
|
1035
1048
|
Removes `RootRef` from the codebase.
|
|
1036
1049
|
|
|
1037
|
-
```
|
|
1050
|
+
```bash
|
|
1038
1051
|
npx @mui/codemod v5.0.0/root-ref <path>
|
|
1039
1052
|
```
|
|
1040
1053
|
|
|
@@ -1049,7 +1062,7 @@ You can find more details about this breaking change in [the migration guide](ht
|
|
|
1049
1062
|
+<Skeleton variant="rectangular" />
|
|
1050
1063
|
```
|
|
1051
1064
|
|
|
1052
|
-
```
|
|
1065
|
+
```bash
|
|
1053
1066
|
npx @mui/codemod v5.0.0/skeleton-variant <path>
|
|
1054
1067
|
```
|
|
1055
1068
|
|
|
@@ -1059,7 +1072,7 @@ You can find more details about this breaking change in [the migration guide](ht
|
|
|
1059
1072
|
|
|
1060
1073
|
Applies `StyledEngineProvider` to the files that contains `ThemeProvider`.
|
|
1061
1074
|
|
|
1062
|
-
```
|
|
1075
|
+
```bash
|
|
1063
1076
|
npx @mui/codemod v5.0.0/styled-engine-provider <path>
|
|
1064
1077
|
```
|
|
1065
1078
|
|
|
@@ -1085,7 +1098,7 @@ Renames props in `Table*` components.
|
|
|
1085
1098
|
|
|
1086
1099
|
```
|
|
1087
1100
|
|
|
1088
|
-
```
|
|
1101
|
+
```bash
|
|
1089
1102
|
npx @mui/codemod v5.0.0/table-props <path>
|
|
1090
1103
|
```
|
|
1091
1104
|
|
|
@@ -1104,7 +1117,7 @@ Renames the `Tabs`'s `scrollButtons` prop values.
|
|
|
1104
1117
|
+<Tabs scrollButtons={false} />
|
|
1105
1118
|
```
|
|
1106
1119
|
|
|
1107
|
-
```
|
|
1120
|
+
```bash
|
|
1108
1121
|
npx @mui/codemod v5.0.0/tabs-scroll-buttons <path>
|
|
1109
1122
|
```
|
|
1110
1123
|
|
|
@@ -1123,7 +1136,7 @@ Renames `TextField`'s rows props.
|
|
|
1123
1136
|
+<TextareaAutosize minRows={3} maxRows={6} />
|
|
1124
1137
|
```
|
|
1125
1138
|
|
|
1126
|
-
```
|
|
1139
|
+
```bash
|
|
1127
1140
|
npx @mui/codemod v5.0.0/textarea-minmax-rows <path>
|
|
1128
1141
|
```
|
|
1129
1142
|
|
|
@@ -1136,7 +1149,7 @@ You can find more details about this breaking change in the migration guide.
|
|
|
1136
1149
|
|
|
1137
1150
|
Adds `DefaultTheme` module augmentation to typescript projects.
|
|
1138
1151
|
|
|
1139
|
-
```
|
|
1152
|
+
```bash
|
|
1140
1153
|
npx @mui/codemod v5.0.0/theme-augment <path>
|
|
1141
1154
|
```
|
|
1142
1155
|
|
|
@@ -1155,7 +1168,7 @@ Updates breakpoint values to match new logic. ⚠️ This mod is not idempotent,
|
|
|
1155
1168
|
|
|
1156
1169
|
<!-- #default-branch-switch -->
|
|
1157
1170
|
|
|
1158
|
-
```
|
|
1171
|
+
```bash
|
|
1159
1172
|
npx @mui/codemod v5.0.0/theme-breakpoints <path>
|
|
1160
1173
|
```
|
|
1161
1174
|
|
|
@@ -1165,7 +1178,7 @@ You can find more details about this breaking change in [the migration guide](ht
|
|
|
1165
1178
|
|
|
1166
1179
|
Renames `theme.breakpoints.width('md')` to `theme.breakpoints.values.md`.
|
|
1167
1180
|
|
|
1168
|
-
```
|
|
1181
|
+
```bash
|
|
1169
1182
|
npx @mui/codemod v5.0.0/theme-breakpoints-width <path>
|
|
1170
1183
|
```
|
|
1171
1184
|
|
|
@@ -1178,7 +1191,7 @@ You can find more details about this breaking change in [the migration guide](ht
|
|
|
1178
1191
|
+import { DeprecatedThemeOptions } from '@material-ui/core';
|
|
1179
1192
|
```
|
|
1180
1193
|
|
|
1181
|
-
```
|
|
1194
|
+
```bash
|
|
1182
1195
|
npx @mui/codemod v5.0.0/theme-options <path>
|
|
1183
1196
|
```
|
|
1184
1197
|
|
|
@@ -1200,7 +1213,7 @@ Renames `type` to `mode`.
|
|
|
1200
1213
|
+theme.palette.mode === 'dark'
|
|
1201
1214
|
```
|
|
1202
1215
|
|
|
1203
|
-
```
|
|
1216
|
+
```bash
|
|
1204
1217
|
npx @mui/codemod v5.0.0/theme-palette-mode <path>
|
|
1205
1218
|
```
|
|
1206
1219
|
|
|
@@ -1210,7 +1223,7 @@ You can find more details about this breaking change in [the migration guide](ht
|
|
|
1210
1223
|
|
|
1211
1224
|
Renames `MuiThemeProvider` to `ThemeProvider`.
|
|
1212
1225
|
|
|
1213
|
-
```
|
|
1226
|
+
```bash
|
|
1214
1227
|
npx @mui/codemod v5.0.0/theme-provider <path>
|
|
1215
1228
|
```
|
|
1216
1229
|
|
|
@@ -1229,7 +1242,7 @@ Removes the 'px' suffix from some template strings.
|
|
|
1229
1242
|
|
|
1230
1243
|
<!-- #default-branch-switch -->
|
|
1231
1244
|
|
|
1232
|
-
```
|
|
1245
|
+
```bash
|
|
1233
1246
|
npx @mui/codemod v5.0.0/theme-spacing <path>
|
|
1234
1247
|
```
|
|
1235
1248
|
|
|
@@ -1244,7 +1257,7 @@ Renames `theme.typography.round($number)` to `Math.round($number * 1e5) / 1e5`.
|
|
|
1244
1257
|
+`${Math.round($number * 1e5) / 1e5}`
|
|
1245
1258
|
```
|
|
1246
1259
|
|
|
1247
|
-
```
|
|
1260
|
+
```bash
|
|
1248
1261
|
npx @mui/codemod v5.0.0/theme-typography-round <path>
|
|
1249
1262
|
```
|
|
1250
1263
|
|
|
@@ -1262,7 +1275,7 @@ Converts all `@mui/material` submodule imports to the root module:
|
|
|
1262
1275
|
|
|
1263
1276
|
<!-- #default-branch-switch -->
|
|
1264
1277
|
|
|
1265
|
-
```
|
|
1278
|
+
```bash
|
|
1266
1279
|
npx @mui/codemod v5.0.0/top-level-imports <path>
|
|
1267
1280
|
```
|
|
1268
1281
|
|
|
@@ -1272,7 +1285,7 @@ Head to https://mui.com/guides/minimizing-bundle-size/ to understand when it's u
|
|
|
1272
1285
|
|
|
1273
1286
|
Renames import `transitions` to `createTransitions`
|
|
1274
1287
|
|
|
1275
|
-
```
|
|
1288
|
+
```bash
|
|
1276
1289
|
npx @mui/codemod v5.0.0/transitions <path>
|
|
1277
1290
|
```
|
|
1278
1291
|
|
|
@@ -1285,7 +1298,7 @@ Renames `useAutocomplete` related import from lab to core
|
|
|
1285
1298
|
+import useAutocomplete from '@material-ui/core/useAutocomplete';
|
|
1286
1299
|
```
|
|
1287
1300
|
|
|
1288
|
-
```
|
|
1301
|
+
```bash
|
|
1289
1302
|
npx @mui/codemod v5.0.0/use-autocomplete <path>
|
|
1290
1303
|
```
|
|
1291
1304
|
|
|
@@ -1314,7 +1327,7 @@ Updates Dialog, Menu, Popover, and Snackbar to use the `TransitionProps` prop to
|
|
|
1314
1327
|
|
|
1315
1328
|
<!-- #default-branch-switch -->
|
|
1316
1329
|
|
|
1317
|
-
```
|
|
1330
|
+
```bash
|
|
1318
1331
|
npx @mui/codemod v5.0.0/use-transitionprops <path>
|
|
1319
1332
|
```
|
|
1320
1333
|
|
|
@@ -1344,7 +1357,7 @@ The diff should look like this:
|
|
|
1344
1357
|
|
|
1345
1358
|
<!-- #default-branch-switch -->
|
|
1346
1359
|
|
|
1347
|
-
```
|
|
1360
|
+
```bash
|
|
1348
1361
|
npx @mui/codemod v5.0.0/variant-prop <path>
|
|
1349
1362
|
```
|
|
1350
1363
|
|
|
@@ -1358,7 +1371,7 @@ Removes imported `withMobileDialog`, and inserts hardcoded version to prevent ap
|
|
|
1358
1371
|
+const withMobileDialog = () => (WrappedComponent) => (props) => <WrappedComponent {...props} width="lg" fullScreen={false} />;
|
|
1359
1372
|
```
|
|
1360
1373
|
|
|
1361
|
-
```
|
|
1374
|
+
```bash
|
|
1362
1375
|
npx @mui/codemod v5.0.0/with-mobile-dialog <path>
|
|
1363
1376
|
```
|
|
1364
1377
|
|
|
@@ -1374,7 +1387,7 @@ Removes `withWidth` import, and inserts hardcoded version to prevent application
|
|
|
1374
1387
|
+const withWidth = () => (WrappedComponent) => (props) => <WrappedComponent {...props} width="xs" />;
|
|
1375
1388
|
```
|
|
1376
1389
|
|
|
1377
|
-
```
|
|
1390
|
+
```bash
|
|
1378
1391
|
npx @mui/codemod v5.0.0/with-width <path>
|
|
1379
1392
|
```
|
|
1380
1393
|
|
|
@@ -1435,7 +1448,7 @@ Replace every occurrence of `material-ui` related package with the new package n
|
|
|
1435
1448
|
+"@mui/styled-engine-sc": "next",
|
|
1436
1449
|
```
|
|
1437
1450
|
|
|
1438
|
-
```
|
|
1451
|
+
```bash
|
|
1439
1452
|
npx @mui/codemod v5.0.0/mui-replace <path>
|
|
1440
1453
|
```
|
|
1441
1454
|
|
|
@@ -1455,7 +1468,7 @@ The diff should look like this:
|
|
|
1455
1468
|
|
|
1456
1469
|
<!-- #default-branch-switch -->
|
|
1457
1470
|
|
|
1458
|
-
```
|
|
1471
|
+
```bash
|
|
1459
1472
|
npx @mui/codemod v4.0.0/theme-spacing-api <path>
|
|
1460
1473
|
```
|
|
1461
1474
|
|
|
@@ -1482,7 +1495,7 @@ Converts all `@material-ui/core` imports more than 1 level deep to the optimal f
|
|
|
1482
1495
|
|
|
1483
1496
|
<!-- #default-branch-switch -->
|
|
1484
1497
|
|
|
1485
|
-
```
|
|
1498
|
+
```bash
|
|
1486
1499
|
npx @mui/codemod v4.0.0/optimal-imports <path>
|
|
1487
1500
|
```
|
|
1488
1501
|
|
|
@@ -1500,7 +1513,7 @@ Converts all `@material-ui/core` submodule imports to the root module:
|
|
|
1500
1513
|
|
|
1501
1514
|
<!-- #default-branch-switch -->
|
|
1502
1515
|
|
|
1503
|
-
```
|
|
1516
|
+
```bash
|
|
1504
1517
|
npx @mui/codemod v4.0.0/top-level-imports <path>
|
|
1505
1518
|
```
|
|
1506
1519
|
|
|
@@ -1521,7 +1534,7 @@ The diff should look like this:
|
|
|
1521
1534
|
|
|
1522
1535
|
<!-- #default-branch-switch -->
|
|
1523
1536
|
|
|
1524
|
-
```
|
|
1537
|
+
```bash
|
|
1525
1538
|
npx @mui/codemod v1.0.0/import-path <path>
|
|
1526
1539
|
```
|
|
1527
1540
|
|
|
@@ -1548,7 +1561,7 @@ The diff should look like this:
|
|
|
1548
1561
|
|
|
1549
1562
|
<!-- #default-branch-switch -->
|
|
1550
1563
|
|
|
1551
|
-
```
|
|
1564
|
+
```bash
|
|
1552
1565
|
npx @mui/codemod v1.0.0/color-imports <path>
|
|
1553
1566
|
```
|
|
1554
1567
|
|
|
@@ -1556,7 +1569,7 @@ npx @mui/codemod v1.0.0/color-imports <path>
|
|
|
1556
1569
|
|
|
1557
1570
|
<!-- #default-branch-switch -->
|
|
1558
1571
|
|
|
1559
|
-
```
|
|
1572
|
+
```bash
|
|
1560
1573
|
npx @mui/codemod v1.0.0/color-imports <path> -- --importPath='mui/styles/colors' --targetPath='mui/colors'
|
|
1561
1574
|
```
|
|
1562
1575
|
|
|
@@ -1574,7 +1587,7 @@ The diff should look like this:
|
|
|
1574
1587
|
|
|
1575
1588
|
<!-- #default-branch-switch -->
|
|
1576
1589
|
|
|
1577
|
-
```
|
|
1590
|
+
```bash
|
|
1578
1591
|
npx @mui/codemod v1.0.0/svg-icon-imports <path>
|
|
1579
1592
|
```
|
|
1580
1593
|
|
|
@@ -1592,7 +1605,7 @@ The diff should look like this:
|
|
|
1592
1605
|
|
|
1593
1606
|
<!-- #default-branch-switch -->
|
|
1594
1607
|
|
|
1595
|
-
```
|
|
1608
|
+
```bash
|
|
1596
1609
|
npx @mui/codemod v1.0.0/menu-item-primary-text <path>
|
|
1597
1610
|
```
|
|
1598
1611
|
|
|
@@ -1616,6 +1629,6 @@ The diff should look like this:
|
|
|
1616
1629
|
|
|
1617
1630
|
<!-- #default-branch-switch -->
|
|
1618
1631
|
|
|
1619
|
-
```
|
|
1632
|
+
```bash
|
|
1620
1633
|
npx @mui/codemod v0.15.0/import-path <path>
|
|
1621
1634
|
```
|
package/codemod.js
CHANGED
|
File without changes
|