npmHooks.npmInstallHook: ignore bundle deps when calculating files to install

This assumes that downstream users of `buildNpmPackage` would rather our
own built `node_modules` be copied to the output rather than only the
`bundleDependencies` specified in the `package.json` file.

Having the latter behavior seems unexpected and unintuitive, and would
not work as installing from an `npm pack` is intended to (since doing
that would not do a `rebuild` step on those dependencies and it would
skip reifying a full dependency tree).

authored by Lily Foster and committed by Matthieu Coudron ae86a507 4d2f3636

+1 -1
+1 -1
pkgs/build-support/node/build-npm-package/hooks/npm-install-hook.sh
··· 12 12 local dest="$packageOut/$(dirname "$file")" 13 13 mkdir -p "$dest" 14 14 cp "${npmWorkspace-.}/$file" "$dest" 15 - done < <(@jq@ --raw-output '.[0].files | map(.path) | join("\n")' <<< "$(npm_config_cache="$HOME/.npm" npm pack --json --dry-run --loglevel=warn --no-foreground-scripts ${npmWorkspace+--workspace=$npmWorkspace} $npmPackFlags "${npmPackFlagsArray[@]}" $npmFlags "${npmFlagsArray[@]}")") 15 + done < <(@jq@ --raw-output '.[0].files | map(.path | select(. | startswith("node_modules/") | not)) | join("\n")' <<< "$(npm_config_cache="$HOME/.npm" npm pack --json --dry-run --loglevel=warn --no-foreground-scripts ${npmWorkspace+--workspace=$npmWorkspace} $npmPackFlags "${npmPackFlagsArray[@]}" $npmFlags "${npmFlagsArray[@]}")") 16 16 17 17 # Based on code from Python's buildPythonPackage wrap.sh script, for 18 18 # supporting both the case when makeWrapperArgs is an array and a