Skip to content

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

@markerikson

Description

@markerikson

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 source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated resolve-url@0.2.1: 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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions