fix(orchestrator): symlink prisma schema for cross-env generate
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
Create apps/orchestrator/prisma/schema.prisma as a symlink pointing to ../../api/prisma/schema.prisma. This gives the orchestrator 'ownership' of its local schema copy so Prisma does not traverse into the api package looking for project-root context. - CI: symlink resolves in the checked-out monorepo; prisma:generate works - Docker: kaniko COPY follows symlinks, schema file is present after 'COPY apps/orchestrator ./apps/orchestrator'; turbo build triggers prisma:generate and generates the client within orchestrator context Revert prisma:generate script to canonical path (./prisma/schema.prisma). Remove deprecated 'prisma' config key from package.json. Simplify Dockerfile builder stage (no more manual generate RUN).
This commit is contained in:
@@ -21,7 +21,7 @@ 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/
|
||||
# (API prisma schema is copied in builder stage directly into orchestrator/prisma/)
|
||||
# API schema is available via apps/orchestrator/prisma/schema.prisma symlink
|
||||
|
||||
# Copy npm configuration for native binary architecture hints
|
||||
COPY .npmrc ./
|
||||
@@ -47,11 +47,11 @@ 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 into orchestrator's own prisma/ dir.
|
||||
# Running generate from within the orchestrator package avoids cross-package
|
||||
# project-root detection issues (Prisma was looking for package.json in /app/apps/).
|
||||
COPY apps/api/prisma/schema.prisma ./apps/orchestrator/prisma/schema.prisma
|
||||
RUN cd apps/orchestrator && ./node_modules/.bin/prisma generate --schema=./prisma/schema.prisma
|
||||
# apps/orchestrator/prisma/schema.prisma is a symlink → ../../api/prisma/schema.prisma
|
||||
# Docker COPY follows symlinks, so the schema file is already present after
|
||||
# "COPY apps/orchestrator ./apps/orchestrator" above.
|
||||
# pnpm turbo build runs prisma:generate first (which uses --schema=./prisma/schema.prisma)
|
||||
# from within the orchestrator package — no cross-package project-root issues.
|
||||
|
||||
# Build the orchestrator app using TurboRepo
|
||||
RUN pnpm turbo build --filter=@mosaic/orchestrator
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
"dev": "nest start --watch",
|
||||
"lint": "eslint src/",
|
||||
"lint:fix": "eslint src/ --fix",
|
||||
"prisma:generate": "prisma generate --schema=./prisma/schema.prisma",
|
||||
"prisma:generate": "prisma generate --schema=../api/prisma/schema.prisma",
|
||||
"start": "node dist/main.js",
|
||||
"start:debug": "nest start --debug --watch",
|
||||
"start:dev": "nest start --watch",
|
||||
@@ -52,8 +52,5 @@
|
||||
"tsconfig-paths": "^4.2.0",
|
||||
"typescript": "^5.8.2",
|
||||
"vitest": "^4.0.18"
|
||||
},
|
||||
"prisma": {
|
||||
"schema": "prisma/schema.prisma"
|
||||
}
|
||||
}
|
||||
|
||||
1
apps/orchestrator/prisma/schema.prisma
Symbolic link
1
apps/orchestrator/prisma/schema.prisma
Symbolic link
@@ -0,0 +1 @@
|
||||
../../api/prisma/schema.prisma
|
||||
Reference in New Issue
Block a user