Open VanTanev opened 3 weeks ago
Do you want to be able to mix root dependencies
and devDependencies
in the root? Or would you like to enforce the root to use devDependencies
instead of dependencies
?
For reference, we currently have this rule
I would like to force all dependencies to be devDependencies
.
this change would make sense to me, cc @emmatown - any objections?
I still want to champion this change, I think it would be a positive one.
I think it’s worth doing - so if you want to prepare a PR for it: let’s do it
Just to make sure, the PR will switch the check to prefer devDependencies
instead of prod ones. It will be a breaking change. There won't be an option to go back to the old behavior.
Alternatively, we could put this behind an option and set devDependencies as the new default, but I prefer the first approach.
Thoughts?
I prefer the first option too.
I like this change. We use Renovate bot and allow it to update devDependencies
without human reviews. PRs are auto-merged as long as CI passes. With ROOT_HAS_DEV_DEPENDENCIES
rule, we have to manually update global linters like Prettier and CSpell, which is OK but not perfect. I’m glad that this won’t be needed once #236 is released!
I think that there is a valid case to be made that manypkg should optionally enforce all dependencies be in
devDependencies
in the root.We have a monorepo that needs to build docker containers. It has separate pnpm installs for the build step and the production step.
When it builds the production step, it uses turbo prune and then
pnpm install --prod
- this will unfortunately also install all monorepo management tools defined in the rootpackage.json#dependencies
, needlessly increasing the docker image size.Forcing root to use
devDependencies
instead would solve for this, and to some degree, I think it makes more intuitive sense if stuff liketypescript
,prettier
,lefthook
etc are dev dependencies instead of prod dependencies.If there is interest from maintainers and guidance on desired implementation, I would be happy to contribute a PR.