Upgrade workspace to TypeScript 6 (#2700)

* Upgrade workspace to TypeScript 6

* Restore Nest baseUrl for SWC builds

* Use empty changeset for TS6 upgrade

* Remove TS6 changeset
This commit is contained in:
Nathan Colosimo
2026-06-29 22:37:38 -07:00
committed by GitHub
parent 654f95911b
commit 692a6ac5dc
28 changed files with 495 additions and 245 deletions
+1 -2
View File
@@ -1,6 +1,5 @@
{
"compilerOptions": {
"baseUrl": ".",
"target": "ESNext",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
@@ -17,7 +16,7 @@
"incremental": true,
"paths": {
"@/*": ["./*"],
"@/.source": [".source"]
"@/.source": ["./.source"]
},
"plugins": [
{
+1
View File
@@ -2,6 +2,7 @@
"extends": "@workflow/tsconfig/base.json",
"compilerOptions": {
"outDir": "dist",
"rootDir": "./src",
"lib": ["dom", "dom.iterable", "esnext"]
},
"include": ["src"],
+1 -1
View File
@@ -2,9 +2,9 @@
"extends": "@workflow/tsconfig/base.json",
"compilerOptions": {
"outDir": "dist",
"rootDir": "./src",
"target": "es2022",
"module": "preserve",
"baseUrl": ".",
"moduleResolution": "bundler"
},
"include": ["src"],
+1
View File
@@ -2,6 +2,7 @@
"extends": "@workflow/tsconfig/base.json",
"compilerOptions": {
"outDir": "dist",
"rootDir": "./src",
"target": "es2022",
"module": "node16",
"moduleResolution": "node16",
+2 -1
View File
@@ -1,7 +1,8 @@
{
"extends": "@workflow/tsconfig/base.json",
"compilerOptions": {
"outDir": "dist"
"outDir": "dist",
"rootDir": "./src"
},
"include": ["src"],
"exclude": ["node_modules", "**/*.test.ts"]
+10 -7
View File
@@ -119,20 +119,23 @@ const compilerOptions: ts.CompilerOptions = {
};
/**
* Modules that we explicitly resolve via `paths` mappings. A TS2307
* ("Cannot find module") error for any of these is a real regression and
* must NOT be silenced.
* Modules that we explicitly resolve via `paths` mappings. Missing-module
* errors for any of these are real regressions and must NOT be silenced.
*/
const RESOLVED_MODULES = new Set(Object.keys(compilerOptions.paths ?? {}));
/**
* Returns true if a TS2307 diagnostic refers to a module we don't expect to
* resolve (relative imports, framework deps, app aliases, etc.).
* Returns true if a missing-module diagnostic refers to a module we don't
* expect to resolve (relative imports, framework deps, app aliases, etc.).
* Returns false for modules in our paths mapping — those failures are real.
*/
function isExpectedMissingModule(diagnostic: ts.Diagnostic): boolean {
const msg = ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n');
const match = msg.match(/Cannot find module '([^']+)'/);
const match =
msg.match(/Cannot find module '([^']+)'/) ??
msg.match(
/Cannot find module or type declarations for side-effect import of '([^']+)'/
);
if (!match) return false;
const mod = match[1];
return !RESOLVED_MODULES.has(mod);
@@ -241,7 +244,7 @@ export function typeCheckBatch(
(d) =>
!IGNORED_ERROR_CODES.has(d.code) &&
!expectedErrorSet.has(d.code) &&
!(d.code === 2307 && isExpectedMissingModule(d))
!([2307, 2882].includes(d.code) && isExpectedMissingModule(d))
);
const diagnostics = relevantDiagnostics.map((d) =>
+1 -1
View File
@@ -392,7 +392,7 @@ export interface RuntimeDecryptionErrorContext {
*/
export class RuntimeDecryptionError extends WorkflowRuntimeError {
/** Optional structured context about the failed encrypt/decrypt call. */
readonly context?: RuntimeDecryptionErrorContext;
declare readonly context?: RuntimeDecryptionErrorContext;
constructor(
message: string,
+2 -1
View File
@@ -1,7 +1,8 @@
{
"extends": "@workflow/tsconfig/base.json",
"compilerOptions": {
"outDir": "dist"
"outDir": "dist",
"rootDir": "./src"
},
"include": ["src"],
"exclude": ["node_modules", "**/*.test.ts"]
+1 -1
View File
@@ -1,4 +1,4 @@
// re-export runtime as stub for resolving to not
// require @workflow/core be a dependency as well as
// @workflow/next
export * from '@workflow/core/dist/runtime';
export * from '@workflow/core/runtime';
+2 -1
View File
@@ -2,9 +2,10 @@
"extends": "@workflow/tsconfig/base.json",
"compilerOptions": {
"outDir": "dist",
"rootDir": "./src",
"target": "es2022",
"module": "commonjs",
"moduleResolution": "node"
"moduleResolution": "bundler"
},
"include": ["src"],
"exclude": ["node_modules", "**/*.test.ts"]
+1 -1
View File
@@ -2,9 +2,9 @@
"extends": "@workflow/tsconfig/base.json",
"compilerOptions": {
"outDir": "dist",
"rootDir": "./src",
"target": "es2022",
"module": "preserve",
"baseUrl": ".",
"moduleResolution": "bundler"
},
"include": ["src"],
+1 -1
View File
@@ -2,9 +2,9 @@
"extends": "@workflow/tsconfig/base.json",
"compilerOptions": {
"outDir": "dist",
"rootDir": "./src",
"target": "es2022",
"module": "preserve",
"baseUrl": ".",
"moduleResolution": "bundler"
},
"include": ["src"],
+2 -1
View File
@@ -1,7 +1,8 @@
{
"extends": "@workflow/tsconfig/base.json",
"compilerOptions": {
"outDir": "dist"
"outDir": "dist",
"rootDir": "./src"
},
"include": ["src"],
"exclude": ["node_modules", "**/*.test.ts"]
+1 -1
View File
@@ -2,9 +2,9 @@
"extends": "@workflow/tsconfig/base.json",
"compilerOptions": {
"outDir": "dist",
"rootDir": "./src",
"target": "es2022",
"module": "preserve",
"baseUrl": ".",
"moduleResolution": "bundler"
},
"include": ["src"],
+2
View File
@@ -16,7 +16,9 @@
"preserveWatchOutput": true,
"skipLibCheck": true,
"module": "node20",
"target": "es2023",
"lib": ["es2022"],
"types": ["*"],
"strict": true
}
}
+2 -2
View File
@@ -4,8 +4,8 @@
"outDir": "./dist",
"rootDir": "./src",
"target": "ES2022",
"module": "commonjs",
"moduleResolution": "node",
"module": "node16",
"moduleResolution": "node16",
"esModuleInterop": true,
"strict": false,
"skipLibCheck": true
+1
View File
@@ -2,6 +2,7 @@
"extends": "@workflow/tsconfig/base.json",
"compilerOptions": {
"outDir": "dist",
"rootDir": "./src",
"target": "es2022",
"lib": ["es2022", "dom", "dom.iterable", "webworker"],
"jsx": "react-jsx",
+1
View File
@@ -0,0 +1 @@
declare module '*.css';
+30 -16
View File
@@ -3,6 +3,8 @@ import { build, type Plugin, type Rollup } from 'vite';
import { describe, expect, test } from 'vitest';
import { nodeRequireBanner } from './vite-plugin-node-require';
const BUILD_TEST_TIMEOUT_MS = 30_000;
// A virtual entry so the build needs no real files on disk. The body is
// irrelevant — we only care about the banner the plugin prepends to the chunk.
function virtualEntry(): Plugin {
@@ -48,22 +50,34 @@ describe('nodeRequireBanner', () => {
// back to a stub with no `http2.connect`, and every HTTP/2 request (the v4
// events API + stream writes) breaks — silently degrading observability
// reads. See vite-plugin-node-require.ts for the full mechanism.
test('injects the global-require shim into the SSR server build', async () => {
// rollup may re-quote / reflow the banner, so assert on its semantic parts
// rather than the exact source string.
const code = await buildChunkCode({ ssr: true, withPlugin: true });
expect(code).toContain('__wkfCreateRequire');
expect(code).toContain('globalThis.require');
expect(code).toMatch(/createRequire[\s\S]*from ['"]node:module['"]/);
});
test(
'injects the global-require shim into the SSR server build',
async () => {
// rollup may re-quote / reflow the banner, so assert on its semantic parts
// rather than the exact source string.
const code = await buildChunkCode({ ssr: true, withPlugin: true });
expect(code).toContain('__wkfCreateRequire');
expect(code).toContain('globalThis.require');
expect(code).toMatch(/createRequire[\s\S]*from ['"]node:module['"]/);
},
BUILD_TEST_TIMEOUT_MS
);
test('does not inject the shim into the client/browser build', async () => {
const code = await buildChunkCode({ ssr: false, withPlugin: true });
expect(code).not.toContain('__wkfCreateRequire');
});
test(
'does not inject the shim into the client/browser build',
async () => {
const code = await buildChunkCode({ ssr: false, withPlugin: true });
expect(code).not.toContain('__wkfCreateRequire');
},
BUILD_TEST_TIMEOUT_MS
);
test('the SSR build has no shim without the plugin (guards the assertion)', async () => {
const code = await buildChunkCode({ ssr: true, withPlugin: false });
expect(code).not.toContain('__wkfCreateRequire');
});
test(
'the SSR build has no shim without the plugin (guards the assertion)',
async () => {
const code = await buildChunkCode({ ssr: true, withPlugin: false });
expect(code).not.toContain('__wkfCreateRequire');
},
BUILD_TEST_TIMEOUT_MS
);
});
+2 -1
View File
@@ -1,7 +1,8 @@
{
"extends": "@workflow/tsconfig/base.json",
"compilerOptions": {
"outDir": "dist"
"outDir": "dist",
"rootDir": "./src"
},
"include": ["src"],
"exclude": ["node_modules", "**/*.test.ts"]
+1
View File
@@ -2,6 +2,7 @@
"extends": "@workflow/tsconfig/base.json",
"compilerOptions": {
"outDir": "dist",
"rootDir": "./src",
"target": "es2022"
},
"include": ["src"],
+2 -1
View File
@@ -2,7 +2,8 @@
"extends": "@workflow/tsconfig/base.json",
"compilerOptions": {
"moduleResolution": "NodeNext",
"outDir": "dist"
"outDir": "dist",
"rootDir": "./src"
},
"include": ["src"],
"exclude": ["node_modules", "**/*.test.ts"]
+1
View File
@@ -5,6 +5,7 @@
"allowJs": true,
"module": "NodeNext",
"outDir": "dist",
"rootDir": ".",
"lib": ["ES2024"]
},
"include": ["src", ".well-known"],
+1
View File
@@ -2,6 +2,7 @@
"extends": "@workflow/tsconfig/base.json",
"compilerOptions": {
"outDir": "dist",
"rootDir": "./src",
"target": "es2022"
},
"include": ["src"],
+2 -1
View File
@@ -1,7 +1,8 @@
{
"extends": "@workflow/tsconfig/base.json",
"compilerOptions": {
"outDir": "dist"
"outDir": "dist",
"rootDir": "./src"
},
"include": ["src"],
"exclude": ["node_modules", "**/*.test.ts"]
+422 -203
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -19,7 +19,7 @@ catalog:
esbuild: ^0.28.1
nitro: ^3.0.260429-beta
semver: 7.7.4
typescript: ^5.9.3
typescript: ^6.0.3
ulid: ~3.0.1
undici: 7.28.0
vitest: ^4.0.18
-1
View File
@@ -16,7 +16,6 @@
"esModuleInterop": true,
"resolveJsonModule": true,
"isolatedModules": true,
"baseUrl": ".",
"paths": {
"@/*": ["./*"],
"@repo/*": ["../../*"]