@mui/x-codemod 7.0.0 → 7.7.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 CHANGED
@@ -13,7 +13,7 @@ This repository contains a collection of codemod scripts based for use with
13
13
  <!-- #default-branch-switch -->
14
14
 
15
15
  ```bash
16
- npx @mui/x-codemod <codemod> <paths...>
16
+ npx @mui/x-codemod@latest <codemod> <paths...>
17
17
 
18
18
  Applies a `@mui/x-codemod` to the specified paths
19
19
 
@@ -29,8 +29,8 @@ Options:
29
29
  --jscodeshift Pass options directly to jscodeshift [array]
30
30
 
31
31
  Examples:
32
- npx @mui/x-codemod v6.0.0/preset-safe src
33
- npx @mui/x-codemod v6.0.0/component-rename-prop src --
32
+ npx @mui/x-codemod@latest v7.0.0/preset-safe src
33
+ npx @mui/x-codemod@latest v6.0.0/component-rename-prop src --
34
34
  --component=DataGrid --from=prop --to=newProp
35
35
  ```
36
36
 
@@ -40,9 +40,9 @@ To pass more options directly to jscodeshift, use `--jscodeshift=...`. For examp
40
40
 
41
41
  ```bash
42
42
  // single option
43
- npx @mui/x-codemod --jscodeshift=--run-in-band
43
+ npx @mui/x-codemod@latest --jscodeshift=--run-in-band
44
44
  // multiple options
45
- npx @mui/x-codemod --jscodeshift=--cpus=1 --jscodeshift=--print --jscodeshift=--dry --jscodeshift=--verbose=2
45
+ npx @mui/x-codemod@latest --jscodeshift=--cpus=1 --jscodeshift=--print --jscodeshift=--dry --jscodeshift=--verbose=2
46
46
  ```
47
47
 
48
48
  See all available options [here](https://github.com/facebook/jscodeshift#usage-cli).
@@ -53,7 +53,7 @@ Options to [recast](https://github.com/benjamn/recast)'s printer can be provided
53
53
  through jscodeshift's `printOptions` command line argument
54
54
 
55
55
  ```bash
56
- npx @mui/x-codemod <transform> <path> --jscodeshift="--printOptions='{\"quote\":\"double\"}'"
56
+ npx @mui/x-codemod@latest <transform> <path> --jscodeshift="--printOptions='{\"quote\":\"double\"}'"
57
57
  ```
58
58
 
59
59
  ## v7.0.0
@@ -66,7 +66,7 @@ It runs codemods for both Data Grid and Date and Time Pickers packages.
66
66
  To run codemods for a specific package, refer to the respective section.
67
67
 
68
68
  ```bash
69
- npx @mui/x-codemod v7.0.0/preset-safe <path|folder>
69
+ npx @mui/x-codemod@latest v7.0.0/preset-safe <path|folder>
70
70
  ```
71
71
 
72
72
  The corresponding sub-sections are listed below
@@ -82,7 +82,7 @@ The corresponding sub-sections are listed below
82
82
  The `preset-safe` codemods for pickers.
83
83
 
84
84
  ```bash
85
- npx @mui/x-codemod v7.0.0/pickers/preset-safe <path|folder>
85
+ npx @mui/x-codemod@latest v7.0.0/pickers/preset-safe <path|folder>
86
86
  ```
87
87
 
88
88
  The list includes these transformers
@@ -108,7 +108,7 @@ This change only affects Date and Time Picker components.
108
108
  ```
109
109
 
110
110
  ```bash
111
- npx @mui/x-codemod v7.0.0/pickers/rename-components-to-slots <path>
111
+ npx @mui/x-codemod@latest v7.0.0/pickers/rename-components-to-slots <path>
112
112
  ```
113
113
 
114
114
  #### `rename-default-calendar-month-to-reference-date`
@@ -121,7 +121,7 @@ Replace the `defaultCalendarMonth` prop with the `referenceDate` prop.
121
121
  ```
122
122
 
123
123
  ```bash
124
- npx @mui/x-codemod v7.0.0/pickers/rename-default-calendar-month-to-reference-date <path>
124
+ npx @mui/x-codemod@latest v7.0.0/pickers/rename-default-calendar-month-to-reference-date <path>
125
125
  ```
126
126
 
127
127
  #### `rename-day-picker-classes`
@@ -134,7 +134,7 @@ Rename the `dayPickerClasses` variable to `dayCalendarClasses`.
134
134
  ```
135
135
 
136
136
  ```bash
137
- npx @mui/x-codemod v7.0.0/pickers/rename-day-picker-classes <path>
137
+ npx @mui/x-codemod@latest v7.0.0/pickers/rename-day-picker-classes <path>
138
138
  ```
139
139
 
140
140
  #### `rename-slots-types`
@@ -149,7 +149,7 @@ Replace types suffix `SlotsComponent` by `Slots` and `SlotsComponentsProps` by `
149
149
  ```
150
150
 
151
151
  ```bash
152
- npx @mui/x-codemod v7.0.0/pickers/rename-slots-types <path>
152
+ npx @mui/x-codemod@latest v7.0.0/pickers/rename-slots-types <path>
153
153
  ```
154
154
 
155
155
  ### Data Grid codemods
@@ -159,7 +159,7 @@ npx @mui/x-codemod v7.0.0/pickers/rename-slots-types <path>
159
159
  The `preset-safe` codemods for data grid.
160
160
 
161
161
  ```bash
162
- npx @mui/x-codemod v7.0.0/data-grid/preset-safe <path|folder>
162
+ npx @mui/x-codemod@latest v7.0.0/data-grid/preset-safe <path|folder>
163
163
  ```
164
164
 
165
165
  The list includes these transformers
@@ -184,7 +184,7 @@ This change only affects Data Grid components.
184
184
  ```
185
185
 
186
186
  ```bash
187
- npx @mui/x-codemod v7.0.0/data-grid/rename-components-to-slots <path>
187
+ npx @mui/x-codemod@latest v7.0.0/data-grid/rename-components-to-slots <path>
188
188
  ```
189
189
 
190
190
  #### `rename-cell-selection-props`
@@ -203,7 +203,7 @@ Rename props related to `cellSelection` feature.
203
203
  ```
204
204
 
205
205
  ```bash
206
- npx @mui/x-codemod v7.0.0/data-grid/rename-cell-selection-props <path>
206
+ npx @mui/x-codemod@latest v7.0.0/data-grid/rename-cell-selection-props <path>
207
207
  ```
208
208
 
209
209
  #### `remove-stabilized-v7-experimentalFeatures`
@@ -222,7 +222,7 @@ Remove feature flags for stabilized `experimentalFeatures`.
222
222
  ```
223
223
 
224
224
  ```bash
225
- npx @mui/x-codemod@next v7.0.0/data-grid/remove-stabilized-experimentalFeatures <path>
225
+ npx @mui/x-codemod@latest v7.0.0/data-grid/remove-stabilized-experimentalFeatures <path>
226
226
  ```
227
227
 
228
228
  ### Tree View codemods
@@ -232,7 +232,7 @@ npx @mui/x-codemod@next v7.0.0/data-grid/remove-stabilized-experimentalFeatures
232
232
  The `preset-safe` codemods for tree view.
233
233
 
234
234
  ```bash
235
- npx @mui/x-codemod v7.0.0/tree-view/preset-safe <path|folder>
235
+ npx @mui/x-codemod@latest v7.0.0/tree-view/preset-safe <path|folder>
236
236
  ```
237
237
 
238
238
  The list includes these transformers
package/codemod.js CHANGED
@@ -65,7 +65,7 @@ function run(argv) {
65
65
  parser
66
66
  }, other || []);
67
67
  }
68
- _yargs.default.command({
68
+ (0, _yargs.default)(process.argv.slice(2)).command({
69
69
  command: '$0 <codemod> <paths...>',
70
70
  describe: 'Applies a `@mui/x-codemod` to the specified paths',
71
71
  builder: command => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-codemod",
3
- "version": "7.0.0",
3
+ "version": "7.7.0",
4
4
  "bin": "./codemod.js",
5
5
  "private": false,
6
6
  "author": "MUI Team",
@@ -13,13 +13,6 @@
13
13
  "codemod",
14
14
  "jscodeshift"
15
15
  ],
16
- "scripts": {
17
- "test": "cd ../../ && cross-env NODE_ENV=test mocha 'packages/x-codemod/**/*.test.ts'",
18
- "typescript": "tsc -p tsconfig.json",
19
- "prebuild": "rimraf build",
20
- "copy-files": "cpy README.md build && cpy package.json build",
21
- "build": "node ../../scripts/build.mjs node --ignore 'src/types.ts' && yarn copy-files"
22
- },
23
16
  "repository": {
24
17
  "type": "git",
25
18
  "url": "https://github.com/mui/mui-x.git",
@@ -32,21 +25,32 @@
32
25
  "url": "https://opencollective.com/mui-org"
33
26
  },
34
27
  "dependencies": {
35
- "@babel/core": "^7.24.0",
36
- "@babel/runtime": "^7.24.0",
37
- "@babel/traverse": "^7.24.0",
28
+ "@babel/core": "^7.24.7",
29
+ "@babel/runtime": "^7.24.7",
30
+ "@babel/traverse": "^7.24.7",
38
31
  "jscodeshift": "0.13.1",
39
32
  "jscodeshift-add-imports": "^1.0.10",
40
33
  "yargs": "^17.7.2"
41
34
  },
42
35
  "devDependencies": {
43
- "@types/jscodeshift": "^0.11.5"
36
+ "@types/jscodeshift": "^0.11.5",
37
+ "dayjs": "^1.11.11",
38
+ "moment-timezone": "^0.5.45",
39
+ "rimraf": "^5.0.7"
44
40
  },
45
41
  "sideEffects": false,
46
42
  "publishConfig": {
47
- "access": "public"
43
+ "access": "public",
44
+ "directory": "build"
48
45
  },
49
46
  "engines": {
50
47
  "node": ">=14.0.0"
48
+ },
49
+ "scripts": {
50
+ "test": "cd ../../ && cross-env NODE_ENV=test mocha 'packages/x-codemod/**/*.test.ts'",
51
+ "typescript": "tsc -p tsconfig.json",
52
+ "prebuild": "rimraf build",
53
+ "copy-files": "cpy README.md build && cpy package.json build",
54
+ "build": "node ../../scripts/build.mjs node --ignore 'src/types.ts' && pnpm copy-files"
51
55
  }
52
- }
56
+ }
@@ -8,7 +8,7 @@ exports.default = transform;
8
8
  var _renameCSSClasses = _interopRequireDefault(require("../../../util/renameCSSClasses"));
9
9
  var _renameIdentifiers = _interopRequireWildcard(require("../../../util/renameIdentifiers"));
10
10
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
11
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
11
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
12
12
  const renamedIdentifiers = {
13
13
  GridLinkOperator: 'GridLogicOperator',
14
14
  linkOperatorInputProps: 'logicOperatorInputProps',