From 0c57943a1fa2c0cc3be0080ad0324ff9d554e61b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Dec 2026 18:10:36 +0000 Subject: [PATCH 1/4] build(deps-dev): bump typescript from 5.9.3 to 7.0.2 Bumps [typescript](https://github.com/microsoft/TypeScript) from 5.9.3 to 7.0.2. - [Release notes](https://github.com/microsoft/TypeScript/releases) - [Commits](https://github.com/microsoft/TypeScript/compare/v5.9.3...v7.0.2) --- updated-dependencies: - dependency-name: typescript dependency-version: 7.0.2 dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- package.json | 2 +- pnpm-lock.yaml | 213 +++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 208 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 0b28c26..79e9f40 100644 --- a/package.json +++ b/package.json @@ -149,7 +149,7 @@ "prettier": "^3.9.6", "redis": "^6.2.1", "signal-polyfill": "^0.2.2", - "typescript": "^5.9.0", + "typescript": "^7.0.2", "vite": "^8.3.4", "vitest": "^4.1.11", "wrangler": "^4.129.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 59c11c6..afcfcf4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -54,8 +54,8 @@ importers: specifier: ^0.2.2 version: 0.2.3 typescript: - specifier: ^5.9.0 - version: 5.9.3 + specifier: ^7.0.2 + version: 7.0.2 vite: specifier: ^8.3.4 version: 8.3.8(@types/node@24.13.3)(esbuild@0.28.2) @@ -716,6 +716,126 @@ packages: '@types/yargs@17.0.24': resolution: {integrity: sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw==} + '@typescript/typescript-aix-ppc64@7.0.2': + resolution: {integrity: sha512-MTKKkWB7p/0E9xi1d1tHtZ5PiLkGEMIq88pK2CubZjOsLtYTLqhgIgi6zepFa+9GHZ6h05NMCkQxGKiPXMxXtQ==} + engines: {node: '>=16.20.0'} + cpu: [ppc64] + os: [aix] + + '@typescript/typescript-darwin-arm64@7.0.2': + resolution: {integrity: sha512-gowzar9MwS/aRWp6f3a4KUqzRjAZjOsmGNCM6LcTgXum+dBfgsBVMN+AgvOCCbguXyick6LJhpBszxMebJ8syA==} + engines: {node: '>=16.20.0'} + cpu: [arm64] + os: [darwin] + + '@typescript/typescript-darwin-x64@7.0.2': + resolution: {integrity: sha512-SZ9xZInqApNlNGc9s0W1VSsktYSOe9cFqNOIqmN1Gs8SmkjKZYFt017G4VwPxASInODuAdbTW7sXiFUf893RgA==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [darwin] + + '@typescript/typescript-freebsd-arm64@7.0.2': + resolution: {integrity: sha512-W5NH4y/J0plIIS5b2xvTEkU7JFxyqdMAOgf+Ilhl0vHQXKO5dZoxd+C/jEtq56c4F3wk71RB4BMRQ2XdI+bwYQ==} + engines: {node: '>=16.20.0'} + cpu: [arm64] + os: [freebsd] + + '@typescript/typescript-freebsd-x64@7.0.2': + resolution: {integrity: sha512-UMGDx5sTpzNw3WiPebH7l90IWfJggEd+egHt/q6p7/Cm3zqoV7VxkGXt+3DxPIw8CcmvAB0j3sVVfbhX+M4Tpw==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [freebsd] + + '@typescript/typescript-linux-arm64@7.0.2': + resolution: {integrity: sha512-Qh4eU4/y3yDjnfjjyPYihMj5/ODIlmt+Bzu17OI+fiSRDW57QmU5SiN63exPRNJPKUzcc1INa1NXdrJ+MqHjUQ==} + engines: {node: '>=16.20.0'} + cpu: [arm64] + os: [linux] + + '@typescript/typescript-linux-arm@7.0.2': + resolution: {integrity: sha512-gffT3xPz9sR7j/YJExkyPntrI0P2EP9XbOyWzth2/Gs0RstK+90RBcO0ncXoXy/beYll1SXw846Nf2zdnEz0QQ==} + engines: {node: '>=16.20.0'} + cpu: [arm] + os: [linux] + + '@typescript/typescript-linux-loong64@7.0.2': + resolution: {integrity: sha512-uEHck9i8hoAzXPiYRib1O7miOnz23SxIeVl6F4LXox+qov1K35jHcEW6VHKvZI+pyvl7fZEP4MCU5LYvIq1GuQ==} + engines: {node: '>=16.20.0'} + cpu: [loong64] + os: [linux] + + '@typescript/typescript-linux-mips64el@7.0.2': + resolution: {integrity: sha512-R4KvAMnE43W5Qeqb0Ly56O3mWMWIAgsMyz36DCaycd5nbg/9kzm0liw3JocfRqyJY0KPmzFjbswozXyW0DnIYA==} + engines: {node: '>=16.20.0'} + cpu: [mips64el] + os: [linux] + + '@typescript/typescript-linux-ppc64@7.0.2': + resolution: {integrity: sha512-DORx5b3sd/4S7eayxm4FQv+A7CrkUIGRaHiwI8oiHTAI1fAPWhF4J0vAlkC8biAlHSVVwxMQ3tjZ2/DVbnQiiA==} + engines: {node: '>=16.20.0'} + cpu: [ppc64] + os: [linux] + + '@typescript/typescript-linux-riscv64@7.0.2': + resolution: {integrity: sha512-wf0jqEDOjrPRnKwYRyyJDRo11KMbvMFrU+q4zqKyChODBzvlkbhNQfKvLxQCcwTpdDaXSHZTVuh0JoCrKCUMHQ==} + engines: {node: '>=16.20.0'} + cpu: [riscv64] + os: [linux] + + '@typescript/typescript-linux-s390x@7.0.2': + resolution: {integrity: sha512-IkwJc3L7yhytWd/ewjyxNDfOmswCm9GWMJT/ue/dU4aZNbwZeYAetq42VyLmsmSjvoX7z74X6ZaYCtzAr0EuGw==} + engines: {node: '>=16.20.0'} + cpu: [s390x] + os: [linux] + + '@typescript/typescript-linux-x64@7.0.2': + resolution: {integrity: sha512-EYdf2cNg7rgCWJnxCdJ+F3V39O8ihb37eHAu1LK8oAFizgTQbPOK7zHHXbPt8rX24COqODXeI3sIf0fCXG7H/A==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [linux] + + '@typescript/typescript-netbsd-arm64@7.0.2': + resolution: {integrity: sha512-+polYF4MF04aPpO5FTkHran9yUQDSXqy5GiSDKpsll5jy3l3+g9QLhpf39T+ePtefhXLOGrLl0QIjkQP6VnelA==} + engines: {node: '>=16.20.0'} + cpu: [arm64] + os: [netbsd] + + '@typescript/typescript-netbsd-x64@7.0.2': + resolution: {integrity: sha512-8YIT0EHM/3dq10ZOVF/A7pc/YSMtbcecct4rWtexrnSCHOPcpC2KTLXfTCR6vDpnSiY12heNb1GiN/wu+T/FyA==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [netbsd] + + '@typescript/typescript-openbsd-arm64@7.0.2': + resolution: {integrity: sha512-APT8+ClYnuYm1u9+kgGXoMj2VzWzcymwh2gNSQVySHfkRDGOTVkoWLjCmOQSaO+PoqQ57B0flRp9SA+7GnnkzQ==} + engines: {node: '>=16.20.0'} + cpu: [arm64] + os: [openbsd] + + '@typescript/typescript-openbsd-x64@7.0.2': + resolution: {integrity: sha512-yX7s+Q0Dln0Dt9tEzZsAjXXR/+ytBM7AlglaqyeMPxQszJ1JhlJdZ6jLA+IzldHtflX81em7lDao1xXu+aRRkg==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [openbsd] + + '@typescript/typescript-sunos-x64@7.0.2': + resolution: {integrity: sha512-dLJDGaLZ1D4HPQn62u1n8mBDkJREwMsAkCdkwd4Ieqw+x3TUyTsqY0YiBCtE6H6OzzgGk3iuZ3vFWRS+E8/d1g==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [sunos] + + '@typescript/typescript-win32-arm64@7.0.2': + resolution: {integrity: sha512-Gyl1Vy6OsWesLzmq+EP0Fb7b4Nid5232AvcA2SFcdYreldpNtYFFofPjnt62y9hQy7VTaZp65ICJjuAQRaVcIQ==} + engines: {node: '>=16.20.0'} + cpu: [arm64] + os: [win32] + + '@typescript/typescript-win32-x64@7.0.2': + resolution: {integrity: sha512-0BQ3HkAHHlKLSp1qRvf3SUhGpGsDuhB/jgFw75guyqbxJqEaS0Cw/VFO8i2nHglJUzQCRtMMR/IBAKE3ETMC4g==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [win32] + '@vitest/coverage-v8@4.1.11': resolution: {integrity: sha512-8MVGEFnJIcdGjcbfKmeq8z0pZHH0JlVtoVZH9Q/qwUp6wyFnEJUBMrw9DCaj+ra3vShGmhavjalMIhPNxZAUcw==} peerDependencies: @@ -1271,9 +1391,9 @@ packages: tslib@2.9.1: resolution: {integrity: sha512-a4Ux9VKuIMHsOS7ENbEq6hK2ZGYIT27Rtl0E4eD9KqwxhKiQeMZE/9xb3IdYwWaSOyIBQLExhQgXDTYoiCxnWA==} - typescript@5.9.3: - resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==} - engines: {node: '>=14.17'} + typescript@7.0.2: + resolution: {integrity: sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA==} + engines: {node: '>=16.20.0'} hasBin: true undici-types@5.26.5: @@ -1887,6 +2007,66 @@ snapshots: dependencies: '@types/yargs-parser': 21.0.3 + '@typescript/typescript-aix-ppc64@7.0.2': + optional: true + + '@typescript/typescript-darwin-arm64@7.0.2': + optional: true + + '@typescript/typescript-darwin-x64@7.0.2': + optional: true + + '@typescript/typescript-freebsd-arm64@7.0.2': + optional: true + + '@typescript/typescript-freebsd-x64@7.0.2': + optional: true + + '@typescript/typescript-linux-arm64@7.0.2': + optional: true + + '@typescript/typescript-linux-arm@7.0.2': + optional: true + + '@typescript/typescript-linux-loong64@7.0.2': + optional: true + + '@typescript/typescript-linux-mips64el@7.0.2': + optional: true + + '@typescript/typescript-linux-ppc64@7.0.2': + optional: true + + '@typescript/typescript-linux-riscv64@7.0.2': + optional: true + + '@typescript/typescript-linux-s390x@7.0.2': + optional: true + + '@typescript/typescript-linux-x64@7.0.2': + optional: true + + '@typescript/typescript-netbsd-arm64@7.0.2': + optional: true + + '@typescript/typescript-netbsd-x64@7.0.2': + optional: true + + '@typescript/typescript-openbsd-arm64@7.0.2': + optional: true + + '@typescript/typescript-openbsd-x64@7.0.2': + optional: true + + '@typescript/typescript-sunos-x64@7.0.2': + optional: true + + '@typescript/typescript-win32-arm64@7.0.2': + optional: true + + '@typescript/typescript-win32-x64@7.0.2': + optional: true + '@vitest/coverage-v8@4.1.11(vitest@4.1.11)': dependencies: '@bcoe/v8-coverage': 1.0.2 @@ -2444,7 +2624,28 @@ snapshots: tslib@2.9.1: optional: true - typescript@5.9.3: {} + typescript@7.0.2: + optionalDependencies: + '@typescript/typescript-aix-ppc64': 7.0.2 + '@typescript/typescript-darwin-arm64': 7.0.2 + '@typescript/typescript-darwin-x64': 7.0.2 + '@typescript/typescript-freebsd-arm64': 7.0.2 + '@typescript/typescript-freebsd-x64': 7.0.2 + '@typescript/typescript-linux-arm': 7.0.2 + '@typescript/typescript-linux-arm64': 7.0.2 + '@typescript/typescript-linux-loong64': 7.0.2 + '@typescript/typescript-linux-mips64el': 7.0.2 + '@typescript/typescript-linux-ppc64': 7.0.2 + '@typescript/typescript-linux-riscv64': 7.0.2 + '@typescript/typescript-linux-s390x': 7.0.2 + '@typescript/typescript-linux-x64': 7.0.2 + '@typescript/typescript-netbsd-arm64': 7.0.2 + '@typescript/typescript-netbsd-x64': 7.0.2 + '@typescript/typescript-openbsd-arm64': 7.0.2 + '@typescript/typescript-openbsd-x64': 7.0.2 + '@typescript/typescript-sunos-x64': 7.0.2 + '@typescript/typescript-win32-arm64': 7.0.2 + '@typescript/typescript-win32-x64': 7.0.2 undici-types@5.26.5: {} From 667986e19c7f4b0371248f8d78ed6deee0ed1440 Mon Sep 17 00:00:00 2001 From: Lucas Carlson Date: Wed, 2 Dec 2026 12:21:47 -0800 Subject: [PATCH 2/4] fix: use TypeScript 7's unstable API in the source-check scripts TypeScript 7 no longer exports the compiler API from the package root, so the parameter-style and import-graph checks now load source files through typescript/unstable/sync and walk them with typescript/unstable/ast. --- scripts/check-browser-imports.mjs | 73 ++++++++++++++-------------- scripts/check-cloudflare-imports.mjs | 58 ++++++++++++---------- scripts/check-parameter-style.mjs | 33 ++++++------- scripts/typescript-source.mjs | 44 +++++++++++++++++ 4 files changed, 130 insertions(+), 78 deletions(-) create mode 100644 scripts/typescript-source.mjs diff --git a/scripts/check-browser-imports.mjs b/scripts/check-browser-imports.mjs index 3c2a7f0..762ee36 100644 --- a/scripts/check-browser-imports.mjs +++ b/scripts/check-browser-imports.mjs @@ -1,7 +1,12 @@ -import fs from "node:fs" import path from "node:path" import process from "node:process" -import ts from "typescript" +import { + isExportDeclaration, + isImportDeclaration, + isStringLiteral, + SyntaxKind, +} from "typescript/unstable/ast" +import { withTypeScriptSources } from "./typescript-source.mjs" const repositoryRoot = path.resolve(import.meta.dirname, "..") const browserSafeRoots = [ @@ -22,49 +27,45 @@ const browserSafeRoots = [ ] const forbiddenPackages = new Set(["mysql2", "pg", "redis", "ws"]) -const violations = [] -const visited = new Set() -const roots = process.argv.slice(2).length > 0 ? process.argv.slice(2) : browserSafeRoots -for (const root of roots) visit(path.resolve(repositoryRoot, root)) +withTypeScriptSources(({ getSourceFile }) => { + const violations = [] + const visited = new Set() + const roots = process.argv.slice(2).length > 0 ? process.argv.slice(2) : browserSafeRoots + for (const root of roots) visit(path.resolve(repositoryRoot, root)) -if (violations.length > 0) { - process.stderr.write(`${violations.join("\n")}\n`) - process.exitCode = 1 -} + if (violations.length > 0) { + process.stderr.write(`${violations.join("\n")}\n`) + process.exitCode = 1 + } -function visit(filePath) { - if (visited.has(filePath)) return - visited.add(filePath) - const source = ts.createSourceFile( - filePath, - fs.readFileSync(filePath, "utf8"), - ts.ScriptTarget.Latest, - true, - ) - for (const statement of source.statements) { - const specifier = valueImportSpecifier(statement) - if (specifier === undefined) continue - if (specifier.startsWith("node:") || forbiddenPackages.has(specifier)) { - violations.push( - `${path.relative(repositoryRoot, filePath)} imports ${specifier}, which the browser cannot load`, - ) - continue + function visit(filePath) { + if (visited.has(filePath)) return + visited.add(filePath) + const source = getSourceFile(filePath) + for (const statement of source.statements) { + const specifier = valueImportSpecifier(statement) + if (specifier === undefined) continue + if (specifier.startsWith("node:") || forbiddenPackages.has(specifier)) { + violations.push( + `${path.relative(repositoryRoot, filePath)} imports ${specifier}, which the browser cannot load`, + ) + continue + } + if (!specifier.startsWith(".")) continue + visit(resolveRelativeImport({ from: filePath, specifier })) } - if (!specifier.startsWith(".")) continue - visit(resolveRelativeImport({ from: filePath, specifier })) } -} +}) function valueImportSpecifier(statement) { - if (ts.isImportDeclaration(statement)) { - if (statement.importClause?.isTypeOnly) return undefined - if (!ts.isStringLiteral(statement.moduleSpecifier)) return undefined + if (isImportDeclaration(statement)) { + if (statement.importClause?.phaseModifier === SyntaxKind.TypeKeyword) return undefined + if (!isStringLiteral(statement.moduleSpecifier)) return undefined return statement.moduleSpecifier.text } - if (ts.isExportDeclaration(statement)) { + if (isExportDeclaration(statement)) { if (statement.isTypeOnly) return undefined - if (!statement.moduleSpecifier || !ts.isStringLiteral(statement.moduleSpecifier)) - return undefined + if (!statement.moduleSpecifier || !isStringLiteral(statement.moduleSpecifier)) return undefined return statement.moduleSpecifier.text } return undefined diff --git a/scripts/check-cloudflare-imports.mjs b/scripts/check-cloudflare-imports.mjs index fd132a8..26be4b8 100644 --- a/scripts/check-cloudflare-imports.mjs +++ b/scripts/check-cloudflare-imports.mjs @@ -1,32 +1,40 @@ -import fs from "node:fs" import path from "node:path" import assert from "node:assert/strict" -import ts from "typescript" +import { + isExportDeclaration, + isImportDeclaration, + isStringLiteral, + SyntaxKind, +} from "typescript/unstable/ast" +import { withTypeScriptSources } from "./typescript-source.mjs" const visited = new Set() const forbidden = new Set(["pg", "mysql2", "redis", "ws"]) -visit(path.resolve("src/cloudflare/index.ts")) -function visit(file) { - if (visited.has(file)) return - visited.add(file) - const source = ts.createSourceFile( - file, - fs.readFileSync(file, "utf8"), - ts.ScriptTarget.Latest, - true, - ) - for (const statement of source.statements) { - if (!ts.isImportDeclaration(statement) && !ts.isExportDeclaration(statement)) continue - if (ts.isImportDeclaration(statement) && statement.importClause?.isTypeOnly) continue - if (ts.isExportDeclaration(statement) && statement.isTypeOnly) continue - const specifier = statement.moduleSpecifier - if (!specifier || !ts.isStringLiteral(specifier)) continue - const name = specifier.text - assert( - !forbidden.has(name) && (!name.startsWith("node:") || name === "node:async_hooks"), - `${file} imports unsupported Cloudflare dependency ${name}`, - ) - if (name.startsWith(".")) visit(path.resolve(path.dirname(file), name.replace(/\.js$/, ".ts"))) +withTypeScriptSources(({ getSourceFile }) => { + visit(path.resolve("src/cloudflare/index.ts")) + + function visit(file) { + if (visited.has(file)) return + visited.add(file) + const source = getSourceFile(file) + for (const statement of source.statements) { + if (!isImportDeclaration(statement) && !isExportDeclaration(statement)) continue + if ( + isImportDeclaration(statement) && + statement.importClause?.phaseModifier === SyntaxKind.TypeKeyword + ) + continue + if (isExportDeclaration(statement) && statement.isTypeOnly) continue + const specifier = statement.moduleSpecifier + if (!specifier || !isStringLiteral(specifier)) continue + const name = specifier.text + assert( + !forbidden.has(name) && (!name.startsWith("node:") || name === "node:async_hooks"), + `${file} imports unsupported Cloudflare dependency ${name}`, + ) + if (name.startsWith(".")) + visit(path.resolve(path.dirname(file), name.replace(/\.js$/, ".ts"))) + } } -} +}) diff --git a/scripts/check-parameter-style.mjs b/scripts/check-parameter-style.mjs index fc29e20..18f8dfa 100644 --- a/scripts/check-parameter-style.mjs +++ b/scripts/check-parameter-style.mjs @@ -1,15 +1,21 @@ import fs from "node:fs" import path from "node:path" import process from "node:process" -import ts from "typescript" +import { isConstructorDeclaration, isSignatureDeclaration } from "typescript/unstable/ast" +import { withTypeScriptSources } from "./typescript-source.mjs" const sourceDirectory = path.resolve("src") -const violations = sourceFiles(sourceDirectory).flatMap(findViolations) -if (violations.length > 0) { - process.stderr.write(`${violations.join("\n")}\n`) - process.exitCode = 1 -} +withTypeScriptSources(({ getSourceFile }) => { + const violations = sourceFiles(sourceDirectory).flatMap((filePath) => + findViolations(filePath, getSourceFile(filePath)), + ) + + if (violations.length > 0) { + process.stderr.write(`${violations.join("\n")}\n`) + process.exitCode = 1 + } +}) function sourceFiles(directory) { return fs.readdirSync(directory, { withFileTypes: true }).flatMap((entry) => { @@ -19,29 +25,22 @@ function sourceFiles(directory) { }) } -function findViolations(filePath) { - const source = ts.createSourceFile( - filePath, - fs.readFileSync(filePath, "utf8"), - ts.ScriptTarget.Latest, - true, - ) +function findViolations(filePath, source) { const violations = [] function visit(node) { if ( - ts.isFunctionLike(node) && + isSignatureDeclaration(node) && node.parameters.filter((parameter) => parameter.name.getText(source) !== "this").length > 2 ) { const position = source.getLineAndCharacterOfPosition(node.getStart(source)) const name = - node.name?.getText(source) ?? - (ts.isConstructorDeclaration(node) ? "constructor" : "anonymous") + node.name?.getText(source) ?? (isConstructorDeclaration(node) ? "constructor" : "anonymous") violations.push( `${path.relative(process.cwd(), filePath)}:${position.line + 1} ${name} has ${node.parameters.length} positional parameters; use an options object`, ) } - ts.forEachChild(node, visit) + node.forEachChild(visit) } visit(source) diff --git a/scripts/typescript-source.mjs b/scripts/typescript-source.mjs new file mode 100644 index 0000000..f89f3a7 --- /dev/null +++ b/scripts/typescript-source.mjs @@ -0,0 +1,44 @@ +import path from "node:path" +import { API } from "typescript/unstable/sync" + +const defaultProjects = ["tsconfig.json", "tsconfig.cloudflare.json"] + +/** + * TypeScript 7's root export is version-only. Until the stable 7.1 API lands, + * programmatic access goes through typescript/unstable/*. + * + * Run `callback` with source files loaded from the given tsconfig projects, + * then dispose the compiler session. + */ +export function withTypeScriptSources(callback, options = {}) { + const cwd = options.cwd ?? process.cwd() + const api = new API({ cwd }) + let snapshot + try { + snapshot = api.updateSnapshot({ + openProjects: (options.projects ?? defaultProjects).map((file) => path.resolve(cwd, file)), + }) + const sources = new Map() + for (const project of snapshot.getProjects()) { + for (const fileName of project.program.getSourceFileNames()) { + const resolved = path.resolve(fileName) + if (sources.has(resolved)) continue + const source = project.program.getSourceFile(fileName) + if (source) sources.set(resolved, source) + } + } + return callback({ + getSourceFile(filePath) { + const resolved = path.resolve(filePath) + const source = sources.get(resolved) + if (!source) { + throw new Error(`TypeScript 7 did not load a source file for ${resolved}`) + } + return source + }, + }) + } finally { + snapshot?.dispose() + api.close() + } +} From f5e7c3d1a87e8d25e2f2b9535c0e1003e44ae66d Mon Sep 17 00:00:00 2001 From: Lucas Carlson Date: Wed, 2 Dec 2026 12:21:47 -0800 Subject: [PATCH 3/4] fix: expect the broad schedule override body under TypeScript 7 The signature was already a type error. TypeScript 7 also flags the return of super.schedule() as not assignable to ScheduledOperations. --- test/actor-operations.types.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/test/actor-operations.types.ts b/test/actor-operations.types.ts index fae5562..afd6f3b 100644 --- a/test/actor-operations.types.ts +++ b/test/actor-operations.types.ts @@ -124,6 +124,7 @@ export class ExistingOverride extends Actor { } // @ts-expect-error broad legacy override cannot promise concrete operation keys override schedule(options: { at: Date }): ScheduledOperations { + // @ts-expect-error the concrete schedule return is not assignable to that broad type either return super.schedule(options) } } From c276258461c939d15a7393fa8e7717549cdc5915 Mon Sep 17 00:00:00 2001 From: Lucas Carlson Date: Wed, 2 Dec 2026 12:24:42 -0800 Subject: [PATCH 4/4] Remove baseUrl from example tsconfigs for TypeScript 7 (TS5102) --- tsconfig.cloudflare-example.json | 1 - tsconfig.examples.json | 1 - 2 files changed, 2 deletions(-) diff --git a/tsconfig.cloudflare-example.json b/tsconfig.cloudflare-example.json index 77f567c..408d3f8 100644 --- a/tsconfig.cloudflare-example.json +++ b/tsconfig.cloudflare-example.json @@ -2,7 +2,6 @@ "extends": "./tsconfig.cloudflare.json", "compilerOptions": { "types": ["node", "@cloudflare/workers-types"], - "baseUrl": ".", "paths": { "solid-objects/core": ["./src/core.ts"], "solid-objects/cloudflare": ["./src/cloudflare/index.ts"] diff --git a/tsconfig.examples.json b/tsconfig.examples.json index 0bdf958..0c6e89d 100644 --- a/tsconfig.examples.json +++ b/tsconfig.examples.json @@ -2,7 +2,6 @@ "extends": "./tsconfig.json", "compilerOptions": { "allowImportingTsExtensions": true, - "baseUrl": ".", "paths": { "solid-objects": ["./src/index.ts"], "solid-objects/database/sqlite": ["./src/database/sqlite.ts"],