fix(typecheck): drop legacy FunctionRuntime branches in contracts/index
Fix round 1 for task 1: packages/typecheck also branched on the removed legacy runtime (componentContract's exclusion filter and the runtime-namespace loop). Removes both, adds a regression test. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env node
|
||||
// WRN editor language server source hash: 047a3b701a20619b02c7dacecdb3af63e2989e1837abbc83c8b235981f694562
|
||||
// WRN editor language server source hash: 8f158f0d23d75de9b08a12cef6e20d2e5cdb48b6242db3b724634880277acd8c
|
||||
// WRN editor language server generator hash: f593a44aaf05495b789ce7a3086bee1eebb951b884d41c0e017bbcfe5f547e72
|
||||
// @bun @bun-cjs
|
||||
(function(exports, require, module, __filename, __dirname) {var __create = Object.create;
|
||||
@@ -172681,7 +172681,7 @@ function componentContract(ast) {
|
||||
`);
|
||||
const outputs = ast.outputs.map((output) => ` ${safe(output.name)}(${output.payload ? `${output.payload.name}${output.payload.optional ? "?" : ""}: ${output.payload.valueType}` : ""}): void;`).join(`
|
||||
`);
|
||||
const callable = ast.runtimeFunctions.filter((fn) => fn.runtime !== "legacy").map((fn) => ` ${safe(fn.name)}(${fn.parameters.map((param) => `${param.name}${param.optional ? "?" : ""}: ${param.valueType ?? "unknown"}`).join(", ")}): ${fn.returnType ?? (fn.async ? "Promise<unknown>" : "unknown")};`).join(`
|
||||
const callable = ast.runtimeFunctions.map((fn) => ` ${safe(fn.name)}(${fn.parameters.map((param) => `${param.name}${param.optional ? "?" : ""}: ${param.valueType ?? "unknown"}`).join(", ")}): ${fn.returnType ?? (fn.async ? "Promise<unknown>" : "unknown")};`).join(`
|
||||
`);
|
||||
return `${typeSource ? `${typeSource}
|
||||
|
||||
@@ -172960,7 +172960,7 @@ function virtualTypeScriptModule(source, filePath = "component.wrn", appRoot = f
|
||||
append(ast.kind === "global-store" || ast.kind === "page-store" ? storeContract(ast) : componentContract(ast));
|
||||
append(importedWrnDeclarations(ast, filePath, appRoot));
|
||||
const sharedNames = new Set(ast.runtimeFunctions.filter((fn) => fn.runtime === "shared").map((fn) => fn.name));
|
||||
for (const runtime of ["shared", "client", "server", "legacy"]) {
|
||||
for (const runtime of ["shared", "client", "server"]) {
|
||||
const functions = ast.runtimeFunctions.filter((fn) => fn.runtime === runtime);
|
||||
if (!functions.length)
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user