Skip to content

chore: migrate type-check from tsc to tsgo across all workspaces#35488

Merged
lyzno1 merged 2 commits intomainfrom
chore/migrate-type-check-to-tsgo
Apr 22, 2026
Merged

chore: migrate type-check from tsc to tsgo across all workspaces#35488
lyzno1 merged 2 commits intomainfrom
chore/migrate-type-check-to-tsgo

Conversation

@lyzno1
Copy link
Copy Markdown
Member

@lyzno1 lyzno1 commented Apr 22, 2026

Summary

Switch every workspace's type-check script from tsc to tsgo (the TypeScript 7.0 beta native compiler from @typescript/native-preview), and drop the transitional type-check:tsgo alias.

On the web workspace alone, pnpm type-check goes from ~54s to ~6s. Running all five workspaces via pnpm type-check (i.e. vp run -r type-check) now finishes in ~7s total.

What changed

  • Replace tsc with tsgo in web / e2e / sdks/nodejs-client / packages/dify-ui / packages/migrate-no-unchecked-indexed-access package.json scripts
  • Switch the migrate codemod's runtime subprocess (pnpm exec tsc ...pnpm exec tsgo ...) — all required flags (--noEmit, --pretty, --incremental, --tsBuildInfoFile, --project) are supported by tsgo
  • Add @typescript/native-preview to every workspace that runs tsgo so the binary resolves without relying on hoisting
  • Pin @typescript-eslint/eslint-plugin to 8.59.0 so it matches the already-bumped @typescript-eslint/parser@8.59.0 (they are released in lockstep, eslint-plugin@8.59.0 has peerDependencies["@typescript-eslint/parser"]: ^8.59.0)
  • Add explicit include / exclude to packages/dify-ui/tsconfig.json so tsgo does not scan the generated storybook-static/ JS artifacts (TS 7 is stricter about JSDoc/Closure-style JS than TS 6)
  • Drop stale pnpm type-check:tsgo references in AGENTS.md, .agents/skills/**, web/docs/lint.md, web/scripts/refactor-component.js and packages/dify-ui/README.md

The typescript package itself stays as devDep: typescript-eslint, tsslint, knip, Next, vite-plus, and the migrate codemod all import the TS 6 programmatic API at runtime (stable TS 7 programmatic API is planned for 7.1).

Test plan

  • pnpm install --frozen-lockfile — clean
  • pnpm type-check — all 5 workspaces pass, 0 errors, ~7s total
  • pnpm --filter dify-web exec eslint app/layout.tsx — 0 errors (typescript-eslint 8.59.0 / 8.59.0 aligned)
  • pnpm --filter dify-client exec eslint src/index.ts — 0 errors
  • CI: Web type check step (vp run type-check in .github/workflows/style.yml)

Made with Cursor

Switch every workspace's `type-check` script to `tsgo` (TypeScript 7.0
beta native compiler), removing the transitional `type-check:tsgo`
alias. On the web workspace this takes type-check from ~54s to ~6s;
running all five workspaces in parallel now finishes in ~7s total.

- Replace `tsc` with `tsgo` in web / e2e / sdks / dify-ui / migrate
  package.json scripts, and in the migrate codemod's runtime subprocess
  invocation (all required flags --noEmit / --pretty / --incremental /
  --tsBuildInfoFile / --project are supported by tsgo)
- Add `@typescript/native-preview` to each workspace that runs tsgo so
  the binary resolves without relying on hoisting
- Pin `@typescript-eslint/eslint-plugin` to 8.59.0 to match the already
  bumped `parser` (both are released in lockstep)
- Add explicit `include`/`exclude` to packages/dify-ui/tsconfig.json so
  tsgo does not scan the generated `storybook-static/` JS artifacts
- Drop stale `pnpm type-check:tsgo` references in docs, agent skills,
  and refactor-component.js output

The `typescript` package itself stays as devDep because typescript-eslint,
tsslint, knip, next, vite-plus and the migrate codemod still import the
TS 6 programmatic API at runtime (TS 7 stable API lands in 7.1).

Made-with: Cursor
@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Apr 22, 2026
@github-actions github-actions Bot added the web This relates to changes on the web. label Apr 22, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.54%. Comparing base (712e522) to head (54cc76d).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #35488      +/-   ##
==========================================
- Coverage   85.54%   85.54%   -0.01%     
==========================================
  Files        4438     4438              
  Lines      207244   207244              
  Branches    38623    38623              
==========================================
- Hits       177284   177283       -1     
- Misses      26850    26851       +1     
  Partials     3110     3110              
Flag Coverage Δ
dify-ui 93.01% <ø> (ø)
web 86.43% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@lyzno1 lyzno1 enabled auto-merge April 22, 2026 08:24
Keep the scope of this PR limited to the tsc → tsgo migration by
reverting unrelated dependency bumps that snuck in: security-override
target bumps for brace-expansion / canvas / dompurify / rollup /
solid-js / undici, and react-i18next 16.5.8 → 16.6.6. The vite-plus
override entries are left as-is.

Made-with: Cursor
@lyzno1 lyzno1 added this pull request to the merge queue Apr 22, 2026
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Apr 22, 2026
Merged via the queue into main with commit ba924fc Apr 22, 2026
35 checks passed
@lyzno1 lyzno1 deleted the chore/migrate-type-check-to-tsgo branch April 22, 2026 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer size:S This PR changes 10-29 lines, ignoring generated files. web This relates to changes on the web.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants