"shamefully-hoist" inversion: only "shamefully-hoist" devDependencies as an option? #4931
ScottAwesome
started this conversation in
Ideas
Replies: 1 comment
-
It is probably possible to implement. The changes would mostly be in https://github.com/pnpm/pnpm/tree/main/packages/hoist |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all!
Just had a thought of an idea:
I know that this is probably way more complex than I imagine, but something that struck me is one of the big reasons why alot of codebases end up with
shamefully-hoist=true
is because some big packages are still not well behaved in the symlinked enviornment (looking at you storybook, nuxt, and vue!)to try and avoid this, I first did this:
but i noticed that in doing this, their dependent packages aren't completely hoisted either, so it ended up being more scralled. Just for
nuxt
I had to do the following, which was look at each nuxt package.json for each package, and hoist everything in theirdependencies
object in their respective package.jsonrinse and repeat with storybook, and I was still running into edge cases, which lead to me to finally collapse and
shamefully-hoist
and feel the shame knowing I'm shamefully hoisting 😢Then I had the bright thought, maybe, that what if we could invert this, where there was some sort of
hoist deep
for specified packages? Maybe something that is likeshamefully-hoist-devdeps
orhoist-pattern-deep[]
or something? I'm not sure if this is feasible, per se, but it would allow better strictness to be allowed even when dealing with offending packages.In particular, if its possible to simply hoist for only the given dependency rather than hoist to the top of node modules, it'd be prime time!
Some kind of selective inverted hoisting control here basically. I'm not sure if its feasbile, I know in other dicussions things like selectively per package
shamefully-hoisting
isn't possible, but what if the "shameful" hoist was scoped to the lower package? Maybe some magic with symlinks would do the trick here?Beta Was this translation helpful? Give feedback.
All reactions