Skip to content

fix: 收敛 tsc7 双轨入口(审查 d9cf0d2) - #58

Merged
Tanya7z merged 1 commit into
mainfrom
cursor/bc-9b549302-f908-497b-a2ea-1c66b6b5b861-642e
Jul 23, 2026
Merged

fix: 收敛 tsc7 双轨入口(审查 d9cf0d2)#58
Tanya7z merged 1 commit into
mainfrom
cursor/bc-9b549302-f908-497b-a2ea-1c66b6b5b861-642e

Conversation

@cursor

@cursor cursor Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

背景

main@61b921b 合入 d9cf0d2(TypeScript 6/7 双轨 + tools/tsc7.mjs)。ootb 已绿(run 30025918061)。本 PR 收敛审查中可验证的 SOLID 债。

审查(DRY / OCP / DIP / LSP / Demeter)

级别 原则 问题
MAJOR DRY / LSP package-lock 已声明 tsc7 bin,但 tools/package.json 未声明 — 权威源不一致;npm install 会按 package.json 回写 lock
MAJOR DRY / DIP esbuild-transpile / SDK build.mjsnpx tsc,与 typecheck 入口分叉;依赖 .bin/tsc 链接胜出
MAJOR OCP typecheck 写死 7 个 -p 路径 — 新增 workspace 需改根脚本
MAJOR DRY / LSP new-module 脚手架仍 tsc --noEmit,与已装模块 tsc7 契约不一致
MINOR DRY 各包用不同相对路径 node ../tools/tsc7.mjs vs ../../../
MINOR LSP tsc7.mjs.bin 符号链接调用时若用 href 比入口会空跑(本 PR 用 realpath)

改动

  1. tools/package.json 声明 tsc7 bin;tsc7.mjs 导出 runTsc7 / resolveNativeTsc,主入口用 realpath(兼容 symlink)
  2. scripts/esbuild-transpile.mjs@sfmc-sdk/build.mjs 改调 runTsc7(唯一 emit 权威)
  3. 各包 typecheck/build:types 统一 tsc7 …;根脚本改为 npm run typecheck --workspaces --if-present
  4. new-module.mjs 脚手架对齐 tsc7

验证

  • npm run build --workspaces --if-present
  • npm run typecheck(全 workspace)
  • npm run test -w @sfmc-bds/bds-tools / db-server

未改

Open in Web View Automation 

d9cf0d2 引入 TS6/TS7 双轨后,tools/package.json 未声明 tsc7 bin、
emit 路径仍 npx tsc、根 typecheck 写死包列表、脚手架仍用裸 tsc。
统一经 tools/tsc7.mjs(runTsc7 + realpath 主入口)与 bin tsc7。

Co-authored-by: Shiroha <Tanya7z@users.noreply.github.com>
@Tanya7z
Tanya7z marked this pull request as ready for review July 23, 2026 17:05
@cursor

cursor Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor Author

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@Tanya7z
Tanya7z merged commit 8bfff2c into main Jul 23, 2026
1 check passed
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.

2 participants