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

Investigate what metadata can be retrieved for npm-install modules #218

Closed
sophiewigmore opened this issue May 10, 2021 · 4 comments
Closed
Assignees

Comments

@sophiewigmore
Copy link
Member

sophiewigmore commented May 10, 2021

As a part of our BOM work outlined in this RFC, we would like to support some type of BOM metadata for modules provided by buildpacks like npm-install.

We should investigate the extent of data that can be extracted around the following for the modules provided by this buildpack:

  • All of the the other information (SHA, URI, etc for each module)
  • License information
  • CPEs

Acceptance

The outcome of this issue should be more issues that outline the work needed to implement viable metadata as a result of this investigation.

@sophiewigmore sophiewigmore changed the title Investigate what metadata we can provide for each module Investigate what metadata we can provide for npm-install modules May 10, 2021
@sophiewigmore sophiewigmore changed the title Investigate what metadata we can provide for npm-install modules Investigate what metadata that can be retrieved for npm-install modules May 10, 2021
@sophiewigmore sophiewigmore changed the title Investigate what metadata that can be retrieved for npm-install modules Investigate what metadata can be retrieved for npm-install modules May 10, 2021
@sophiewigmore sophiewigmore removed their assignment Jul 27, 2021
@ForestEckhardt
Copy link
Contributor

There does not appear to be any straight forward tooling from NPM to facilitate the retrieval of module information. However, because the modules themselves contain package.json files we could walk the node_modules directory and parse all of the information such as name, version, license, repository, etc. out of the package.json itself as these are standard fields. Another benefit of this approach is that is will for for any node package manager (i.e. npm, yarn) as it relies on the contents of the node_modules folder as opposed to the functionality built into the package manager.

@ryanmoran
Copy link
Member

@sophiewigmore
Copy link
Member Author

sophiewigmore commented Jul 28, 2021

Just checked it out! This tool is awesome, it gets almost everything we want:
name, version, description, hash, source URI, license ID, package URL for each node module. I'm thinking we can try to run this tool along side the npm install or yarn install buildpack. We may need to do some additional work to generate CPEs and deprecation dates.

The tool outputs in CycloneDX which will be ideal if/when we officially support CycloneDX. For the time being, with the current TOML format we support we can likely pull the information off of the JSON, and pass it into the same BOM Generator we currently use in node-engine and yarn

@sophiewigmore
Copy link
Member Author

Closing in favour of the suite of issues to implement this.

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

No branches or pull requests

3 participants