sapegin / mrm

Codemods for your project config files
https://mrm.js.org/
MIT License
1.61k stars 78 forks source link

Add option to install() to pass parameters to package manager #293

Closed manuschillerdev closed 1 year ago

manuschillerdev commented 1 year ago

I'd like to use mrm to set up pnpm monorepos. pnpm will throw an error if you try to install dependencies at the workspace level without providing the -w or --workspace-root flag:

 ERR_PNPM_ADDING_TO_ROOT  Running this command will add the dependency to the workspace root, which might not be what you want - if you really meant it, make it explicit by running this command again with the -w flag (or --workspace-root). If you don't want to see this warning anymore, you may set the ignore-workspace-root-check setting to true.

I'd love to be able to pass extra flags to the package manager to circumvent that:

- install(["@commitlint/config-conventional", "@commitlint/cli"], {pnpm: true})
+ install(["@commitlint/config-conventional", "@commitlint/cli"], {pnpm: true, commandArgs: ["-w"])