From 8e74bc71e9697d3e13756e276716a1c876177f6f Mon Sep 17 00:00:00 2001 From: flym Date: Sat, 12 Sep 2026 01:51:53 +0800 Subject: [PATCH] chore: exclude apps/ from root tsconfig so www builds standalone on server --- docs/production-deployment-2026-09-11.md | 9 +++++++++ tsconfig.json | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/production-deployment-2026-09-11.md b/docs/production-deployment-2026-09-11.md index 9282e49..4977ce4 100644 --- a/docs/production-deployment-2026-09-11.md +++ b/docs/production-deployment-2026-09-11.md @@ -53,3 +53,12 @@ - 新增 4G swap,避免服务器构建 OOM。 - Caddy 增加了访问日志(`log { output stdout }`),便于后续排查。 - 发布:`releases/cms-ad87a71-c`(含本次修复),回滚可指向 `releases/cms-ad87a71-b`(可运行,但根路由登录后 404)。 + +## 追加:www 改为服务器构建 + 发布目录清理 + +- 根 `tsconfig.json` 原先通过 `**/*.ts` 把 `apps/cms/**` 一并纳入类型检查,导致 www 在服务器上构建时报 `Cannot find module 'payload'`(www 发布目录不含 `apps/cms/node_modules`)。已在根 tsconfig `exclude` 中加入 `"apps"`(CMS 使用自身 `apps/cms/tsconfig.json`,不受影响),此后 www 可在服务器独立构建。 +- www 已在服务器重建并切换:`releases/ad87a71-www`(`kaotings-www`)。构建命令需带 `NODE_ENV=production CMS_PUBLIC_API_URL=http://127.0.0.1:3001/cms`(与 systemd 单元一致;`NEXT_PUBLIC_API_BASE_URL` 未设置,按默认 `/api/v1`)。 +- 清理旧发布与备份包(释放约 3G)。当前保留: + - www:`releases/ad87a71-www`(当前,服务器构建);回滚 `releases/ad87a71`(上一版 www,仍可指向使用) + - CMS:`releases/cms-ad87a71-c`(当前,含根路由 404 修复);回滚 `releases/cms-ad87a71-b` + - API:`releases/ad87a71/services/api` diff --git a/tsconfig.json b/tsconfig.json index 9e6036a..9bb16cc 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -37,6 +37,7 @@ ".next/dev/types/**/*.ts" ], "exclude": [ - "node_modules" + "node_modules", + "apps" ] }