Skip to content

[codemod] Fix codemods not found#45473

Merged
DiegoAndai merged 1 commit intomui:masterfrom
DiegoAndai:fix-v7-codemod-script
Mar 3, 2025
Merged

[codemod] Fix codemods not found#45473
DiegoAndai merged 1 commit intomui:masterfrom
DiegoAndai:fix-v7-codemod-script

Conversation

@DiegoAndai
Copy link
Member

@DiegoAndai DiegoAndai commented Mar 3, 2025

Fixes #45445

After #43264, the codemod package no longer packages the codemods inside the ./node folder, but in the root (./). We have to update the codemod script to search in ./ instead of ./node.

Layout before: https://unpkg.com/browse/@mui/codemod@6.4.6/
Layout after: https://unpkg.com/browse/@mui/codemod@7.0.0-beta.1/

@DiegoAndai DiegoAndai added package: codemod Specific to codemod. type: regression A bug, but worse, it used to behave as expected. labels Mar 3, 2025
@DiegoAndai DiegoAndai self-assigned this Mar 3, 2025
@mui-bot
Copy link

mui-bot commented Mar 3, 2025

Netlify deploy preview

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

Bundle size report

No bundle size changes (Toolpad)
No bundle size changes

Generated by 🚫 dangerJS against 44bfb39

@DiegoAndai DiegoAndai changed the title [codemod] Fix codemods not being found in v7 [codemod] Fix codemods not found Mar 3, 2025
@DiegoAndai
Copy link
Member Author

I can confirm that the codesandbox build of this PR works as expected:

npx @mui/codemod@https://pkg.csb.dev/mui/material-ui/commit/44bfb392/@mui/codemod deprecations/accordion-props ./

In contrast, if you test with the latest @next release, it doesn't work:

npx @mui/codemod@next deprecations/accordion-props ./

Even though the accordion-props codemod has existed for a long time.

Copy link
Member

@Janpot Janpot left a comment

Choose a reason for hiding this comment

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

thank you

@DiegoAndai DiegoAndai merged commit 583a24b into mui:master Mar 3, 2025
21 checks passed
@DiegoAndai DiegoAndai deleted the fix-v7-codemod-script branch March 3, 2025 18:55
mnajdova pushed a commit to mnajdova/material-ui that referenced this pull request Mar 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: codemod Specific to codemod. type: regression A bug, but worse, it used to behave as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[codemod] npx can't find any codemods

4 participants