From 86d64b2b352e1e96c4eaf136910625ec8a721be8 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Mar 2026 12:16:37 +0000 Subject: [PATCH] chore: migrate to TypeScript 6.0 - Update typescript from 5.9.3 to 6.0.2 - Remove deprecated baseUrl option (migrate absolute imports to relative) - Remove esModuleInterop (always enabled in TS 6.0) - Change module from CommonJS to preserve (tsup handles bundling) - Add explicit moduleResolution: bundler (node10 deprecated) - Add explicit types: ["node"] (default changed to []) - Add ignoreDeprecations: "6.0" (needed for tsup's internal baseUrl usage) https://claude.ai/code/session_0168r2kkTqkaA39YaV2XPVac --- package-lock.json | 8 ++++---- package.json | 2 +- src/stream/isStreamCloudEvent.ts | 8 ++++---- src/stream/isStreamError.ts | 2 +- src/stream/isStreamEventType.ts | 4 ++-- src/stream/isStreamSubject.ts | 2 +- tsconfig.json | 9 +++++---- 7 files changed, 18 insertions(+), 17 deletions(-) diff --git a/package-lock.json b/package-lock.json index 797ebba..39cd1a9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,7 +17,7 @@ "get-port": "7.2.0", "tsup": "8.5.1", "tsx": "4.21.0", - "typescript": "5.9.3" + "typescript": "6.0.2" } }, "node_modules/@balena/dockerignore": { @@ -3342,9 +3342,9 @@ "license": "Unlicense" }, "node_modules/typescript": { - "version": "5.9.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", - "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-6.0.2.tgz", + "integrity": "sha512-bGdAIrZ0wiGDo5l8c++HWtbaNCWTS4UTv7RaTH/ThVIgjkveJt83m74bBHMJkuCbslY8ixgLBVZJIOiQlQTjfQ==", "dev": true, "license": "Apache-2.0", "bin": { diff --git a/package.json b/package.json index 7e79b4a..7aaf31c 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "get-port": "7.2.0", "tsup": "8.5.1", "tsx": "4.21.0", - "typescript": "5.9.3" + "typescript": "6.0.2" }, "scripts": { "analyze": "npx tsc --noEmit && npx biome check --error-on-warnings .", diff --git a/src/stream/isStreamCloudEvent.ts b/src/stream/isStreamCloudEvent.ts index b0270a4..599097f 100644 --- a/src/stream/isStreamCloudEvent.ts +++ b/src/stream/isStreamCloudEvent.ts @@ -1,8 +1,8 @@ -import { isRecord } from 'src/types/isRecord.js'; -import { isString } from 'src/types/isString.js'; -import { isStringOrNull } from 'src/types/isStringOrNull.js'; -import { isStringOrUndefined } from 'src/types/isStringOrUndefined.js'; import { hasShapeOf } from '../types/hasShapeOf.js'; +import { isRecord } from '../types/isRecord.js'; +import { isString } from '../types/isString.js'; +import { isStringOrNull } from '../types/isStringOrNull.js'; +import { isStringOrUndefined } from '../types/isStringOrUndefined.js'; import type { StreamCloudEvent } from './StreamCloudEvent.js'; const isStreamCloudEvent = (line: unknown): line is StreamCloudEvent => { diff --git a/src/stream/isStreamError.ts b/src/stream/isStreamError.ts index 46613d0..c2b7092 100644 --- a/src/stream/isStreamError.ts +++ b/src/stream/isStreamError.ts @@ -1,5 +1,5 @@ -import { isString } from 'src/types/isString.js'; import { hasShapeOf } from '../types/hasShapeOf.js'; +import { isString } from '../types/isString.js'; import type { StreamError } from './StreamError.js'; const isStreamError = (line: unknown): line is StreamError => { diff --git a/src/stream/isStreamEventType.ts b/src/stream/isStreamEventType.ts index f2f68b7..eb0a16a 100644 --- a/src/stream/isStreamEventType.ts +++ b/src/stream/isStreamEventType.ts @@ -1,6 +1,6 @@ -import { isBoolean } from 'src/types/isBoolean.js'; -import { isString } from 'src/types/isString.js'; import { hasShapeOf } from '../types/hasShapeOf.js'; +import { isBoolean } from '../types/isBoolean.js'; +import { isString } from '../types/isString.js'; import type { StreamEventType } from './StreamEventType.js'; const isStreamEventType = (line: unknown): line is StreamEventType => { diff --git a/src/stream/isStreamSubject.ts b/src/stream/isStreamSubject.ts index 86e5fbe..048e51f 100644 --- a/src/stream/isStreamSubject.ts +++ b/src/stream/isStreamSubject.ts @@ -1,5 +1,5 @@ -import { isString } from 'src/types/isString.js'; import { hasShapeOf } from '../types/hasShapeOf.js'; +import { isString } from '../types/isString.js'; import type { StreamSubject } from './StreamSubject.js'; const isStreamSubject = (line: unknown): line is StreamSubject => { diff --git a/tsconfig.json b/tsconfig.json index c91503f..7f0e86a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,14 +1,15 @@ { "compilerOptions": { - "baseUrl": ".", + "ignoreDeprecations": "6.0", "declaration": true, - "esModuleInterop": true, "lib": ["ES2023"], - "module": "CommonJS", + "module": "preserve", + "moduleResolution": "bundler", "outDir": "dist", "resolveJsonModule": true, "strict": true, - "target": "ES2023" + "target": "ES2023", + "types": ["node"] }, "include": ["./src/**/*.ts"], "exclude": ["./dist"]