Skip to content

Commit

Permalink
Bump jscodeshift to 0.15.2 (mui#12305)
Browse files Browse the repository at this point in the history
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Bilal Shafi <[email protected]>
Co-authored-by: Lukas <[email protected]>
  • Loading branch information
3 people authored and thomasmoon committed Sep 6, 2024
1 parent 204b522 commit c3b8ebe
Show file tree
Hide file tree
Showing 27 changed files with 75 additions and 660 deletions.
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"doctrine": "^3.0.0",
"exceljs": "^4.4.0",
"fg-loadcss": "^3.1.0",
"jscodeshift": "0.13.1",
"jscodeshift": "0.15.2",
"lodash": "^4.17.21",
"luxon": "^3.4.4",
"lz-string": "^1.5.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/x-codemod/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@
"@babel/core": "^7.24.7",
"@babel/runtime": "^7.24.7",
"@babel/traverse": "^7.24.7",
"jscodeshift": "0.13.1",
"jscodeshift": "0.15.2",
"jscodeshift-add-imports": "^1.0.10",
"yargs": "^17.7.2"
},
"devDependencies": {
"@types/jscodeshift": "^0.11.5",
"@types/jscodeshift": "^0.11.11",
"dayjs": "^1.11.11",
"moment-timezone": "^0.5.45",
"rimraf": "^5.0.7"
Expand Down
2 changes: 1 addition & 1 deletion packages/x-codemod/src/codemod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Not all use cases are covered by codemods. In some scenarios, like props spreadi
For example, if a codemod tries to rename a prop, but this prop is hidden with the spread operator, it won't be transformed as expected.
<DatePicker {...pickerProps} />
After running the codemods, make sure to test your application and that you don't have any console errors.
After running the codemods, make sure to test your application and that you don't have any formatting or console errors.
`);
const jscodeshiftProcess = childProcess.spawnSync('node', args, { stdio: 'inherit' });

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
GridFilterItemProps,
} from '@mui/x-data-grid';

// prettier-ignore
function App({ column, hideMenu }: GridFilterItemProps) {
return (
<React.Fragment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
GridFilterItemProps,
} from '@mui/x-data-grid-premium';

// prettier-ignore
function App({ column, hideMenu }: GridFilterItemProps) {
return (
<React.Fragment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
GridFilterItemProps,
} from '@mui/x-data-grid-pro';

// prettier-ignore
function App({ column, hideMenu }: GridFilterItemProps) {
return (
<React.Fragment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ import {
GridColumnMenuItemProps,
} from '@mui/x-data-grid';

// prettier-ignore
function App({ column, hideMenu }: GridColumnMenuItemProps) {
return (
<React.Fragment>
(<React.Fragment>
<GridColumnMenuFilterItem colDef={column} onClick={hideMenu} />
<GridColumnMenuHideItem colDef={column} onClick={hideMenu} />
<GridColumnMenuColumnsItem colDef={column} onClick={hideMenu} />
<GridColumnMenuSortItem colDef={column} onClick={hideMenu} />
</React.Fragment>
</React.Fragment>)
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,16 @@ import {
GridColumnMenuItemProps,
} from '@mui/x-data-grid-premium';

// prettier-ignore
function App({ column, hideMenu }: GridColumnMenuItemProps) {
return (
<React.Fragment>
(<React.Fragment>
<GridColumnMenuFilterItem colDef={column} onClick={hideMenu} />
<GridColumnMenuHideItem colDef={column} onClick={hideMenu} />
<GridColumnMenuColumnsItem colDef={column} onClick={hideMenu} />
<GridColumnMenuSortItem colDef={column} onClick={hideMenu} />
<GridColumnMenuPinningItem colDef={column} onClick={hideMenu} />
<GridColumnMenuAggregationItem colDef={column} onClick={hideMenu} />
</React.Fragment>
</React.Fragment>)
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ import {
GridColumnMenuItemProps,
} from '@mui/x-data-grid-pro';

// prettier-ignore
function App({ column, hideMenu }: GridColumnMenuItemProps) {
return (
<React.Fragment>
(<React.Fragment>
<GridColumnMenuFilterItem colDef={column} onClick={hideMenu} />
<GridColumnMenuHideItem colDef={column} onClick={hideMenu} />
<GridColumnMenuColumnsItem colDef={column} onClick={hideMenu} />
<GridColumnMenuSortItem colDef={column} onClick={hideMenu} />
<GridColumnMenuPinningItem colDef={column} onClick={hideMenu} />
</React.Fragment>
</React.Fragment>)
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function App({ column, hideMenu, apiRef, handleEvent }) {
event.defaultMuiPrevented = true;
};
return (
<React.Fragment>
(<React.Fragment>
<DataGrid
disableMultipleRowSelection
showCellVerticalBorder
Expand All @@ -29,7 +29,7 @@ function App({ column, hideMenu, apiRef, handleEvent }) {
},
}} />
<GridColumnMenuSortItem colDef={column} onClick={hideMenu} />
</React.Fragment>
</React.Fragment>)
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import { DataGridPremium } from '@mui/x-data-grid-premium';

function App() {
return (
<React.Fragment>
(<React.Fragment>
<DataGrid />
<DataGridPro />
<DataGridPremium />
</React.Fragment>
</React.Fragment>)
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { DataGridPremium } from '@mui/x-data-grid-premium';

function App() {
return (
<React.Fragment>
(<React.Fragment>
<DataGrid />
<DataGridPro />
<DataGridPremium
Expand All @@ -14,7 +14,7 @@ function App() {
}}
/>
<DataGridPro {...props} />
</React.Fragment>
</React.Fragment>)
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Button, Checkbox, TextField } from '@mui/material';

export default function App() {
return (
<div>
(<div>
<DataGrid
slots={{
toolbar: CustomToolbar,
Expand Down Expand Up @@ -39,6 +39,6 @@ export default function App() {
},
}}
/>
</div>
</div>)
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const rows = [
{ id: 3, column: 'c', name: 'James', score: 300 },
];

// prettier-ignore
function App() {
const [proFilterModel, setProFilterModel] = React.useState<GridFilterModel>({
items: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const rows = [
{ id: 3, column: 'c', name: 'James', score: 300 },
];

// prettier-ignore
function App() {
const [proFilterModel, setProFilterModel] = React.useState<GridFilterModel>({
items: [
Expand All @@ -31,7 +32,7 @@ function App() {
],
});
return (
<React.Fragment>
(<React.Fragment>
<DataGrid
columns={columns}
rows={rows}
Expand Down Expand Up @@ -72,6 +73,6 @@ function App() {
premiumFilterModel.current = model;
}}
/>
</React.Fragment>
</React.Fragment>)
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function App ({ apiRef, initialState }) {
const rowIndex = apiRef.current.getRowIndexRelativeToVisibleRows(1);
const localeText = apiRef.current.getLocaleText('filterPanelLogicOperator');
return (
<React.Fragment>
(<React.Fragment>
<DataGrid
className={classes.root}
initialState={{
Expand Down Expand Up @@ -68,7 +68,7 @@ function App ({ apiRef, initialState }) {
}}
/>
<DataGridPremium initialState={initialState} />
</React.Fragment>
</React.Fragment>)
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function App() {
event.defaultMuiPrevented = true;
};
return (
<React.Fragment>
(<React.Fragment>
<DataGrid
componentsProps={{
cell: {
Expand All @@ -32,7 +32,7 @@ function App() {
onBlur: someCustomEvent,
},
}} />
</React.Fragment>
</React.Fragment>)
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { DataGridPremium } from '@mui/x-data-grid-premium'

function App () {
return (
<React.Fragment>
(<React.Fragment>
<DataGrid
rowSelectionModel={[]}
onRowSelectionModelChange={() => {}}
Expand Down Expand Up @@ -33,7 +33,7 @@ function App () {
showColumnVerticalBorder
columnHeaderHeight={56}
/>
</React.Fragment>
</React.Fragment>)
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const theme = createTheme({});

function App() {
return (
<ThemeProvider theme={theme}>
(<ThemeProvider theme={theme}>
<LocalizationProvider
dateAdapter={AdapterDayjs}
adapterLocale="fr"
Expand Down Expand Up @@ -57,7 +57,7 @@ function App() {
},
}} />
</LocalizationProvider>
</ThemeProvider>
</ThemeProvider>)
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import {
getCalendarPickerSkeletonUtilityClass,
} from '@mui/x-date-pickers/CalendarPickerSkeleton';

// prettier-ignore
function App() {
type DateProps = CalendarPickerProps<any>;
type MonthProps = MonthPickerProps<any>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import {
getDayCalendarSkeletonUtilityClass,
} from '@mui/x-date-pickers/DayCalendarSkeleton';

// prettier-ignore
function App() {
type DateProps = DateCalendarProps<any>;
type MonthProps = MonthCalendarProps<any>;
Expand All @@ -57,12 +58,12 @@ function App() {
getDayCalendarSkeletonUtilityClass('root');

return (
<React.Fragment>
(<React.Fragment>
<DateCalendar value={null} onChange={() => {}} />
<MonthCalendar value={null} onChange={() => {}} />
<YearCalendar value={null} onChange={() => {}} />
<TimeClock value={null} onChange={() => {}} />
<DayCalendarSkeleton />
</React.Fragment>
</React.Fragment>)
);
}
4 changes: 2 additions & 2 deletions packages/x-codemod/src/v6.0.0/preset-safe/expected.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const theme = createTheme({});

function App() {
return (
<ThemeProvider theme={theme}>
(<ThemeProvider theme={theme}>
<DataGrid
disableMultipleRowSelection
showCellVerticalBorder
Expand All @@ -37,7 +37,7 @@ function App() {
okButtonLabel: "string_okText"
}} />
</LocalizationProvider>
</ThemeProvider>
</ThemeProvider>)
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Button, Checkbox, TextField } from '@mui/material';

export default function App() {
return (
<div>
(<div>
<DataGrid
slots={{
toolbar: CustomToolbar,
Expand Down Expand Up @@ -39,6 +39,6 @@ export default function App() {
}}
cellSelection
/>
</div>
</div>)
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import { DataGridPremium } from '@mui/x-data-grid-premium';

function App() {
return (
<React.Fragment>
(<React.Fragment>
<DataGrid />
<DataGridPro />
<DataGridPremium />
<DataGridPro {...props} />
</React.Fragment>
</React.Fragment>)
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import { DataGridPremium } from '@mui/x-data-grid-premium'

function App () {
return (
<DataGridPremium
(<DataGridPremium
cellSelection
cellSelectionModel={{ 0: { id: true, currencyPair: true, price1M: false } }}
onCellSelectionModelChange={() => {}}
/>
/>)
);
}

Expand Down
4 changes: 2 additions & 2 deletions packages/x-codemod/src/v7.0.0/preset-safe/expected.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const theme = createTheme({});

function App() {
return (
<ThemeProvider theme={theme}>
(<ThemeProvider theme={theme}>
<DataGrid
slotProps={{
toolbar: {
Expand All @@ -22,7 +22,7 @@ function App() {
textField: { variant: 'filled' }
}} />
</LocalizationProvider>
</ThemeProvider>
</ThemeProvider>)
);
}

Expand Down
Loading

0 comments on commit c3b8ebe

Please sign in to comment.