From e0e269d8cb9fa828c0590934a6dc269e7529dc40 Mon Sep 17 00:00:00 2001 From: Jason Woltje Date: Fri, 6 Mar 2026 22:45:00 -0600 Subject: [PATCH] fix(orchestrator): add prisma generate to Dockerfile and reflect-metadata to vitest setup Two CI fixes: 1. Orchestrator Dockerfile now copies apps/api/prisma schema and runs prisma generate before build. Fixes TS2305/TS2339 errors (PrismaClient and model properties not found) in docker-build-orchestrator step. 2. Add reflect-metadata to vitest setupFiles. Fixes class-transformer decorator error (Reflect.getMetadata is not a function) in DTO unit tests. --- apps/orchestrator/Dockerfile | 6 ++++++ apps/orchestrator/package.json | 13 +++++++------ apps/orchestrator/vitest.config.ts | 1 + 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/apps/orchestrator/Dockerfile b/apps/orchestrator/Dockerfile index 96fcf31..688dca5 100644 --- a/apps/orchestrator/Dockerfile +++ b/apps/orchestrator/Dockerfile @@ -21,6 +21,8 @@ FROM base AS deps COPY packages/shared/package.json ./packages/shared/ COPY packages/config/package.json ./packages/config/ COPY apps/orchestrator/package.json ./apps/orchestrator/ +# Copy API prisma schema so prisma generate can run in the orchestrator build +COPY apps/api/prisma ./apps/api/prisma # Copy npm configuration for native binary architecture hints COPY .npmrc ./ @@ -46,6 +48,10 @@ COPY --from=deps /app/packages/shared/node_modules ./packages/shared/node_module COPY --from=deps /app/packages/config/node_modules ./packages/config/node_modules COPY --from=deps /app/apps/orchestrator/node_modules ./apps/orchestrator/node_modules +# Copy API prisma schema and generate the Prisma client for the orchestrator +COPY apps/api/prisma ./apps/api/prisma +RUN pnpm --filter=@mosaic/orchestrator prisma:generate + # Build the orchestrator app using TurboRepo RUN pnpm turbo build --filter=@mosaic/orchestrator diff --git a/apps/orchestrator/package.json b/apps/orchestrator/package.json index 80ea663..2036790 100644 --- a/apps/orchestrator/package.json +++ b/apps/orchestrator/package.json @@ -3,19 +3,20 @@ "version": "0.0.20", "private": true, "scripts": { - "dev": "nest start --watch", "build": "nest build", + "dev": "nest start --watch", + "lint": "eslint src/", + "lint:fix": "eslint src/ --fix", + "prisma:generate": "prisma generate --schema=../api/prisma/schema.prisma", "start": "node dist/main.js", - "start:dev": "nest start --watch", "start:debug": "nest start --debug --watch", + "start:dev": "nest start --watch", "start:prod": "node dist/main.js", "test": "vitest", - "test:watch": "vitest watch", "test:e2e": "vitest run --config tests/integration/vitest.config.ts", "test:perf": "vitest run --config tests/performance/vitest.config.ts", - "typecheck": "tsc --noEmit", - "lint": "eslint src/", - "lint:fix": "eslint src/ --fix" + "test:watch": "vitest watch", + "typecheck": "tsc --noEmit" }, "dependencies": { "@anthropic-ai/sdk": "^0.72.1", diff --git a/apps/orchestrator/vitest.config.ts b/apps/orchestrator/vitest.config.ts index 540b74a..b414b2f 100644 --- a/apps/orchestrator/vitest.config.ts +++ b/apps/orchestrator/vitest.config.ts @@ -4,6 +4,7 @@ export default defineConfig({ test: { globals: true, environment: "node", + setupFiles: ["reflect-metadata"], exclude: ["**/node_modules/**", "**/dist/**", "**/tests/integration/**"], include: ["src/**/*.spec.ts", "src/**/*.test.ts"], coverage: {