Loading doc/languages-frameworks/javascript.section.md +35 −0 Original line number Diff line number Diff line Loading @@ -444,6 +444,7 @@ stdenv.mkDerivation (finalAttrs: { pnpmDeps = pnpm.fetchDeps { inherit (finalAttrs) pname version src; hash = "..."; fetcherVersion = 1; }; }) ``` Loading Loading @@ -558,6 +559,40 @@ set `prePnpmInstall` to the right commands to run. For example: In this example, `prePnpmInstall` will be run by both `pnpm.configHook` and by the `pnpm.fetchDeps` builder. #### PNPM `fetcherVersion` {#javascript-pnpm-fetcherVersion} This is the version of the output of `pnpm.fetchDeps`, if you haven't set it already, you can use `1` with your current hash: ```nix { # ... pnpmDeps = pnpm.fetchDeps { # ... hash = "..."; # you can use your already set hash here fetcherVersion = 1; }; } ``` After upgrading to a newer `fetcherVersion`, you need to regenerate the hash: ```nix { # ... pnpmDeps = pnpm.fetchDeps { # ... hash = "..."; # clear this hash and generate a new one fetcherVersion = 2; }; } ``` This variable ensures that we can make changes to the output of `pnpm.fetchDeps` without breaking existing hashes. Changes can include workarounds or bug fixes to existing PNPM issues. ##### Version history {#javascript-pnpm-fetcherVersion-versionHistory} - 1: Initial version, nothing special ### Yarn {#javascript-yarn} Loading doc/redirects.json +6 −0 Original line number Diff line number Diff line Loading @@ -3347,6 +3347,12 @@ "javascript-pnpm-extraCommands": [ "index.html#javascript-pnpm-extraCommands" ], "javascript-pnpm-fetcherVersion": [ "index.html#javascript-pnpm-fetcherVersion" ], "javascript-pnpm-fetcherVersion-versionHistory": [ "index.html#javascript-pnpm-fetcherVersion-versionHistory" ], "javascript-yarn": [ "index.html#javascript-yarn" ], Loading pkgs/by-name/ba/bash-language-server/package.nix +1 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ stdenvNoCC.mkDerivation (finalAttrs: { pnpmWorkspaces ; hash = "sha256-NvyqPv5OKgZi3hW98Da8LhsYatmrzrPX8kLOfLr+BrI="; fetcherVersion = 1; }; nativeBuildInputs = [ Loading pkgs/development/tools/pnpm/fetch-deps/default.nix +6 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ in pnpmWorkspaces ? [ ], prePnpmInstall ? "", pnpmInstallFlags ? [ ], fetcherVersion ? 1, ... }@args: let Loading Loading @@ -96,6 +97,11 @@ in --registry="$NIX_NPM_REGISTRY" \ --frozen-lockfile # Store newer fetcherVersion in case pnpm.configHook also needs it if [[ ${toString fetcherVersion} -gt 1 ]]; then echo ${toString fetcherVersion} > $out/.fetcher-version fi runHook postInstall ''; Loading pkgs/development/tools/pnpm/fetch-deps/pnpm-config-hook.sh +7 −0 Original line number Diff line number Diff line Loading @@ -12,6 +12,13 @@ pnpmConfigHook() { exit 1 fi fetcherVersion=1 if [[ -e "${pnpmDeps}/.fetcher-version" ]]; then fetcherVersion=$(cat "${pnpmDeps}/.fetcher-version") fi echo "Using fetcherVersion: $fetcherVersion" echo "Configuring pnpm store" export HOME=$(mktemp -d) Loading Loading
doc/languages-frameworks/javascript.section.md +35 −0 Original line number Diff line number Diff line Loading @@ -444,6 +444,7 @@ stdenv.mkDerivation (finalAttrs: { pnpmDeps = pnpm.fetchDeps { inherit (finalAttrs) pname version src; hash = "..."; fetcherVersion = 1; }; }) ``` Loading Loading @@ -558,6 +559,40 @@ set `prePnpmInstall` to the right commands to run. For example: In this example, `prePnpmInstall` will be run by both `pnpm.configHook` and by the `pnpm.fetchDeps` builder. #### PNPM `fetcherVersion` {#javascript-pnpm-fetcherVersion} This is the version of the output of `pnpm.fetchDeps`, if you haven't set it already, you can use `1` with your current hash: ```nix { # ... pnpmDeps = pnpm.fetchDeps { # ... hash = "..."; # you can use your already set hash here fetcherVersion = 1; }; } ``` After upgrading to a newer `fetcherVersion`, you need to regenerate the hash: ```nix { # ... pnpmDeps = pnpm.fetchDeps { # ... hash = "..."; # clear this hash and generate a new one fetcherVersion = 2; }; } ``` This variable ensures that we can make changes to the output of `pnpm.fetchDeps` without breaking existing hashes. Changes can include workarounds or bug fixes to existing PNPM issues. ##### Version history {#javascript-pnpm-fetcherVersion-versionHistory} - 1: Initial version, nothing special ### Yarn {#javascript-yarn} Loading
doc/redirects.json +6 −0 Original line number Diff line number Diff line Loading @@ -3347,6 +3347,12 @@ "javascript-pnpm-extraCommands": [ "index.html#javascript-pnpm-extraCommands" ], "javascript-pnpm-fetcherVersion": [ "index.html#javascript-pnpm-fetcherVersion" ], "javascript-pnpm-fetcherVersion-versionHistory": [ "index.html#javascript-pnpm-fetcherVersion-versionHistory" ], "javascript-yarn": [ "index.html#javascript-yarn" ], Loading
pkgs/by-name/ba/bash-language-server/package.nix +1 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ stdenvNoCC.mkDerivation (finalAttrs: { pnpmWorkspaces ; hash = "sha256-NvyqPv5OKgZi3hW98Da8LhsYatmrzrPX8kLOfLr+BrI="; fetcherVersion = 1; }; nativeBuildInputs = [ Loading
pkgs/development/tools/pnpm/fetch-deps/default.nix +6 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ in pnpmWorkspaces ? [ ], prePnpmInstall ? "", pnpmInstallFlags ? [ ], fetcherVersion ? 1, ... }@args: let Loading Loading @@ -96,6 +97,11 @@ in --registry="$NIX_NPM_REGISTRY" \ --frozen-lockfile # Store newer fetcherVersion in case pnpm.configHook also needs it if [[ ${toString fetcherVersion} -gt 1 ]]; then echo ${toString fetcherVersion} > $out/.fetcher-version fi runHook postInstall ''; Loading
pkgs/development/tools/pnpm/fetch-deps/pnpm-config-hook.sh +7 −0 Original line number Diff line number Diff line Loading @@ -12,6 +12,13 @@ pnpmConfigHook() { exit 1 fi fetcherVersion=1 if [[ -e "${pnpmDeps}/.fetcher-version" ]]; then fetcherVersion=$(cat "${pnpmDeps}/.fetcher-version") fi echo "Using fetcherVersion: $fetcherVersion" echo "Configuring pnpm store" export HOME=$(mktemp -d) Loading