@mui/x-codemod 6.9.0 → 7.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 CHANGED
@@ -38,7 +38,7 @@ Examples:
38
38
 
39
39
  To pass more options directly to jscodeshift, use `--jscodeshift=...`. For example:
40
40
 
41
- ```sh
41
+ ```bash
42
42
  // single option
43
43
  npx @mui/x-codemod --jscodeshift=--run-in-band
44
44
  // multiple options
@@ -52,7 +52,7 @@ See all available options [here](https://github.com/facebook/jscodeshift#usage-c
52
52
  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
- ```sh
55
+ ```bash
56
56
  npx @mui/x-codemod <transform> <path> --jscodeshift="--printOptions='{\"quote\":\"double\"}'"
57
57
  ```
58
58
 
@@ -64,7 +64,7 @@ npx @mui/x-codemod <transform> <path> --jscodeshift="--printOptions='{\"quote\":
64
64
 
65
65
  A combination of all important transformers for migrating v5 to v6. ⚠️ This codemod should be run only once. It runs codemods for both Data Grid and Date and Time Pickers packages. To run codemods for a specific package, refer to the respective section.
66
66
 
67
- ```sh
67
+ ```bash
68
68
  npx @mui/x-codemod v6.0.0/preset-safe <path|folder>
69
69
  ```
70
70
 
@@ -79,7 +79,7 @@ The corresponding sub-sections are listed below
79
79
 
80
80
  The `preset-safe` codemods for pickers.
81
81
 
82
- ```sh
82
+ ```bash
83
83
  npx @mui/x-codemod v6.0.0/pickers/preset-safe <path|folder>
84
84
  ```
85
85
 
@@ -164,7 +164,7 @@ Renames the `locale` prop of the `LocalizationProvider` component into `adapterL
164
164
 
165
165
  ```
166
166
 
167
- ```sh
167
+ ```bash
168
168
  npx @mui/x-codemod v6.0.0/pickers/localization-provider-rename-locale <path>
169
169
  ```
170
170
 
@@ -181,7 +181,7 @@ Replace props used for localization such as `cancelText` to their corresponding
181
181
  />
182
182
  ```
183
183
 
184
- ```sh
184
+ ```bash
185
185
  npx @mui/x-codemod v6.0.0/pickers/text-props-to-localeText <path>
186
186
  ```
187
187
 
@@ -222,7 +222,7 @@ Replace props used for `Tabs` in DateTime pickers by `componentsProps.tabs` prop
222
222
  />
223
223
  ```
224
224
 
225
- ```sh
225
+ ```bash
226
226
  npx @mui/x-codemod v6.0.0/pickers/replace-tabs-props <path>
227
227
  ```
228
228
 
@@ -248,7 +248,7 @@ Replace props used to customize the `Toolbar` in pickers by slots properties and
248
248
  + localeText={{ toolbarTitle: "Title" }}
249
249
  ```
250
250
 
251
- ```sh
251
+ ```bash
252
252
  npx @mui/x-codemod v6.0.0/pickers/replace-toolbar-props-by-slot <path>
253
253
  ```
254
254
 
@@ -298,7 +298,7 @@ Replace customization props by their equivalent `components` and `componentsProp
298
298
  />
299
299
  ```
300
300
 
301
- ```sh
301
+ ```bash
302
302
  npx @mui/x-codemod v6.0.0/pickers/migrate-to-components-componentsProps <path>
303
303
  ```
304
304
 
@@ -324,7 +324,7 @@ Replace `LeftArrowButton` and `RightArrowButton` slots for navigation buttons by
324
324
  />
325
325
  ```
326
326
 
327
- ```sh
327
+ ```bash
328
328
  npx @mui/x-codemod v6.0.0/pickers/replace-arrows-button-slot <path>
329
329
  ```
330
330
 
@@ -339,7 +339,7 @@ Replace `shouldDisableTime` by `shouldDisableClock`.
339
339
  />
340
340
  ```
341
341
 
342
- ```sh
342
+ ```bash
343
343
  npx @mui/x-codemod v6.0.0/pickers/rename-should-disable-time <path>
344
344
  ```
345
345
 
@@ -354,7 +354,7 @@ Replace `inputFormat` prop with `format`.
354
354
  />
355
355
  ```
356
356
 
357
- ```sh
357
+ ```bash
358
358
  npx @mui/x-codemod v6.0.0/pickers/rename-inputFormat-prop <path>
359
359
  ```
360
360
 
@@ -377,7 +377,7 @@ Rename toolbar related translation keys, removing `Default` part from them to be
377
377
  />
378
378
  ```
379
379
 
380
- ```sh
380
+ ```bash
381
381
  npx @mui/x-codemod v6.0.0/pickers/rename-default-toolbar-title-localeText <path>
382
382
  ```
383
383
 
@@ -396,7 +396,7 @@ This change only affects pickers components.
396
396
  />;
397
397
  ```
398
398
 
399
- ```sh
399
+ ```bash
400
400
  npx @mui/x-codemod v6.0.0/pickers/rename-components-to-slots <path>
401
401
  ```
402
402
 
@@ -406,7 +406,7 @@ npx @mui/x-codemod v6.0.0/pickers/rename-components-to-slots <path>
406
406
 
407
407
  The `preset-safe` codemods for data grid.
408
408
 
409
- ```sh
409
+ ```bash
410
410
  npx @mui/x-codemod v6.0.0/data-grid/preset-safe <path|folder>
411
411
  ```
412
412
 
@@ -441,7 +441,7 @@ Replace column menu items that have been renamed.
441
441
  </CustomColumnMenu>
442
442
  ```
443
443
 
444
- ```sh
444
+ ```bash
445
445
  npx @mui/x-codemod v6.0.0/data-grid/column-menu-components-rename <path>
446
446
  ```
447
447
 
@@ -468,7 +468,7 @@ Data grid props that have been renamed.
468
468
  />
469
469
  ```
470
470
 
471
- ```sh
471
+ ```bash
472
472
  npx @mui/x-codemod v6.0.0/data-grid/row-selection-props-rename <path>
473
473
  ```
474
474
 
@@ -483,7 +483,7 @@ Rename `rowsPerPageOptions` prop to `pageSizeOptions`.
483
483
  />
484
484
  ```
485
485
 
486
- ```sh
486
+ ```bash
487
487
  npx @mui/x-codemod v6.0.0/data-grid/rename-rowsPerPageOptions-prop <path>
488
488
  ```
489
489
 
@@ -497,7 +497,7 @@ Remove `disableExtendRowFullWidth` prop which is no longer supported.
497
497
  />
498
498
  ```
499
499
 
500
- ```sh
500
+ ```bash
501
501
  npx @mui/x-codemod v6.0.0/data-grid/remove-disableExtendRowFullWidth-prop <path>
502
502
  ```
503
503
 
@@ -552,7 +552,7 @@ Rename `linkOperators` related props to `logicOperators` and rename classes.
552
552
  />
553
553
  ```
554
554
 
555
- ```sh
555
+ ```bash
556
556
  npx @mui/x-codemod v6.0.0/data-grid/rename-linkOperators-logicOperators <path>
557
557
  ```
558
558
 
@@ -593,7 +593,7 @@ Rename filter item props to the new values.
593
593
  />
594
594
  ```
595
595
 
596
- ```sh
596
+ ```bash
597
597
  npx @mui/x-codemod v6.0.0/data-grid/rename-filter-item-props <path>
598
598
  ```
599
599
 
@@ -632,7 +632,7 @@ Rename selectors and events.
632
632
  }
633
633
  ```
634
634
 
635
- ```sh
635
+ ```bash
636
636
  npx @mui/x-codemod v6.0.0/data-grid/rename-selectors-and-events <path>
637
637
  ```
638
638
 
@@ -657,7 +657,7 @@ Remove feature flags for stabilized `experimentalFeatures`.
657
657
  />
658
658
  ```
659
659
 
660
- ```sh
660
+ ```bash
661
661
  npx @mui/x-codemod v6.0.0/data-grid/remove-stabilized-experimentalFeatures <path>
662
662
  ```
663
663
 
@@ -676,7 +676,7 @@ Replace `onCellFocusOut` prop with `componentsProps.cell.onBlur`.
676
676
  />
677
677
  ```
678
678
 
679
- ```sh
679
+ ```bash
680
680
  npx @mui/x-codemod v6.0.0/data-grid/replace-onCellFocusOut-prop <path>
681
681
  ```
682
682
 
@@ -695,7 +695,7 @@ This change only affects data grid components.
695
695
  />;
696
696
  ```
697
697
 
698
- ```sh
698
+ ```bash
699
699
  npx @mui/x-codemod v6.0.0/data-grid/rename-components-to-slots <path>
700
700
  ```
701
701
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-codemod",
3
- "version": "6.9.0",
3
+ "version": "7.0.0-alpha.1",
4
4
  "bin": "./codemod.js",
5
5
  "private": false,
6
6
  "author": "MUI Team",
@@ -31,9 +31,9 @@
31
31
  "url": "https://opencollective.com/mui"
32
32
  },
33
33
  "dependencies": {
34
- "@babel/core": "^7.22.5",
35
- "@babel/runtime": "^7.22.5",
36
- "@babel/traverse": "^7.22.5",
34
+ "@babel/core": "^7.23.2",
35
+ "@babel/runtime": "^7.23.2",
36
+ "@babel/traverse": "^7.23.2",
37
37
  "jscodeshift": "0.13.1",
38
38
  "jscodeshift-add-imports": "^1.0.10",
39
39
  "yargs": "^17.7.2"
@@ -7,8 +7,8 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.default = transform;
8
8
  var _renameCSSClasses = _interopRequireDefault(require("../../../util/renameCSSClasses"));
9
9
  var _renameIdentifiers = _interopRequireWildcard(require("../../../util/renameIdentifiers"));
10
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
11
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
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; }
12
12
  const renamedIdentifiers = {
13
13
  GridLinkOperator: 'GridLogicOperator',
14
14
  linkOperatorInputProps: 'logicOperatorInputProps',
@@ -0,0 +1,12 @@
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 _renameComponentsToSlots = _interopRequireDefault(require("../../../v6.0.0/data-grid/rename-components-to-slots"));
9
+ function transformer(file, api, options) {
10
+ file.source = (0, _renameComponentsToSlots.default)(file, api, options);
11
+ return file.source;
12
+ }
@@ -0,0 +1,12 @@
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 _renameComponentsToSlots = _interopRequireDefault(require("../../../v6.0.0/pickers/rename-components-to-slots"));
9
+ function transformer(file, api, options) {
10
+ file.source = (0, _renameComponentsToSlots.default)(file, api, options);
11
+ return file.source;
12
+ }
@@ -0,0 +1,14 @@
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 _presetSafe = _interopRequireDefault(require("../pickers/preset-safe"));
9
+ var _presetSafe2 = _interopRequireDefault(require("../data-grid/preset-safe"));
10
+ function transformer(file, api, options) {
11
+ file.source = (0, _presetSafe.default)(file, api, options);
12
+ file.source = (0, _presetSafe2.default)(file, api, options);
13
+ return file.source;
14
+ }