Description
JavaScriptResolver in pkg/resolver/javascript.go appears biased toward pnpm path layouts (via pnpmPathRe) and does not fully resolve dependencies for standard npm/yarn flattened node_modules layouts.
Steps to Reproduce
- Use a project that installs dependencies using npm or yarn classic.
- Run sbomit on that project.
- Compare expected packages in
node_modules/<package> to resolved output.
Expected Behavior
Resolver supports pnpm, npm, and yarn topologies and resolves dependencies from standard node_modules/<package> paths.
Actual Behavior
Dependencies in non-pnpm layouts are missed or incompletely resolved.
Environment
- sbomit version: current main branch
- Go version: any supported version
- OS: Linux/macOS/Windows
Additional Context
- Area:
pkg/resolver/javascript.go
- Suggested fix:
- Expand regex matching to include standard npm/yarn paths.
- Update resolution logic to normalize package paths across pnpm and non-pnpm structures.
Description
JavaScriptResolverinpkg/resolver/javascript.goappears biased toward pnpm path layouts (viapnpmPathRe) and does not fully resolve dependencies for standard npm/yarn flattenednode_moduleslayouts.Steps to Reproduce
node_modules/<package>to resolved output.Expected Behavior
Resolver supports pnpm, npm, and yarn topologies and resolves dependencies from standard
node_modules/<package>paths.Actual Behavior
Dependencies in non-pnpm layouts are missed or incompletely resolved.
Environment
Additional Context
pkg/resolver/javascript.go