Skip to content

Commit 17e4fee

Browse files
lyzno1fatelei
authored andcommitted
chore: migrate type-check from tsc to tsgo across all workspaces (#35488)
1 parent 2dc080c commit 17e4fee

15 files changed

Lines changed: 1304 additions & 1058 deletions

File tree

.agents/skills/component-refactoring/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ For each extraction:
367367
┌────────────────────────────────────────┐
368368
1. Extract code
369369
2. Run: pnpm lint:fix
370-
3. Run: pnpm type-check:tsgo
370+
3. Run: pnpm type-check
371371
4. Run: pnpm test
372372
5. Test functionality manually
373373
6. PASS?Next extraction

.agents/skills/frontend-testing/references/checklist.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ For the current file being tested:
127127
- [ ] Run full directory test: `pnpm test path/to/directory/`
128128
- [ ] Check coverage report: `pnpm test:coverage`
129129
- [ ] Run `pnpm lint:fix` on all test files
130-
- [ ] Run `pnpm type-check:tsgo`
130+
- [ ] Run `pnpm type-check`
131131

132132
## Common Issues to Watch
133133

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ The codebase is split into:
3030
## Language Style
3131

3232
- **Python**: Keep type hints on functions and attributes, and implement relevant special methods (e.g., `__repr__`, `__str__`). Prefer `TypedDict` over `dict` or `Mapping` for type safety and better code documentation.
33-
- **TypeScript**: Use the strict config, rely on ESLint (`pnpm lint:fix` preferred) plus `pnpm type-check:tsgo`, and avoid `any` types.
33+
- **TypeScript**: Use the strict config, rely on ESLint (`pnpm lint:fix` preferred) plus `pnpm type-check`, and avoid `any` types.
3434

3535
## General Practices
3636

e2e/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@
1212
"e2e:middleware:down": "tsx ./scripts/setup.ts middleware-down",
1313
"e2e:middleware:up": "tsx ./scripts/setup.ts middleware-up",
1414
"e2e:reset": "tsx ./scripts/setup.ts reset",
15-
"type-check": "tsc"
15+
"type-check": "tsgo"
1616
},
1717
"devDependencies": {
1818
"@cucumber/cucumber": "catalog:",
1919
"@dify/tsconfig": "workspace:*",
2020
"@playwright/test": "catalog:",
2121
"@types/node": "catalog:",
22+
"@typescript/native-preview": "catalog:",
2223
"tsx": "catalog:",
2324
"typescript": "catalog:",
2425
"vite": "catalog:",

packages/dify-ui/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ See `[web/docs/overlay-migration.md](../../web/docs/overlay-migration.md)` for t
8888

8989
- `pnpm -C packages/dify-ui test` — Vitest unit tests for primitives.
9090
- `pnpm -C packages/dify-ui storybook` — Storybook on the default port. Each primitive has `index.stories.tsx`.
91-
- `pnpm -C packages/dify-ui type-check``tsc --noEmit` for this package only.
91+
- `pnpm -C packages/dify-ui type-check``tsgo --noEmit` for this package only.
9292

9393
See `[AGENTS.md](./AGENTS.md)` for:
9494

packages/dify-ui/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
"storybook:build": "storybook build",
8484
"test": "vp test",
8585
"test:watch": "vp test --watch",
86-
"type-check": "tsc"
86+
"type-check": "tsgo"
8787
},
8888
"peerDependencies": {
8989
"@base-ui/react": "catalog:",
@@ -109,6 +109,7 @@
109109
"@tailwindcss/vite": "catalog:",
110110
"@types/react": "catalog:",
111111
"@types/react-dom": "catalog:",
112+
"@typescript/native-preview": "catalog:",
112113
"@vitejs/plugin-react": "catalog:",
113114
"@vitest/coverage-v8": "catalog:",
114115
"class-variance-authority": "catalog:",

packages/dify-ui/tsconfig.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,7 @@
22
"extends": "@dify/tsconfig/react.json",
33
"compilerOptions": {
44
"types": ["vite-plus/test/globals"]
5-
}
5+
},
6+
"include": ["src/**/*.ts", "src/**/*.tsx", "vite.config.ts", "tailwind.config.ts"],
7+
"exclude": ["node_modules", "dist", "storybook-static", "coverage"]
68
}

packages/migrate-no-unchecked-indexed-access/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88
},
99
"scripts": {
1010
"build": "vp pack",
11-
"type-check": "tsc"
11+
"type-check": "tsgo"
1212
},
1313
"dependencies": {
14+
"@typescript/native-preview": "catalog:",
1415
"typescript": "catalog:"
1516
},
1617
"devDependencies": {

packages/migrate-no-unchecked-indexed-access/src/no-unchecked-indexed-access/run.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,17 +117,17 @@ async function runTypeCheck(
117117

118118
await fs.mkdir(TYPECHECK_CACHE_DIR, { recursive: true })
119119

120-
const tscArgs = ['exec', 'tsc', '--noEmit', '--pretty', 'false']
120+
const tsgoArgs = ['exec', 'tsgo', '--noEmit', '--pretty', 'false']
121121
if (incremental) {
122-
tscArgs.push('--incremental', '--tsBuildInfoFile', buildInfoPath)
122+
tsgoArgs.push('--incremental', '--tsBuildInfoFile', buildInfoPath)
123123
}
124124
else {
125-
tscArgs.push('--incremental', 'false')
125+
tsgoArgs.push('--incremental', 'false')
126126
}
127-
tscArgs.push('--project', projectPath)
127+
tsgoArgs.push('--project', projectPath)
128128

129129
try {
130-
const { stdout, stderr } = await execFileAsync('pnpm', tscArgs, {
130+
const { stdout, stderr } = await execFileAsync('pnpm', tsgoArgs, {
131131
cwd: projectDirectory,
132132
env: {
133133
...process.env,

0 commit comments

Comments
 (0)