diff --git a/specs/nodejs/runner b/specs/nodejs/runner index d3ddff4..ce87f5a 100755 --- a/specs/nodejs/runner +++ b/specs/nodejs/runner @@ -49,6 +49,7 @@ cp validate.cjs "$BUILD"/bs.nodejs # Explicitly set permissions on all copied files. find "$BUILD" -type f -execdir chmod 644 {} + find "$BUILD" -type d -execdir chmod 755 {} + +chmod 755 "$BUILD"/.githooks/pre-commit # Validate the provided name is usable. nix develop "$BUILD" --command bash -c \ diff --git a/specs/nodejs/template/README.md b/specs/nodejs/template/README.md index 3bc0677..69b379d 100644 --- a/specs/nodejs/template/README.md +++ b/specs/nodejs/template/README.md @@ -9,6 +9,20 @@ run via: $ nix develop ``` +## Building + +If you make changes to the `package-lock.json` file, you'll need to update the +`npmDepsHash` value in `flake.nix`. The easiest way to discover this value is +by running the following: +```bash +$ prefetch-npm-deps package-lock.json +``` +Alternatively, you can set the value of `npmDepsHash` to `lib.fakeHash` and run: +```bash +$ nix build +``` +Nix will complain with the has value it actually expected. + ## Language Server The [typescript-language-server](https://github.com/typescript-language-server/typescript-language-server) diff --git a/specs/nodejs/template/flake.nix b/specs/nodejs/template/flake.nix index 9d292d9..e91cdde 100644 --- a/specs/nodejs/template/flake.nix +++ b/specs/nodejs/template/flake.nix @@ -27,6 +27,7 @@ version = "0.1.0"; src = ./.; npmDepsHash = ""; + # npmDepsHash = pkgs.lib.fakeHash; # Needed to properly invoke npm run build. nativeBuildInputs = [ pkgs.typescript ];