fix: reify git dependencies that have workspaces #103
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Draft until I write tests for this
This change will reify a git dependency if that git dependency has workspaces defined.
This is necessary because for git dependencies on a known hosting provider, we actually download an archive file rather than cloning the repository. That's all well and good, but
tar
refuses to unpack symlinks which is how a workspace tends to be stored innode_modules
in a git repository that happens to havenode_modules
checked in. The end result today is thatnpm i -g npm/cli#release-next
gives you a broken installation because all of the workspace modules are missing.We could potentially extend the check so that it requires that the workspaces are defined and bundled dependencies are in use and a node_modules directory is present to be as specific as possible, but I'm not sure if that's overkill...
References