Skip to content

Commit a42fa51

Browse files
abueideclaude
andauthored
feat: add CI checks to pre-commit hook (#1227)
* feat: add CI checks to pre-commit hook Add `devbox run check` command that runs all CI checks: - lint (eslint) - format-check (treefmt) - build - typecheck - test Update pre-commit hook to run `devbox run check` before each commit, ensuring local environment matches CI exactly. The check command calls other devbox commands (not yarn directly) so updates to individual commands stay in sync. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * fix: add NPM_TOKEN to release workflow Add NPM_TOKEN environment variable to all release steps (dry-run, beta, production). Required by @semantic-release/npm plugin to publish packages. This fixes release workflow failures where the job would fail immediately without running any steps due to missing npm authentication. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * revert: remove NPM_TOKEN - using npm provenance instead Repository uses npm provenance with GitHub OIDC (id-token: write), not NPM_TOKEN. Revert the incorrect token addition. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * feat: auto-format files in pre-commit hook Update pre-commit hook to: 1. Run format (auto-fixes formatting issues) 2. Stage formatted files (git add -u) 3. Run CI checks This prevents commits from being blocked by formatting issues - files are automatically formatted and staged before checks run. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 8e92f4b commit a42fa51

File tree

3 files changed

+45
-178
lines changed

3 files changed

+45
-178
lines changed

.husky/pre-commit

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
#!/usr/bin/env sh
22
. "$(dirname -- "$0")/_/husky.sh"
33

4-
yarn lint && yarn typecheck && yarn test
4+
# Auto-format files before commit
5+
devbox run format
6+
7+
# Stage any formatting changes
8+
git add -u
9+
10+
# Run all CI checks (matches .github/workflows/ci.yml)
11+
# Uses devbox to ensure exact same environment as CI
12+
devbox run check

devbox.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@
2323
"scripts": {
2424
"ci:install": ["yarn install --immutable"],
2525
"ci:commitlint": ["bash -c 'echo \"$PR_TITLE\" | yarn commitlint'"],
26+
"check": [
27+
"devbox run lint",
28+
"devbox run format-check",
29+
"devbox run build",
30+
"devbox run typecheck",
31+
"devbox run test"
32+
],
2633
"build": ["yarn build"],
2734
"test": ["yarn test"],
2835
"typecheck": ["yarn typecheck"],

devbox.lock

Lines changed: 29 additions & 177 deletions
Original file line numberDiff line numberDiff line change
@@ -33,83 +33,6 @@
3333
"last_modified": "2026-01-27T15:18:14Z",
3434
"resolved": "github:NixOS/nixpkgs/afce96367b2e37fc29afb5543573cd49db3357b7?lastModified=1769527094"
3535
},
36-
"gradle@latest": {
37-
"last_modified": "2025-12-31T03:27:36Z",
38-
"plugin_version": "0.0.1",
39-
"resolved": "github:NixOS/nixpkgs/f665af0cdb70ed27e1bd8f9fdfecaf451260fc55#gradle",
40-
"source": "devbox-search",
41-
"version": "8.14.3",
42-
"systems": {
43-
"aarch64-darwin": {
44-
"outputs": [
45-
{
46-
"name": "out",
47-
"path": "/nix/store/v2xbkgrvn0b4g4qq7j5x60va0d4gf0kw-gradle-8.14.3",
48-
"default": true
49-
}
50-
],
51-
"store_path": "/nix/store/v2xbkgrvn0b4g4qq7j5x60va0d4gf0kw-gradle-8.14.3"
52-
},
53-
"aarch64-linux": {
54-
"outputs": [
55-
{
56-
"name": "out",
57-
"path": "/nix/store/mvs8d5c60yyx3sxpppg1r67yjvlrrhhh-gradle-8.14.3",
58-
"default": true
59-
}
60-
],
61-
"store_path": "/nix/store/mvs8d5c60yyx3sxpppg1r67yjvlrrhhh-gradle-8.14.3"
62-
},
63-
"x86_64-darwin": {
64-
"outputs": [
65-
{
66-
"name": "out",
67-
"path": "/nix/store/jy3fpkvcymjaglzi9z2gbpzcyqypgfxh-gradle-8.14.3",
68-
"default": true
69-
}
70-
],
71-
"store_path": "/nix/store/jy3fpkvcymjaglzi9z2gbpzcyqypgfxh-gradle-8.14.3"
72-
},
73-
"x86_64-linux": {
74-
"outputs": [
75-
{
76-
"name": "out",
77-
"path": "/nix/store/80fgl9ffaxlxl9s4i1jb37krcljx669g-gradle-8.14.3",
78-
"default": true
79-
}
80-
],
81-
"store_path": "/nix/store/80fgl9ffaxlxl9s4i1jb37krcljx669g-gradle-8.14.3"
82-
}
83-
}
84-
},
85-
"jdk17@latest": {
86-
"last_modified": "2025-10-22T20:59:19Z",
87-
"resolved": "github:NixOS/nixpkgs/01b6809f7f9d1183a2b3e081f0a1e6f8f415cb09#jdk17",
88-
"source": "devbox-search",
89-
"version": "17.0.12",
90-
"systems": {
91-
"aarch64-darwin": {
92-
"outputs": [
93-
{
94-
"name": "out",
95-
"path": "/nix/store/hlm8a8cnp4hm8xkg0a2yy4kv7cq44jii-zulu-ca-jdk-17.0.12",
96-
"default": true
97-
}
98-
],
99-
"store_path": "/nix/store/hlm8a8cnp4hm8xkg0a2yy4kv7cq44jii-zulu-ca-jdk-17.0.12"
100-
},
101-
"x86_64-darwin": {
102-
"outputs": [
103-
{
104-
"name": "out",
105-
"path": "/nix/store/i4zgq9685y6284hbf5a7ac9ysb88dvlz-zulu-ca-jdk-17.0.12",
106-
"default": true
107-
}
108-
],
109-
"store_path": "/nix/store/i4zgq9685y6284hbf5a7ac9ysb88dvlz-zulu-ca-jdk-17.0.12"
110-
}
111-
}
112-
},
11336
"jq@latest": {
11437
"last_modified": "2026-01-12T00:44:08Z",
11538
"resolved": "github:NixOS/nixpkgs/3fbab70c6e69c87ea2b6e48aa6629da2aa6a23b0#jq",
@@ -226,171 +149,100 @@
226149
}
227150
}
228151
},
229-
"netcat@latest": {
230-
"last_modified": "2026-01-20T02:11:35Z",
231-
"resolved": "github:NixOS/nixpkgs/ed142ab1b3a092c4d149245d0c4126a5d7ea00b0#netcat",
152+
"nixfmt@latest": {
153+
"last_modified": "2026-01-09T13:41:53Z",
154+
"resolved": "github:NixOS/nixpkgs/5f02c91314c8ba4afe83b256b023756412218535#nixfmt",
232155
"source": "devbox-search",
233-
"version": "4.2.1",
156+
"version": "1.2.0",
234157
"systems": {
235158
"aarch64-darwin": {
236159
"outputs": [
237-
{
238-
"name": "nc",
239-
"path": "/nix/store/y2i4f3bwmgpxw4m6dl99dz9d7zp5axz2-libressl-4.2.1-nc",
240-
"default": true
241-
},
242-
{
243-
"name": "bin",
244-
"path": "/nix/store/ycvwxl29jb6ajjzgkq2jgy1nqpahq5k4-libressl-4.2.1-bin",
245-
"default": true
246-
},
247-
{
248-
"name": "man",
249-
"path": "/nix/store/2b61bckfnaiw3n5ppjg70avgd9rn60bp-libressl-4.2.1-man",
250-
"default": true
251-
},
252160
{
253161
"name": "out",
254-
"path": "/nix/store/fm6zdqw6856i2snd4fikcsi9d1qagj5j-libressl-4.2.1"
255-
},
256-
{
257-
"name": "dev",
258-
"path": "/nix/store/bz5h2baa7bkpz8sgjc9ld8fr7cg5wapg-libressl-4.2.1-dev"
162+
"path": "/nix/store/4jzq73b6bax62245z5a5ag8xdazfw4fg-nixfmt-1.2.0",
163+
"default": true
259164
}
260165
],
261-
"store_path": "/nix/store/y2i4f3bwmgpxw4m6dl99dz9d7zp5axz2-libressl-4.2.1-nc"
166+
"store_path": "/nix/store/4jzq73b6bax62245z5a5ag8xdazfw4fg-nixfmt-1.2.0"
262167
},
263168
"aarch64-linux": {
264169
"outputs": [
265-
{
266-
"name": "nc",
267-
"path": "/nix/store/0dzxkwilv9lgd7j0429s2rmshy7p8gw7-libressl-4.2.1-nc",
268-
"default": true
269-
},
270-
{
271-
"name": "bin",
272-
"path": "/nix/store/5ama6wp3yi03hbixdcm5jy2ya9ikvzjz-libressl-4.2.1-bin",
273-
"default": true
274-
},
275-
{
276-
"name": "man",
277-
"path": "/nix/store/vr4wlcvj5ba6wdmhj2aidalzqk33lrph-libressl-4.2.1-man",
278-
"default": true
279-
},
280-
{
281-
"name": "dev",
282-
"path": "/nix/store/hs5c0yvhf7n60xijr7bmpi592n45pb6i-libressl-4.2.1-dev"
283-
},
284170
{
285171
"name": "out",
286-
"path": "/nix/store/fiy9987ph2kqr5drlr136w7hvm3v6rvg-libressl-4.2.1"
172+
"path": "/nix/store/as7f2yrlqgv130vdiw2xi7rhlgd1yk8v-nixfmt-1.2.0",
173+
"default": true
287174
}
288175
],
289-
"store_path": "/nix/store/0dzxkwilv9lgd7j0429s2rmshy7p8gw7-libressl-4.2.1-nc"
176+
"store_path": "/nix/store/as7f2yrlqgv130vdiw2xi7rhlgd1yk8v-nixfmt-1.2.0"
290177
},
291178
"x86_64-darwin": {
292179
"outputs": [
293-
{
294-
"name": "nc",
295-
"path": "/nix/store/vmrm6nr9hfhw7x8ln3ms98gszq709bfa-libressl-4.2.1-nc",
296-
"default": true
297-
},
298-
{
299-
"name": "bin",
300-
"path": "/nix/store/7kafgvpwc6s8pnzar90bd8017wc3cnvx-libressl-4.2.1-bin",
301-
"default": true
302-
},
303-
{
304-
"name": "man",
305-
"path": "/nix/store/jwdgv2x1a2a84v2jkj964xvm2s0kymps-libressl-4.2.1-man",
306-
"default": true
307-
},
308-
{
309-
"name": "dev",
310-
"path": "/nix/store/sjiz0iphbc7dvddlrbrk8k7kkqi3swz3-libressl-4.2.1-dev"
311-
},
312180
{
313181
"name": "out",
314-
"path": "/nix/store/rn10w2jbdkz3f7p1q1fl6aml9b0352ki-libressl-4.2.1"
182+
"path": "/nix/store/qmas80hmzqbm7n5h9is2im9gjzxsl04a-nixfmt-1.2.0",
183+
"default": true
315184
}
316185
],
317-
"store_path": "/nix/store/vmrm6nr9hfhw7x8ln3ms98gszq709bfa-libressl-4.2.1-nc"
186+
"store_path": "/nix/store/qmas80hmzqbm7n5h9is2im9gjzxsl04a-nixfmt-1.2.0"
318187
},
319188
"x86_64-linux": {
320189
"outputs": [
321-
{
322-
"name": "nc",
323-
"path": "/nix/store/54hijwy3gpc728s3468rv3sdw78ksakh-libressl-4.2.1-nc",
324-
"default": true
325-
},
326-
{
327-
"name": "bin",
328-
"path": "/nix/store/l5vvbs0vl734mshifahals0054pimlx4-libressl-4.2.1-bin",
329-
"default": true
330-
},
331-
{
332-
"name": "man",
333-
"path": "/nix/store/j26qyc85gk95bk06dq0fi0c9q8y7livx-libressl-4.2.1-man",
334-
"default": true
335-
},
336190
{
337191
"name": "out",
338-
"path": "/nix/store/4f21prki98shrvp29r88pnxhzw2y4qr2-libressl-4.2.1"
339-
},
340-
{
341-
"name": "dev",
342-
"path": "/nix/store/0dndzgjzx25y7v1942c2rys20narddp8-libressl-4.2.1-dev"
192+
"path": "/nix/store/yx338k689yp9hpnl6h5y22f7vbmi5pky-nixfmt-1.2.0",
193+
"default": true
343194
}
344195
],
345-
"store_path": "/nix/store/54hijwy3gpc728s3468rv3sdw78ksakh-libressl-4.2.1-nc"
196+
"store_path": "/nix/store/yx338k689yp9hpnl6h5y22f7vbmi5pky-nixfmt-1.2.0"
346197
}
347198
}
348199
},
349-
"nixfmt@latest": {
350-
"last_modified": "2026-01-09T13:41:53Z",
351-
"resolved": "github:NixOS/nixpkgs/5f02c91314c8ba4afe83b256b023756412218535#nixfmt",
200+
"nodejs@22": {
201+
"last_modified": "2026-03-27T11:17:38Z",
202+
"plugin_version": "0.0.2",
203+
"resolved": "github:NixOS/nixpkgs/832efc09b4caf6b4569fbf9dc01bec3082a00611#nodejs_22",
352204
"source": "devbox-search",
353-
"version": "1.2.0",
205+
"version": "22.22.2",
354206
"systems": {
355207
"aarch64-darwin": {
356208
"outputs": [
357209
{
358210
"name": "out",
359-
"path": "/nix/store/4jzq73b6bax62245z5a5ag8xdazfw4fg-nixfmt-1.2.0",
211+
"path": "/nix/store/jp1j44w4fvrxvx62fasairgwv80iw6x3-nodejs-22.22.2",
360212
"default": true
361213
}
362214
],
363-
"store_path": "/nix/store/4jzq73b6bax62245z5a5ag8xdazfw4fg-nixfmt-1.2.0"
215+
"store_path": "/nix/store/jp1j44w4fvrxvx62fasairgwv80iw6x3-nodejs-22.22.2"
364216
},
365217
"aarch64-linux": {
366218
"outputs": [
367219
{
368220
"name": "out",
369-
"path": "/nix/store/as7f2yrlqgv130vdiw2xi7rhlgd1yk8v-nixfmt-1.2.0",
221+
"path": "/nix/store/8h77mdsa9py3x9xxx2yak50fl6kqf2ma-nodejs-22.22.2",
370222
"default": true
371223
}
372224
],
373-
"store_path": "/nix/store/as7f2yrlqgv130vdiw2xi7rhlgd1yk8v-nixfmt-1.2.0"
225+
"store_path": "/nix/store/8h77mdsa9py3x9xxx2yak50fl6kqf2ma-nodejs-22.22.2"
374226
},
375227
"x86_64-darwin": {
376228
"outputs": [
377229
{
378230
"name": "out",
379-
"path": "/nix/store/qmas80hmzqbm7n5h9is2im9gjzxsl04a-nixfmt-1.2.0",
231+
"path": "/nix/store/xn66x7bs1winnfa4pakr9lrjamb9bmj3-nodejs-22.22.2",
380232
"default": true
381233
}
382234
],
383-
"store_path": "/nix/store/qmas80hmzqbm7n5h9is2im9gjzxsl04a-nixfmt-1.2.0"
235+
"store_path": "/nix/store/xn66x7bs1winnfa4pakr9lrjamb9bmj3-nodejs-22.22.2"
384236
},
385237
"x86_64-linux": {
386238
"outputs": [
387239
{
388240
"name": "out",
389-
"path": "/nix/store/yx338k689yp9hpnl6h5y22f7vbmi5pky-nixfmt-1.2.0",
241+
"path": "/nix/store/h2barca1k5pmvcyl9fwrzwrb4cn1b248-nodejs-22.22.2",
390242
"default": true
391243
}
392244
],
393-
"store_path": "/nix/store/yx338k689yp9hpnl6h5y22f7vbmi5pky-nixfmt-1.2.0"
245+
"store_path": "/nix/store/h2barca1k5pmvcyl9fwrzwrb4cn1b248-nodejs-22.22.2"
394246
}
395247
}
396248
},

0 commit comments

Comments
 (0)