From f1de7ecde77218f7635fcbde82931c647acc14b3 Mon Sep 17 00:00:00 2001 From: "soleil.colza" Date: Fri, 30 Oct 2026 00:00:38 +0900 Subject: [PATCH 1/2] Migrate owned compiler tools to the TypeScript 7.1 API --- packages/adapter/package.json | 3 +- .../test/runtime-manifest-privacy.test.ts | 14 +- pnpm-lock.yaml | 227 ++++++++++++++++++ pnpm-workspace.yaml | 2 + tools/next-matrix/package.json | 5 +- .../next-matrix/src/node-handler-lifetime.ts | 27 ++- 6 files changed, 258 insertions(+), 20 deletions(-) diff --git a/packages/adapter/package.json b/packages/adapter/package.json index 377947b6c..abfda07b7 100644 --- a/packages/adapter/package.json +++ b/packages/adapter/package.json @@ -27,7 +27,7 @@ "scripts": { "build": "node scripts/build.ts", "prepack": "node scripts/build.ts", - "typecheck": "tsc --noEmit" + "typecheck": "node node_modules/typescript/bin/tsc --noEmit" }, "dependencies": { "@jridgewell/sourcemap-codec": "catalog:", @@ -43,6 +43,7 @@ "miniflare": "catalog:", "next": "catalog:", "typescript": "catalog:", + "typescript-api": "catalog:", "vitest": "catalog:" }, "peerDependencies": { diff --git a/packages/adapter/test/runtime-manifest-privacy.test.ts b/packages/adapter/test/runtime-manifest-privacy.test.ts index 137cf7b36..fa330879d 100644 --- a/packages/adapter/test/runtime-manifest-privacy.test.ts +++ b/packages/adapter/test/runtime-manifest-privacy.test.ts @@ -8,8 +8,6 @@ import { } from '@stayingupwind/core/bundle'; import { createId } from '@stayingupwind/core/util'; import { - createSourceFile, - forEachChild, isAsExpression, isIdentifier, isObjectLiteralExpression, @@ -18,8 +16,8 @@ import { isVariableDeclaration, type Node, type ObjectLiteralExpression, - ScriptTarget, -} from 'typescript'; +} from 'typescript-api/ast'; +import { API } from 'typescript-api/sync'; import { describe, expect, it } from 'vitest'; const GENERATED_AT = '2026-10-20T00:00:00.000Z'; @@ -110,7 +108,7 @@ function runtimeReferences(node: Node): 'one-pass' | undefined { isObjectLiteralExpression(node.initializer) ) return referenceProperty(node.initializer); - return forEachChild(node, runtimeReferences); + return node.forEachChild(runtimeReferences); } describe('runtime manifest privacy authority', () => { @@ -130,11 +128,11 @@ describe('runtime manifest privacy authority', () => { ]; // The repository-owned source URL is fixed; no request or environment input selects a file. const source = readFileSync(new URL('../src/index.ts', import.meta.url), 'utf8'); + using api = new API({ cwd: process.cwd() }); + using parsed = api.createSourceFile('index.ts', source); const runtime = { ...bundle, - routerReferences: runtimeReferences( - createSourceFile('index.ts', source, ScriptTarget.Latest), - ), + routerReferences: runtimeReferences(parsed.sourceFile), }; const legacy = { ...bundle, routerReferences: undefined }; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3ba958f4c..e06baae39 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -272,6 +272,9 @@ catalogs: typescript: specifier: 6.0.3 version: 6.0.3 + typescript-api: + specifier: npm:typescript@7.1.0-beta + version: 7.1.0-beta typescript-eslint: specifier: 8.72.0 version: 8.72.0 @@ -399,6 +402,9 @@ importers: typescript: specifier: 'catalog:' version: 6.0.3 + typescript-api: + specifier: 'catalog:' + version: typescript@7.1.0-beta vitest: specifier: 'catalog:' version: 5.0.5(@types/node@24.19.2)(vite@8.3.5(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(yaml@2.9.1)) @@ -767,6 +773,9 @@ importers: typescript: specifier: 'catalog:' version: 6.0.3 + typescript-api: + specifier: 'catalog:' + version: typescript@7.1.0-beta vitest: specifier: 'catalog:' version: 5.0.5(@types/node@24.19.2)(vite@8.3.5(@types/node@24.19.2)(esbuild@0.28.2)(jiti@2.7.0)(yaml@2.9.1)) @@ -2006,6 +2015,132 @@ packages: resolution: {integrity: sha512-E2mroviasaWecDzTGiGMtuEguuLVOeRggnrIn93CJuxYJzQBHbyymlT08aVQydbBal5538o+JkBKXh2sRuCyIA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@typescript/typescript-aix-ppc64@7.1.0-beta': + resolution: {integrity: sha512-DXDG+jIWxBHGdoO70tcHON33rCnSzsEZj9P13oyf/r/KEGIo6awsdSNVNjAw0uMwEpqRu75IrgCcW58YcVkZHg==} + engines: {node: '>=16.20.0'} + cpu: [ppc64] + os: [aix] + + '@typescript/typescript-android-arm64@7.1.0-beta': + resolution: {integrity: sha512-UZx6PxoQavuvaVTrSf3aw0Oy/J/uJpRylipA0kzc038jMvZXh0UtE8vnQp20FqtdgD5bhXZ0aJrRJyoTSUO58Q==} + engines: {node: '>=16.20.0'} + cpu: [arm64] + os: [android] + + '@typescript/typescript-darwin-arm64@7.1.0-beta': + resolution: {integrity: sha512-q7mxblcyX0E7hXsY4k+Q6KWKK5mGmfVq+BDesdTgRVgjodk27aIxER77Zyj9+TgSTlCje8F7+JM6f6hl2BuNdw==} + engines: {node: '>=16.20.0'} + cpu: [arm64] + os: [darwin] + + '@typescript/typescript-darwin-x64@7.1.0-beta': + resolution: {integrity: sha512-D5EYqG5Wm/guw9+0j8+Mn1Jbr/gfS/VtFTuoH8PJtFbcqeDaQGMulc7SW8q51QG6Y3wGOGX3nbsTOw6fIKWWAA==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [darwin] + + '@typescript/typescript-freebsd-arm64@7.1.0-beta': + resolution: {integrity: sha512-9A0XX0tcnH9qPdolSKKzSjTb93dlB0UEcAJbHYEsrFX2fkFNSum9+dvkQQJ9vLc+7vxHetDPujq9Qe6wx+Xhow==} + engines: {node: '>=16.20.0'} + cpu: [arm64] + os: [freebsd] + + '@typescript/typescript-freebsd-x64@7.1.0-beta': + resolution: {integrity: sha512-EDf/dBHfY0TxX3NmUTek0hbffeyZlh3+ls6WQW3ICB8vYxwYLFnzg7wkgEUvl9eRlpiJ/nmc2S8arPMzINJ7rg==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [freebsd] + + '@typescript/typescript-linux-arm64@7.1.0-beta': + resolution: {integrity: sha512-hNqQBgQ5b5oGqN76QqbAU6CwYhJZ6iOcWc2kPTUs2OentgpxZktETziH6KIyRFJPaiBncognwn2ZLu3DNhHiWw==} + engines: {node: '>=16.20.0'} + cpu: [arm64] + os: [linux] + + '@typescript/typescript-linux-arm@7.1.0-beta': + resolution: {integrity: sha512-AvN9HmzOQh46G4312ooSgMHhbB7DtnLwg8D9mo324X49B7weMwtJrBG1MxT9IyI8kzDd7YRtW+1hWGun7WG7Qw==} + engines: {node: '>=16.20.0'} + cpu: [arm] + os: [linux] + + '@typescript/typescript-linux-loong64@7.1.0-beta': + resolution: {integrity: sha512-xbUustlBrFflt2pNEyG5ye+d4WGPc/rfr2xK29MXeobPSw297JqwuKRrvbKM5o3fE/eUM/c+urVm6jQ3IaMVTw==} + engines: {node: '>=16.20.0'} + cpu: [loong64] + os: [linux] + + '@typescript/typescript-linux-mips64el@7.1.0-beta': + resolution: {integrity: sha512-fS4/G7/0bXZ3NSq3nBMAXyg65I3tO4S7j08VNQ2g1aNC/qq79gE7Qne1BNjVsjMFfHBVBFjQYoTQCjmVU2iFlg==} + engines: {node: '>=16.20.0'} + cpu: [mips64el] + os: [linux] + + '@typescript/typescript-linux-ppc64@7.1.0-beta': + resolution: {integrity: sha512-0upCCxYPX8X6gOwkvfv+Ee7/ufyy7k97mTrGE0e5BxLlnUEa+w+rtgnv2dsKcxFdwdeZYVlZKCqgN/xCBV08+A==} + engines: {node: '>=16.20.0'} + cpu: [ppc64] + os: [linux] + + '@typescript/typescript-linux-riscv64@7.1.0-beta': + resolution: {integrity: sha512-0jKU9YRgOPRgiy5V/UWv37kB53PaTpIbwGCbbOMUPPAkrjVRNOIAJaz7Wa7s3H7mdDebX1LopUEPEJR+7Xa7zg==} + engines: {node: '>=16.20.0'} + cpu: [riscv64] + os: [linux] + + '@typescript/typescript-linux-s390x@7.1.0-beta': + resolution: {integrity: sha512-j+d04s2kxaPQh6DLPb01sknAQfzsrdSZy15jBRHyLEZoaaQ19dVjbFRlkNVvYwUG7ZdP8+y5b/7RmPxdtHUKdQ==} + engines: {node: '>=16.20.0'} + cpu: [s390x] + os: [linux] + + '@typescript/typescript-linux-x64@7.1.0-beta': + resolution: {integrity: sha512-kcD51ihf+pnI5KT4uQQYG04OpwznaZYBlIQhDhl8fflFd27NktxXsUeguxZyvUMyWfum7IF2bBS6Jv7ox0AgFQ==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [linux] + + '@typescript/typescript-netbsd-arm64@7.1.0-beta': + resolution: {integrity: sha512-8W85YyoGK+rgGoSU9jJQUpELbrKcZcbdJk2jPNQ6UKDKI7ryPlPFTrV2jCE5RQuv4Tt96hMDTc33s4YfRrLFBA==} + engines: {node: '>=16.20.0'} + cpu: [arm64] + os: [netbsd] + + '@typescript/typescript-netbsd-x64@7.1.0-beta': + resolution: {integrity: sha512-iGsTE0ve2PG0AcyZinwAR0LnGEZhu/y4dceS0hZsYCaKdYETvQtvtlNWlmYKempsBr6C7Il7dMXHVk+VFm9u0g==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [netbsd] + + '@typescript/typescript-openbsd-arm64@7.1.0-beta': + resolution: {integrity: sha512-Z2FERdHB9fAKI+KGqdWn04O7uNlnB+VYiEm6INE1aZuzzLNd3KBqQ6IpKUJF2ny4GigGU6nVu75XD9tAUODPng==} + engines: {node: '>=16.20.0'} + cpu: [arm64] + os: [openbsd] + + '@typescript/typescript-openbsd-x64@7.1.0-beta': + resolution: {integrity: sha512-NVG3qeyCq/rJEOhaRjR3LsWgjrjo5vJW25omVLeHAVnpKIG4pE4cenwwKGR06DiJ1s0QTOymcJeKXMEpsiNBVg==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [openbsd] + + '@typescript/typescript-sunos-x64@7.1.0-beta': + resolution: {integrity: sha512-ovAdoWXEn2B5/fyWG69pLU3FWmQwPWOjQV5TFbcxtpnOv+R3g8ySGHl1NYRq7Lb/GYdFDvaGcZ+SiU7iKuiMsA==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [sunos] + + '@typescript/typescript-win32-arm64@7.1.0-beta': + resolution: {integrity: sha512-lJbo71IEOfL7ZZIZnArRaOLqjn9BAfoSzyUQn0aSjfSpDZL4ru0afUsdBfo6PQEjD6ssdmi0n/RwaPADX6bsvQ==} + engines: {node: '>=16.20.0'} + cpu: [arm64] + os: [win32] + + '@typescript/typescript-win32-x64@7.1.0-beta': + resolution: {integrity: sha512-UKcHvbybY2tDTvFW2b1vwiAvDlIRooo69lh8CXWVhOQejcvpM5+IgbiFW9EIwR5Wi5X/v+BdN7gdWbigBuJ3rw==} + engines: {node: '>=16.20.0'} + cpu: [x64] + os: [win32] + '@unrs/resolver-binding-android-arm-eabi@1.12.2': resolution: {integrity: sha512-g5T90pqg1bo/7mytQx6F4iBNC0Wsh9cu+z9veDbFjc7HjpesJFWD7QMS0NGStXM075+7dJPPVvBbpZlnrdpi/w==} cpu: [arm] @@ -3265,6 +3400,11 @@ packages: engines: {node: '>=14.17'} hasBin: true + typescript@7.1.0-beta: + resolution: {integrity: sha512-cjWjZAJDsmZzsNC5GwHNlW0YPM65jZa5oR0KyQcYX3KSVIfTvtBq//vewISyatKk4OLi5grZjHhIVE9fdrw1UQ==} + engines: {node: '>=16.20.0'} + hasBin: true + unbash@6.0.1: resolution: {integrity: sha512-0db9eS5iqybux41zLkX69nk90KTci7F7eZ+gXzEG/Q7E0tAqEBhRh5fkZvk1N7jT7QkGWqq34i8SFGPFEe1V8A==} engines: {node: '>=14'} @@ -4292,6 +4432,69 @@ snapshots: '@typescript-eslint/types': 8.72.0 eslint-visitor-keys: 5.0.1 + '@typescript/typescript-aix-ppc64@7.1.0-beta': + optional: true + + '@typescript/typescript-android-arm64@7.1.0-beta': + optional: true + + '@typescript/typescript-darwin-arm64@7.1.0-beta': + optional: true + + '@typescript/typescript-darwin-x64@7.1.0-beta': + optional: true + + '@typescript/typescript-freebsd-arm64@7.1.0-beta': + optional: true + + '@typescript/typescript-freebsd-x64@7.1.0-beta': + optional: true + + '@typescript/typescript-linux-arm64@7.1.0-beta': + optional: true + + '@typescript/typescript-linux-arm@7.1.0-beta': + optional: true + + '@typescript/typescript-linux-loong64@7.1.0-beta': + optional: true + + '@typescript/typescript-linux-mips64el@7.1.0-beta': + optional: true + + '@typescript/typescript-linux-ppc64@7.1.0-beta': + optional: true + + '@typescript/typescript-linux-riscv64@7.1.0-beta': + optional: true + + '@typescript/typescript-linux-s390x@7.1.0-beta': + optional: true + + '@typescript/typescript-linux-x64@7.1.0-beta': + optional: true + + '@typescript/typescript-netbsd-arm64@7.1.0-beta': + optional: true + + '@typescript/typescript-netbsd-x64@7.1.0-beta': + optional: true + + '@typescript/typescript-openbsd-arm64@7.1.0-beta': + optional: true + + '@typescript/typescript-openbsd-x64@7.1.0-beta': + optional: true + + '@typescript/typescript-sunos-x64@7.1.0-beta': + optional: true + + '@typescript/typescript-win32-arm64@7.1.0-beta': + optional: true + + '@typescript/typescript-win32-x64@7.1.0-beta': + optional: true + '@unrs/resolver-binding-android-arm-eabi@1.12.2': optional: true @@ -5585,6 +5788,30 @@ snapshots: typescript@6.0.3: {} + typescript@7.1.0-beta: + optionalDependencies: + '@typescript/typescript-aix-ppc64': 7.1.0-beta + '@typescript/typescript-android-arm64': 7.1.0-beta + '@typescript/typescript-darwin-arm64': 7.1.0-beta + '@typescript/typescript-darwin-x64': 7.1.0-beta + '@typescript/typescript-freebsd-arm64': 7.1.0-beta + '@typescript/typescript-freebsd-x64': 7.1.0-beta + '@typescript/typescript-linux-arm': 7.1.0-beta + '@typescript/typescript-linux-arm64': 7.1.0-beta + '@typescript/typescript-linux-loong64': 7.1.0-beta + '@typescript/typescript-linux-mips64el': 7.1.0-beta + '@typescript/typescript-linux-ppc64': 7.1.0-beta + '@typescript/typescript-linux-riscv64': 7.1.0-beta + '@typescript/typescript-linux-s390x': 7.1.0-beta + '@typescript/typescript-linux-x64': 7.1.0-beta + '@typescript/typescript-netbsd-arm64': 7.1.0-beta + '@typescript/typescript-netbsd-x64': 7.1.0-beta + '@typescript/typescript-openbsd-arm64': 7.1.0-beta + '@typescript/typescript-openbsd-x64': 7.1.0-beta + '@typescript/typescript-sunos-x64': 7.1.0-beta + '@typescript/typescript-win32-arm64': 7.1.0-beta + '@typescript/typescript-win32-x64': 7.1.0-beta + unbash@6.0.1: {} undici-types@7.24.6: {} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 5f55b6301..54f697a62 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -69,6 +69,8 @@ catalog: tldts: 7.4.19 wrangler: 4.152.0 typescript: 6.0.3 + # The owned compiler API consumers use 7.1; lint and legacy compatibility proofs stay on 6. + typescript-api: npm:typescript@7.1.0-beta typescript-eslint: 8.72.0 # The suites of the packages that have them, run by one root runner (`vitest.config.ts`), and the # lint rules they are held to beside the rest. diff --git a/tools/next-matrix/package.json b/tools/next-matrix/package.json index d487ec6ff..da7058f42 100644 --- a/tools/next-matrix/package.json +++ b/tools/next-matrix/package.json @@ -5,8 +5,8 @@ "description": "Builds the fixtures with each Next.js in the supported range and holds the result to what the adapter promises.", "type": "module", "scripts": { - "build": "tsc --noEmit", - "typecheck": "tsc --noEmit" + "build": "node node_modules/typescript/bin/tsc --noEmit", + "typecheck": "node node_modules/typescript/bin/tsc --noEmit" }, "dependencies": { "@stayingupwind/core": "workspace:*" @@ -16,6 +16,7 @@ "@types/ws": "catalog:", "miniflare": "catalog:", "typescript": "catalog:", + "typescript-api": "catalog:", "vitest": "catalog:", "ws": "catalog:" }, diff --git a/tools/next-matrix/src/node-handler-lifetime.ts b/tools/next-matrix/src/node-handler-lifetime.ts index f4bd16dca..95bb31263 100644 --- a/tools/next-matrix/src/node-handler-lifetime.ts +++ b/tools/next-matrix/src/node-handler-lifetime.ts @@ -4,7 +4,8 @@ import { mkdir, readFile, writeFile } from 'node:fs/promises'; import path from 'node:path'; import { convertV4MiniflareOptions, Log, LogLevel, Miniflare } from 'miniflare'; -import ts from 'typescript'; +import { ScriptTarget } from 'typescript-api/ast'; +import { API, ModuleKind } from 'typescript-api/sync'; const REQUEST_MS = 10_000; const CLEANUP_MS = 5000; @@ -80,14 +81,14 @@ async function bounded(pending: Promise, signal: AbortSignal): Promise } } -function compiled(source: string): string { - return ts.transpileModule(source, { - compilerOptions: { target: ts.ScriptTarget.ES2023, module: ts.ModuleKind.ESNext }, +function compiled(api: API, source: string): string { + return api.transpileModule(source, { + compilerOptions: { target: ScriptTarget.ES2023, module: ModuleKind.ESNext }, }).outputText; } -function compiledBridge(source: string): string { - return compiled(source) +function compiledBridge(api: API, source: string): string { + return compiled(api, source) .replace("'./tasks.ts'", "'./tasks.mjs'") .replace("'@stayingupwind/core/next'", "'./websocket-response-bridge.mjs'") .replace("'@stayingupwind/core/request'", "'./websocket-upgrade.mjs'"); @@ -251,20 +252,28 @@ async function exercise( } } +using api = new API({ cwd: ROOT }); const source = await readFile(path.join(ROOT, 'packages/runtime/src/node-bridge.ts'), 'utf8'); assert.equal(source.split(HOLD).length, 2, 'the bridge lifetime boundary moved'); const previous = source.replace(HOLD, () => GUARDED_HOLD); -const tasks = compiled(await readFile(path.join(ROOT, 'packages/runtime/src/tasks.ts'), 'utf8')); +const tasks = compiled( + api, + await readFile(path.join(ROOT, 'packages/runtime/src/tasks.ts'), 'utf8'), +); const invocation = compiled( + api, await readFile(path.join(ROOT, 'packages/runtime/src/invocation.ts'), 'utf8'), ); const reframe = compiled( + api, await readFile(path.join(ROOT, 'packages/runtime/src/reframe.ts'), 'utf8'), ); const websocketResponse = compiled( + api, await readFile(path.join(ROOT, 'packages/core/src/next/websocket-response-bridge.ts'), 'utf8'), ); const websocketUpgrade = compiled( + api, await readFile(path.join(ROOT, 'packages/core/src/request/websocket.ts'), 'utf8'), ); const lanes: Lane[] = []; @@ -304,7 +313,7 @@ async function collect(bridge: string, lane: Lane): Promise { } try { for (const mode of ['previous-method-guard', 'retained'] as const) { - const bridge = compiledBridge(mode === 'retained' ? source : previous); + const bridge = compiledBridge(api, mode === 'retained' ? source : previous); for (const method of ['GET', 'POST'] as const) { const lane: Lane = { kind: 'immediate-end', @@ -331,7 +340,7 @@ try { egressAttempts: 0, stage: 'created', }; - await collect(compiledBridge(source), later); + await collect(compiledBridge(api, source), later); assert.equal(failures.length, 0, 'one or more finite handler lifetime controls failed'); proof.status = 'success'; } catch (error) { From 643e7f8a55298d51afc2ba1aaff04bcc17999a9d Mon Sep 17 00:00:00 2001 From: "soleil.colza" Date: Fri, 30 Oct 2026 00:08:30 +0900 Subject: [PATCH 2/2] Share the lifetime proof compiler without redundant parameters --- .../next-matrix/src/node-handler-lifetime.ts | 22 +++++++------------ 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/tools/next-matrix/src/node-handler-lifetime.ts b/tools/next-matrix/src/node-handler-lifetime.ts index 95bb31263..e7292c3dd 100644 --- a/tools/next-matrix/src/node-handler-lifetime.ts +++ b/tools/next-matrix/src/node-handler-lifetime.ts @@ -81,14 +81,16 @@ async function bounded(pending: Promise, signal: AbortSignal): Promise } } -function compiled(api: API, source: string): string { +using api = new API({ cwd: ROOT }); + +function compiled(source: string): string { return api.transpileModule(source, { compilerOptions: { target: ScriptTarget.ES2023, module: ModuleKind.ESNext }, }).outputText; } -function compiledBridge(api: API, source: string): string { - return compiled(api, source) +function compiledBridge(source: string): string { + return compiled(source) .replace("'./tasks.ts'", "'./tasks.mjs'") .replace("'@stayingupwind/core/next'", "'./websocket-response-bridge.mjs'") .replace("'@stayingupwind/core/request'", "'./websocket-upgrade.mjs'"); @@ -252,28 +254,20 @@ async function exercise( } } -using api = new API({ cwd: ROOT }); const source = await readFile(path.join(ROOT, 'packages/runtime/src/node-bridge.ts'), 'utf8'); assert.equal(source.split(HOLD).length, 2, 'the bridge lifetime boundary moved'); const previous = source.replace(HOLD, () => GUARDED_HOLD); -const tasks = compiled( - api, - await readFile(path.join(ROOT, 'packages/runtime/src/tasks.ts'), 'utf8'), -); +const tasks = compiled(await readFile(path.join(ROOT, 'packages/runtime/src/tasks.ts'), 'utf8')); const invocation = compiled( - api, await readFile(path.join(ROOT, 'packages/runtime/src/invocation.ts'), 'utf8'), ); const reframe = compiled( - api, await readFile(path.join(ROOT, 'packages/runtime/src/reframe.ts'), 'utf8'), ); const websocketResponse = compiled( - api, await readFile(path.join(ROOT, 'packages/core/src/next/websocket-response-bridge.ts'), 'utf8'), ); const websocketUpgrade = compiled( - api, await readFile(path.join(ROOT, 'packages/core/src/request/websocket.ts'), 'utf8'), ); const lanes: Lane[] = []; @@ -313,7 +307,7 @@ async function collect(bridge: string, lane: Lane): Promise { } try { for (const mode of ['previous-method-guard', 'retained'] as const) { - const bridge = compiledBridge(api, mode === 'retained' ? source : previous); + const bridge = compiledBridge(mode === 'retained' ? source : previous); for (const method of ['GET', 'POST'] as const) { const lane: Lane = { kind: 'immediate-end', @@ -340,7 +334,7 @@ try { egressAttempts: 0, stage: 'created', }; - await collect(compiledBridge(api, source), later); + await collect(compiledBridge(source), later); assert.equal(failures.length, 0, 'one or more finite handler lifetime controls failed'); proof.status = 'success'; } catch (error) {