Skip to content

Commit

Permalink
fix: dont omit license from stored manifests (#7475)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
lukekarrys committed May 6, 2024
1 parent 1e375c1 commit effe910
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 21 deletions.
2 changes: 1 addition & 1 deletion workspaces/arborist/lib/arborist/build-ideal-tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -1219,7 +1219,7 @@ This is a one-time fix-up, please be patient...
fullMetadata: true,
}
const p = pacote.manifest(spec, o)
.then(({ license, ...mani }) => {
.then((mani) => {
this.#manifests.set(spec.raw, mani)
return mani
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97938,7 +97938,8 @@ exports[`test/arborist/build-ideal-tree.js TAP store files with a custom indenti
"node_modules/abbrev": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
"integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q=="
"integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==",
"license": "ISC"
}
}
}
Expand Down
Loading

0 comments on commit effe910

Please sign in to comment.