diff --git a/docs/data/migration/migration-data-grid-v6/migration-data-grid-v6.md b/docs/data/migration/migration-data-grid-v6/migration-data-grid-v6.md index 97ffd3fb77f2..3f5baec4ce73 100644 --- a/docs/data/migration/migration-data-grid-v6/migration-data-grid-v6.md +++ b/docs/data/migration/migration-data-grid-v6/migration-data-grid-v6.md @@ -40,7 +40,7 @@ npx @mui/x-codemod@next v7.0.0/preset-safe ``` :::info -If you want to run the codemods one by one, check out the codemods included in the [preset-safe codemod for data grid](https://github.com/mui/mui-x/blob/master/packages/x-codemod/README.md#preset-safe-for-data-grid-v700) for more details. +If you want to run the codemods one by one, check out the codemods included in the [preset-safe codemod for data grid](https://github.com/mui/mui-x/blob/HEAD/packages/x-codemod/README.md#preset-safe-for-data-grid-v700) for more details. ::: Breaking changes that are handled by `preset-safe` codemod are denoted by a ✅ emoji in the table of contents on the right side of the screen or next to the specific point that is handled by it. diff --git a/docs/data/migration/migration-pickers-v5/migration-pickers-v5.md b/docs/data/migration/migration-pickers-v5/migration-pickers-v5.md index 5653e19345b7..df0dc58354cc 100644 --- a/docs/data/migration/migration-pickers-v5/migration-pickers-v5.md +++ b/docs/data/migration/migration-pickers-v5/migration-pickers-v5.md @@ -37,7 +37,7 @@ npx @mui/x-codemod@latest v6.0.0/preset-safe ``` :::info -If you want to run the transformers one by one, check out the transformers included in the [preset-safe codemod for pickers](https://github.com/mui/mui-x/blob/master/packages/x-codemod/README.md#preset-safe-for-pickers-v600) for more details. +If you want to run the transformers one by one, check out the transformers included in the [preset-safe codemod for pickers](https://github.com/mui/mui-x/blob/HEAD/packages/x-codemod/README.md#preset-safe-for-pickers-v600) for more details. ::: Breaking changes that are handled by this codemod are denoted by a ✅ emoji in the table of contents on the right side of the screen. diff --git a/docs/data/migration/migration-pickers-v6/migration-pickers-v6.md b/docs/data/migration/migration-pickers-v6/migration-pickers-v6.md index 0e3990592bfa..fb582678ec04 100644 --- a/docs/data/migration/migration-pickers-v6/migration-pickers-v6.md +++ b/docs/data/migration/migration-pickers-v6/migration-pickers-v6.md @@ -33,14 +33,14 @@ You can either run it on a specific file, folder, or your entire codebase when c ```bash // Date and Time Pickers specific -npx @mui/x-codemod v7.0.0/pickers/preset-safe +npx @mui/x-codemod@next v7.0.0/pickers/preset-safe // Target Data Grid as well -npx @mui/x-codemod v7.0.0/preset-safe +npx @mui/x-codemod@next v7.0.0/preset-safe ``` :::info -If you want to run the transformers one by one, check out the transformers included in the [preset-safe codemod for pickers](https://github.com/mui/mui-x/blob/master/packages/x-codemod/README.md#preset-safe-for-pickers-v700) for more details. +If you want to run the transformers one by one, check out the transformers included in the [preset-safe codemod for pickers](https://github.com/mui/mui-x/blob/HEAD/packages/x-codemod/README.md#preset-safe-for-pickers-v700) for more details. ::: Breaking changes that are handled by this codemod are denoted by a ✅ emoji in the table of contents on the right side of the screen. @@ -75,7 +75,7 @@ And are removed from the v7. If not already done, this modification can be handled by the codemod ```bash -npx @mui/x-codemod v7.0.0/pickers/ +npx @mui/x-codemod@next v7.0.0/pickers/ ``` Take a look at [the RFC](https://github.com/mui/material-ui/issues/33416) for more information. diff --git a/packages/x-codemod/README.md b/packages/x-codemod/README.md index 9b493db52b85..e98cc3cb6c84 100644 --- a/packages/x-codemod/README.md +++ b/packages/x-codemod/README.md @@ -29,8 +29,8 @@ Options: --jscodeshift Pass options directly to jscodeshift [array] Examples: - npx @mui/x-codemod v6.0.0/preset-safe src - npx @mui/x-codemod v6.0.0/component-rename-prop src -- + npx @mui/x-codemod@latest v6.0.0/preset-safe src + npx @mui/x-codemod@latest v6.0.0/component-rename-prop src -- --component=DataGrid --from=prop --to=newProp ``` @@ -40,9 +40,9 @@ To pass more options directly to jscodeshift, use `--jscodeshift=...`. For examp ```bash // single option -npx @mui/x-codemod --jscodeshift=--run-in-band +npx @mui/x-codemod@next --jscodeshift=--run-in-band // multiple options -npx @mui/x-codemod --jscodeshift=--cpus=1 --jscodeshift=--print --jscodeshift=--dry --jscodeshift=--verbose=2 +npx @mui/x-codemod@next --jscodeshift=--cpus=1 --jscodeshift=--print --jscodeshift=--dry --jscodeshift=--verbose=2 ``` 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 through jscodeshift's `printOptions` command line argument ```bash -npx @mui/x-codemod --jscodeshift="--printOptions='{\"quote\":\"double\"}'" +npx @mui/x-codemod@next --jscodeshift="--printOptions='{\"quote\":\"double\"}'" ``` ## v7.0.0 @@ -66,7 +66,7 @@ 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. ```bash -npx @mui/x-codemod v7.0.0/preset-safe +npx @mui/x-codemod@next v7.0.0/preset-safe ``` The corresponding sub-sections are listed below @@ -82,7 +82,7 @@ The corresponding sub-sections are listed below The `preset-safe` codemods for pickers. ```bash -npx @mui/x-codemod v7.0.0/pickers/preset-safe +npx @mui/x-codemod@next v7.0.0/pickers/preset-safe ``` The list includes these transformers @@ -108,7 +108,7 @@ This change only affects Date and Time Picker components. ``` ```bash -npx @mui/x-codemod v7.0.0/pickers/rename-components-to-slots +npx @mui/x-codemod@next v7.0.0/pickers/rename-components-to-slots ``` #### `rename-default-calendar-month-to-reference-date` @@ -116,12 +116,12 @@ npx @mui/x-codemod v7.0.0/pickers/rename-components-to-slots Replace the `defaultCalendarMonth` prop with the `referenceDate` prop. ```diff -- +- ``` ```bash -npx @mui/x-codemod v7.0.0/pickers/rename-default-calendar-month-to-reference-date +npx @mui/x-codemod@next v7.0.0/pickers/rename-default-calendar-month-to-reference-date ``` #### `rename-day-picker-classes` @@ -129,12 +129,12 @@ npx @mui/x-codemod v7.0.0/pickers/rename-default-calendar-month-to-reference-dat Rename the `dayPickerClasses` variable to `dayCalendarClasses`. ```diff -- import { dayPickerClasses } from '@mui/x-date-pickers/DateCalendar'; -+ import { dayCalendarClasses } from '@mui/x-date-pickers/DateCalendar'; +-import { dayPickerClasses } from '@mui/x-date-pickers/DateCalendar'; ++import { dayCalendarClasses } from '@mui/x-date-pickers/DateCalendar'; ``` ```bash -npx @mui/x-codemod v7.0.0/pickers/rename-day-picker-classes +npx @mui/x-codemod@next v7.0.0/pickers/rename-day-picker-classes ``` #### `rename-slots-types` @@ -149,7 +149,7 @@ Replace types suffix `SlotsComponent` by `Slots` and `SlotsComponentsProps` by ` ``` ```bash -npx @mui/x-codemod v7.0.0/pickers/rename-slots-types +npx @mui/x-codemod@next v7.0.0/pickers/rename-slots-types ``` ### Data Grid codemods @@ -159,7 +159,7 @@ npx @mui/x-codemod v7.0.0/pickers/rename-slots-types The `preset-safe` codemods for data grid. ```bash -npx @mui/x-codemod v7.0.0/data-grid/preset-safe +npx @mui/x-codemod@next v7.0.0/data-grid/preset-safe ``` The list includes these transformers @@ -176,14 +176,14 @@ This change only affects Data Grid components. ```diff ; ``` ```bash -npx @mui/x-codemod v7.0.0/data-grid/rename-components-to-slots +npx @mui/x-codemod@next v7.0.0/data-grid/rename-components-to-slots ``` #### `rename-cell-selection-props` @@ -193,16 +193,16 @@ Rename props related to `cellSelection` feature. ```diff {}} + cellSelection -- cellSelectionModel={{ 0: { id: true, currencyPair: true, price1M: false } }} + cellSelectionModel={{ 0: { id: true, currencyPair: true, price1M: false } }} -- unstable_onCellSelectionModelChange={() => {}} + onCellSelectionModelChange={() => {}} />; ``` ```bash -npx @mui/x-codemod v7.0.0/data-grid/rename-cell-selection-props +npx @mui/x-codemod@next v7.0.0/data-grid/rename-cell-selection-props ``` ### Tree View codemods @@ -212,7 +212,7 @@ npx @mui/x-codemod v7.0.0/data-grid/rename-cell-selection-props The `preset-safe` codemods for tree view. ```bash -npx @mui/x-codemod v7.0.0/tree-view/preset-safe +npx @mui/x-codemod@next v7.0.0/tree-view/preset-safe ``` The list includes these transformers @@ -246,16 +246,16 @@ Renames the `TreeView` component to `SimpleTreeView` Rename the expansion props ```diff - +- defaultExpanded={defaultExpandedNodes} ++ defaultExpandedNodes={defaultExpandedNodes} + /> ``` #### `rename-selection-props` @@ -263,16 +263,16 @@ Rename the expansion props Rename the selection props ```diff - +- defaultSelected={defaultSelectedNodes} ++ defaultSelectedNodes={defaultSelectedNodes} + /> ``` ## v6.0.0 @@ -285,7 +285,7 @@ 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. ```bash -npx @mui/x-codemod v6.0.0/preset-safe +npx @mui/x-codemod@latest v6.0.0/preset-safe ``` The corresponding sub-sections are listed below @@ -300,7 +300,7 @@ The corresponding sub-sections are listed below The `preset-safe` codemods for pickers. ```bash -npx @mui/x-codemod v6.0.0/pickers/preset-safe +npx @mui/x-codemod@latest v6.0.0/pickers/preset-safe ``` The list includes these transformers @@ -385,7 +385,7 @@ Renames the `locale` prop of the `LocalizationProvider` component into `adapterL ``` ```bash -npx @mui/x-codemod v6.0.0/pickers/localization-provider-rename-locale +npx @mui/x-codemod@latest v6.0.0/pickers/localization-provider-rename-locale ``` #### `text-props-to-localeText` @@ -402,7 +402,7 @@ Replace props used for localization such as `cancelText` to their corresponding ``` ```bash -npx @mui/x-codemod v6.0.0/pickers/text-props-to-localeText +npx @mui/x-codemod@latest v6.0.0/pickers/text-props-to-localeText ``` If you were always using the same text value in all your components, consider moving those translation from the component to the `LocalizationProvider` by hand. @@ -443,7 +443,7 @@ Replace props used for `Tabs` in DateTime pickers by `componentsProps.tabs` prop ``` ```bash -npx @mui/x-codemod v6.0.0/pickers/replace-tabs-props +npx @mui/x-codemod@latest v6.0.0/pickers/replace-tabs-props ``` #### `replace-toolbar-props-by-slot` @@ -469,7 +469,7 @@ Replace props used to customize the `Toolbar` in pickers by slots properties and ``` ```bash -npx @mui/x-codemod v6.0.0/pickers/replace-toolbar-props-by-slot +npx @mui/x-codemod@latest v6.0.0/pickers/replace-toolbar-props-by-slot ``` #### `migrate-to-components-componentsProps` @@ -519,7 +519,7 @@ Replace customization props by their equivalent `components` and `componentsProp ``` ```bash -npx @mui/x-codemod v6.0.0/pickers/migrate-to-components-componentsProps +npx @mui/x-codemod@latest v6.0.0/pickers/migrate-to-components-componentsProps ``` #### `replace-arrows-button-slot` @@ -545,7 +545,7 @@ Replace `LeftArrowButton` and `RightArrowButton` slots for navigation buttons by ``` ```bash -npx @mui/x-codemod v6.0.0/pickers/replace-arrows-button-slot +npx @mui/x-codemod@latest v6.0.0/pickers/replace-arrows-button-slot ``` #### `rename-should-disable-time` @@ -560,7 +560,7 @@ Replace `shouldDisableTime` by `shouldDisableClock`. ``` ```bash -npx @mui/x-codemod v6.0.0/pickers/rename-should-disable-time +npx @mui/x-codemod@latest v6.0.0/pickers/rename-should-disable-time ``` #### `rename-inputFormat-prop` @@ -575,7 +575,7 @@ Replace `inputFormat` prop with `format`. ``` ```bash -npx @mui/x-codemod v6.0.0/pickers/rename-inputFormat-prop +npx @mui/x-codemod@latest v6.0.0/pickers/rename-inputFormat-prop ``` #### `rename-default-toolbar-title-localeText` @@ -598,7 +598,7 @@ Rename toolbar related translation keys, removing `Default` part from them to be ``` ```bash -npx @mui/x-codemod v6.0.0/pickers/rename-default-toolbar-title-localeText +npx @mui/x-codemod@latest v6.0.0/pickers/rename-default-toolbar-title-localeText ``` #### `rename-components-to-slots-pickers` @@ -617,7 +617,7 @@ This change only affects Date and Time Pickers components. ``` ```bash -npx @mui/x-codemod v6.0.0/pickers/rename-components-to-slots +npx @mui/x-codemod@latest v6.0.0/pickers/rename-components-to-slots ``` ### Data Grid codemods @@ -627,7 +627,7 @@ npx @mui/x-codemod v6.0.0/pickers/rename-components-to-slots The `preset-safe` codemods for data grid. ```bash -npx @mui/x-codemod v6.0.0/data-grid/preset-safe +npx @mui/x-codemod@latest v6.0.0/data-grid/preset-safe ``` The list includes these transformers @@ -662,7 +662,7 @@ Replace column menu items that have been renamed. ``` ```bash -npx @mui/x-codemod v6.0.0/data-grid/column-menu-components-rename +npx @mui/x-codemod@latest v6.0.0/data-grid/column-menu-components-rename ``` If you are using `GridRowGroupingColumnMenuItems` and `GridRowGroupableColumnMenuItems` for grouping, consider fixing them manually as these imports are replaced by `GridColumnMenuGroupingItem` and may require some extra work to port. @@ -689,7 +689,7 @@ Data Grid props that have been renamed. ``` ```bash -npx @mui/x-codemod v6.0.0/data-grid/row-selection-props-rename +npx @mui/x-codemod@latest v6.0.0/data-grid/row-selection-props-rename ``` #### `rename-rowsPerPageOptions-prop` @@ -704,7 +704,7 @@ Rename `rowsPerPageOptions` prop to `pageSizeOptions`. ``` ```bash -npx @mui/x-codemod v6.0.0/data-grid/rename-rowsPerPageOptions-prop +npx @mui/x-codemod@latest v6.0.0/data-grid/rename-rowsPerPageOptions-prop ``` #### `remove-disableExtendRowFullWidth-prop` @@ -718,7 +718,7 @@ Remove `disableExtendRowFullWidth` prop which is no longer supported. ``` ```bash -npx @mui/x-codemod v6.0.0/data-grid/remove-disableExtendRowFullWidth-prop +npx @mui/x-codemod@latest v6.0.0/data-grid/remove-disableExtendRowFullWidth-prop ``` #### `rename-linkOperators-logicOperators` @@ -773,7 +773,7 @@ Rename `linkOperators` related props to `logicOperators` and rename classes. ``` ```bash -npx @mui/x-codemod v6.0.0/data-grid/rename-linkOperators-logicOperators +npx @mui/x-codemod@latest v6.0.0/data-grid/rename-linkOperators-logicOperators ``` #### `rename-filter-item-props` @@ -814,7 +814,7 @@ Rename filter item props to the new values. ``` ```bash -npx @mui/x-codemod v6.0.0/data-grid/rename-filter-item-props +npx @mui/x-codemod@latest v6.0.0/data-grid/rename-filter-item-props ``` #### `rename-selectors-and-events` @@ -853,7 +853,7 @@ Rename selectors and events. ``` ```bash -npx @mui/x-codemod v6.0.0/data-grid/rename-selectors-and-events +npx @mui/x-codemod@latest v6.0.0/data-grid/rename-selectors-and-events ``` #### `remove-stabilized-experimentalFeatures` @@ -878,7 +878,7 @@ Remove feature flags for stabilized `experimentalFeatures`. ``` ```bash -npx @mui/x-codemod v6.0.0/data-grid/remove-stabilized-experimentalFeatures +npx @mui/x-codemod@latest v6.0.0/data-grid/remove-stabilized-experimentalFeatures ``` #### `replace-onCellFocusOut-prop` @@ -897,7 +897,7 @@ Replace `onCellFocusOut` prop with `componentsProps.cell.onBlur`. ``` ```bash -npx @mui/x-codemod v6.0.0/data-grid/replace-onCellFocusOut-prop +npx @mui/x-codemod@latest v6.0.0/data-grid/replace-onCellFocusOut-prop ``` #### `rename-components-to-slots-data-grid` @@ -916,7 +916,7 @@ This change only affects Data Grid components. ``` ```bash -npx @mui/x-codemod v6.0.0/data-grid/rename-components-to-slots +npx @mui/x-codemod@latest v6.0.0/data-grid/rename-components-to-slots ``` You can find more details about Data Grid breaking change in [the migration guide](https://mui.com/x/migration/migration-data-grid-v5/).