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?
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-nodeat runtime.When I run the codemods, they work, but I get a Babel warning saying it's dealing with large files in
node_modules:I've tracked this backwards:
jscodeshiftapparently compiles transforms by default, including anything they import: got ERR_REQUIRE_ESM on implicit-children eps1lon/types-react-codemod#62--no-babelCLI arg forjscodeshiftthat tells it not to compile transforms: Improve/fix applying babel to the transformer facebook/jscodeshift#294 , https://github.com/eps1lon/types-react-codemod/pull/63/files#diff-a45e7ec5c1df24cb4bec3997fad609744e1890a3acb5e7acddc29a82dfa24a97R67-R68However,
codemod-clihas a hardcoded-ish list ofjscodeshiftargs and doesn't provide a way to alter that:codemod-cli/src/bin-support.js
Lines 26 to 33 in 4a126ec
Any chance you could add a
codemod-clioption to forward through the--no-babelarg in some form?