• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

npm / arborist / #811

Build:
Build:
LAST BUILD BRANCH:
DEFAULT BRANCH: master
Ran 11 Mar 2021 08:08PM UTC
Jobs 1
Files 39
Run time 7s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
#811

push

ruyadorno
fix: respect link deps when calc peer dep sets

* Show useful debug printing for virtual root nodes
* Respect hidden lockfiles when symlink deps present. As long as the
target of the link is in the shrinkwrap, and not newer.
* Respect link deps when calculating peerDep sets

Previously, we were not including link targets in the virtual trees
where peer dependency sets are calculated.  Additionally, we were still
using the path `/virtual-root` for the virtual node, even though this is
no longer load-bearing.  (And, as of the recent change to the Node
printable output, no longer necessary or particularly helpful for
debugging.)

As a result, a link dependency from the root node like `file:../../foo`
would get resolved against `/virtual-root`, resulting in `/foo`, which
of course does not match any Node in the virtual tree.  The outcome was
an ERESOLVE error where the `current` Node is shown as having no name
or version (because it is an unsatisfied Link).

The solution is two-part.

First, the path of the virtual tree root now matches the path of the
Node that it is sourced from.

Second, any Link children of the source node have their targets mirrored
in the virtual tree, resulting in them being matched appropriately.

The result is that a Link dependency can now properly satisfy a
peerDependency.  Test shows an example of using a Link to a local Node
as a workaround for a peerSet that otherwise would not be resolveable.

This can of course be abused to get around valid peerDep contracts, but
if they user takes it on themselves to use a local fork of a dependency,
we should respect that in buildIdealTree as we do elsewhere.

Fix: npm/cli#2199

PR-URL: https://github.com/npm/arborist/pull/249
Credit: @isaacs
Close: #249
Reviewed-by: @ruyadorno

2824 of 2824 branches covered (100.0%)

Branch coverage included in aggregate %.

3838 of 3838 relevant lines covered (100.0%)

565.44 hits per line

Jobs
ID Job ID Ran Files Coverage
1 #811.1 11 Mar 2021 08:08PM UTC 0
100.0
Source Files on build #811
Detailed source file information is not available for this build.
  • Back to Repo
  • fa16e093 on github
  • Prev Build on
  • Next Build on
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc