Prove cross-package application composition through public capabilities (WI-15)
This commit is contained in:
@@ -46,11 +46,25 @@ pkg.controllers = parseControllerCatalog(
|
||||
[iface, controllerInterface],
|
||||
pkg.checkedQueries,
|
||||
);
|
||||
const viewer = compileCapabilityResourceSource(await read("Viewer.qx"), {
|
||||
source: { ...source, repository: "https://example.test/device-viewer.git" },
|
||||
environment,
|
||||
});
|
||||
assert.ok(viewer.ok && viewer.resource.kind === "package", JSON.stringify(viewer.diagnostics));
|
||||
const viewerPackage = viewer.resource.revision;
|
||||
viewerPackage.checkedQueries = await Promise.all(
|
||||
viewerPackage.queries!.map((query) => compileQuery(query, [iface], read)),
|
||||
);
|
||||
for (const variant of ["controller", "controller-next"]) {
|
||||
const extra = variant.endsWith("next") ? 'atom Dashboard id "dashboard";' : "";
|
||||
const extra = variant.endsWith("next")
|
||||
? 'atom Dashboard id "dashboard"; import package DeviceViewer; presentation DeviceStatus id "device:status" for Device using DeviceViewer.Status;'
|
||||
: "";
|
||||
const result = compileCapabilitySource((await read("workspace.qx")).replace(/}\s*$/, extra + "\n}"), "workspace.qx", {
|
||||
...environment,
|
||||
packages: new Map([["Driver", pkg]]),
|
||||
packages: new Map([
|
||||
["Driver", pkg],
|
||||
...(variant.endsWith("next") ? [["DeviceViewer", viewerPackage] as const] : []),
|
||||
]),
|
||||
});
|
||||
assert.ok(result.ok, JSON.stringify(result.diagnostics));
|
||||
const plan = compileExecutionPlan(result.workspace),
|
||||
|
||||
Reference in New Issue
Block a user