nodePackages: Regenerate node packages for nodejs 10 & 12

This commit is contained in:
adisbladis 2019-07-05 11:01:52 +01:00 committed by Robin Gloster
parent 443b0f6332
commit fae732edb1
No known key found for this signature in database
GPG Key ID: D5C458DF6DD97EDF
9 changed files with 8692 additions and 5228 deletions

View File

@ -1,4 +1,4 @@
# This file has been generated by node2nix 1.7.0. Do not edit! # This file has been generated by node2nix 1.6.0. Do not edit!
{pkgs ? import <nixpkgs> { {pkgs ? import <nixpkgs> {
inherit system; inherit system;

View File

@ -1,8 +1,8 @@
# This file has been generated by node2nix 1.7.0. Do not edit! # This file has been generated by node2nix 1.6.0. Do not edit!
{pkgs ? import <nixpkgs> { {pkgs ? import <nixpkgs> {
inherit system; inherit system;
}, system ? builtins.currentSystem, nodejs ? pkgs."nodejs-12_x"}: }, system ? builtins.currentSystem, nodejs ? pkgs."nodejs-6_x"}:
let let
nodeEnv = import ./node-env.nix { nodeEnv = import ./node-env.nix {

View File

@ -7,15 +7,6 @@ let
}; };
in in
nodePackages // { nodePackages // {
aws-azure-login = nodePackages.aws-azure-login.override {
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD = "true";
buildInputs = [ pkgs.makeWrapper ];
postInstall = ''
wrapProgram "$out/bin/aws-azure-login" --set PUPPETEER_EXECUTABLE_PATH "${pkgs.chromium}/bin/chromium"
'';
};
bower2nix = nodePackages.bower2nix.override { bower2nix = nodePackages.bower2nix.override {
buildInputs = [ pkgs.makeWrapper ]; buildInputs = [ pkgs.makeWrapper ];
postInstall = '' postInstall = ''

View File

@ -4,6 +4,5 @@
set -eu -o pipefail set -eu -o pipefail
rm -f node-env.nix rm -f node-env.nix
node2nix -8 -i node-packages-v8.json -o node-packages-v8.nix -c composition-v8.nix
node2nix --nodejs-10 -i node-packages-v10.json -o node-packages-v10.nix -c composition-v10.nix node2nix --nodejs-10 -i node-packages-v10.json -o node-packages-v10.nix -c composition-v10.nix
node2nix --nodejs-12 -i node-packages-v12.json -o node-packages-v12.nix -c composition-v12.nix node2nix --nodejs-12 -i node-packages-v12.json -o node-packages-v12.nix -c composition-v12.nix

View File

@ -11,7 +11,7 @@ let
cat > $out/bin/tar <<EOF cat > $out/bin/tar <<EOF
#! ${stdenv.shell} -e #! ${stdenv.shell} -e
$(type -p tar) "\$@" --warning=no-unknown-keyword --delay-directory-restore $(type -p tar) "\$@" --warning=no-unknown-keyword
EOF EOF
chmod +x $out/bin/tar chmod +x $out/bin/tar
@ -72,7 +72,7 @@ let
packageDir="$(find . -maxdepth 1 -type d | tail -1)" packageDir="$(find . -maxdepth 1 -type d | tail -1)"
# Restore write permissions to make building work # Restore write permissions to make building work
find "$packageDir" -type d -exec chmod u+x {} \; find "$packageDir" -type d -print0 | xargs -0 chmod u+x
chmod -R u+w "$packageDir" chmod -R u+w "$packageDir"
# Move the extracted tarball into the output folder # Move the extracted tarball into the output folder
@ -219,16 +219,7 @@ let
packageObj["_integrity"] = "sha1-000000000000000000000000000="; // When no _integrity string has been provided (e.g. by Git dependencies), add a dummy one. It does not seem to harm and it bypasses downloads. packageObj["_integrity"] = "sha1-000000000000000000000000000="; // When no _integrity string has been provided (e.g. by Git dependencies), add a dummy one. It does not seem to harm and it bypasses downloads.
} }
if(dependency.resolved) { packageObj["_resolved"] = dependency.version; // Set the resolved version to the version identifier. This prevents NPM from cloning Git repositories.
packageObj["_resolved"] = dependency.resolved; // Adopt the resolved property if one has been provided
} else {
packageObj["_resolved"] = dependency.version; // Set the resolved version to the version identifier. This prevents NPM from cloning Git repositories.
}
if(dependency.from !== undefined) { // Adopt from property if one has been provided
packageObj["_from"] = dependency.from;
}
fs.writeFileSync(packageJSONPath, JSON.stringify(packageObj, null, 2)); fs.writeFileSync(packageJSONPath, JSON.stringify(packageObj, null, 2));
} }
@ -317,11 +308,50 @@ let
''; '';
}; };
prepareAndInvokeNPM = {packageName, bypassCache, reconstructLock, npmFlags, production}: # Builds and composes an NPM package including all its dependencies
buildNodePackage =
{ name
, packageName
, version
, dependencies ? []
, buildInputs ? []
, production ? true
, npmFlags ? ""
, dontNpmInstall ? false
, bypassCache ? false
, preRebuild ? ""
, dontStrip ? true
, unpackPhase ? "true"
, buildPhase ? "true"
, ... }@args:
let let
forceOfflineFlag = if bypassCache then "--offline" else "--registry http://www.example.com"; forceOfflineFlag = if bypassCache then "--offline" else "--registry http://www.example.com";
extraArgs = removeAttrs args [ "name" "dependencies" "buildInputs" "dontStrip" "dontNpmInstall" "preRebuild" "unpackPhase" "buildPhase" ];
in in
'' stdenv.mkDerivation ({
name = "node-${name}-${version}";
buildInputs = [ tarWrapper python nodejs ]
++ stdenv.lib.optional (stdenv.isLinux) utillinux
++ stdenv.lib.optional (stdenv.isDarwin) libtool
++ buildInputs;
inherit dontStrip; # Stripping may fail a build for some package deployments
inherit dontNpmInstall preRebuild unpackPhase buildPhase;
compositionScript = composePackage args;
pinpointDependenciesScript = pinpointDependenciesOfPackage args;
passAsFile = [ "compositionScript" "pinpointDependenciesScript" ];
installPhase = ''
# Create and enter a root node_modules/ folder
mkdir -p $out/lib/node_modules
cd $out/lib/node_modules
# Compose the package and all its dependencies
source $compositionScriptPath
# Pinpoint the versions of all dependencies to the ones that are actually being used # Pinpoint the versions of all dependencies to the ones that are actually being used
echo "pinpointing versions of dependencies..." echo "pinpointing versions of dependencies..."
source $pinpointDependenciesScriptPath source $pinpointDependenciesScriptPath
@ -345,18 +375,11 @@ let
runHook preRebuild runHook preRebuild
${stdenv.lib.optionalString bypassCache '' ${stdenv.lib.optionalString bypassCache ''
${stdenv.lib.optionalString reconstructLock '' if [ ! -f package-lock.json ]
if [ -f package-lock.json ] then
then echo "No package-lock.json file found, reconstructing..."
echo "WARNING: Reconstruct lock option enabled, but a lock file already exists!" node ${reconstructPackageLock}
echo "This will most likely result in version mismatches! We will remove the lock file and regenerate it!" fi
rm package-lock.json
else
echo "No package-lock.json file found, reconstructing..."
fi
node ${reconstructPackageLock}
''}
node ${addIntegrityFieldsScript} node ${addIntegrityFieldsScript}
''} ''}
@ -370,53 +393,6 @@ let
npm ${forceOfflineFlag} --nodedir=${nodeSources} ${npmFlags} ${stdenv.lib.optionalString production "--production"} install npm ${forceOfflineFlag} --nodedir=${nodeSources} ${npmFlags} ${stdenv.lib.optionalString production "--production"} install
fi fi
'';
# Builds and composes an NPM package including all its dependencies
buildNodePackage =
{ name
, packageName
, version
, dependencies ? []
, buildInputs ? []
, production ? true
, npmFlags ? ""
, dontNpmInstall ? false
, bypassCache ? false
, reconstructLock ? false
, preRebuild ? ""
, dontStrip ? true
, unpackPhase ? "true"
, buildPhase ? "true"
, ... }@args:
let
extraArgs = removeAttrs args [ "name" "dependencies" "buildInputs" "dontStrip" "dontNpmInstall" "preRebuild" "unpackPhase" "buildPhase" ];
in
stdenv.mkDerivation ({
name = "node_${name}-${version}";
buildInputs = [ tarWrapper python nodejs ]
++ stdenv.lib.optional (stdenv.isLinux) utillinux
++ stdenv.lib.optional (stdenv.isDarwin) libtool
++ buildInputs;
inherit dontStrip; # Stripping may fail a build for some package deployments
inherit dontNpmInstall preRebuild unpackPhase buildPhase;
compositionScript = composePackage args;
pinpointDependenciesScript = pinpointDependenciesOfPackage args;
passAsFile = [ "compositionScript" "pinpointDependenciesScript" ];
installPhase = ''
# Create and enter a root node_modules/ folder
mkdir -p $out/lib/node_modules
cd $out/lib/node_modules
# Compose the package and all its dependencies
source $compositionScriptPath
${prepareAndInvokeNPM { inherit packageName bypassCache reconstructLock npmFlags production; }}
# Create symlink to the deployed executable folder, if applicable # Create symlink to the deployed executable folder, if applicable
if [ -d "$out/lib/node_modules/.bin" ] if [ -d "$out/lib/node_modules/.bin" ]
@ -455,13 +431,14 @@ let
, npmFlags ? "" , npmFlags ? ""
, dontNpmInstall ? false , dontNpmInstall ? false
, bypassCache ? false , bypassCache ? false
, reconstructLock ? false
, dontStrip ? true , dontStrip ? true
, unpackPhase ? "true" , unpackPhase ? "true"
, buildPhase ? "true" , buildPhase ? "true"
, ... }@args: , ... }@args:
let let
forceOfflineFlag = if bypassCache then "--offline" else "--registry http://www.example.com";
extraArgs = removeAttrs args [ "name" "dependencies" "buildInputs" ]; extraArgs = removeAttrs args [ "name" "dependencies" "buildInputs" ];
nodeDependencies = stdenv.mkDerivation ({ nodeDependencies = stdenv.mkDerivation ({
@ -496,13 +473,39 @@ let
fi fi
''} ''}
# Go to the parent folder to make sure that all packages are pinpointed # Pinpoint the versions of all dependencies to the ones that are actually being used
echo "pinpointing versions of dependencies..."
cd .. cd ..
${stdenv.lib.optionalString (builtins.substring 0 1 packageName == "@") "cd .."} ${stdenv.lib.optionalString (builtins.substring 0 1 packageName == "@") "cd .."}
${prepareAndInvokeNPM { inherit packageName bypassCache reconstructLock npmFlags production; }} source $pinpointDependenciesScriptPath
cd ${packageName}
# Patch the shebangs of the bundled modules to prevent them from
# calling executables outside the Nix store as much as possible
patchShebangs .
export HOME=$PWD
${stdenv.lib.optionalString bypassCache ''
if [ ! -f package-lock.json ]
then
echo "No package-lock.json file found, reconstructing..."
node ${reconstructPackageLock}
fi
node ${addIntegrityFieldsScript}
''}
npm ${forceOfflineFlag} --nodedir=${nodeSources} ${npmFlags} ${stdenv.lib.optionalString production "--production"} rebuild
${stdenv.lib.optionalString (!dontNpmInstall) ''
# NPM tries to download packages even when they already exist if npm-shrinkwrap is used.
rm -f npm-shrinkwrap.json
npm ${forceOfflineFlag} --nodedir=${nodeSources} ${npmFlags} ${stdenv.lib.optionalString production "--production"} install
''}
# Expose the executables that were installed
cd .. cd ..
${stdenv.lib.optionalString (builtins.substring 0 1 packageName == "@") "cd .."} ${stdenv.lib.optionalString (builtins.substring 0 1 packageName == "@") "cd .."}
@ -529,7 +532,6 @@ let
inherit nodeDependencies; inherit nodeDependencies;
shellHook = stdenv.lib.optionalString (dependencies != []) '' shellHook = stdenv.lib.optionalString (dependencies != []) ''
export NODE_PATH=$nodeDependencies/lib/node_modules export NODE_PATH=$nodeDependencies/lib/node_modules
export PATH="$nodeDependencies/bin:$PATH"
''; '';
}; };
in in

View File

@ -2,8 +2,15 @@
"@angular/cli" "@angular/cli"
, "@antora/cli" , "@antora/cli"
, "@antora/site-generator-default" , "@antora/site-generator-default"
, "@vue/cli"
, "@webassemblyjs/cli"
, "@webassemblyjs/repl"
, "@webassemblyjs/wasm-strip"
, "@webassemblyjs/wasm-text-gen"
, "@webassemblyjs/wast-refmt"
, "alloy"
, "asar" , "asar"
, "aws-azure-login" , "azure-cli"
, "azure-functions-core-tools" , "azure-functions-core-tools"
, "bash-language-server" , "bash-language-server"
, "bower" , "bower"
@ -27,10 +34,10 @@
, "elm-live" , "elm-live"
, "elm-oracle" , "elm-oracle"
, "emoj" , "emoj"
, "emojione"
, "eslint" , "eslint"
, "eslint_d" , "eslint_d"
, "emojione" , {"fast-cli": "1.x"}
, { "fast-cli": "1.x" }
, "fkill-cli" , "fkill-cli"
, "forever" , "forever"
, "git-run" , "git-run"
@ -40,26 +47,26 @@
, "grunt-cli" , "grunt-cli"
, "gulp" , "gulp"
, "gulp-cli" , "gulp-cli"
, "htmlhint"
, "html-minifier" , "html-minifier"
, "htmlhint"
, "http-server" , "http-server"
, "hueadm" , "hueadm"
, "ionic"
, "ios-deploy"
, "imapnotify" , "imapnotify"
, "indium" , "indium"
, "ionic"
, "ios-deploy"
, "jake" , "jake"
, "javascript-typescript-langserver" , "javascript-typescript-langserver"
, "joplin" , "joplin"
, "js-beautify"
, "js-yaml"
, "jsdoc" , "jsdoc"
, "jshint" , "jshint"
, "json" , "json"
, "js-beautify"
, "jsonlint"
, "json-diff" , "json-diff"
, "json-refs" , "json-refs"
, "json-server" , "json-server"
, "js-yaml" , "jsonlint"
, "karma" , "karma"
, "lcov-result-merger" , "lcov-result-merger"
, "leetcode-cli" , "leetcode-cli"
@ -68,7 +75,7 @@
, "less-plugin-clean-css" , "less-plugin-clean-css"
, "live-server" , "live-server"
, "livedown" , "livedown"
, { "lumo-build-deps": "../interpreters/clojurescript/lumo" } , {"lumo-build-deps": "../interpreters/clojurescript/lumo" }
, "madoko" , "madoko"
, "markdown-link-check" , "markdown-link-check"
, "mathjax" , "mathjax"
@ -78,24 +85,25 @@
, "multi-file-swagger" , "multi-file-swagger"
, "neovim" , "neovim"
, "nijs" , "nijs"
, "node2nix"
, "node-gyp" , "node-gyp"
, "node-gyp-build" , "node-gyp-build"
, "node-inspector" , "node-inspector"
, "node-pre-gyp" , "node-pre-gyp"
, "nodemon"
, "node-red" , "node-red"
, "node2nix"
, "nodemon"
, "npm" , "npm"
, "npm-check-updates" , "npm-check-updates"
, {"npm2nix": "git://github.com/NixOS/npm2nix.git#5.12.0"}
, "ocaml-language-server" , "ocaml-language-server"
, "parcel-bundler"
, "peerflix" , "peerflix"
, "peerflix-server" , "peerflix-server"
, "pnpm" , "pnpm"
, "parcel-bundler"
, "prettier" , "prettier"
, "pulp" , "pulp"
, "react-tools"
, "react-native-cli" , "react-native-cli"
, "react-tools"
, "reveal.js" , "reveal.js"
, "s3http" , "s3http"
, "semver" , "semver"
@ -108,9 +116,10 @@
, "speed-test" , "speed-test"
, "ssb-server" , "ssb-server"
, "stackdriver-statsd-backend" , "stackdriver-statsd-backend"
, "stf"
, "svgo" , "svgo"
, "swagger" , "swagger"
, { "tedicross": "git+https://github.com/TediCross/TediCross.git#v0.8.7" } , {"tedicross": "git+https://github.com/TediCross/TediCross.git#v0.8.7"}
, "tern" , "tern"
, "textlint" , "textlint"
, "textlint-plugin-latex" , "textlint-plugin-latex"
@ -129,6 +138,7 @@
, "thelounge" , "thelounge"
, "three" , "three"
, "tiddlywiki" , "tiddlywiki"
, "titanium"
, "triton" , "triton"
, "tsun" , "tsun"
, "ttf2eot" , "ttf2eot"
@ -139,17 +149,11 @@
, "vscode-css-languageserver-bin" , "vscode-css-languageserver-bin"
, "vscode-html-languageserver-bin" , "vscode-html-languageserver-bin"
, "vue-cli" , "vue-cli"
, "@vue/cli"
, "vue-language-server" , "vue-language-server"
, "@webassemblyjs/cli" , "web-ext"
, "@webassemblyjs/repl"
, "@webassemblyjs/wasm-strip"
, "@webassemblyjs/wasm-text-gen"
, "@webassemblyjs/wast-refmt"
, "webpack" , "webpack"
, "webpack-cli" , "webpack-cli"
, "webtorrent-cli" , "webtorrent-cli"
, "web-ext"
, "wring" , "wring"
, "write-good" , "write-good"
, "yarn" , "yarn"

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
# This file has been generated by node2nix 1.7.0. Do not edit! # This file has been generated by node2nix 1.6.0. Do not edit!
{nodeEnv, fetchurl, fetchgit, globalBuildInputs ? []}: {nodeEnv, fetchurl, fetchgit, globalBuildInputs ? []}:
@ -1624,13 +1624,13 @@ let
sha1 = "212d5bfe1318306a420f6402b8e26ff39647a849"; sha1 = "212d5bfe1318306a420f6402b8e26ff39647a849";
}; };
}; };
"psl-1.2.0" = { "psl-1.3.0" = {
name = "psl"; name = "psl";
packageName = "psl"; packageName = "psl";
version = "1.2.0"; version = "1.3.0";
src = fetchurl { src = fetchurl {
url = "https://registry.npmjs.org/psl/-/psl-1.2.0.tgz"; url = "https://registry.npmjs.org/psl/-/psl-1.3.0.tgz";
sha512 = "GEn74ZffufCmkDDLNcl3uuyF/aSD6exEyh1v/ZSdAomB82t6G9hzJVRx0jBmLDW+VfZqks3aScmMw9DszwUalA=="; sha512 = "avHdspHO+9rQTLbv1RO+MPYeP/SzsCoxofjVnHanETfQhTJrmB0HlDoW+EiN/R+C0BZ+gERab9NY0lPN2TxNag==";
}; };
}; };
"punycode-1.4.1" = { "punycode-1.4.1" = {
@ -1714,13 +1714,13 @@ let
sha512 = "NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg=="; sha512 = "NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==";
}; };
}; };
"resolve-1.11.1" = { "resolve-1.12.0" = {
name = "resolve"; name = "resolve";
packageName = "resolve"; packageName = "resolve";
version = "1.11.1"; version = "1.12.0";
src = fetchurl { src = fetchurl {
url = "https://registry.npmjs.org/resolve/-/resolve-1.11.1.tgz"; url = "https://registry.npmjs.org/resolve/-/resolve-1.12.0.tgz";
sha512 = "vIpgF6wfuJOZI7KKKSP+HmiKggadPQAdsp5HiC1mvqnfp0gF1vdwgBWZIdrVft9pgqoMFQN+R7BSWZiBxx+BBw=="; sha512 = "B/dOmuoAik5bKcD6s6nXDCjzUKnaDvdkRyAk6rsmsKLipWj4797iothd7jmmUhWTfinVMU+wc56rYKsit2Qy4w==";
}; };
}; };
"resolve-dir-1.0.1" = { "resolve-dir-1.0.1" = {
@ -2303,8 +2303,7 @@ in
license = "MIT"; license = "MIT";
}; };
production = true; production = true;
bypassCache = true; bypassCache = false;
reconstructLock = true;
}; };
coffee-script = nodeEnv.buildNodePackage { coffee-script = nodeEnv.buildNodePackage {
name = "coffee-script"; name = "coffee-script";
@ -2321,8 +2320,7 @@ in
license = "MIT"; license = "MIT";
}; };
production = true; production = true;
bypassCache = true; bypassCache = false;
reconstructLock = true;
}; };
grunt-cli = nodeEnv.buildNodePackage { grunt-cli = nodeEnv.buildNodePackage {
name = "grunt-cli"; name = "grunt-cli";
@ -2497,7 +2495,7 @@ in
sources."regex-not-1.0.2" sources."regex-not-1.0.2"
sources."repeat-element-1.1.3" sources."repeat-element-1.1.3"
sources."repeat-string-1.6.1" sources."repeat-string-1.6.1"
sources."resolve-1.11.1" sources."resolve-1.12.0"
sources."resolve-dir-1.0.1" sources."resolve-dir-1.0.1"
sources."resolve-url-0.2.1" sources."resolve-url-0.2.1"
sources."ret-0.1.15" sources."ret-0.1.15"
@ -2587,8 +2585,7 @@ in
license = "MIT"; license = "MIT";
}; };
production = true; production = true;
bypassCache = true; bypassCache = false;
reconstructLock = true;
}; };
node2nix = nodeEnv.buildNodePackage { node2nix = nodeEnv.buildNodePackage {
name = "node2nix"; name = "node2nix";
@ -2716,7 +2713,7 @@ in
sources."performance-now-2.1.0" sources."performance-now-2.1.0"
sources."process-nextick-args-2.0.1" sources."process-nextick-args-2.0.1"
sources."proto-list-1.2.4" sources."proto-list-1.2.4"
sources."psl-1.2.0" sources."psl-1.3.0"
sources."punycode-2.1.1" sources."punycode-2.1.1"
sources."qs-6.5.2" sources."qs-6.5.2"
(sources."readable-stream-2.3.6" // { (sources."readable-stream-2.3.6" // {
@ -2725,7 +2722,7 @@ in
]; ];
}) })
sources."request-2.88.0" sources."request-2.88.0"
sources."resolve-1.11.1" sources."resolve-1.12.0"
sources."retry-0.10.1" sources."retry-0.10.1"
sources."rimraf-2.6.3" sources."rimraf-2.6.3"
sources."safe-buffer-5.2.0" sources."safe-buffer-5.2.0"
@ -2777,7 +2774,6 @@ in
license = "MIT"; license = "MIT";
}; };
production = true; production = true;
bypassCache = true; bypassCache = false;
reconstructLock = true;
}; };
} }

View File

@ -653,7 +653,7 @@ in
iamy = callPackage ../tools/admin/iamy { }; iamy = callPackage ../tools/admin/iamy { };
azure-cli = nodePackages_8_x.azure-cli; azure-cli = nodePackages_10_x.azure-cli;
azure-storage-azcopy = callPackage ../development/tools/azcopy { }; azure-storage-azcopy = callPackage ../development/tools/azcopy { };