-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Option to pack workspace instead of link it? #3697
Comments
We have the same use-case for a large monorepo. We’ve written a lot of custom tooling that fakes this workflow (we have a script that replaces monorepo dependencies with published npm versions, and publishes them if they don’t exist yet). None of the workspace implementations handle this case, they just symlink the whole node_modules. We’re currently considering writing a lerna variant that publishes “bare” packages to npm (which will have only the dependencies in them with no built files) and then manually symlinking based on the package.json “files” field. This wouldn’t be needed if something like this issue asks for exists. I think this is a pretty big caveat that almost all workspace implementations have (yarn v2 portals sort of addresses it, but yarn v2 is such a different approach that we haven’t been able to make it work with our monorepo). |
A super strict mode for workspaces, where the “files” property is respected and the only thing that is symlinked (and the dependencies are resolved as if they came from a registry) would be great for local development and CI. |
This would fix an issue that I have:
Here Should https://pnpm.io/package_json#dependenciesmetainjected be the solution? If someone is willing to take a look at this, I will make a reproduction repository in place. |
Describe the user story
A common case is that people want to organize the repo in workspace form ie into many packages. But they do not need to version some(even all) of them since the packages always stay locally and privately.
Currently,
pnpm link
or local dependecy may help. But the problem is, when deploy the root package, all files in the linked packages folder are deployed. Usually we only wantlib, dist...
but notsrc source...
right?Describe the solution you'd like
So can we have an option, when it's toggled,
pnpm install
firstlypnpm pack
all local dependencies, and then extract, link the tarballs intonode_modules/.pnpm
as if they were downloaded from aninstall-time-registry
. Sincepnpm pack
is performed. The tarballs only contain files filtered by.npmignore
.Describe the drawbacks of your solution
The main drawback of the proposed solution is that when this option is toggled, the install process is slow. But as far as I considered, this option would be only toggled in CI. During normal development, the dependecies still link.
Describe alternatives you've considered
The text was updated successfully, but these errors were encountered: