-
Notifications
You must be signed in to change notification settings - Fork 33
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
yarn runtime vs development dependencies #4
Comments
Build time dependencies are still dependencies (i.e., "Build and Test Dependencies"). They're "works with", though, so we have considerable latitude with regard to licenses. The worst case scenario is that a project team would maintain a dependency list (or, alternatively, an exclude list that's processed against a generated dependency list). I'm thinking that we may have no other choice for technologies that don't provide an easy means of generating a dependency list directly from the build (e.g. make files). |
I am not a Yarn expert, but my understanding is that To know the type of dependency (build dependency vs runtime dependency) you need the |
I'm not a yarn expert too. 😅 But I also understand that the kind of dependencies are in {
"dependencies": {
"webpack": "^5.0.0"
},
"optionalDependencies": {
"fsevents": "^5.0.0"
},
"devDependencies": {
"webpack": "^5.0.0"
},
"peerDependencies": {
"react": "*",
"react-dom": "*"
}
} The yarn.lock file just fix version. (see yarn1 doc) So ideally, I guess that @jmini is right and both files are need to get the information we want. I don't know if there is a way to query about this kind of information with |
It seems that In my case, this returns 20 lines instead of 3573 (without --prod).
If we want something more easy to parse there is something like : click here to see the result.{ "type": "tree", "data": { "type": "list", "trees": [ { "name": "@fontsource/[email protected]", "children": [], "hint": null, "color": "bold", "depth": 0 }, { "name": "@mdi/[email protected]", "children": [], "hint": null, "color": "bold", "depth": 0 }, { "name": "[email protected]", "children": [ { "name": "follow-redirects@^1.10.0", "color": "dim", "shadow": true } ], "hint": null, "color": "bold", "depth": 0 }, { "name": "[email protected]", "children": [], "hint": null, "color": "bold", "depth": 0 }, { "name": "[email protected]", "children": [], "hint": null, "color": "bold", "depth": 0 }, { "name": "[email protected]", "children": [], "hint": null, "color": "bold", "depth": 0 }, { "name": "[email protected]", "children": [ { "name": "moment@^2.19.2", "color": "dim", "shadow": true } ], "hint": null, "color": "bold", "depth": 0 }, { "name": "[email protected]", "children": [], "hint": null, "color": "bold", "depth": 0 }, { "name": "[email protected]", "children": [], "hint": null, "color": "bold", "depth": 0 }, { "name": "[email protected]", "children": [ { "name": "event-source-polyfill@^1.0.22", "color": "dim", "shadow": true } ], "hint": null, "color": "bold", "depth": 0 }, { "name": "[email protected]", "children": [], "hint": null, "color": "bold", "depth": 0 }, { "name": "[email protected]", "children": [], "hint": null, "color": "bold", "depth": 0 }, { "name": "[email protected]", "children": [], "hint": null, "color": null, "depth": 0 }, { "name": "[email protected]", "children": [], "hint": null, "color": null, "depth": 0 }, { "name": "[email protected]", "children": [], "hint": null, "color": null, "depth": 0 } ] } } |
In case we need to write some javascript based on yarn API. I also see it exists a |
@sbernard31 - I wrote the contents of https://github.com/eclipse/dash-licenses/tree/master/yarn when I needed it almost 2 years ago, I have no doubt that there are updates and maybe better solutions now available. Please feel free to provide a PR.
That is what needs checking for full license compatibility, but keep in mind as @waynebeaton said in #4 (comment) that all the hundreds to thousands of deps need handling, just that they are works-with instead. So having the tool spit out two lists would be useful. See https://www.eclipse.org/projects/handbook/#ip-third-party-test for more info. |
This part confused me a little because it's not clear to me what should be done exactly with "work_with". Maybe it's not true for all projects, but for me I understand that my yarn |
@paul-marechal, @marcdumais-work I see that you opened some issues about using I would be like to know your opinion about this issue ? |
Hi @sbernard31, For the Theia project, we have an unusual number of dependencies: over 1000. When we were doing the license checks manually, using clearlydefined, we would filter-down the list to only production/runtime dependencies, to keep it somewhat manageable. Now that (1): I encourage you to use this amazingly useful feature, that essentially opens the equivalent of a CQ for you for each dependency that needs it: https://github.com/eclipse/dash-licenses#automatic-ip-team-review-requests. See one of these automatically opened |
Another option would be to use tooling to generate SBOM.
And then give that SBOM to |
I was wrong using trivy this is possible to generate SBOM with or without devDependencies : Without dev dependencies :
With dev dependencies :
|
This may not be an issue for the tool, but rather the CQ process?
At the moment to develop in yarn it takes hundreds of development time packages that are not part of the runtime distribution. For example, the cdt-gdb-adapter has ~500 items listed in yarn.deps when run on cdt-gdb-adapter code base. However, if you only consider the runtime dependencies the list is just 5 items.
One idea of how to automate is this:
The text was updated successfully, but these errors were encountered: