feat: add display kiosk host
This commit is contained in:
@@ -9,11 +9,12 @@ import {
|
||||
* How a host obtains a module's UI artifact.
|
||||
*
|
||||
* `url` is a **browser-loadable module URL**, not a filesystem path. That distinction is the whole
|
||||
* reason this type exists. Core's module discovery resolves `entrypoints.ui` to an absolute path on
|
||||
* the server's disk (`ResolvedModuleEntrypoints.ui`); a browser cannot import that, and a host that
|
||||
* passed one here would fail at run time in a way no test on a server would catch. Turning an
|
||||
* installed artifact into a URL a browser may fetch is **asset publication**, a separate concern
|
||||
* this package deliberately does not own and Ekklesia does not implement yet (ADR 0024).
|
||||
* reason this type exists. Core's module discovery resolves each primary or display entrypoint to an
|
||||
* absolute path on the server's disk; a browser cannot import that, and a host that passed one here
|
||||
* would fail at run time in a way no test on a server would catch. Turning an installed artifact
|
||||
* into a URL a browser may fetch is **asset publication**, a separate concern this generic package
|
||||
* deliberately does not own. Ekklesia implements that concern for both roles at its API edge (ADR
|
||||
* 0025, ADR 0033).
|
||||
*
|
||||
* `moduleId` and `version` are the identity the host already read from the module's validated
|
||||
* manifest. They are checked against the artifact before anything is mounted.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"manifestVersion": 5,
|
||||
"manifestVersion": 6,
|
||||
"id": "example",
|
||||
"name": "Example",
|
||||
"version": "0.1.0",
|
||||
|
||||
@@ -56,7 +56,11 @@ function standaloneContext(requested: string[]): ModuleUiHostContext {
|
||||
describe("loading a real compiled artifact", () => {
|
||||
beforeAll(async () => {
|
||||
const result = await buildModuleUi({ moduleDirectory: fixtureDirectory });
|
||||
artifactSource = await readFile(result.outputFile, "utf8");
|
||||
const primaryArtifact = result.artifacts.find((artifact) => artifact.kind === "ui");
|
||||
if (!primaryArtifact) {
|
||||
throw new Error("The real-artifact fixture must declare a primary UI artifact.");
|
||||
}
|
||||
artifactSource = await readFile(primaryArtifact.outputFile, "utf8");
|
||||
artifactUrl = `data:text/javascript;base64,${Buffer.from(artifactSource, "utf8").toString("base64")}`;
|
||||
}, 60_000);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user