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

Pass through an option to jscodeshift to not compile transforms? #249

Open
markerikson opened this issue Oct 13, 2022 · 0 comments
Open

Comments

@markerikson
Copy link

I've been working to set up my first couple codemods for some deprecated Redux Toolkit features over in reduxjs/redux-toolkit#2768 . So far so good. One thing that's different is that I'm writing the transform files as TS and compiling them with ts-node at runtime.

When I run the codemods, they work, but I get a Babel warning saying it's dealing with large files in node_modules:

$ npx @reduxjs/rtk-codemods createReducerBuilder ./modified/**/*.{js,ts}

Need to install the following packages:
  @reduxjs/rtk-codemods
Ok to proceed? (y) y
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
Processing 2 files...
Spawning 2 workers...
Sending 1 files to free worker...
Sending 1 files to free worker...
[BABEL] Note: The code generator has deoptimised the styling of home\npm-cache\_npx\c7474bb40fa6e968\node_modules\lodash\lodash.js as it exceeds the max of 500KB.
[BABEL] Note: The code generator has deoptimised the styling of home\npm-cache\_npx\c7474bb40fa6e968\node_modules\lodash\lodash.js as it exceeds the max of 500KB.
All done.
Results:
0 errors
0 unmodified
0 skipped
2 ok

I've tracked this backwards:

However, codemod-cli has a hardcoded-ish list of jscodeshift args and doesn't provide a way to alter that:

let binOptions = [
'-t',
transformPath,
'--extensions',
extensions,
...transformerOptions,
'--stdin', // tell jscodeshift to read the list of files from stdin
];

Any chance you could add a codemod-cli option to forward through the --no-babel arg in some form?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant