nodejs: Add instructions around building and chmod on pre-commit.

pull/1/head
Joshua Potter 2023-12-13 15:49:55 -07:00
parent 07a05d6a04
commit 0aaa1ebc38
3 changed files with 16 additions and 0 deletions

View File

@ -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 \

View File

@ -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)

View File

@ -27,6 +27,7 @@
version = "0.1.0";
src = ./.;
npmDepsHash = "<SHA_256>";
# npmDepsHash = pkgs.lib.fakeHash;
# Needed to properly invoke npm run build.
nativeBuildInputs = [ pkgs.typescript ];