cachi2 yarn followups: How to handle development dependencies ? #472
Closed
slimreaper35
started this conversation in
Ideas
Replies: 2 comments
-
Sign-offsReviewed |
Beta Was this translation helpful? Give feedback.
0 replies
-
Are we going to be able to get all of the information we need from the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Introduction
Package managers often have a feature that allows specifying dependencies meant only for development. Yarn supports this through the devDependencies section in the package.json file. However, yarn has no clear indication or "dev" label in the lock file to identify these development-only dependencies.
STONEBLD-1900
Here is a snippet from the conversation with the lead maintainer of yarnpkg 📦 🧶 on Discord:
SBOM
The goal is to mark these development dependencies in the SBOM using a CycloneDX property. The snippet is from npm_bundled_lockfile3 test data bom.json.
Cachito
As you might know, something similar already exists in cachito. There is a function that finds all non-development dependencies based on the BFS algorithm using the devDependencies section as a starting point from all top-level package.json files.
To copy the solution from cachito, we will need a couple of things:
a. our internal Package dataclass
b. output from yarn.lock => We will need to parse yarn.lock file
In cachito it looks like this:
I am not sure if
f"{name}@{version}"
gives enough information.Thank you for all your comments. 🙏
Beta Was this translation helpful? Give feedback.
All reactions