-
Notifications
You must be signed in to change notification settings - Fork 3.7k
fix(ls): correctly show deduped dependencies #8217
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
base: latest
Are you sure you want to change the base?
Conversation
fb7ba8e
to
1ff339c
Compare
d549aa0
to
1a088fb
Compare
This is displaying root nodes which are explicitly there cause of being a dependency as
The base this PR:
npm:
Later, mock-registry (which is a root node) is also shown in both, but this PR dives back into arborist, and itself. this PR:
npm:
As it is I don't thing this fix is right. The base |
Attempt to fix
npm ls
outputProblem:
npm ls dep-name
ifdep-name
is a child of some deduped parent then whole tree would be shown till that parent but logicallydep-name
is still the child/grand-child of that.dep1
is ancestor ofdep2
which again depends ondep1
creating a cycle when explored, also the algorithm used is BFS so it's hard to detect cycle.Solution:
Progress:
Test output
`npm ls child` - before and after
fixes: #7917