Skip to content

Commit dc87b88

Browse files
authored
chore: upgrade to typescript 6 (#4310)
## Summary Upgrades the workspace to TypeScript 6.0.3 and applies the compiler, type, and build configuration changes required to preserve package layouts and existing runtime behavior, apart from correcting the HTTP status field used for deployment connection errors. ## Compatibility - Centralizes TypeScript 6.0.3 through the pnpm workspace catalog. - Replaces compiler options and module resolution modes that TypeScript 6 no longer accepts. - Restores explicit Node types where TypeScript 6 no longer includes them transitively. - Adds explicit declaration build roots that preserve each package's existing output layout. - Patches tsup to stop injecting the removed `baseUrl` option during declaration builds. - Uses type-only assertions for stricter typed-array and stream definitions without changing runtime behavior. - Reads the EventSource v3 HTTP status from `code`, so deployment connection errors include it correctly. - Keeps standalone CLI compatibility fixtures pinned to their existing TypeScript version and lockfiles. `turbo run typecheck` and the complete PR test suite are green.
1 parent cbec613 commit dc87b88

63 files changed

Lines changed: 356 additions & 242 deletions

Some content is hidden

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

.configs/tsconfig.base.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
"esModuleInterop": true,
2727
"emitDecoratorMetadata": false,
2828
"experimentalDecorators": false,
29-
"downlevelIteration": true,
3029
"isolatedModules": true,
3130
"noUncheckedIndexedAccess": true,
3231

apps/webapp/app/routes/otel.v1.logs.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ export async function action({ request }: ActionFunctionArgs) {
2121
await exporter.exportLogsRaw(new Uint8Array(buffer));
2222

2323
return new Response(
24-
ExportLogsServiceResponse.encode(ExportLogsServiceResponse.create()).finish(),
24+
ExportLogsServiceResponse.encode(
25+
ExportLogsServiceResponse.create()
26+
).finish() as Uint8Array<ArrayBuffer>,
2527
{ status: 200 }
2628
);
2729
}
@@ -30,9 +32,12 @@ export async function action({ request }: ActionFunctionArgs) {
3032

3133
const exportResponse = await exporter.exportLogs(exportRequest);
3234

33-
return new Response(ExportLogsServiceResponse.encode(exportResponse).finish(), {
34-
status: 200,
35-
});
35+
return new Response(
36+
ExportLogsServiceResponse.encode(exportResponse).finish() as Uint8Array<ArrayBuffer>,
37+
{
38+
status: 200,
39+
}
40+
);
3641
} else {
3742
return new Response(
3843
"Unsupported content type. Must be either application/x-protobuf or application/json",

apps/webapp/app/routes/otel.v1.metrics.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ export async function action({ request }: ActionFunctionArgs) {
2525
await exporter.exportMetricsRaw(new Uint8Array(buffer));
2626

2727
return new Response(
28-
ExportMetricsServiceResponse.encode(ExportMetricsServiceResponse.create()).finish(),
28+
ExportMetricsServiceResponse.encode(
29+
ExportMetricsServiceResponse.create()
30+
).finish() as Uint8Array<ArrayBuffer>,
2931
{ status: 200 }
3032
);
3133
}
@@ -34,9 +36,12 @@ export async function action({ request }: ActionFunctionArgs) {
3436

3537
const exportResponse = await exporter.exportMetrics(exportRequest);
3638

37-
return new Response(ExportMetricsServiceResponse.encode(exportResponse).finish(), {
38-
status: 200,
39-
});
39+
return new Response(
40+
ExportMetricsServiceResponse.encode(exportResponse).finish() as Uint8Array<ArrayBuffer>,
41+
{
42+
status: 200,
43+
}
44+
);
4045
} else {
4146
return new Response(
4247
"Unsupported content type. Must be either application/x-protobuf or application/json",

apps/webapp/app/routes/otel.v1.traces.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ export async function action({ request }: ActionFunctionArgs) {
2121
await exporter.exportTracesRaw(new Uint8Array(buffer));
2222

2323
return new Response(
24-
ExportTraceServiceResponse.encode(ExportTraceServiceResponse.create()).finish(),
24+
ExportTraceServiceResponse.encode(
25+
ExportTraceServiceResponse.create()
26+
).finish() as Uint8Array<ArrayBuffer>,
2527
{ status: 200 }
2628
);
2729
}
@@ -30,9 +32,12 @@ export async function action({ request }: ActionFunctionArgs) {
3032

3133
const exportResponse = await exporter.exportTraces(exportRequest);
3234

33-
return new Response(ExportTraceServiceResponse.encode(exportResponse).finish(), {
34-
status: 200,
35-
});
35+
return new Response(
36+
ExportTraceServiceResponse.encode(exportResponse).finish() as Uint8Array<ArrayBuffer>,
37+
{
38+
status: 200,
39+
}
40+
);
3641
} else {
3742
return new Response(
3843
"Unsupported content type. Must be either application/x-protobuf or application/json",

apps/webapp/app/services/realtime/redisRealtimeStreams.server.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,9 @@ export class RedisRealtimeStreams implements StreamIngestor, StreamResponder {
321321
let currentChunkIndex = startChunk;
322322

323323
try {
324-
const textStream = stream.pipeThrough(new TextDecoderStream());
324+
const textStream = stream.pipeThrough(
325+
new TextDecoderStream() as ReadableWritablePair<string, Uint8Array>
326+
);
325327
const reader = textStream.getReader();
326328

327329
while (true) {

apps/webapp/tsconfig.check.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010
},
1111
"customConditions": []
1212
},
13-
"exclude": ["**/*.test.ts", "**/*.test.tsx"]
13+
"exclude": ["**/*.test.ts", "**/*.test.tsx", "test/setup-test-env.ts"]
1414
}

apps/webapp/tsconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
"skipLibCheck": true,
1818
"experimentalDecorators": true,
1919
"emitDecoratorMetadata": true,
20-
"baseUrl": ".",
2120
"paths": {
2221
"~/*": ["./app/*"],
2322
"@/*": ["./*"]

internal-packages/cache/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"moduleResolution": "Node16",
77
"moduleDetection": "force",
88
"verbatimModuleSyntax": false,
9-
"types": ["vitest/globals"],
9+
"types": ["vitest/globals", "node"],
1010
"esModuleInterop": true,
1111
"forceConsistentCasingInFileNames": true,
1212
"isolatedModules": true,

internal-packages/clickhouse/tsconfig.build.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
"include": ["src/**/*.ts"],
33
"exclude": ["src/**/*.test.ts"],
44
"compilerOptions": {
5+
"types": ["node"],
6+
"rootDir": ".",
57
"composite": true,
68
"target": "ES2019",
79
"lib": ["ES2019", "DOM", "DOM.Iterable", "DOM.AsyncIterable"],

internal-packages/clickhouse/tsconfig.test.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"moduleResolution": "Node16",
1010
"moduleDetection": "force",
1111
"verbatimModuleSyntax": false,
12-
"types": ["vitest/globals"],
12+
"types": ["vitest/globals", "node"],
1313
"esModuleInterop": true,
1414
"forceConsistentCasingInFileNames": true,
1515
"isolatedModules": true,

0 commit comments

Comments
 (0)