Handle multiple license types for dependencies
danielpmichalski opened this issue · 0 comments
danielpmichalski commented
Currently (v25.0.1
), the licenses
field can be either a string or an array of strings that holds names of licenses used by a dependency. Unfortunately, there's only a single licenseText
field, which doesn't necessarily contain any of the licenses' texts, e.g.:
{
"json-schema@0.2.3": {
"licenses": [
"AFLv2.1",
"BSD"
],
"repository": "https://github.com/kriszyp/json-schema",
"publisher": "Kris Zyp",
"name": "json-schema",
"version": "0.2.3",
"copyright": "",
"licenseText": "JSON Schema is a repository for the JSON Schema specification, reference schemas and a CommonJS implementation of JSON Schema (not the only JavaScript implementation of JSON Schema, JSV is another excellent JavaScript validator).\r\n\r\nCode is licensed under the AFL or BSD license as part of the Persevere \r\nproject which is administered under the Dojo foundation,\r\nand all contributions require a Dojo CLA.",
"path": "...",
"licenseFile": "node_modules\\json-schema\\README.md"
}
...
}
Please, provide support for such cases.
Proposed solution: change the JSON structure to something like below example:
{
"json-schema@0.2.3": {
"licenses": [
{
"name": "AFLv2.1",
"text": "<proper license text; could be taken from https://spdx.org/licenses/>",
"file": undefined // there is no license file sometimes
},
{
"name": "BSD",
"text": "<proper license text; could be taken from https://spdx.org/licenses/>",
"file": undefined // there is no license file sometimes
}
],
"repository": "https://github.com/kriszyp/json-schema",
"publisher": "Kris Zyp",
"name": "json-schema",
"version": "0.2.3",
"copyright": "",
"path": "..."
}
}