fix: rename npm-shrinkwrap.json to package-lock.json - #1129
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1129 +/- ##
=======================================
Coverage 96.20% 96.20%
=======================================
Files 29 29
Lines 2213 2213
=======================================
Hits 2129 2129
Misses 84 84 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
e7300df to
21412aa
Compare
npm 12 does not support npm-shrinkwrap.json semver-major change since npm install -g citgm will install dependencies according to the published package.json, ensuring consistency independent of npm version used. package-lock.json is only used for repo development and test. Signed-off-by: Mike McCready <66998419+MikeMcC399@users.noreply.github.com>
21412aa to
93baef8
Compare
|
This would need a review, if you are available. I imagine that npm 12 will at some stage land on Making this change now would make sure that any issues resulting from installing with |
|
I think we should solve it the same way as in node-core-utils for consistency: nodejs/node-core-utils#1135 |
I'm not sure that is the best way for citgm if the objective is to catch compatibility issues early, although
Allowing global installs to use only package.json would re-evaluate the SemVer ranges each time citgm is installed, for instance in Jenkins. That means testing against I don't have the history in this repo to judge what is best, so if this PR doesn't fit the needs then please go ahead and close it. I'll leave it to the citgm team then to resolve the issue as it sees best. |
|
|
citgm is pulling in unpinned packages listed in lib/lookup.json, any of which could be potentially compromised, so citgm should be run in a sandboxed environment where it cannot cause damage. I'm not sure that pinning the dependencies that citgm itself uses would provide a security advantage in that case. @nodejs/citgm will have their own views on that I expect. Independent of this discussion, perhaps .npmrc should start using |
|
I'm going to close this PR, since the current
to be installed with citgm. The use of I suggest first to update the pinned dependencies before moving them to any other variation including |
npm-shrinkwrap.json#1117Situation
npm 12 drops
npm-shrinkwrap.jsonused in this repo as a published lockfile.The npm 12.0.0 changelog states:
npm installunder npm 12 installs dependencies according to theirSemVerrange specified inpackage.jsonand ignores the lower locked versions specified innpm-shrinkwrap.json.Change
To ensure that dependencies are consistently installed by downstream consumers of citgm, whichever version of npm is being used to execute the Installation instructions
npm install -g citgm, rename:npm-shrinkwrap.json to
package-lock.json.This should be considered a breaking change (semver-major) when the next release is cut.
Checklist
npm testpasses (for currently bundled versions of npm 10.x & 11.x)here