cachi2 yarn followups: "Handling development dependencies" #495
Closed
slimreaper35
started this conversation in
Polls
Replies: 1 comment
-
It appears that both yarn.lock and the "Dependencies" key in the output from Or did you see something else missing? |
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:
yarn info --all --json --recursive --cache
command which basically means map them to our internal Package dataclass.In cachito it looks like this:
An example of package.json from cachi2 integration tests repository:
My concerns are that devDependencies are not declared to a specific version. Will we need to parse yarn.lock for that and is it actually worth doing it ?
Thank you for all your comments. 🙏
0 votes ·
Beta Was this translation helpful? Give feedback.
All reactions