Skip to content

build(Deps): 升级 TypeScript 6.0.3 并迁移 tsconfig 模块解析策略(Closes #57) - #67

Merged
ThreeFish-AI merged 2 commits into
feature/1.x.xfrom
ThreeFish-AI/ts6-migration
Jul 4, 2026
Merged

build(Deps): 升级 TypeScript 6.0.3 并迁移 tsconfig 模块解析策略(Closes #57)#67
ThreeFish-AI merged 2 commits into
feature/1.x.xfrom
ThreeFish-AI/ts6-migration

Conversation

@ThreeFish-AI

Copy link
Copy Markdown
Owner

背景

承接 #57bump typescript from 5.9.3 to 6.0.3,原 Dependabot PR 因锁文件漂移 CONFLICTING)。TS 6 主版本跨越非平凡:在 #66 的验证中发现 TS 6 有两处真实阻断,故单开本 PR 做真正的迁移。

TS 6 阻断点(已逐项解决)

  1. moduleResolution: \"node\"(node10)由告警升为硬错 TS5107(将在 TS 7 移除)—— 迁移至 moduleResolution: \"bundler\"
  2. bundler 解析下不再自动纳入 @types/node 全局 —— setTimeout/clearTimeout/AbortSignal/URL/path/os/process/NodeJS 等一律 TS2591/TS2304。按报错提示显式声明 types: [\"node\"] 恢复。

改动清单

  • `package.json`:`typescript ^5.9.2 → ^6.0.3`
  • `tsconfig.json`:
    • `module: commonjs → esnext`
    • `moduleResolution: node → bundler`
    • 显式 `types: ["node"]`
  • `pnpm-lock.yaml`:重生(typescript 升级)

无源码改动。 `esbuild.js` 的 `format: 'cjs'` 硬编码保证 VS Code 扩展仍输出 CJS——`module` 仅影响 `tsc --noEmit` 类型检查,不影响构建产物。

验证(CI 同款四闸门,本地实测)

闸门 命令 结果
类型检查 `pnpm run check-types`(`tsc --noEmit`)
Lint `pnpm run lint`(`eslint`)
生产构建 `pnpm run package`
单测 `pnpm run test:unit`(`vitest run`) ✅ 34 文件 / 349 用例全绿

已合并最新 `feature/1.x.x`(含 #65 Graph 视图新代码),#65 新增的 `commit-detail-panel.ts`、`format-time.ts` 等在 TS 6 + 新 tsconfig 下编译通过。

合入顺序建议

本 PR 与 #66(vitest/vite/typescript-eslint 整合)都改 `pnpm-lock.yaml`。建议 先合 #66,再合本 PR;若 #66 先合入,本 PR 的锁文件会再次漂移,合并前需 `pnpm install` 重生(届时我可补一次)。

关联

Closes #57
#56#59 已由 #66 收编关闭)

- typescript ^5.9.2 → ^6.0.3:TS 6 把 moduleResolution=node10("node")由告警升为硬错 TS5107(将在 TS 7 移除);且 bundler 解析下不再自动纳入 @types/node 全局
- tsconfig 迁移(tsc 仅做 --noEmit 类型检查,产物 CJS 由 esbuild 固定 format:'cjs' 输出,不受 module 变更影响):
  - module commonjs → esnext
  - moduleResolution node → bundler(现代 bundler 场景推荐,弃用 node10)
  - 显式 types:["node"]:恢复 @types/node 全局(setTimeout/clearTimeout/AbortSignal/URL/path/os/process/NodeJS 等);@types/vscode 经 import 消费,不受 types 限制
- 本地 CI 同款四闸门全绿:check-types / lint / package / test:unit(332/332)
- 无源码改动;esbuild.js 的 format:'cjs' 硬编码保证 VS Code 扩展仍输出 CJS

Closes #57。

🤖 Generated with [Claude Code](https://github.com/claude), [CodeX](https://openai.com), [Gemini](https://github.com/apps/gemini-code-assist)
Co-Authored-By: Aurelius Huang<threefish.ai@gmail.com>
@ThreeFish-AI
ThreeFish-AI merged commit 6938a74 into feature/1.x.x Jul 4, 2026
5 checks passed
ThreeFish-AI added a commit that referenced this pull request Jul 4, 2026
冲突消解(package.json 取并集,pnpm-lock.yaml 由 pnpm@11.9.0 重生):
- typescript ^6.0.3(承自 #67)
- typescript-eslint ^8.62.1(承自 #66)
- vite ^7.0.0(承自 #66)
- vitest ^4.1.9(承自 #66)

合并后为首次 vitest4 + TS6 同框组合,已本地复跑 CI 同款四闸门全绿:
check-types / lint / package / test:unit(34 文件 / 349 用例)。

🤖 Generated with [Claude Code](https://github.com/claude), [CodeX](https://openai.com), [Gemini](https://github.com/apps/gemini-code-assist)
Co-Authored-By: Aurelius Huang<threefish.ai@gmail.com>
ThreeFish-AI added a commit that referenced this pull request Jul 4, 2026
… tsconfig 迁移);

冲突解决(3 处均取 HEAD——hover tooltip 是用户最新决定方向,feature 上 #65 squash 带的是已撤回的 WebviewPanel 版本):
- log-webview.ts:保留 HEAD 光标跟随 hover tooltip + log/commitDetail 回包;丢弃 feature 的 WebviewPanel 方案。
- format-time.ts / log-format-time.test.ts:保留 HEAD 全拼(minutes/hours)+ 去秒;丢弃 feature 的缩写(min/hr)+ 带秒。
- commit-detail-panel.ts:HEAD 已删(撤回 WebviewPanel),feature 重新引入→再次删除。

feature 净并入:package.json/pnpm-lock.yaml(vitest 4 / vite 7 / typescript-eslint 8.62.1 / TS 6.0.3)、
tsconfig.json(#67 模块解析迁移)。

验证:TS 6 / vitest 4 / vite 7 新基线下 check-types/lint/生产打包/349 单测/vsce package 全通过。
@ThreeFish-AI
ThreeFish-AI deleted the ThreeFish-AI/ts6-migration branch July 4, 2026 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant