Skip to content

JavaScript: resolve transitive deps from npm v1 lock files - #8566

Open
bmuschko wants to merge 1 commit into
mainfrom
bmuschko/concise-lockfile-comment
Open

JavaScript: resolve transitive deps from npm v1 lock files#8566
bmuschko wants to merge 1 commit into
mainfrom
bmuschko/concise-lockfile-comment

Conversation

@bmuschko

Copy link
Copy Markdown
Contributor

org.openrewrite.javascript.search.DependencyInsight did not report transitive dependencies from a committed package-lock.json when "Include transitive dependencies" was selected.

The npm lock file parser only understood the modern packages map (lockfileVersion 2/3). A lockfileVersion 1 file (npm 5/6) has no packages map, only a nested dependencies tree, so the parser produced an empty resolved-dependency graph. Direct dependencies were still matched by name, but every transitive match was silently lost.

The parser now converts a legacy v1 dependencies tree into the same internal shape, so transitive dependencies resolve from v1 lock files just as they do from v2/v3.

@github-project-automation github-project-automation Bot moved this to In Progress in OpenRewrite Aug 19, 2026
@bmuschko bmuschko added the enhancement New feature or request label Aug 19, 2026

@sambsnyd sambsnyd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know NPM dependency resolution semantics deeply enough to comment on whether this is correct, but it looks reasonable to me

@github-project-automation github-project-automation Bot moved this from In Progress to Ready to Review in OpenRewrite Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Ready to Review

Development

Successfully merging this pull request may close these issues.

2 participants