fix(npm): extract workspace member subtree from npm ls output#485
Open
Strum355 wants to merge 3 commits intoguacsec:mainfrom
Open
fix(npm): extract workspace member subtree from npm ls output#485Strum355 wants to merge 3 commits intoguacsec:mainfrom
Strum355 wants to merge 3 commits intoguacsec:mainfrom
Conversation
When npm ls --package-lock-only --json runs from the workspace root, it returns a tree rooted at the workspace root package with workspace members nested under dependencies. Component analysis failed because _getRootDependencies read the root-level deps (workspace member entries), not the member's actual deps — filtering by the member's manifest dependencies found no match, returning 0 dependencies. Now overrides _buildDependencyTree to detect when the tree root name differs from the manifest name and extracts the member's subtree. Implements TC-4181 Assisted-by: Claude Code
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Test fixtures regenerated from actual npm ls output (follow-redirects resolved to 1.16.0, root object has no version field, resolved path uses relative ../packages/member-a). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ruromero
approved these changes
Apr 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
npm ls --package-lock-only --jsonruns from the workspace root, the tree is rooted at the workspace root — the override now detects this (tree root name ≠ manifest name) and extracts the member's subtree fromtree.dependencies[memberName]Implements TC-4181
Test plan
🤖 Generated with Claude Code