From ddb64e6eeabcc2368ca2c18279530a72a13ccaf9 Mon Sep 17 00:00:00 2001 From: Graham Langford Date: Mon, 3 Aug 2026 11:53:35 -0500 Subject: [PATCH] Bump typescript from 5.9.3 to 6.0.3 Supersedes #424, which bumped straight to TypeScript 7.0.2. That cannot land yet: typescript-eslint has no TS 7 support and is blocked upstream until the native Go compiler ships a public API (typescript-eslint/typescript-eslint#10940), so `npm run lint` crashes in ts-api-utils. TypeScript 6 is the last JS-based compiler and sits inside typescript-eslint's `<6.1.0` peer range. TypeScript 6 turns several tsconfig options into deprecation errors and drops automatic `@types` inclusion, so the config needs three changes: - `baseUrl` is deprecated and removed in 7.0; `rootDir` replaces it and has to be explicit once `baseUrl` is gone - `paths` values must be relative in 7.0 - `types: ["chrome"]` restores the `chrome` globals, which 5.9 picked up by scanning all of node_modules/@types Also refreshes @types/node 24.0.8 -> 26.1.2 in the lockfile. 24.0.8 declares `URLPattern` incompatibly with TypeScript 6's lib.dom.d.ts, which this project sees because it sets `skipLibCheck: false`. @types/tape already requests `@types/node: "*"`, so no direct dependency is needed. The emitted `distribution/` is byte-identical to the 5.9.3 output across all 108 files, so the published API is unchanged. Co-Authored-By: Claude Opus 5 (1M context) --- package-lock.json | 26 ++++++++++++++------------ package.json | 2 +- tsconfig.json | 8 +++++--- 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4ca05a0..661dde7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -29,7 +29,7 @@ "process": "^0.11.10", "stream-browserify": "^3.0.0", "tape": "^5.10.2", - "typescript": "^5.9.3", + "typescript": "^6.0.3", "vitest": "^4.1.10" } }, @@ -3519,12 +3519,13 @@ "dev": true }, "node_modules/@types/node": { - "version": "24.0.8", - "resolved": "https://registry.npmjs.org/@types/node/-/node-24.0.8.tgz", - "integrity": "sha512-WytNrFSgWO/esSH9NbpWUfTMGQwCGIKfCmNlmFDNiI5gGhgMmEA+V1AEvKLeBNvvtBnailJtkrEa2OIISwrVAA==", + "version": "26.1.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-26.1.2.tgz", + "integrity": "sha512-Vu4a5UFA9rIIFJ7rB/Vaafh9lrCQszopTCx6KjFboXTGQbPNasehVR5TEiithSDGyd1DEiUByggTZsg8jukeIg==", "dev": true, + "license": "MIT", "dependencies": { - "undici-types": "~7.8.0" + "undici-types": "~8.3.0" } }, "node_modules/@types/normalize-package-data": { @@ -10675,9 +10676,9 @@ } }, "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.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-6.0.3.tgz", + "integrity": "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==", "dev": true, "license": "Apache-2.0", "bin": { @@ -10708,10 +10709,11 @@ } }, "node_modules/undici-types": { - "version": "7.8.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.8.0.tgz", - "integrity": "sha512-9UJ2xGDvQ43tYyVMpuHlsgApydB8ZKfVYTsLDhXkFL/6gfkp+U8xTGdh8pMJv1SpZna0zxG1DwsKZsreLbXBxw==", - "dev": true + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.3.0.tgz", + "integrity": "sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ==", + "dev": true, + "license": "MIT" }, "node_modules/update-browserslist-db": { "version": "1.1.3", diff --git a/package.json b/package.json index 3c3d771..0de69cf 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,7 @@ "process": "^0.11.10", "stream-browserify": "^3.0.0", "tape": "^5.10.2", - "typescript": "^5.9.3", + "typescript": "^6.0.3", "vitest": "^4.1.10" }, "targets": { diff --git a/tsconfig.json b/tsconfig.json index ad75558..41387f1 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,12 +3,14 @@ "include": ["source/**/*"], "compilerOptions": { "esModuleInterop": true, - "baseUrl": ".", + "rootDir": "./source", "outDir": "distribution", "skipLibCheck": false, + // TypeScript 6 no longer auto-includes every node_modules/@types package + "types": ["chrome"], "paths": { - "webext-messenger/*": ["source/*"], - "webext-messenger": ["source/index.ts"] + "webext-messenger/*": ["./source/*"], + "webext-messenger": ["./source/index.ts"] } } }