@cloudcrane/app-runtime 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/compiler/compile.d.ts +1 -0
- package/dist/compiler/compile.js +5 -1
- package/dist/host.d.ts +1 -1
- package/dist/host.js +1 -1
- package/package.json +2 -2
|
@@ -13,6 +13,7 @@ export type LinkedRuntime = {
|
|
|
13
13
|
path: string;
|
|
14
14
|
integrity: string;
|
|
15
15
|
};
|
|
16
|
+
/** `runtime` names the runtime the page carries, or is "page" for an HTML app's spec, which is its page as written, with none. */
|
|
16
17
|
export type Compiled = {
|
|
17
18
|
html: string;
|
|
18
19
|
sha256: string;
|
package/dist/compiler/compile.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
|
-
import { canonical, validateSpec } from "@cloudcrane/app-spec";
|
|
2
|
+
import { canonical, pageOf, validateSpec } from "@cloudcrane/app-spec";
|
|
3
3
|
import { CODED_CSS, DATESTRIP_CSS } from "../runtime/styles.js";
|
|
4
4
|
import { tokensCss } from "../runtime/theme.js";
|
|
5
5
|
import { RUNTIME_JS, RUNTIME_SHA256, RUNTIME_VERSION } from "./runtime.generated.js";
|
|
@@ -40,6 +40,10 @@ export function compile(input, options = {}) {
|
|
|
40
40
|
const { spec, problems } = validateSpec(input);
|
|
41
41
|
if (!spec)
|
|
42
42
|
throw new CompileError(problems);
|
|
43
|
+
// A spec that is an HTML app's page is that page, as written: no runtime, so any runtime version builds it the same.
|
|
44
|
+
const page = pageOf(spec);
|
|
45
|
+
if (page !== null)
|
|
46
|
+
return { html: page, sha256: createHash("sha256").update(page).digest("hex"), runtime: "page" };
|
|
43
47
|
if (spec.manifest.runtime !== RUNTIME_VERSION)
|
|
44
48
|
throw new CompileError([{ at: "manifest.runtime", problem: `this compiler builds runtime ${RUNTIME_VERSION}` }]);
|
|
45
49
|
// Only what drawing the app needs goes in the page: not the journeys, promises or tests.
|
package/dist/host.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { validateSpec, leakProblems, deriveBlueprint, CLOUDCRANE_CATALOG_ID } from "@cloudcrane/app-spec";
|
|
1
|
+
export { validateSpec, leakProblems, deriveBlueprint, CLOUDCRANE_CATALOG_ID, pageOf, wrapPage, type PageApp } from "@cloudcrane/app-spec";
|
|
2
2
|
export { compile, CompileError, runtimeFile } from "./compiler/compile.js";
|
|
3
3
|
export { RUNTIME_JS, RUNTIME_SHA256, RUNTIME_VERSION } from "./compiler/runtime.generated.js";
|
package/dist/host.js
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
// one file, built by vendor.mjs): check a spec, build it, and describe it as a
|
|
3
3
|
// blueprint. The runtime's code is exported so a host can check a built page
|
|
4
4
|
// without it: the runtime is reviewed once per version and locked by its hash.
|
|
5
|
-
export { validateSpec, leakProblems, deriveBlueprint, CLOUDCRANE_CATALOG_ID } from "@cloudcrane/app-spec";
|
|
5
|
+
export { validateSpec, leakProblems, deriveBlueprint, CLOUDCRANE_CATALOG_ID, pageOf, wrapPage } from "@cloudcrane/app-spec";
|
|
6
6
|
export { compile, CompileError, runtimeFile } from "./compiler/compile.js";
|
|
7
7
|
export { RUNTIME_JS, RUNTIME_SHA256, RUNTIME_VERSION } from "./compiler/runtime.generated.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudcrane/app-runtime",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"runtimeVersion": "0.4.0",
|
|
5
5
|
"description": "Builds a CloudCrane app spec into one HTML page, the same bytes every time, and the runtime that draws it with A2UI's renderer.",
|
|
6
6
|
"keywords": [
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"LICENSE"
|
|
45
45
|
],
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@cloudcrane/app-spec": "^0.
|
|
47
|
+
"@cloudcrane/app-spec": "^0.5.0"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"zod": "^3.25.76"
|