Skip to content

Commit 170ec7f

Browse files
authored
chore(tooling): upgrade to TypeScript 7 and tsdown 0.23 (#6061)
Upgrade the workspace checker to stable TypeScript 7.0.2 and tsdown 0.23. Remove the framework-bundled ts-node dependency and use Oxc for CLI development and the legacy ESM fallback. Plain JavaScript ESM apps receive no TypeScript loader; applications can still install and select a compiler with --tscompiler. The default native utoo TypeScript catalog is TS7 and workspace scripts use plain tsc. Only the root and egg-bin SWC compatibility tests opt into the separate compiler-api TS5 catalog. Egg 4 templates and the HTTP benchmark declare TS7 directly. Delete the obsolete pnpm workspace configuration. An installed-toolchain guard checks the actual tsc version from each workspace's bin paths. Validate real utoo tarballs through strict publint using isolated package copies and published manifests. Include declaration compatibility fixes, packaging regressions, ESM compiler initialization coverage, and compiler tests that resolve the supported package metadata instead of TS7's unexported bin subpath. The compiler resolution test helper is shared following CodeRabbit's review. ### Validation on final commit 69324e8 - GitHub Actions CI succeeded: typecheck, lint/format/build/package validation, Linux Node 22/24/26 tests, macOS Node 24 tests, Windows Node 24 tests, egg-bin/egg-scripts/tegg-vitest matrices, and coverage aggregation. - cnpmcore, cnpmcore snapshot, and examples E2E all succeeded. - CodeQL, Codecov project/patch, Socket checks and CodeRabbit follow-up succeeded. Copilot could not review because its requested-review quota was exhausted. - Local focused compiler regressions, both Redis TypeScript fixture builds, and all workspace typechecks passed. Snyk and FOSSA still report third-party scan errors; their linked detailed reports are inaccessible here. Site deployment checks are outside this PR's requested validation scope. Re-run the 02 stable-release rehearsal after integrating 07. No merge or release is included. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * TypeScript 7 is now the default for type checking across the framework and its examples. Legacy compiler API use remains supported through a separate TypeScript 5 compatibility path. * TypeScript applications can use Oxc for runtime registration, while explicitly selected custom compilers remain supported. * Public packages are checked for publishing issues during builds. * **Bug Fixes** * Improved TypeScript compiler selection for application startup and package checks. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent a4f7410 commit 170ec7f

137 files changed

Lines changed: 843 additions & 497 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.utoo.toml‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"@types/type-is" = "^1.6.6"
5858
"@types/urijs" = "^1.19.25"
5959
"@types/vary" = "^1.1.3"
60-
"@typescript/native-preview" = "7.0.0-dev.20260117.1"
60+
"@typescript/native" = "npm:typescript@^7.0.2"
6161
"@utoo/pack" = "^1.4.16"
6262
"@vitest/coverage-v8" = "^5.0.1"
6363
"@vitest/ui" = "^5.0.1"
@@ -172,7 +172,7 @@
172172
"oxc-minify" = "^0.105.0"
173173
"oxfmt" = "^0.70.0"
174174
"oxlint" = "^1.60.0"
175-
"oxlint-tsgolint" = "^0.18.1"
175+
"oxlint-tsgolint" = "^7.0.2003"
176176
"parseurl" = "^1.3.3"
177177
"path-to-regexp" = "^6.3.0"
178178
"performance-ms" = "^1.1.0"
@@ -197,14 +197,13 @@
197197
"stream-wormhole" = "^2.0.1"
198198
"superagent" = "^10.0.0"
199199
"terminal-link" = "^5.0.0"
200-
"ts-node" = "^10.9.2"
201200
"tsconfig-paths" = "^4.2.0"
202-
"tsdown" = "^0.18.2"
201+
"tsdown" = "^0.23.0"
203202
"tsx" = "4.23.15"
204203
"type-fest" = "^5.0.1"
205204
"type-is" = "^2.0.0"
206205
"typebox" = "^1.0.65"
207-
"typescript" = "^5.9.3"
206+
"typescript" = "^7.0.2"
208207
"unplugin-unused" = "^0.5.4"
209208
"urijs" = "^1.19.11"
210209
"urllib" = "^4.8.2"
@@ -220,3 +219,7 @@
220219

221220
[catalogs."path-to-regexp1"]
222221
"path-to-regexp" = "^1.9.0"
222+
223+
# Legacy compiler API required by the SWC compatibility tests, not the checker.
224+
[catalogs.compiler-api]
225+
"typescript" = "^5.9.3"

‎examples/helloworld-service-worker/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"start": "node --import=@oxc-node/core/register main.ts",
99
"bundle:cf": "egg-bin bundle --framework @eggjs/service-worker --entry worker.ts -o .worker-cf --root ../..",
1010
"test": "vitest run",
11-
"typecheck": "tsgo --noEmit"
11+
"typecheck": "tsc --noEmit"
1212
},
1313
"dependencies": {
1414
"@eggjs/service-worker": "workspace:*",

‎examples/helloworld-tegg/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"prepublishOnly": "pnpm run build",
4545
"start": "egg-scripts start --daemon",
4646
"stop": "egg-scripts stop",
47-
"typecheck": "tsgo --noEmit",
47+
"typecheck": "tsc --noEmit",
4848
"build": "tsdown"
4949
},
5050
"dependencies": {

‎examples/helloworld-typescript/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"prepublishOnly": "pnpm run build",
3333
"start": "egg-scripts start --daemon",
3434
"stop": "egg-scripts stop",
35-
"typecheck": "tsgo --noEmit",
35+
"typecheck": "tsc --noEmit",
3636
"build": "tsdown"
3737
},
3838
"dependencies": {

‎package.json‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"type": "module",
1515
"scripts": {
1616
"clean-dist": "ut run clean --workspaces --if-present",
17+
"prebuild": "node --test scripts/test/check-package.test.js",
1718
"build": "tsdown",
1819
"prelint": "ut run clean-dist",
1920
"lint": "oxlint --type-aware --type-check --quiet",
@@ -57,7 +58,7 @@
5758
"@types/js-yaml": "catalog:",
5859
"@types/koa-compose": "catalog:",
5960
"@types/node": "catalog:",
60-
"@typescript/native-preview": "catalog:",
61+
"@typescript/native": "catalog:",
6162
"@vitest/coverage-v8": "catalog:",
6263
"@vitest/ui": "catalog:",
6364
"c8": "catalog:",
@@ -74,7 +75,7 @@
7475
"smol-toml": "catalog:",
7576
"tsdown": "catalog:",
7677
"tsx": "catalog:",
77-
"typescript": "catalog:",
78+
"typescript": "catalog:compiler-api",
7879
"unplugin-unused": "catalog:",
7980
"urllib": "catalog:",
8081
"utoo": "catalog:",

‎packages/cluster/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
},
4545
"scripts": {
4646
"lint": "oxlint",
47-
"typecheck": "tsgo --noEmit",
47+
"typecheck": "tsc --noEmit",
4848
"test": "vitest run"
4949
},
5050
"dependencies": {
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22

33
module.exports = () => {
4-
if (require.extensions['.ts']) {
5-
console.log('### inject ts-node/register at agent');
4+
if (process.env.EGG_TEST_REQUIRE_HOOK === 'true') {
5+
console.log('### inject additional require hook at agent');
66
}
77
};
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22

33
module.exports = () => {
4-
if (require.extensions['.ts']) {
5-
console.log('### inject ts-node/register at app');
4+
if (process.env.EGG_TEST_REQUIRE_HOOK === 'true') {
5+
console.log('### inject additional require hook at app');
66
}
77
};
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
'use strict';
2+
3+
process.env.EGG_TEST_REQUIRE_HOOK = 'true';

‎packages/cluster/test/master/others.test.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ describe.skip('--require', () => {
450450
describe('array', () => {
451451
beforeAll(() => {
452452
app = cluster('apps/options-require', {
453-
require: [getFilepath('apps/options-require/inject.js'), 'ts-node/register'],
453+
require: [getFilepath('apps/options-require/inject.js'), getFilepath('apps/options-require/check.js')],
454454
} as any);
455455
// app.debug();
456456
return app.ready();
@@ -460,8 +460,8 @@ describe.skip('--require', () => {
460460
it('should inject', () => {
461461
app.expect('stdout', /### inject application/);
462462
app.expect('stdout', /### inject agent/);
463-
app.expect('stdout', /### inject ts-node\/register at app/);
464-
app.expect('stdout', /### inject ts-node\/register at agent/);
463+
app.expect('stdout', /### inject additional require hook at app/);
464+
app.expect('stdout', /### inject additional require hook at agent/);
465465
});
466466
});
467467
});

0 commit comments

Comments
 (0)