mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-29 02:13:23 +00:00
Merge pull request #244646 from wmertens/corepack-wrappers
nodejs: corepack wrappers package
This commit is contained in:
commit
e99603603d
@ -217,6 +217,10 @@ $ prefetch-npm-deps package-lock.json
|
||||
sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
|
||||
```
|
||||
|
||||
### corepack {#javascript-corepack}
|
||||
|
||||
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}
|
||||
|
||||
#### Preparation {#javascript-node2nix-preparation}
|
||||
|
26
pkgs/development/web/nodejs/corepack.nix
Normal file
26
pkgs/development/web/nodejs/corepack.nix
Normal file
@ -0,0 +1,26 @@
|
||||
{ lib, stdenv, nodejs }:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
pname = "corepack-nodejs";
|
||||
inherit (nodejs) version;
|
||||
|
||||
nativeBuildInputs = [ nodejs ];
|
||||
|
||||
dontUnpack = true;
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
corepack enable --install-directory $out/bin
|
||||
# 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 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;
|
||||
};
|
||||
}
|
@ -10236,31 +10236,30 @@ with pkgs;
|
||||
nodenv = callPackage ../development/tools/nodenv { };
|
||||
|
||||
nodejs = hiPrio nodejs_18;
|
||||
|
||||
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;
|
||||
};
|
||||
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;
|
||||
};
|
||||
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 corepack_20;
|
||||
|
||||
buildNpmPackage = callPackage ../build-support/node/build-npm-package { };
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user