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

WIP: Add javascript dep tree parser #2134

Closed
wants to merge 9 commits into from

Conversation

noqcks
Copy link
Contributor

@noqcks noqcks commented Sep 15, 2023

implements the same functionality desired by #2020

This PR implements a new cataloger called javascript-cataloger that collects full dependency trees and packages with for javascript ecosystem pkg managers -- [pnpm, yarn, npm]

This allows one to see the relationships between packages such as with the dependencies field in CycloneDX https://cyclonedx.org/docs/1.5/json/#dependencies

// NewJavascriptCataloger returns a new JavaScript cataloger object based on detection
// of npm based packages and lock files to provide a complete dependency graph of the
// packages.
func NewJavascriptCataloger() *generic.GroupedCataloger {
	return generic.NewGroupedCataloger("javascript-cataloger").
		WithParserByGlobColocation(parseJavascript, "**/yarn.lock", []string{"**/package.json", "**/yarn.lock"}).
		WithParserByGlobColocation(parseJavascript, "**/package-lock.json", []string{"**/package.json", "**/package-lock.json"}).
		WithParserByGlobColocation(parseJavascript, "**/pnpm-lock.yaml", []string{"**/package.json", "**/pnpm-lock.yaml"})
}

EDIT: just making some final tests pass before this can go for review.

Signed-off-by: Benji Visser <[email protected]>
Signed-off-by: Benji Visser <[email protected]>
Signed-off-by: Benji Visser <[email protected]>
Signed-off-by: Benji Visser <[email protected]>
Signed-off-by: Benji Visser <[email protected]>
@noqcks noqcks changed the title Add javascript dependencies parser Add javascript dep tree parser Sep 15, 2023
Signed-off-by: Benji Visser <[email protected]>
@noqcks noqcks changed the title Add javascript dep tree parser WIP: Add javascript dep tree parser Sep 15, 2023
@noqcks noqcks closed this Sep 15, 2023
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.

1 participant