fetchPnpmDeps: deprecate fetcherVersion = 2

Extend the existing v1 deprecation warning to also fire for
`fetcherVersion = 2`, since callers should migrate directly to
`fetcherVersion = 3`. Both pre-v3 versions now share a single
`lib.warnIf` keyed on `fetcherVersion < 3` and produce a message
parameterised by the offending version.

Consolidate the manual's version-history entries: the per-item
**Deprecated** and **Recommended** labels are replaced by a single
sentence above the list noting that v3 is recommended and v1/v2 are
scheduled for removal.

Add a release note mirroring the existing v1 entry.
This commit is contained in:
Aliaksandr
2026-05-11 18:02:36 +03:00
parent 6443f9dfb2
commit f472a6385b
3 changed files with 12 additions and 9 deletions
@@ -503,9 +503,11 @@ Changes can include workarounds or bug fixes to existing PNPM issues.
##### Version history {#javascript-pnpm-fetcherVersion-versionHistory}
- 1: Initial version, nothing special. **Deprecated: Scheduled for removal in the 26.11 release.**. New packages must not use this value.
Version 3 is the recommended value for new packages. Versions 1 and 2 are deprecated and scheduled for removal in the 26.11 release; existing packages must migrate.
- 1: Initial version, nothing special.
- 2: [Ensure consistent permissions](https://github.com/NixOS/nixpkgs/pull/422975)
- 3: [Build a reproducible tarball](https://github.com/NixOS/nixpkgs/pull/469950). **Recommended**
- 3: [Build a reproducible tarball](https://github.com/NixOS/nixpkgs/pull/469950)
### Yarn {#javascript-yarn}
+6 -5
View File
@@ -330,11 +330,12 @@
- `fetchPnpmDeps` and `pnpmConfigHook` were added as top-level attributes, replacing the now deprecated `pnpm.fetchDeps` and `pnpm.configHook` attributes.
- `fetchPnpmDeps`' `fetcherVersion = 1` is deprecated and scheduled for removal
in the 26.11 release. A deprecation warning has been added. Packages still on
`fetcherVersion = 1` should migrate to `fetcherVersion = 3` and regenerate
their hashes. See the [pnpm `fetcherVersion`
section](#javascript-pnpm-fetcherVersion) of the manual for details.
- `fetchPnpmDeps`' `fetcherVersion = 1` and `fetcherVersion = 2` are deprecated
and scheduled for removal in the 26.11 release. A deprecation warning has
been added. Packages still on `fetcherVersion = 1` or `fetcherVersion = 2`
should migrate to `fetcherVersion = 3` and regenerate their hashes. See the
[pnpm `fetcherVersion` section](#javascript-pnpm-fetcherVersion) of the
manual for details.
- `buildNpmPackage` now supports `npmDepsFetcherVersion` (and `fetchNpmDeps` now supports `fetcherVersion`). Set to `2` to enable packument caching, which fixes builds for projects using npm workspaces.
@@ -61,8 +61,8 @@ in
"fetchPnpmDeps `fetcherVersion` is not set to a supported value (${lib.concatStringsSep ", " (map toString supportedFetcherVersions)}), see https://nixos.org/manual/nixpkgs/stable/#javascript-pnpm-fetcherVersion."
) true;
lib.warnIf (fetcherVersion == 1)
"fetchPnpmDeps: `fetcherVersion = 1` is deprecated and scheduled for removal in the 26.11 release. Please migrate `${pname}` to `fetcherVersion = 3` and regenerate the hash. See https://nixos.org/manual/nixpkgs/stable/#javascript-pnpm-fetcherVersion."
lib.warnIf (fetcherVersion < 3)
"fetchPnpmDeps: `fetcherVersion = ${toString fetcherVersion}` is deprecated and scheduled for removal in the 26.11 release. Please migrate `${pname}` to `fetcherVersion = 3` and regenerate the hash. See https://nixos.org/manual/nixpkgs/stable/#javascript-pnpm-fetcherVersion."
stdenvNoCC.mkDerivation
(