From 91e692e3e786b73ad8bab3289f20409a8464f10d Mon Sep 17 00:00:00 2001 From: "shaggy (mosaic-dev box)" Date: Sun, 9 Aug 2026 17:58:13 -0500 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20break-C=20=E2=80=94=20install-hooks?= =?UTF-8?q?=20no-ops=20without=20git;=20web=20image=20builds=20@mosaicstac?= =?UTF-8?q?k/web?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit install-hooks.mjs hard-failed (exit 1) in environments without a git binary — e.g. the docker image builds, which have no git and no repo. Hook installation is meaningless there; skip with a warning instead. docker/web.Dockerfile filtered @mosaic/web, but the package is named @mosaicstack/web, so the image build compiled nothing. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01ESFAnh2t9HmLwng8oW95St --- docker/web.Dockerfile | 2 +- scripts/install-hooks.mjs | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/docker/web.Dockerfile b/docker/web.Dockerfile index 4d92b4f7..5418a692 100644 --- a/docker/web.Dockerfile +++ b/docker/web.Dockerfile @@ -10,7 +10,7 @@ COPY apps/web/package.json ./apps/web/ COPY packages/ ./packages/ RUN pnpm install --frozen-lockfile COPY . . -RUN pnpm --filter @mosaic/web build +RUN pnpm --filter @mosaicstack/web build FROM base AS runner WORKDIR /app diff --git a/scripts/install-hooks.mjs b/scripts/install-hooks.mjs index becf0511..e626bfd4 100644 --- a/scripts/install-hooks.mjs +++ b/scripts/install-hooks.mjs @@ -75,6 +75,16 @@ export async function installHooks({ } = {}) { if (disabled) return; + try { + await execFileAsync('git', ['--version']); + } catch (error) { + if (error.code === 'ENOENT') { + console.warn('git not found; skipping hook installation'); + return; + } + throw error; + } + const huskyDir = path.join(root, '.husky'); const active = path.join(huskyDir, '_'); const nonce = `${Date.now()}-${process.pid}`; -- 2.54.0 From 620cc608e05df1ee8795cd193aca2173e5ad205a Mon Sep 17 00:00:00 2001 From: "shaggy (mosaic-dev box)" Date: Sun, 9 Aug 2026 18:03:18 -0500 Subject: [PATCH 2/2] =?UTF-8?q?fix(docker):=20copy=20scripts/=20into=20web?= =?UTF-8?q?=20builder=20=E2=80=94=20prepare=20runs=20install-hooks.mjs=20o?= =?UTF-8?q?n=20install?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The layer-cached install copies only manifests and packages/, so the root prepare script could not be found and pnpm install exited 1 before the git-absent guard could even run. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01ESFAnh2t9HmLwng8oW95St --- docker/web.Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docker/web.Dockerfile b/docker/web.Dockerfile index 5418a692..8661d367 100644 --- a/docker/web.Dockerfile +++ b/docker/web.Dockerfile @@ -8,6 +8,8 @@ WORKDIR /app COPY pnpm-workspace.yaml pnpm-lock.yaml package.json ./ COPY apps/web/package.json ./apps/web/ COPY packages/ ./packages/ +# the root prepare script runs scripts/install-hooks.mjs on install +COPY scripts/ ./scripts/ RUN pnpm install --frozen-lockfile COPY . . RUN pnpm --filter @mosaicstack/web build -- 2.54.0