Skip to content

Commit 8df8ab4

Browse files
committed
chore: upgrade to tshy 4 and TypeScript 6
Hoist tshy to a single root devDependency (4.1.2) instead of one per public package, and move the repo from TypeScript 5.5.4 to 6.0.3. Most of the TS6 work was absorbed by bumping @types/node to 20.19.19, which brings the generic Buffer typings TS6 expects and clears the Buffer/Uint8Array assignability errors at the source. The rest: - Replace the deprecated moduleResolution: node and drop downlevelIteration across the internal package configs, and give the database build an explicit rootDir. - Patch tsup so it only passes the deprecated baseUrl when configured, so the tsup-built packages' declaration builds run under TS6. - Declare node types explicitly (types: ["node"] in the shared base config, with the React packages adding react/react-dom, and the clickhouse build config) since TS6 no longer reliably auto-includes them. Also a few genuine type fixes (clickhouse row typing, OTLP response bodies, realtime stream ingest types) and one real bug: the dev CLI read error.status off an eventsource error that only exposes code, so the HTTP status never showed. Verified: full-repo typecheck and build pass under TS6.
1 parent 359e250 commit 8df8ab4

31 files changed

Lines changed: 509 additions & 414 deletions

File tree

.configs/tsconfig.base.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"compilerOptions": {
3+
"types": ["node"],
34
"target": "es2022",
45
"lib": ["ES2022", "DOM", "DOM.Iterable", "DOM.AsyncIterable"],
56
"module": "NodeNext",
@@ -26,7 +27,6 @@
2627
"esModuleInterop": true,
2728
"emitDecoratorMetadata": false,
2829
"experimentalDecorators": false,
29-
"downlevelIteration": true,
3030
"isolatedModules": true,
3131
"noUncheckedIndexedAccess": true,
3232

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export async function action({ request }: ActionFunctionArgs) {
2020

2121
const exportResponse = await exporter.exportLogs(exportRequest);
2222

23-
return new Response(ExportLogsServiceResponse.encode(exportResponse).finish(), {
23+
return new Response(ExportLogsServiceResponse.encode(exportResponse).finish().slice(), {
2424
status: 200,
2525
});
2626
} else {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export async function action({ request }: ActionFunctionArgs) {
2626

2727
const exportResponse = await exporter.exportMetrics(exportRequest);
2828

29-
return new Response(ExportMetricsServiceResponse.encode(exportResponse).finish(), {
29+
return new Response(ExportMetricsServiceResponse.encode(exportResponse).finish().slice(), {
3030
status: 200,
3131
});
3232
} else {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export async function action({ request }: ActionFunctionArgs) {
2020

2121
const exportResponse = await exporter.exportTraces(exportRequest);
2222

23-
return new Response(ExportTraceServiceResponse.encode(exportResponse).finish(), {
23+
return new Response(ExportTraceServiceResponse.encode(exportResponse).finish().slice(), {
2424
status: 200,
2525
});
2626
} else {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ export class RedisRealtimeStreams implements StreamIngestor, StreamResponder {
306306
}
307307

308308
async ingestData(
309-
stream: ReadableStream<Uint8Array>,
309+
stream: ReadableStream<Uint8Array<ArrayBuffer>>,
310310
runId: string,
311311
streamId: string,
312312
clientId: string,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ export class S2RealtimeStreams implements StreamResponder, StreamIngestor {
183183
}
184184

185185
ingestData(
186-
stream: ReadableStream<Uint8Array>,
186+
stream: ReadableStream<Uint8Array<ArrayBuffer>>,
187187
runId: string,
188188
streamId: string,
189189
clientId: string,

apps/webapp/app/services/realtime/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export interface StreamIngestor {
1919
): Promise<{ responseHeaders?: Record<string, string> }>;
2020

2121
ingestData(
22-
stream: ReadableStream<Uint8Array>,
22+
stream: ReadableStream<Uint8Array<ArrayBuffer>>,
2323
runId: string,
2424
streamId: string,
2525
clientId: string,

apps/webapp/test/setup-test-env.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.

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/clickhouse/src/client/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ export class ClickhouseClient implements ClickhouseReader, ClickhouseWriter {
492492
}
493493

494494
for (const row of rows) {
495-
const rowData = row.json();
495+
const rowData = row.json<unknown[]>();
496496

497497
const hydratedRow: Record<string, any> = {};
498498
for (let i = 0; i < req.columns.length; i++) {

0 commit comments

Comments
 (0)