Skip to content

Commit 4afbb83

Browse files
authored
chore(nix): migrate lefthook from npm to nix (#294)
Move lefthook from pnpm devDependencies to nix flake buildInputs. This ensures consistent versioning across the team via nix and automatically installs git hooks when entering the devshell. Changes: - Add lefthook to flake.nix buildInputs - Add `lefthook install` to shellHook for automatic setup - Remove lefthook from package.json devDependencies - Remove lefthook from pnpm-workspace.yaml catalog and onlyBuiltDependencies
1 parent 0a83cdc commit 4afbb83

File tree

4 files changed

+6
-106
lines changed

4 files changed

+6
-106
lines changed

flake.nix

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@
3737

3838
# security
3939
gitleaks
40+
41+
# git hooks
42+
lefthook
4043
];
4144

4245
shellHook = ''
@@ -47,6 +50,9 @@
4750
echo "📦 Installing dependencies..."
4851
pnpm install --frozen-lockfile
4952
fi
53+
54+
# Install lefthook git hooks
55+
lefthook install > /dev/null 2>&1
5056
'';
5157
};
5258
}

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@
7272
"ai": "catalog:dev",
7373
"hono": "catalog:dev",
7474
"knip": "catalog:dev",
75-
"lefthook": "catalog:dev",
7675
"msw": "catalog:dev",
7776
"openai": "catalog:peer",
7877
"publint": "catalog:dev",

pnpm-lock.yaml

Lines changed: 0 additions & 103 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ catalogs:
1616
'@vitest/coverage-v8': ^4.0.15
1717
hono: ^4.9.10
1818
knip: ^5.72.0
19-
lefthook: ^2.0.8
2019
msw: ^2.10.4
2120
publint: ^0.3.12
2221
tsdown: ^0.17.2
@@ -55,7 +54,6 @@ minimumReleaseAgeExclude:
5554

5655
onlyBuiltDependencies:
5756
- esbuild
58-
- lefthook
5957
- msw
6058

6159
shellEmulator: true

0 commit comments

Comments
 (0)