Generate typed asynchronous service capability bindings

This commit is contained in:
Timothy J. Aveni
2026-09-20 20:35:16 -07:00
parent 21502ed023
commit c4ae58831d
13 changed files with 192 additions and 21 deletions
+15
View File
@@ -87,3 +87,18 @@ const negative: PortableImplementation = {
void negative;
`,
);
const { asyncObjectPlan } = await import("./async-fixture.js");
const { generateRemoteTypeScriptBindings } = await import("../src/bindings/portable.js");
const asyncPlan = await asyncObjectPlan();
await mkdir("dist/portable-reader/async", { recursive: true });
await writeFile("dist/portable-reader/async/plan.json", JSON.stringify(asyncPlan));
await writeFile("dist/portable-reader/async/kernel.json", JSON.stringify(compileKernelProgram(asyncPlan)));
for (const [name, revision] of [
["controller", "async:controller-runtime@1"],
["provider", "async:provider-runtime@2"],
] as const)
await writeFile(
`dist/portable-reader/async/${name}.ts`,
generateRemoteTypeScriptBindings(asyncPlan.definition.bindingSchema, revision),
);