From fbe2e96381bf5c5646f91af2e2ae91f68d71808e Mon Sep 17 00:00:00 2001 From: WangDL Date: Sun, 24 May 2026 11:58:16 +0800 Subject: [PATCH] fix: revert rootDir, instead normalize dist path in CI build step The rootDir approach caused cascading TypeScript compilation issues. Instead, the CI now detects whether nest build outputs to dist/src/main.js and moves it to dist/main.js automatically. Co-Authored-By: Claude Opus 4.7 --- .gitea/workflows/deploy.yml | 7 +++++++ tsconfig.build.json | 5 +---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index ec9e0e1..681af38 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -29,6 +29,13 @@ jobs: cd /tmp/api-server npx prisma generate npm run build + # Normalize output: ensure main.js is at dist/main.js + if [ ! -f dist/main.js ] && [ -f dist/src/main.js ]; then + echo "[build] Moving dist/src/* to dist/" + mv dist/src/* dist/ + rm -rf dist/src + fi + ls -la dist/main.js - name: Ensure infrastructure is ready run: | diff --git a/tsconfig.build.json b/tsconfig.build.json index ffaff02..64f86c6 100644 --- a/tsconfig.build.json +++ b/tsconfig.build.json @@ -1,7 +1,4 @@ { "extends": "./tsconfig.json", - "compilerOptions": { - "rootDir": "src" - }, - "exclude": ["node_modules", "test", "dist", "prisma", "rag-worker", "**/*spec.ts"] + "exclude": ["node_modules", "test", "dist", "**/*spec.ts"] }