From fa27df87f6891529e5969cf7d710c1d95baffd2a Mon Sep 17 00:00:00 2001 From: Ethan Date: Wed, 22 Apr 2026 17:29:14 -0700 Subject: [PATCH] fix: unbreak docker compose build after husky devDep MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit atomicmemory-core PR #33 added husky as a devDep with a \`"prepare": "husky"\` lifecycle script. That broke \`docker compose build app\`: Dockerfile runs \`npm ci --omit=dev\`, npm still invokes the prepare script, husky isn't installed (devDep was omitted), and the build fails with exit code 127. The image on disk has been 40 hours stale — nobody could rebuild it after #33 merged. Two-line fix: - package.json: \`"prepare": "husky || true"\` — husky still installs the hooks during local \`pnpm install\`, and silently skips when it's missing (Docker, CI, --omit=dev installs). - Dockerfile: \`RUN HUSKY=0 npm ci ...\` as belt-and-suspenders, skipping hook init even if husky ever ends up in the production install tree. Caught while rebuilding core to verify the Add Context regression test in Atomicmem-webapp PR #22. Without this the running container was 40 hours old (pre-snake-case-wire-flip) and returned camelCase response bodies that the rebuilt SDK no longer translated. Co-Authored-By: Claude Opus 4.7 (1M context) --- Dockerfile | 4 +++- package.json | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index d152d68..116ea1e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,7 +11,9 @@ COPY package.json package-lock.json ./ # npm's softer peer resolution by default; `npm ci` on node:22-slim is # strict, so opt into legacy resolution here until openai publishes a # zod@4-compatible release. -RUN npm ci --omit=dev --legacy-peer-deps +# HUSKY=0: the `prepare` script runs `husky`, which is a devDep omitted +# here. Husky v9 respects this env var and skips silently. +RUN HUSKY=0 npm ci --omit=dev --legacy-peer-deps # Copy application source COPY src/ ./src/ diff --git a/package.json b/package.json index badbf17..54cb3ff 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,7 @@ "test:docker-smoke": "./scripts/docker-smoke-test.sh", "migrate": "dotenv -e .env -- tsx src/db/migrate.ts", "migrate:test": "dotenv -e .env.test -- tsx src/db/migrate.ts", - "prepare": "husky" + "prepare": "husky || true" }, "dependencies": { "@anthropic-ai/sdk": "^0.80.0",