diff --git a/app/gateway-api/src/orchestrator/gatewayOrchestrator.ts b/app/gateway-api/src/orchestrator/gatewayOrchestrator.ts index d7e4b3a..316980b 100644 --- a/app/gateway-api/src/orchestrator/gatewayOrchestrator.ts +++ b/app/gateway-api/src/orchestrator/gatewayOrchestrator.ts @@ -327,16 +327,18 @@ export const buildWorkspaceCommands = ( env, }); } - for (const packageName of [ - '@sammo-ts/common', - '@sammo-ts/infra', - '@sammo-ts/logic', - '@sammo-ts/game-api', - '@sammo-ts/game-engine', - ]) { + const buildSteps: Array<[filter: string, script: string]> = [ + ['@sammo-ts/common', 'build'], + ['@sammo-ts/infra', 'prisma:generate'], + ['@sammo-ts/infra', 'build'], + ['@sammo-ts/logic', 'build'], + ['@sammo-ts/game-api', 'build'], + ['@sammo-ts/game-engine', 'build'], + ]; + for (const [filter, script] of buildSteps) { commands.push({ command: 'pnpm', - args: ['--filter', packageName, 'build'], + args: ['--filter', filter, script], cwd: workspaceRoot, env, }); diff --git a/app/gateway-api/test/orchestratorPlan.test.ts b/app/gateway-api/test/orchestratorPlan.test.ts index 4505621..6e893b5 100644 --- a/app/gateway-api/test/orchestratorPlan.test.ts +++ b/app/gateway-api/test/orchestratorPlan.test.ts @@ -103,6 +103,7 @@ describe('buildWorkspaceCommands', () => { expect(commands.map(({ args }) => args)).toEqual([ ['install'], ['--filter', '@sammo-ts/common', 'build'], + ['--filter', '@sammo-ts/infra', 'prisma:generate'], ['--filter', '@sammo-ts/infra', 'build'], ['--filter', '@sammo-ts/logic', 'build'], ['--filter', '@sammo-ts/game-api', 'build'], diff --git a/docs/architecture/runtime.md b/docs/architecture/runtime.md index a524464..56273b1 100644 --- a/docs/architecture/runtime.md +++ b/docs/architecture/runtime.md @@ -87,7 +87,7 @@ Gateway runs a lightweight cron loop (setInterval) that: - Each workspace stores `lastUsedAt` in DB so cleanup can remove stale worktrees. - Cleanup is invoked manually by admin API and removes worktrees unused for 6+ months. - Build runs `pnpm install` when workspace is created, then executes - the common, infra, and logic dependency builds before + the common build, Prisma client generation, and infra/logic dependency builds before `pnpm --filter @sammo-ts/game-api build` and `pnpm --filter @sammo-ts/game-engine build`, then marks build success/failure. - On success, status moves to `PREOPEN` for reserved builds or stays unchanged for manual builds.