mirror of
https://github.com/algerkong/AlgerMusicPlayer.git
synced 2026-07-06 17:07:29 +08:00
ci: typecheck 前先跑 build 让 unplugin 生成自动 import d.ts
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 通过。
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user