Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add upgrade mui-x to v6 #35

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions src/v8/mui-x-upgrade.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { existsSync } from "fs";

import { executeCommand } from "../util/execute-command.util";
import { updateDependencyVersion } from "../util/update-dependency-version.util";

const adminPackageJsonPath = "admin/package.json";

/**
* Update MUI X version to 6.0.0
*
* Migration Guide 5-6: https://mui.com/x/migration/migration-data-grid-v5
*
*/
export default async function updateMuiXVersion() {
if (!existsSync(adminPackageJsonPath)) {
return;
}

await updateDependencyVersion(adminPackageJsonPath, "@mui/x-data-grid", "^6.0.0");
await updateDependencyVersion(adminPackageJsonPath, "@mui/x-data-grid-pro", "^6.0.0");
Comment on lines +19 to +20
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will likely fail due to incorrect peer dependencies when upgrading the Comet packages to v8. We should add a separate script in the before-install stage that changes the version numbers in the package.json.


await executeCommand("npm", ["install", "--prefix", "admin", "--no-audit", "--loglevel", "error"]);

await executeCommand("npx", ["@mui/x-codemod@latest", "v6.0.0/data-grid/preset-safe", "admin/src"]);
}
Loading