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

[codemod] Allow json files to be transformed #40536

Merged

Conversation

ZeeshanTamboli
Copy link
Member

@ZeeshanTamboli ZeeshanTamboli commented Jan 11, 2024

Fixes #40362


Testing

As the codemod.js script lacks tests, I performed local testing with the following steps:

  1. Navigate to the packages/mui-codemod directory (cd packages/mui-codemod).
  2. Create a new json file for testing by adding a package.json file under the src/v5.0.0/mui-replace.test folder and adding the following code:
{
  "name": "mui-codemods",
  "version": "1.0.0",
  "description": "",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "MIT",
  "dependencies": {
    "@material-ui/core": "^4.11.0",
    "@material-ui/icons": "^4.9.1",
    "@material-ui/lab": "4.0.0-alpha.57"
  }
}
  1. Execute node codemod.js v5.0.0/mui-replace ./src/v5.0.0/mui-replace.test. This command replaces the occurrences of @material-ui/* with @mui/*. If the json extension in the list is not there, the replacement fails to work.

@ZeeshanTamboli ZeeshanTamboli added bug 🐛 Something doesn't work package: codemod Specific to @mui/codemod labels Jan 11, 2024
@mui-bot
Copy link

mui-bot commented Jan 11, 2024

Netlify deploy preview

https://deploy-preview-40536--material-ui.netlify.app/

Bundle size report

No bundle size changes (Toolpad)
No bundle size changes

Generated by 🚫 dangerJS against 420af36

@ZeeshanTamboli ZeeshanTamboli marked this pull request as ready for review January 11, 2024 12:27
@ZeeshanTamboli ZeeshanTamboli merged commit 9d7a370 into mui:master Jan 15, 2024
21 checks passed
@ZeeshanTamboli ZeeshanTamboli deleted the codemod-mui-replace-allow-json-files branch January 15, 2024 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work package: codemod Specific to @mui/codemod
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[mui-codemod] mui-replace does not update package.json as documented
3 participants