feat!: stop including npm-shrinkwrap.json#8163
Conversation
Per https://docs.npmjs.com/cli/v11/configuring-npm/npm-shrinkwrap-json, one of the intended use cases for `npm-shrinkwrap.json` is > command-line tools intended as global installs or devDependencies For several years, this is what we've done with Netlify CLI. This has come with... some pushback: #6731. Including from the creator of NPM. On one hand, ensuring dependencies are pinned makes installs deterministic and *helps* with security by preventing certain classes of supply chain vulnerabilities. On the other hand, when vulnerabilities are disclosed and patched, Netlify CLI users cannot benefit from those patches until Netlify CLI maintainers specifically bump them and publish a new release. Users can't even `npm audit fix`. Also, pnpm, yarn, bun, and all package managers other than npm do not respect `npm-shrinkwrap.json` anyway. It also honestly adds some maintenance complexity for us. We have some strange scripts needed to make this work, for example to exclude our own dev dependencies from the file. And reacting quickly to all the incoming CVEs is disruptive. Also, in some cases users may lose out on potential dependency deduping in their tree (and global caching on their machine, with some package managers). Verdict: remove it.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
📝 WalkthroughSummary by CodeRabbit
WalkthroughRemoved Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
📊 Benchmark resultsComparing with 28c958f
|
npm-shrinkwrap.jsonnpm-shrinkwrap.json
🤖 I have created a release *beep* *boop* --- ## [25.0.0](v24.11.3...v25.0.0) (2026-04-17) ### ⚠ BREAKING CHANGES * stop including `npm-shrinkwrap.json` ([#8163](#8163)) * remove `logs:function`, `logs:deploy`, and `logs:edge-functions` commands in favor of a new unified `logs` command ([#8158](#8158)) * remove Go and Rust function templates from `functions:create` command ([#7957](#7957)) ### Features * add improved `logs` command ([#8158](#8158)) ([28c958f](28c958f)) * remove Go and Rust function templates ([#7957](#7957)) ([c0333a6](c0333a6)) * stop including `npm-shrinkwrap.json` ([#8163](#8163)) ([0f444ae](0f444ae)), closes [#6731](#6731) ### Bug Fixes * **deps:** update dependency @netlify/dev to v4.17.1 ([#8160](#8160)) ([f8da537](f8da537)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --------- Co-authored-by: token-generator-app[bot] <82042599+token-generator-app[bot]@users.noreply.github.com> Co-authored-by: Philippe Serhal <philippe.serhal@netlify.com>
We were pinning deps to partially mimic the published npm-shrinkwrap.json for package managers like yarn and pnpm that don't support it. Since we stopped shipping the shrinkwrap in #8163, the pinning is no longer relevant. This will help users' dependency trees get heavily deduped as well.
We were pinning deps to partially mimic the published npm-shrinkwrap.json for package managers like yarn and pnpm that don't support it. Since we stopped shipping the shrinkwrap in #8163, the pinning is no longer relevant. This will help users' dependency trees get heavily deduped as well.
Summary
Per https://docs.npmjs.com/cli/v11/configuring-npm/npm-shrinkwrap-json, one of the intended use cases for
npm-shrinkwrap.jsonisFor several years, this is what we've done with Netlify CLI.
This has come with... some pushback: #6731. Including from the creator of NPM.
On one hand, ensuring dependencies are pinned makes installs deterministic and helps with security by preventing certain classes of supply chain vulnerabilities.
On the other hand, when vulnerabilities are disclosed and patched, Netlify CLI users cannot benefit from those patches until Netlify CLI maintainers specifically bump them and publish a new release. Users can't even
npm audit fix.Also, pnpm, yarn, bun, and all package managers other than npm do not respect
npm-shrinkwrap.jsonanyway.It also honestly adds some maintenance complexity for us. We have some strange scripts needed to make this work, for example to exclude our own dev dependencies from the file. We've encountered some strange shrinkwrap-specific bugs. And reacting quickly to all the incoming CVEs is disruptive.
Also, in some cases users may lose out on potential dependency deduping in their tree (and global caching on their machine, with some package managers).
✅ Verdict: remove it.
Closes #6731