From 7a6da4f18fc32d78420676ee3195a8bab75e643a Mon Sep 17 00:00:00 2001 From: ianshaloom Date: Sun, 8 Mar 2026 03:16:29 +0300 Subject: [PATCH] fix(ci): fix convex missing from prune output and npm version mismatch Two root causes for the Docker build failures: 1. convex/_generated/api not found (both apps) turbo prune only traces npm workspace packages; the root convex/ directory is not a workspace package so it is excluded from out/full/. Copy it manually into the prune output after turbo prune runs. 2. @heroui/react not found (storefront) package-lock.json was generated with npm@11 but node:20-alpine ships npm@10. turbo warns it cannot parse the npm 11 lockfile and generates an incomplete out/package-lock.json, causing npm ci inside Docker to miss packages. Upgrade npm to 11 in the deps stage of both Dockerfiles. Co-Authored-By: Claude Sonnet 4.6 --- .gitea/workflows/deploy-staging.yml | 8 +++++++- apps/admin/Dockerfile | 6 ++++++ apps/storefront/Dockerfile | 6 ++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/deploy-staging.yml b/.gitea/workflows/deploy-staging.yml index f044b97..b55cf31 100644 --- a/.gitea/workflows/deploy-staging.yml +++ b/.gitea/workflows/deploy-staging.yml @@ -77,7 +77,13 @@ jobs: run: npm ci - name: Prune workspace for ${{ matrix.app }} - run: npx turbo prune ${{ matrix.app }} --docker + run: | + npx turbo prune ${{ matrix.app }} --docker + # turbo prune only traces npm workspace packages. The root convex/ directory + # is not a workspace package, so it is excluded from out/full/ — causing + # "Module not found: convex/_generated/api" at build time. + # Copy it manually so the Dockerfile has the generated types it needs. + cp -r convex out/full/convex - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 diff --git a/apps/admin/Dockerfile b/apps/admin/Dockerfile index 5a747e4..8c2545c 100644 --- a/apps/admin/Dockerfile +++ b/apps/admin/Dockerfile @@ -9,6 +9,12 @@ FROM node:20-alpine AS deps RUN apk add --no-cache libc6-compat WORKDIR /app +# Upgrade npm to match the project's packageManager (npm@11). The package-lock.json +# was generated with npm 11 — npm 10 (bundled with node:20) can't fully parse it, +# causing turbo prune to generate an incomplete pruned lockfile and npm ci to miss +# packages. +RUN npm install -g npm@11 --quiet + COPY json/ . COPY package-lock.json . RUN npm ci diff --git a/apps/storefront/Dockerfile b/apps/storefront/Dockerfile index 7e974af..3478c00 100644 --- a/apps/storefront/Dockerfile +++ b/apps/storefront/Dockerfile @@ -12,6 +12,12 @@ FROM node:20-alpine AS deps RUN apk add --no-cache libc6-compat WORKDIR /app +# Upgrade npm to match the project's packageManager (npm@11). The package-lock.json +# was generated with npm 11 — npm 10 (bundled with node:20) can't fully parse it, +# causing turbo prune to generate an incomplete pruned lockfile and npm ci to miss +# packages like @heroui/react. +RUN npm install -g npm@11 --quiet + COPY json/ . COPY package-lock.json . RUN npm ci