corepack: PR review updates

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
Co-authored-by: Sandro Jaeckel <sandro.jaeckel@gmail.com>
This commit is contained in:
Wout Mertens 2023-09-20 09:54:38 +02:00
parent 724f6bcb77
commit 00de2104fc
3 changed files with 21 additions and 33 deletions

View file

@ -219,7 +219,7 @@ sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
### corepack {#javascript-corepack}
This package puts the corepack wrappers for npm, pnpm and yarn in your PATH, and they will honor the `packageManager` setting in the `package.json`.
This package puts the corepack wrappers for pnpm and yarn in your PATH, and they will honor the `packageManager` setting in the `package.json`.
### node2nix {#javascript-node2nix}

View file

@ -1,26 +1,24 @@
{ lib, stdenv, nodejs }:
let
inherit (nodejs) version;
in
stdenv.mkDerivation {
name = "corepack-nodejs-${version}";
pname = "corepack-nodejs";
inherit (nodejs) version;
nativeBuildInputs = [ nodejs ];
unpackPhase = "true";
dontUnpack = true;
installPhase = ''
mkdir -p $out/bin
corepack enable --install-directory $out/bin
# Also wrap npm
corepack enable --install-directory $out/bin npm
# Enabling npm caused some crashes - leaving out for now
# corepack enable --install-directory $out/bin npm
'';
meta = {
description = "Wrappers for npm, pnpm and yarn via nodejs's corepack";
homepage = "https://nodejs.org";
changelog = "https://github.com/nodejs/node/releases/tag/v${version}";
description = "Wrappers for npm, pnpm and Yarn via Node.js Corepack";
homepage = "https://nodejs.org/api/corepack.html";
changelog = "https://github.com/nodejs/node/releases/tag/v${nodejs.version}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ wmertens ];
platforms = lib.platforms.linux ++ lib.platforms.darwin;

View file

@ -10236,40 +10236,30 @@ with pkgs;
nodenv = callPackage ../development/tools/nodenv { };
nodejs = hiPrio nodejs_18;
corepack = hiPrio (callPackage ../development/web/nodejs/corepack.nix {
nodejs = nodejs; });
nodejs-slim = nodejs-slim_18;
corepack = hiPrio corepack_18;
nodejs_14 = callPackage ../development/web/nodejs/v14.nix {
openssl = openssl_1_1;
};
nodejs_14 = callPackage ../development/web/nodejs/v14.nix { openssl = openssl_1_1; };
nodejs-slim_14 = callPackage ../development/web/nodejs/v14.nix {
openssl = openssl_1_1;
enableNpm = false;
};
nodejs_16 = callPackage ../development/web/nodejs/v16.nix { };
nodejs-slim_16 = callPackage ../development/web/nodejs/v16.nix {
enableNpm = false;
};
nodejs-slim_16 = callPackage ../development/web/nodejs/v16.nix { enableNpm = false; };
nodejs_18 = callPackage ../development/web/nodejs/v18.nix { };
nodejs-slim_18 = callPackage ../development/web/nodejs/v18.nix {
enableNpm = false;
};
corepack_18 = hiPrio (callPackage ../development/web/nodejs/corepack.nix
{ nodejs = nodejs_18; });
nodejs-slim_18 = callPackage ../development/web/nodejs/v18.nix { enableNpm = false; };
corepack_18 = hiPrio (callPackage ../development/web/nodejs/corepack.nix { nodejs = nodejs_18; });
nodejs_20 = callPackage ../development/web/nodejs/v20.nix { };
nodejs-slim_20 = callPackage ../development/web/nodejs/v20.nix {
enableNpm = false;
};
corepack_20 = hiPrio (callPackage ../development/web/nodejs/corepack.nix
{ nodejs = nodejs_20; });
nodejs-slim_20 = callPackage ../development/web/nodejs/v20.nix { enableNpm = false; };
corepack_20 = hiPrio (callPackage ../development/web/nodejs/corepack.nix { nodejs = nodejs_20; });
# Update this when adding the newest nodejs major version!
nodejs_latest = nodejs_20;
nodejs-slim_latest = nodejs-slim_20;
corepack_latest = hiPrio (callPackage ../development/web/nodejs/corepack.nix
{ nodejs = nodejs_latest; });
corepack_latest = hiPrio corepack_20;
buildNpmPackage = callPackage ../build-support/node/build-npm-package { };