Skip to content
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

npm-aliases: handle aliases for package-lock.json #1349

Merged
merged 1 commit into from
Nov 20, 2022

Conversation

Mikcl
Copy link
Contributor

@Mikcl Mikcl commented Nov 18, 2022

Fixes #1314

This only addresses npm/package-lock.json aliases.
Addresses package-lock.json version 1-3.

the package.json that the package-lock.jsons examples were derived from:
https://gist.github.com/Mikcl/aef4d180f4275b66252dca32b6668375#file-package-json

Mikcl referenced this pull request Nov 18, 2022
This PR adds support for npm lockfile version 3, which drops the
"dependencies" key and uses "packages" instead. I've refactored the
lockfile parser to make the distinction between the versions explicit
rather than the implicit behaviour before. It _might_ be worth splitting
into separate files at some point, but the logic is so minimal that I
haven't done it.

Fixes #1203
Signed-off-by: Rob Cresswell <robcresswell@users.noreply.github.com>
kzantow
kzantow previously approved these changes Nov 19, 2022
Copy link
Contributor

@kzantow kzantow left a comment

Choose a reason for hiding this comment

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

Thanks @Mikcl this looks great, and thanks for adding tests 👍

syft/pkg/cataloger/javascript/parse_package_lock.go Outdated Show resolved Hide resolved
@kzantow kzantow dismissed their stale review November 19, 2022 16:31

It looks like there are some checks failing in lint & tests

@kzantow
Copy link
Contributor

kzantow commented Nov 20, 2022

Hi @Mikcl could you sign-off your commits? The easiest way would be to squash to one and just sign-off and force push that one, probably. https://github.com/anchore/syft/blob/main/CONTRIBUTING.md#sign-off-your-work

syft/pkg/cataloger/javascript/package.go Outdated Show resolved Hide resolved
Signed-off-by: mikcl <mikesmikes400@gmail.com>
@kzantow kzantow merged commit 04880c0 into anchore:main Nov 20, 2022
GijsCalis pushed a commit to GijsCalis/syft that referenced this pull request Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

syft fails to resolve npm package aliases
2 participants