From 2b72d94a2454e139026bb26f2822535a004cb375 Mon Sep 17 00:00:00 2001 From: WangDL Date: Sun, 24 May 2026 11:52:27 +0800 Subject: [PATCH] fix: set rootDir to src in tsconfig.build.json for consistent output The NestJS build was outputting to dist/src/main.js instead of dist/main.js due to TypeScript's automatic rootDir calculation. Explicit rootDir: "src" ensures the output is always at dist/main.js. Also remove the test-run debugging step from CI. Co-Authored-By: Claude Opus 4.7 --- .gitea/workflows/deploy.yml | 5 ----- tsconfig.build.json | 3 +++ 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 2194a82..ec9e0e1 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -79,11 +79,6 @@ jobs: run: | cd /opt/zhixi/backend && npx prisma generate - - name: Test-run API to capture startup errors - run: | - cd /opt/zhixi/backend - timeout 5 node dist/main.js 2>&1 || true - - name: Restart API service run: | sudo systemctl restart zhixi-api diff --git a/tsconfig.build.json b/tsconfig.build.json index 64f86c6..f56a05c 100644 --- a/tsconfig.build.json +++ b/tsconfig.build.json @@ -1,4 +1,7 @@ { "extends": "./tsconfig.json", + "compilerOptions": { + "rootDir": "src" + }, "exclude": ["node_modules", "test", "dist", "**/*spec.ts"] }