-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
Contribution
- I'd be willing to implement this feature (contributing guide)
Describe the user story
I'd like to have build-in support for metapackages (known from linux package managers or from nuget).
Background:
I've multiple repositories that share the same basic set of packages that should be in sync version with my boilerplate project. Right now I've to manually keep the version in sync in each and every project. I'd like to create single meta package that will manage my dependencies in all of child projects. After install this one, the direct dependencies will be hoisted to the root of my project.
Describe the solution you'd like
I see a couple of ways to do it:
- allow to set some additional flag in
readPackagehook that will force hoisting of dependencies - add additional option to .npmrc next to
public-hoist-pattern- something likepublic-hoist-dependencies-of-pattern
Describe the drawbacks of your solution
This is purly optional, selective hoisting is supported anyways. The second option seems to be less intrusive, but some changes to @pnpm/hoist would be required that will introduce some addtional complexity to maitain.
Describe alternatives you've considered
- post install script that will manage symlinks for me
- post install script that will call
pnpm addfor each dependency of my meta package so it will be explicitly added to package.json - pre-install script that will check all deps of my package, put it into .npmrc
public-hoist-pattern