diff --git a/apps/update-sources/src/node-modules.ts b/apps/update-sources/src/node-modules.ts index 0b9ade64..0029b59f 100644 --- a/apps/update-sources/src/node-modules.ts +++ b/apps/update-sources/src/node-modules.ts @@ -44,7 +44,7 @@ const updatePackageJson = async(workspaceDir: string, updates: object) => { const prefetchNpmDeps = (workspaceDir: string): string => { - npmRun(['install', '--package-lock-only'], workspaceDir); + npmRun(['update', '--package-lock-only'], workspaceDir); return spawnSync( 'prefetch-npm-deps', diff --git a/devShells/default.nix b/devShells/default.nix index 760e3e0a..be9270c9 100644 --- a/devShells/default.nix +++ b/devShells/default.nix @@ -18,8 +18,13 @@ }; text = '' # this command might fail but still updates the main lockfile - npm i --package-lock-only || true - prefetch-npm-deps ./package-lock.json + npm update --package-lock-only || true + hash="$(prefetch-npm-deps ./package-lock.json)" + echo "$hash" + + if [[ -f ./default.nix ]]; then + sed -i "s#npmDepsHash = .*#npmDepsHash = \"$hash\";#" ./default.nix + fi ''; }; in