This repository has been archived by the owner on Jan 20, 2022. It is now read-only.
Ensure correct flags on shrinkwrapped module deps #225
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.
When running
Arborist.loadVirtual()
to read the tree from the point ofa tree that contains a shrinkwrap, we were inappropriately setting all
dep flags to
false
, as we would when reading the virtual tree in aproject root.
This patch updates loadVirtual to ensure that it always sets the proper
flags on nodes within the subtree, if the root supplied is not actually
the project root.
As a result, changes had to be made to the process that inflates
old/ancient lockfiles, and reify()'s handling of garbage data needed to
be updated as well (since the cases being tested previously would now
typically prune the invalid data out as extraneous before getting to the
reify step). If a node DOES make it through to reify() in the
idealTree, but lacks a version or resolved field, then something is very
wrong, and so we now print a warning to the user asking them to re-try
the install or delete their lockfile (which will typically fix the
problem, since it either is a root dep that's being removed and will be
re-added properly, or a metadep problem that can only be fixed with a
full tree rebuild anyway).
References