Implement typed module contracts and conformance bindings

This commit is contained in:
Timothy J. Aveni
2026-09-22 13:51:32 -07:00
parent 60b44a6637
commit 7173751f37
33 changed files with 2963 additions and 2261 deletions
+5 -5
View File
@@ -25,11 +25,11 @@ test("checked component scaffolding composes with execution handlers without rep
tools: { quixos: source, protocol: source, helpers: source, sdk: source },
});
const packageFile = path.join(root, "package.qx");
await fs.writeFile(packageFile, "import interface Data;\n" + (await fs.readFile(packageFile, "utf8")));
await fs.writeFile(packageFile, "import interface View;\n" + (await fs.readFile(packageFile, "utf8")));
await apply("component", {
name: "Card",
id: "component:card",
declaration: 'component Card id "component:card" subject Data runtime react;',
declaration: 'module Card id "component:card" implements View.render;',
});
assert.deepEqual(JSON.parse(await fs.readFile(path.join(root, "quixos.components.json"), "utf8")), {
"component:card": { entry: "src/components/Card.tsx", export: "Card" },
@@ -45,7 +45,7 @@ test("checked component scaffolding composes with execution handlers without rep
await apply("component", {
name: "Details",
id: "component:details",
declaration: 'component Details id "component:details" subject Data runtime react;',
declaration: 'module Details id "component:details" implements View.render;',
});
assert.equal(await fs.readFile(card, "utf8"), retained);
assert.match(await fs.readFile(path.join(root, "src/server.ts"), "utf8"), /echo/);
@@ -54,7 +54,7 @@ test("checked component scaffolding composes with execution handlers without rep
apply("component", {
name: "Card",
id: "component:other",
declaration: 'component Card id "component:other" subject Data runtime react;',
declaration: 'module Card id "component:other" implements View.render;',
}),
/unique/,
);
@@ -63,7 +63,7 @@ test("checked component scaffolding composes with execution handlers without rep
name: "Injected",
id: "component:inject",
declaration:
'component Injected id "component:inject" subject Data runtime react; function sneak id "sneak" : unit -> unit;',
'module Injected id "component:inject" implements View.render; function sneak id "sneak" : unit -> unit;',
}),
/exactly one/,
);