From 8a7bdd7be05f08ce00e12a3abea2ef24358c5cd0 Mon Sep 17 00:00:00 2001 From: Rene Zander Date: Wed, 3 Jun 2026 09:02:51 +0000 Subject: [PATCH] chore(hooks): rebuild dist before pre-commit tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The pre-commit hook ran test:fast, which skips the build step, so tests ran against a stale dist/ — green-or-red on code that wasn't being committed (e.g. a stale templates command after #18-#20). The comment already claimed "build first" but nothing did. Switch to `npm test`, which rebuilds dist/ first. Co-Authored-By: Claude Opus 4.8 (1M context) --- .husky/pre-commit | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index 12ac598..831d2bd 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,7 +1,7 @@ #!/usr/bin/env sh # Pre-commit gate: # 1. lint-staged — biome check/format on staged files only -# 2. fast unit tests — node:test against the built CLI +# 2. unit tests — node:test against a freshly built CLI # # Skip with `git commit --no-verify` only when truly necessary; the gate is # cheap (lint=<1s, tests<10s on a clean tree) so the bypass should be rare. @@ -11,5 +11,7 @@ set -e # 1. Lint + format staged files npx --no-install lint-staged -# 2. Fast unit tests. Build first so dist/ matches src/. -npm run test:fast --silent 2>&1 | tail -20 +# 2. Unit tests. `npm test` rebuilds dist/ first so it matches src/ — without +# the rebuild, test:fast runs against a stale build and can pass-or-fail on +# code that isn't what's being committed. +npm test --silent 2>&1 | tail -20