@mui/codemod 6.0.0-alpha.0 → 6.0.0-alpha.1
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 +29 -0
- package/node/deprecations/badge-props/badge-props.js +22 -0
- package/node/deprecations/badge-props/index.js +13 -0
- package/node/deprecations/badge-props/test-cases/actual.js +59 -0
- package/node/deprecations/badge-props/test-cases/expected.js +44 -0
- package/node/deprecations/badge-props/test-cases/theme.actual.js +73 -0
- package/node/deprecations/badge-props/test-cases/theme.expected.js +58 -0
- package/node/v6.0.0/all/index.js +13 -0
- package/node/v6.0.0/all/postcss.config.js +9 -0
- package/node/v6.0.0/all/v6-all.js +17 -0
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -62,6 +62,7 @@ npx @mui/codemod@next <transform> <path> --jscodeshift="--printOptions='{\"quote
|
|
|
62
62
|
## Included scripts
|
|
63
63
|
|
|
64
64
|
- [Deprecation](#deprecations)
|
|
65
|
+
- [v6](#v600)
|
|
65
66
|
- [v5](#v500)
|
|
66
67
|
- [v4](#v400)
|
|
67
68
|
- [v1](#v100)
|
|
@@ -287,6 +288,32 @@ npx @mui/codemod@next deprecations/alert-props <path>
|
|
|
287
288
|
npx @mui/codemod@next deprecations/backdrop-props <path>
|
|
288
289
|
```
|
|
289
290
|
|
|
291
|
+
#### `badge-props`
|
|
292
|
+
|
|
293
|
+
```diff
|
|
294
|
+
<Badge
|
|
295
|
+
- components={{ Root: CustomRoot }}
|
|
296
|
+
+ slots={{ root: CustomRoot }}
|
|
297
|
+
- componentsProps={{ root: { testid: 'test-id' } }}
|
|
298
|
+
+ slotProps={{ root: { testid: 'test-id' } }}
|
|
299
|
+
/>
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
```diff
|
|
303
|
+
MuiBadge: {
|
|
304
|
+
defaultProps: {
|
|
305
|
+
- components: { Root: CustomRoot }
|
|
306
|
+
+ slots: { root: CustomRoot },
|
|
307
|
+
- componentsProps: { root: { testid: 'test-id' }}
|
|
308
|
+
+ slotProps: { root: { testid: 'test-id' } },
|
|
309
|
+
},
|
|
310
|
+
},
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
```bash
|
|
314
|
+
npx @mui/codemod@next deprecations/badge-props <path>
|
|
315
|
+
```
|
|
316
|
+
|
|
290
317
|
#### `button-classes`
|
|
291
318
|
|
|
292
319
|
JS transforms:
|
|
@@ -944,6 +971,8 @@ npx @mui/codemod@latest deprecations/step-label-props <path>
|
|
|
944
971
|
|
|
945
972
|
```
|
|
946
973
|
|
|
974
|
+
### v6.0.0
|
|
975
|
+
|
|
947
976
|
### v5.0.0
|
|
948
977
|
|
|
949
978
|
#### `base-use-named-exports`
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = transformer;
|
|
8
|
+
var _replaceComponentsWithSlots = _interopRequireDefault(require("../utils/replaceComponentsWithSlots"));
|
|
9
|
+
/**
|
|
10
|
+
* @param {import('jscodeshift').FileInfo} file
|
|
11
|
+
* @param {import('jscodeshift').API} api
|
|
12
|
+
*/
|
|
13
|
+
function transformer(file, api, options) {
|
|
14
|
+
const j = api.jscodeshift;
|
|
15
|
+
const root = j(file.source);
|
|
16
|
+
const printOptions = options.printOptions;
|
|
17
|
+
(0, _replaceComponentsWithSlots.default)(j, {
|
|
18
|
+
root,
|
|
19
|
+
componentName: 'Badge'
|
|
20
|
+
});
|
|
21
|
+
return root.toSource(printOptions);
|
|
22
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
Object.defineProperty(exports, "default", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () {
|
|
10
|
+
return _badgeProps.default;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
var _badgeProps = _interopRequireDefault(require("./badge-props"));
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _material = require("@mui/material");
|
|
4
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
5
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Badge, {
|
|
6
|
+
components: {
|
|
7
|
+
root: ComponentsRoot
|
|
8
|
+
},
|
|
9
|
+
componentsProps: {
|
|
10
|
+
root: componentsRootProps
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Badge, {
|
|
14
|
+
slots: {
|
|
15
|
+
badge: SlotsBadge
|
|
16
|
+
},
|
|
17
|
+
components: {
|
|
18
|
+
root: ComponentsRoot
|
|
19
|
+
},
|
|
20
|
+
slotProps: {
|
|
21
|
+
badge: slotsBadgeProps
|
|
22
|
+
},
|
|
23
|
+
componentsProps: {
|
|
24
|
+
root: componentsRootProps
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Badge, {
|
|
28
|
+
slots: {
|
|
29
|
+
root: SlotsRoot,
|
|
30
|
+
badge: SlotsBadge
|
|
31
|
+
},
|
|
32
|
+
components: {
|
|
33
|
+
root: ComponentsRoot
|
|
34
|
+
},
|
|
35
|
+
slotProps: {
|
|
36
|
+
root: slotsRootProps,
|
|
37
|
+
badge: slotsBadgeProps
|
|
38
|
+
},
|
|
39
|
+
componentsProps: {
|
|
40
|
+
root: componentsRootProps
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Badge, {
|
|
44
|
+
slots: {
|
|
45
|
+
root: SlotsRoot,
|
|
46
|
+
badge: SlotsBadge
|
|
47
|
+
},
|
|
48
|
+
components: {
|
|
49
|
+
root: ComponentsRoot
|
|
50
|
+
},
|
|
51
|
+
slotProps: {
|
|
52
|
+
root: slotsRootProps,
|
|
53
|
+
badge: slotsBadgeProps
|
|
54
|
+
},
|
|
55
|
+
componentsProps: {
|
|
56
|
+
root: componentsRootProps,
|
|
57
|
+
badge: componentsBadgeProps
|
|
58
|
+
}
|
|
59
|
+
});
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
5
|
+
var _material = require("@mui/material");
|
|
6
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
7
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Badge, {
|
|
8
|
+
slots: {
|
|
9
|
+
root: ComponentsRoot
|
|
10
|
+
},
|
|
11
|
+
slotProps: {
|
|
12
|
+
root: componentsRootProps
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Badge, {
|
|
16
|
+
slots: {
|
|
17
|
+
badge: SlotsBadge,
|
|
18
|
+
root: ComponentsRoot
|
|
19
|
+
},
|
|
20
|
+
slotProps: {
|
|
21
|
+
badge: slotsBadgeProps,
|
|
22
|
+
root: componentsRootProps
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Badge, {
|
|
26
|
+
slots: {
|
|
27
|
+
root: SlotsRoot,
|
|
28
|
+
badge: SlotsBadge
|
|
29
|
+
},
|
|
30
|
+
slotProps: {
|
|
31
|
+
badge: slotsBadgeProps,
|
|
32
|
+
root: (0, _extends2.default)({}, componentsRootProps, slotsRootProps)
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Badge, {
|
|
36
|
+
slots: {
|
|
37
|
+
root: SlotsRoot,
|
|
38
|
+
badge: SlotsBadge
|
|
39
|
+
},
|
|
40
|
+
slotProps: {
|
|
41
|
+
root: (0, _extends2.default)({}, componentsRootProps, slotsRootProps),
|
|
42
|
+
badge: (0, _extends2.default)({}, componentsBadgeProps, slotsBadgeProps)
|
|
43
|
+
}
|
|
44
|
+
});
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
fn({
|
|
4
|
+
MuiBadge: {
|
|
5
|
+
defaultProps: {
|
|
6
|
+
components: {
|
|
7
|
+
root: ComponentsRoot
|
|
8
|
+
},
|
|
9
|
+
componentsProps: {
|
|
10
|
+
root: componentsRootProps
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
fn({
|
|
16
|
+
MuiBadge: {
|
|
17
|
+
defaultProps: {
|
|
18
|
+
components: {
|
|
19
|
+
root: ComponentsRoot
|
|
20
|
+
},
|
|
21
|
+
slots: {
|
|
22
|
+
badge: SlotsBadge
|
|
23
|
+
},
|
|
24
|
+
componentsProps: {
|
|
25
|
+
root: componentsRootProps
|
|
26
|
+
},
|
|
27
|
+
slotProps: {
|
|
28
|
+
badge: slotsBadgeProps
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
fn({
|
|
34
|
+
MuiBadge: {
|
|
35
|
+
defaultProps: {
|
|
36
|
+
components: {
|
|
37
|
+
root: ComponentsRoot
|
|
38
|
+
},
|
|
39
|
+
slots: {
|
|
40
|
+
badge: SlotsBadge,
|
|
41
|
+
root: SlotsRoot
|
|
42
|
+
},
|
|
43
|
+
componentsProps: {
|
|
44
|
+
root: componentsRootProps
|
|
45
|
+
},
|
|
46
|
+
slotProps: {
|
|
47
|
+
root: slotsRootProps,
|
|
48
|
+
badge: slotsBadgeProps
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
fn({
|
|
54
|
+
MuiBadge: {
|
|
55
|
+
defaultProps: {
|
|
56
|
+
components: {
|
|
57
|
+
root: ComponentsRoot
|
|
58
|
+
},
|
|
59
|
+
slots: {
|
|
60
|
+
badge: SlotsBadge,
|
|
61
|
+
root: SlotsRoot
|
|
62
|
+
},
|
|
63
|
+
componentsProps: {
|
|
64
|
+
root: componentsRootProps,
|
|
65
|
+
badge: componentsBadgeProps
|
|
66
|
+
},
|
|
67
|
+
slotProps: {
|
|
68
|
+
badge: slotsBadgeProps,
|
|
69
|
+
root: slotsRootProps
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
});
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
5
|
+
fn({
|
|
6
|
+
MuiBadge: {
|
|
7
|
+
defaultProps: {
|
|
8
|
+
slots: {
|
|
9
|
+
root: ComponentsRoot
|
|
10
|
+
},
|
|
11
|
+
slotProps: {
|
|
12
|
+
root: componentsRootProps
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
fn({
|
|
18
|
+
MuiBadge: {
|
|
19
|
+
defaultProps: {
|
|
20
|
+
slots: {
|
|
21
|
+
root: ComponentsRoot,
|
|
22
|
+
badge: SlotsBadge
|
|
23
|
+
},
|
|
24
|
+
slotProps: {
|
|
25
|
+
root: componentsRootProps,
|
|
26
|
+
badge: slotsBadgeProps
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
fn({
|
|
32
|
+
MuiBadge: {
|
|
33
|
+
defaultProps: {
|
|
34
|
+
slots: {
|
|
35
|
+
root: SlotsRoot,
|
|
36
|
+
badge: SlotsBadge
|
|
37
|
+
},
|
|
38
|
+
slotProps: {
|
|
39
|
+
root: (0, _extends2.default)({}, componentsRootProps, slotsRootProps),
|
|
40
|
+
badge: slotsBadgeProps
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
fn({
|
|
46
|
+
MuiBadge: {
|
|
47
|
+
defaultProps: {
|
|
48
|
+
slots: {
|
|
49
|
+
root: SlotsRoot,
|
|
50
|
+
badge: SlotsBadge
|
|
51
|
+
},
|
|
52
|
+
slotProps: {
|
|
53
|
+
root: (0, _extends2.default)({}, componentsRootProps, slotsRootProps),
|
|
54
|
+
badge: (0, _extends2.default)({}, componentsBadgeProps, slotsBadgeProps)
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
Object.defineProperty(exports, "default", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () {
|
|
10
|
+
return _v6All.default;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
var _v6All = _interopRequireDefault(require("./v6-all"));
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = v6All;
|
|
7
|
+
/**
|
|
8
|
+
* @param {import('jscodeshift').FileInfo} file
|
|
9
|
+
* @param {import('jscodeshift').API} api
|
|
10
|
+
*/
|
|
11
|
+
function v6All(file) {
|
|
12
|
+
// Currently empty, when adding the first codemod:
|
|
13
|
+
// - Read mui-codemod/CONTRIBUTING.md
|
|
14
|
+
// - Follow mui-codemod/src/deprecations/all/deprecations-all.js as a guide
|
|
15
|
+
// - Remove this comment
|
|
16
|
+
return file.source;
|
|
17
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/codemod",
|
|
3
|
-
"version": "6.0.0-alpha.
|
|
3
|
+
"version": "6.0.0-alpha.1",
|
|
4
4
|
"bin": "./codemod.js",
|
|
5
5
|
"private": false,
|
|
6
6
|
"author": "MUI Team",
|
|
@@ -24,17 +24,17 @@
|
|
|
24
24
|
"url": "https://opencollective.com/mui-org"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@babel/core": "^7.
|
|
28
|
-
"@babel/runtime": "^7.
|
|
29
|
-
"@babel/traverse": "^7.
|
|
27
|
+
"@babel/core": "^7.24.4",
|
|
28
|
+
"@babel/runtime": "^7.24.4",
|
|
29
|
+
"@babel/traverse": "^7.24.1",
|
|
30
30
|
"jscodeshift": "^0.13.1",
|
|
31
31
|
"jscodeshift-add-imports": "^1.0.10",
|
|
32
|
-
"postcss": "^8.4.
|
|
32
|
+
"postcss": "^8.4.38",
|
|
33
33
|
"postcss-cli": "^8.3.1",
|
|
34
34
|
"yargs": "^17.7.2"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@types/chai": "^4.3.
|
|
37
|
+
"@types/chai": "^4.3.14",
|
|
38
38
|
"@types/jscodeshift": "0.11.5",
|
|
39
39
|
"chai": "^4.4.1"
|
|
40
40
|
},
|