fix(ls): correctly show deduped dependencies#8217
fix(ls): correctly show deduped dependencies#8217milaninfy wants to merge 4 commits intonpm:latestfrom
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 lsoutputProblem:
npm ls dep-nameifdep-nameis a child of some deduped parent then whole tree would be shown till that parent but logicallydep-nameis still the child/grand-child of that.dep1is ancestor ofdep2which again depends ondep1creating 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