Skip to content

Commit d7467ed

Browse files
committed
Add Nix dev environment, replace husky with git hooks
Sets up a Nix-based dev environment (fenix + crane) and swaps the husky pre-commit hook for a tracked .githooks directory wired via core.hooksPath. Husky and lint-staged weren't doing much. The only tracked JS is index.js and index.d.ts, both auto-generated by NAPI-RS with eslint-disable and prettier-ignore at the top. lint-staged was formatting code that opts out of linting, while the Rust source got nothing. The new hook just runs `just check`, which runs `nix flake check` (fmt, clippy, build). Cargo.lock is now tracked. Crane vendors git deps from it so it has to be visible to Nix, and for a library shipped via npm tracking the lockfile is the right call anyway as binaries are produced.
1 parent 0b8ff1e commit d7467ed

12 files changed

Lines changed: 3467 additions & 232 deletions

File tree

.envrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
use flake

.githooks/pre-commit

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/usr/bin/env bash
2+
just check

.github/workflows/CI.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ concurrency:
2626
cancel-in-progress: true
2727
jobs:
2828
lint:
29-
name: Lint
29+
name: CI
3030
runs-on: ubuntu-latest
3131
steps:
3232
- uses: actions/checkout@v4
@@ -45,14 +45,13 @@ jobs:
4545
- name: Install dependencies
4646
run: yarn install
4747

48-
- name: Oxlint
49-
run: yarn lint
50-
51-
- name: Cargo fmt
52-
run: cargo fmt -- --check
48+
- name: Install just
49+
uses: taiki-e/install-action@v2
50+
with:
51+
tool: just
5352

54-
- name: Clippy
55-
run: cargo clippy
53+
- name: Check
54+
run: just ci
5655
build:
5756
strategy:
5857
fail-fast: false

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ dist
117117
#Added by cargo
118118

119119
/target
120-
Cargo.lock
121120

122121
*.node
123122
.pnp.*

.husky/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.husky/pre-commit

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)