From 95694057ecef593fa96170e97f5de50ee9272282 Mon Sep 17 00:00:00 2001 From: chengww Date: Mon, 18 May 2026 00:01:19 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20typecheck=20=E5=89=8D=E5=85=88=E8=B7=91?= =?UTF-8?q?=20build=20=E8=AE=A9=20unplugin=20=E7=94=9F=E6=88=90=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=20import=20d.ts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit tsconfig.web.json 的 compilerOptions.types 显式 require src/renderer/{auto-imports,components}.d.ts,这两个文件由 unplugin-auto-import / unplugin-vue-components 在 vite 启动时生成, 且被 .gitignore 排除(58922dc 维护者主动设置)。 CI 直接跑 typecheck 拿不到 d.ts 会报 TS2688,导致所有 PR 都过不了 Code Quality job。在 Type check 步骤前插入一次 npm run build 触发 unplugin 生成 d.ts,同时顺带验证 build 链路(一次到位,不增加额外 专用脚本,CI 多 30-60s 但能拦下 build 阶段的回归)。 本地验证:删除两个 d.ts 后跑 npm run build 重新生成,typecheck 通过。 --- .github/workflows/pr-check.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index a60f0f5..cc82c98 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -64,6 +64,13 @@ jobs: - name: Lint run: npx eslint --max-warnings 0 "src/**/*.{ts,tsx,vue,js}" + # tsconfig.web.json 显式 require src/renderer/{auto-imports,components}.d.ts + # 这两个文件由 unplugin-auto-import / unplugin-vue-components 在 vite 启动时 + # 生成,且被 .gitignore 排除(58922dc 维护者主动设置)。CI 直接跑 typecheck + # 拿不到 d.ts 会报 TS2688,先跑一次 build 触发 unplugin 生成 + - name: Build (generates auto-import / components d.ts) + run: npm run build + - name: Type check run: npm run typecheck