Skip to content

Commit

Permalink
build: upgrade to Node v16
Browse files Browse the repository at this point in the history
Updated pkgs.nix to a5774e76bb8c3145eac524be62375c937143b80c
Updated node2nix to 1.11.0 and loading directly from GitHub
Updated pkg to 5.6.0 and using pkg-fetch 3.3 base binaries
Updated to TypeScript 4.5+
Updated @types/node to 16.11.7
Updated node-gyp-build to 4.4.0
Updated typedoc to 0.22.15, the .nojekyll generation is automatic
Changed to target ES2021 as node 16 supports it
Bin executable duct-tape in default.nix because node2nix no longer generates bin executables
Updated pkg builds hashes to v16.14.2 and specified target node range
  • Loading branch information
emmacasolin committed Jun 6, 2022
1 parent 50f28d9 commit 56c4a50
Show file tree
Hide file tree
Showing 9 changed files with 12,819 additions and 203 deletions.
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"parserOptions": {
"project": "tsconfig.json",
"sourceType": "module",
"ecmaVersion": 2020
"ecmaVersion": 2021
},
"rules": {
"linebreak-style": ["error", "unix"],
Expand Down
25 changes: 20 additions & 5 deletions default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{ runCommandNoCC
, callPackage
, jq
}:

let
Expand Down Expand Up @@ -32,11 +33,25 @@ let
"${utils.node2nixProd}/lib/node_modules" \
"$out/lib/node_modules/$packageName/"
fi
# create symlink to the deployed executable folder, if applicable
if [ -d "${utils.node2nixDev}/lib/node_modules/.bin" ]; then
cp -r ${utils.node2nixDev}/lib/node_modules/.bin $out/lib/node_modules/
ln -s $out/lib/node_modules/.bin $out/bin
# symlink bin executables
if [ \
"$(${jq}/bin/jq 'has("bin")' "$out/lib/node_modules/${utils.node2nixDev.packageName}/package.json")" \
== \
"true" \
]; then
mkdir -p "$out/bin"
while IFS= read -r bin_name && IFS= read -r bin_path; do
# make files executable
chmod a+x "$out/lib/node_modules/${utils.node2nixDev.packageName}/$bin_path"
# create the symlink
ln -s \
"../lib/node_modules/${utils.node2nixDev.packageName}/$bin_path" \
"$out/bin/$bin_name"
done < <(
${jq}/bin/jq -r 'select(.bin != null) | .bin | to_entries[] | (.key, .value)' \
"$out/lib/node_modules/${utils.node2nixDev.packageName}/package.json"
)
fi
'';
'';
in
drv
Loading

0 comments on commit 56c4a50

Please sign in to comment.