Build composable Camino packages with explicit type and source dependencies

This commit is contained in:
Timothy J. Aveni
2026-09-22 14:42:54 -07:00
parent 7173751f37
commit 82a4542746
30 changed files with 736 additions and 420 deletions
+21
View File
@@ -198,3 +198,24 @@ package Owner id "package:owner" revision "package:owner@1" {
}
await import("./emit-controllers.js");
// Standalone public builder roots must work without opting into the other modes.
for (const kind of ["portable", "service"]) {
const pkg = compileCapabilityResourceSource(
`package Owner id "package:owner" revision "package:owner@1" {
function identity id "identity" : int32 -> record {pid:int32;child:int32;}
execution ${kind === "portable" ? "snapshot targets [browser,server]" : "remote"};
}`,
{ source },
);
assert.ok(pkg.ok && pkg.resource.kind === "package", JSON.stringify(pkg.diagnostics));
const workspace = compileCapabilitySource(
`workspace Simple id "workspace:simple" revision "workspace:simple@1" commit "${source.commit}" {import package Owner;}`,
"workspace.qx",
{ packages: new Map([["Owner", pkg.resource.revision]]) },
);
assert.ok(workspace.ok, JSON.stringify(workspace.diagnostics));
const directory = `dist/managed/standalone-${kind}`;
await mkdir(directory, { recursive: true });
await writeFile(`${directory}/execution-plan.json`, JSON.stringify(compileExecutionPlan(workspace.workspace)));
}