Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/adapter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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:",
Expand All @@ -43,6 +43,7 @@
"miniflare": "catalog:",
"next": "catalog:",
"typescript": "catalog:",
"typescript-api": "catalog:",
"vitest": "catalog:"
},
"peerDependencies": {
Expand Down
14 changes: 6 additions & 8 deletions packages/adapter/test/runtime-manifest-privacy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import {
} from '@stayingupwind/core/bundle';
import { createId } from '@stayingupwind/core/util';
import {
createSourceFile,
forEachChild,
isAsExpression,
isIdentifier,
isObjectLiteralExpression,
Expand All @@ -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';
Expand Down Expand Up @@ -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', () => {
Expand All @@ -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 };

Expand Down
227 changes: 227 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 3 additions & 2 deletions tools/next-matrix/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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:*"
Expand All @@ -16,6 +16,7 @@
"@types/ws": "catalog:",
"miniflare": "catalog:",
"typescript": "catalog:",
"typescript-api": "catalog:",
"vitest": "catalog:",
"ws": "catalog:"
},
Expand Down
9 changes: 6 additions & 3 deletions tools/next-matrix/src/node-handler-lifetime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -80,9 +81,11 @@ async function bounded<T>(pending: Promise<T>, signal: AbortSignal): Promise<T>
}
}

using api = new API({ cwd: ROOT });

function compiled(source: string): string {
return ts.transpileModule(source, {
compilerOptions: { target: ts.ScriptTarget.ES2023, module: ts.ModuleKind.ESNext },
return api.transpileModule(source, {
compilerOptions: { target: ScriptTarget.ES2023, module: ModuleKind.ESNext },
}).outputText;
}

Expand Down
Loading