Skip to content

Commit effe910

Browse files
authored
fix: dont omit license from stored manifests (#7475)
This has the effect of adding licenses back into the lockfiles. Based on code in shrinkwrap.js and inventory.js, it appears that lockfiles are supposed to store the license. It's likely that in practice this behavior has not been consistent due to fetching of minifed manifests and packuments. I also attempted to remove the license code from shrinkwrap but that caused many more tests to break. Plus I believe this is the intended behavior, to have licenses in lockfiles based on bug reports like #7384
1 parent 1e375c1 commit effe910

File tree

3 files changed

+68
-21
lines changed

3 files changed

+68
-21
lines changed

workspaces/arborist/lib/arborist/build-ideal-tree.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1219,7 +1219,7 @@ This is a one-time fix-up, please be patient...
12191219
fullMetadata: true,
12201220
}
12211221
const p = pacote.manifest(spec, o)
1222-
.then(({ license, ...mani }) => {
1222+
.then((mani) => {
12231223
this.#manifests.set(spec.raw, mani)
12241224
return mani
12251225
})

workspaces/arborist/tap-snapshots/test/arborist/build-ideal-tree.js.test.cjs

+2-1
Original file line numberDiff line numberDiff line change
@@ -97938,7 +97938,8 @@ exports[`test/arborist/build-ideal-tree.js TAP store files with a custom indenti
9793897938
"node_modules/abbrev": {
9793997939
"version": "1.1.1",
9794097940
"resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
97941-
"integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q=="
97941+
"integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==",
97942+
"license": "ISC"
9794297943
}
9794397944
}
9794497945
}

0 commit comments

Comments
 (0)