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] Add a new utility to rename imports #14919

Merged
merged 4 commits into from
Oct 11, 2024

Conversation

flaviendelangle
Copy link
Member

@flaviendelangle flaviendelangle commented Oct 11, 2024

Needed for #14913
We start to have a lot of codemods that just move imports around, a clean abstraction starts to be worth it

I did not update the grid codemod because their import management differs (there is no nested imports).

Several tree view codemod were not tested because I forgot to add .test in the test file, this is why the testing files might change slightly.

@flaviendelangle flaviendelangle added the package: codemod Specific to @mui/codemod label Oct 11, 2024
@flaviendelangle flaviendelangle self-assigned this Oct 11, 2024
@mui-bot
Copy link

mui-bot commented Oct 11, 2024

Deploy preview: https://deploy-preview-14919--material-ui-x.netlify.app/

Generated by 🚫 dangerJS against 78351e3

@flaviendelangle flaviendelangle marked this pull request as ready for review October 11, 2024 09:21
@flaviendelangle flaviendelangle changed the title [codemods] Add a new utility to rename imports [codemod] Add a new utility to rename imports Oct 11, 2024
Copy link
Contributor

@noraleonte noraleonte left a comment

Choose a reason for hiding this comment

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

Nice addition, super helpful 👌 I left the tiniest nitpick, but LGTM otherwise 🙈

packages/x-codemod/src/util/renameImports.ts Outdated Show resolved Hide resolved
packages/x-codemod/src/util/renameImports.ts Outdated Show resolved Hide resolved
@LukasTy LukasTy added the bug 🐛 Something doesn't work label Oct 11, 2024
@flaviendelangle flaviendelangle removed the bug 🐛 Something doesn't work label Oct 11, 2024
Copy link
Member

@LukasTy LukasTy left a comment

Choose a reason for hiding this comment

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

LGTM. 👍
I've added a bug label as it looks like it fixes some existing TreeView renaming codemods, doesn't it? 🤔

@flaviendelangle
Copy link
Member Author

flaviendelangle commented Oct 11, 2024

I've added a bug label as it looks like it fixes some existing TreeView renaming codemods, doesn't it? 🤔

No, the test were not running and the test output were not correct (but never used so everything passed)
The logic was good 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: codemod Specific to @mui/codemod
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants