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

[infra] Can't pass --jscodeshift option to codemod #17034

Closed
Janpot opened this issue Mar 19, 2025 · 5 comments
Closed

[infra] Can't pass --jscodeshift option to codemod #17034

Janpot opened this issue Mar 19, 2025 · 5 comments
Labels
bug 🐛 Something doesn't work package: codemod Specific to @mui/x-codemod

Comments

@Janpot
Copy link
Member

Janpot commented Mar 19, 2025

Steps to reproduce

Steps:

  1. Run pnpm dlx @mui/[email protected] v8.0.0/preset-safe <path> --jscodeshift "-v"
  2. Check the jscodeshift command that is being executed

Current behavior

no -v option is added to the command

Expected behavior

a -v option is added to the command

Context

Trying to figure out why so many files are being transformed, I feel like it's running on too many files. Trying to get more visibility on what's being passed to jscodeshift and more control over which paths to ignore.

Your environment

npx @mui/envinfo
  System:
    OS: macOS 14.6.1
  Binaries:
    Node: 20.18.3 - ~/.nvm/versions/node/v20.18.3/bin/node
    npm: 10.8.2 - ~/.nvm/versions/node/v20.18.3/bin/npm
    pnpm: 10.6.4 - ~/.nvm/versions/node/v20.18.3/bin/pnpm
  Browsers:
    Chrome: Not Found
    Edge: Not Found
    Safari: 17.6
  npmPackages:
    @mui/internal-docs-utils: workspace:^ => 2.0.0 
    @mui/internal-scripts: workspace:^ => 2.0.4 
    @mui/internal-test-utils: workspace:^ => 2.0.3 
    @pigment-css/react: 0.0.30 => 0.0.30 
    @types/react: ^19.0.10 => 19.0.10 
    typescript: ^5.7.3 => 5.7.3 

Search keywords: jscodeshift

@Janpot Janpot added bug 🐛 Something doesn't work status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Mar 19, 2025
@github-actions github-actions bot added component: data grid This is the name of the generic UI component, not the React module! component: pickers This is the name of the generic UI component, not the React module! component: tree view TreeView, TreeItem. This is the name of the generic UI component, not the React module! component: charts This is the name of the generic UI component, not the React module! labels Mar 19, 2025
@michelengelen michelengelen changed the title Can't pass --jscodeshift option to codemod [infra] Can't pass --jscodeshift option to codemod Mar 19, 2025
@LukasTy
Copy link
Member

LukasTy commented Mar 19, 2025

@Janpot are you sure about the usage? 🤔
I tried passing jscodeshift arguments as mentioned in readme and they seem to work... 🤷 🤔

# multiple options
npx @mui/x-codemod@next v8.0.0/preset-safe docs --jscodeshift=--cpus=1 --jscodeshift=--print --jscodeshift=--dry --jscodeshift=--verbose=2

https://github.com/mui/mui-x/tree/master/packages/x-codemod#jscodeshift-options

@LukasTy LukasTy added status: waiting for author Issue with insufficient information package: codemod Specific to @mui/x-codemod and removed component: data grid This is the name of the generic UI component, not the React module! status: waiting for maintainer These issues haven't been looked at yet by a maintainer component: pickers This is the name of the generic UI component, not the React module! component: tree view TreeView, TreeItem. This is the name of the generic UI component, not the React module! component: charts This is the name of the generic UI component, not the React module! labels Mar 19, 2025
@Janpot
Copy link
Member Author

Janpot commented Mar 19, 2025

😕 Ok, I must have been doing something weird. I can make it work now. Just noticed that on our docs, it seems to be transforming the .next folder and the export folder.

@github-actions github-actions bot added status: waiting for maintainer These issues haven't been looked at yet by a maintainer and removed status: waiting for author Issue with insufficient information labels Mar 19, 2025
@Janpot Janpot closed this as completed Mar 19, 2025
@github-actions github-actions bot removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Mar 19, 2025
Copy link

This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.

@LukasTy
Copy link
Member

LukasTy commented Mar 19, 2025

Just noticed that on our docs, it seems to be transforming the .next folder and the export folder.

Good spot. 👍
Do you think we should be doing anything about it in the codemod package? 🤔
Or just be aware ourselves?
Or document this possible gotcha? 🤔

@Janpot
Copy link
Member Author

Janpot commented Mar 19, 2025

Do you think we should be doing anything about it in the codemod package?

I'm surprised it doesn't follow .gitignore. i.e. what's the purpose of transforming files that aren't checked in? Just noticed as well on packages that it includes build folders.

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/x-codemod
Projects
None yet
Development

No branches or pull requests

2 participants