@mui/codemod 5.2.1 → 5.4.2

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 CHANGED
@@ -39,7 +39,7 @@ Examples:
39
39
  npx @mui/codemod v5.0.0/preset-safe src --parser=flow
40
40
  ```
41
41
 
42
- #### jscodeshift options
42
+ ### jscodeshift options
43
43
 
44
44
  To pass more options directly to jscodeshift, use `--jscodeshift="..."`. For example:
45
45
 
@@ -49,7 +49,7 @@ npx @mui/codemod --jscodeshift="--run-in-band --verbose=2"
49
49
 
50
50
  See all available options [here](https://github.com/facebook/jscodeshift#usage-cli).
51
51
 
52
- #### Recast Options
52
+ ### Recast Options
53
53
 
54
54
  Options to [recast](https://github.com/benjamn/recast)'s printer can be provided
55
55
  through jscodeshift's `printOptions` command line argument
@@ -1073,7 +1073,7 @@ You can find more details about this breaking change in [the migration guide](ht
1073
1073
 
1074
1074
  #### `mui-replace`
1075
1075
 
1076
- Replace every occurrence of `material-ui` related package with the new package names (listed below) except these packages (`@material-ui/pickers`, `@material-ui/data-grid`, `@material-ui/x-grid` & `@material-ui/x-grid-data-generator`). [More details about why package names are changed](https://github.com/mui-org/material-ui/issues/27666)
1076
+ Replace every occurrence of `material-ui` related package with the new package names (listed below) except these packages (`@material-ui/pickers`, `@material-ui/data-grid`, `@material-ui/x-grid` & `@material-ui/x-grid-data-generator`). [More details about why package names are changed](https://github.com/mui/material-ui/issues/27666)
1077
1077
 
1078
1078
  **Material Design components**
1079
1079
 
@@ -1247,13 +1247,13 @@ npx @mui/codemod v1.0.0/color-imports <path>
1247
1247
 
1248
1248
  <!-- #default-branch-switch -->
1249
1249
 
1250
- ```
1250
+ ```sh
1251
1251
  npx @mui/codemod v1.0.0/color-imports <path> -- --importPath='mui/styles/colors' --targetPath='mui/colors'
1252
1252
  ```
1253
1253
 
1254
1254
  #### `svg-icon-imports`
1255
1255
 
1256
- Updates the `svg-icons` import paths from `material-ui/svg-icons/<category>/<icon-name>` to `@material-ui/icons/<IconName>`, to use the new [`@material-ui/icons`](https://github.com/mui-org/material-ui/tree/next/packages/mui-material-icons) package.
1256
+ Updates the `svg-icons` import paths from `material-ui/svg-icons/<category>/<icon-name>` to `@material-ui/icons/<IconName>`, to use the new `@material-ui/icons` package.
1257
1257
  The diff should look like this:
1258
1258
 
1259
1259
  ```diff
package/codemod.js CHANGED
File without changes
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  // This codemod attempts to fix the color imports breaking change introduced in
4
- // https://github.com/mui-org/material-ui/releases/tag/v1.0.0-alpha.21
4
+ // https://github.com/mui/material-ui/releases/tag/v1.0.0-alpha.21
5
5
  // List of colors that are in the `common` module
6
6
  const commonColors = ['black', 'white', 'transparent', 'fullBlack', 'darkBlack', 'lightBlack', 'minBlack', 'faintBlack', 'fullWhite', 'darkWhite', 'lightWhite'];
7
7
  /**
@@ -21,7 +21,6 @@ function pascalize(iconName) {
21
21
  * Update all `svg-icons` import references to use `@material-ui/icons` package.
22
22
  * Find and replace string literal AST nodes to ensure all svg-icon paths get updated, regardless
23
23
  * of being in an import declaration, or a require() call, etc.
24
- * https://github.com/mui-org/material-ui/tree/next/packages/@material-ui/icons
25
24
  * @param {jscodeshift_api_object} j
26
25
  * @param {jscodeshift_ast_object} root
27
26
  */
@@ -79,14 +79,14 @@ function SellHero() {
79
79
  align: "center",
80
80
  variant: "h3",
81
81
  color: "textSecondary",
82
- children: 'Build your React themes business on the official MUI store.'
82
+ children: 'Build your React themes business on the official MUI Store.'
83
83
  })), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
84
84
  className: classes.actions,
85
85
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Button2.default, {
86
86
  variant: "contained",
87
87
  component: _Link.default,
88
88
  naked: true,
89
- to: "https://material-ui.zendesk.com/hc/en-us/articles/360008775380-How-do-I-apply-to-be-a-contributor-",
89
+ to: "https://support.mui.com/hc/en-us/articles/360008775380-How-do-I-apply-to-be-a-contributor-",
90
90
  target: "_blank",
91
91
  rel: "noopener",
92
92
  className: classes.apply,
@@ -88,14 +88,14 @@ function SellHero() {
88
88
  align: "center",
89
89
  variant: "h3",
90
90
  color: "textSecondary",
91
- children: 'Build your React themes business on the official MUI store.'
91
+ children: 'Build your React themes business on the official MUI Store.'
92
92
  })), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
93
93
  className: classes.actions,
94
94
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Button2.default, {
95
95
  variant: "contained",
96
96
  component: _Link.default,
97
97
  naked: true,
98
- to: "https://material-ui.zendesk.com/hc/en-us/articles/360008775380-How-do-I-apply-to-be-a-contributor-",
98
+ to: "https://support.mui.com/hc/en-us/articles/360008775380-How-do-I-apply-to-be-a-contributor-",
99
99
  target: "_blank",
100
100
  rel: "noopener",
101
101
  className: classes.apply,
@@ -208,7 +208,7 @@ class AppAppBar extends _react.default.Component {
208
208
  }), essential ? null : /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
209
209
  className: classes.item,
210
210
  component: _Link.default,
211
- to: "https://material-ui.zendesk.com/hc/en-us",
211
+ to: "https://support.mui.com/hc/en-us",
212
212
  target: "_blank",
213
213
  children: 'Help'
214
214
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_NoSsr.default, {
@@ -223,7 +223,7 @@ class AppAppBar extends _react.default.Component {
223
223
  }), essential ? null : /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
224
224
  className: classes.item,
225
225
  component: _Link.default,
226
- to: "https://material-ui.zendesk.com/hc/en-us",
226
+ to: "https://support.mui.com/hc/en-us",
227
227
  target: "_blank",
228
228
  children: 'Help'
229
229
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_NoSsr.default, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/codemod",
3
- "version": "5.2.1",
3
+ "version": "5.4.2",
4
4
  "bin": "./codemod.js",
5
5
  "private": false,
6
6
  "author": "MUI Team",
@@ -20,18 +20,22 @@
20
20
  },
21
21
  "repository": {
22
22
  "type": "git",
23
- "url": "https://github.com/mui-org/material-ui.git",
23
+ "url": "https://github.com/mui/material-ui.git",
24
24
  "directory": "packages/mui-codemod"
25
25
  },
26
26
  "license": "MIT",
27
- "homepage": "https://github.com/mui-org/material-ui/tree/master/packages/mui-codemod",
27
+ "homepage": "https://github.com/mui/material-ui/tree/master/packages/mui-codemod",
28
+ "funding": {
29
+ "type": "opencollective",
30
+ "url": "https://opencollective.com/mui"
31
+ },
28
32
  "dependencies": {
29
- "@babel/core": "^7.16.0",
30
- "@babel/runtime": "^7.16.3",
31
- "@babel/traverse": "^7.16.3",
32
- "jscodeshift": "^0.13.0",
33
+ "@babel/core": "^7.17.0",
34
+ "@babel/runtime": "^7.17.0",
35
+ "@babel/traverse": "^7.17.0",
36
+ "jscodeshift": "^0.13.1",
33
37
  "jscodeshift-add-imports": "^1.0.10",
34
- "yargs": "^17.2.1"
38
+ "yargs": "^17.3.1"
35
39
  },
36
40
  "devDependencies": {
37
41
  "@types/jscodeshift": "0.11.3"