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