okno 1.0.0-beta.42 → 1.0.0-beta.44
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/astro/index.js +2 -2
- package/dist/bake.d.ts +17 -8
- package/dist/bake.d.ts.map +1 -1
- package/dist/codegen/generate.d.ts +1 -1
- package/dist/codegen/generate.d.ts.map +1 -1
- package/dist/codegen/modules.d.ts +1 -1
- package/dist/codegen/modules.d.ts.map +1 -1
- package/dist/codegen/scan-imports.d.ts +6 -8
- package/dist/codegen/scan-imports.d.ts.map +1 -1
- package/dist/dispatch-CumCB1dI.js +986 -0
- package/dist/editor/index.js +16594 -16565
- package/dist/engine/materialize.d.ts +5 -1
- package/dist/engine/materialize.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/next/codegen.d.ts +10 -10
- package/dist/next/config.d.ts.map +1 -1
- package/dist/next/index.js +60 -60
- package/dist/{plugin-sAwHmkG8.js → plugin-DCxkXmmG.js} +73 -64
- package/dist/runtime/instant.js +129 -124
- package/dist/runtime/wrap.d.ts +28 -1
- package/dist/runtime/wrap.d.ts.map +1 -1
- package/dist/runtime/wrap.js +396 -370
- package/dist/types/fields.d.ts +11 -2
- package/dist/types/fields.d.ts.map +1 -1
- package/dist/vite/index.js +1 -1
- package/dist/vite/plugin.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/runtime/wrap.ts +132 -13
- package/dist/dispatch-Bj6gNKBL.js +0 -973
package/dist/astro/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as i } from "../plugin-
|
|
1
|
+
import { o as i } from "../plugin-DCxkXmmG.js";
|
|
2
2
|
import { join as d } from "node:path";
|
|
3
3
|
import { readFileSync as p } from "node:fs";
|
|
4
4
|
function c(o) {
|
|
@@ -16,7 +16,7 @@ function k(o = {}) {
|
|
|
16
16
|
const t = s === "build" && c(o.dir ?? "okno");
|
|
17
17
|
t && !n.adapter && console.warn(
|
|
18
18
|
"[okno] instant is on in okno/project.json, but this Astro project has no adapter — falling back to the baked build. Add one (e.g. `npx astro add cloudflare`) and set `export const prerender = false` on okno-driven pages. See docs/instant.md."
|
|
19
|
-
), process.env.OKNO_INSTANT = t && n.adapter ? "1" : "0", e({ vite: { plugins: [i(o)] } }), r("page", 'import "okno/boot"'), t && n.adapter && a({ entrypoint: "okno
|
|
19
|
+
), process.env.OKNO_INSTANT = t && n.adapter ? "1" : "0", e({ vite: { plugins: [i(o)] } }), r("page", 'import "okno/boot"'), t && n.adapter && a({ entrypoint: "okno/instant-middleware", order: "pre" });
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
};
|
package/dist/bake.d.ts
CHANGED
|
@@ -4,14 +4,23 @@
|
|
|
4
4
|
* ref). Baking `@HEAD` breaks the editor (HEAD isn't a writable branch), so on
|
|
5
5
|
* detachment fall back to the host's branch env var, then "main". */
|
|
6
6
|
export declare function bakeBranch(): string;
|
|
7
|
-
/** Bake the project's repo identity (`owner/repo@branch`, mirroring
|
|
8
|
-
* X-Okno-Repo header) from the app's git origin + current branch
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
|
|
7
|
+
/** Bake the project's repo identity (`owner/repo[#repoId]@branch`, mirroring
|
|
8
|
+
* the X-Okno-Repo header) from the app's git origin + current branch, plus the
|
|
9
|
+
* immutable repo ID from `<dir>/project.json` when present. The ID is the part
|
|
10
|
+
* that survives a GitHub transfer/rename — the git origin URL goes stale the
|
|
11
|
+
* moment a repo moves (push redirects hide it), which is exactly the failure
|
|
12
|
+
* the ID exists to absorb. A deployed site is exactly one repo, so the editor
|
|
13
|
+
* adopts this and skips the picker on live. Returns null outside a GitHub
|
|
14
|
+
* checkout (no origin / no git) — the editor then falls back to the picker.
|
|
15
|
+
* git resolves the repo from any cwd inside the tree, so process.cwd() (the
|
|
16
|
+
* build's working dir, = the app dir even in a monorepo) is enough.
|
|
17
|
+
*
|
|
18
|
+
* The NAME part is ADVISORY, not authoritative: the hosted backend treats it
|
|
19
|
+
* as a lookup key and maps it to the repo's CURRENT location via its
|
|
20
|
+
* repo_names ledger (backend/src/lib/canonical.ts) — never make backend
|
|
21
|
+
* behavior depend on this string being current. The `#repoId` is the part
|
|
22
|
+
* that stays true. */
|
|
23
|
+
export declare function bakeRepoIdentity(oknoDir?: string): string | null;
|
|
15
24
|
/** Bake the monorepo root path — the build dir relative to the git root — so the
|
|
16
25
|
* hosted backend knows which subtree holds this project's `okno/`. "" at the repo
|
|
17
26
|
* root (single-project repo), "apps/site" in a monorepo. POSIX-normalized. */
|
package/dist/bake.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bake.d.ts","sourceRoot":"","sources":["../src/bake.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bake.d.ts","sourceRoot":"","sources":["../src/bake.ts"],"names":[],"mappings":"AAoBA;;;;sEAIsE;AACtE,wBAAgB,UAAU,IAAI,MAAM,CAWnC;AAiBD;;;;;;;;;;;;;;;uBAeuB;AACvB,wBAAgB,gBAAgB,CAAC,OAAO,SAAS,GAAG,MAAM,GAAG,IAAI,CAOhE;AAED;;+EAE+E;AAC/E,wBAAgB,YAAY,IAAI,MAAM,CAIrC"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* - modules.d.ts (type declarations for okno:* virtual modules)
|
|
4
4
|
*
|
|
5
5
|
* `root` is the project root (parent of the okno dir) — we scan it for
|
|
6
|
-
* `import { x } from "okno
|
|
6
|
+
* `import { x } from "okno/<kind>"` so names referenced before scaffolding
|
|
7
7
|
* still get a (placeholder) type, mirroring the runtime virtual modules.
|
|
8
8
|
*/
|
|
9
9
|
export declare function generateTypes(oknoDir: string, root: string): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../src/codegen/generate.ts"],"names":[],"mappings":"AAUA;;;;;;;GAOG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../src/codegen/generate.ts"],"names":[],"mappings":"AAUA;;;;;;;GAOG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,iBA8MhE"}
|
|
@@ -6,7 +6,7 @@ export declare function getRuntimeSource(): string | null;
|
|
|
6
6
|
* same resolution dance as the wrap runtime above. */
|
|
7
7
|
export declare function getInstantRuntimeSource(): string | null;
|
|
8
8
|
/** The umbrella `okno:content` module: one import, all kinds namespaced
|
|
9
|
-
* (`import * as okno from "okno
|
|
9
|
+
* (`import * as okno from "okno/content"` → okno.pages / .globals /
|
|
10
10
|
* .collections) + the UI-strings store (okno.strings). Pure re-export — the
|
|
11
11
|
* per-kind modules still work. */
|
|
12
12
|
export declare function buildContentModule(): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modules.d.ts","sourceRoot":"","sources":["../../src/codegen/modules.ts"],"names":[],"mappings":"AAgCA,eAAO,MAAM,eAAe,oHACoF,CAAA;AAoBhH;kEACkE;AAClE,wBAAgB,gBAAgB,IAAI,MAAM,GAAG,IAAI,CAKhD;AAED;uDACuD;AACvD,wBAAgB,uBAAuB,IAAI,MAAM,GAAG,IAAI,CAMvD;AAED;;;mCAGmC;AACnC,wBAAgB,kBAAkB,IAAI,MAAM,CAO3C;AA+CD,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAIrE;AAED;;qDAEqD;AACrD,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG;IACtD,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;IAChC,oFAAoF;IACpF,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IACtB,wEAAwE;IACxE,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M,GAAG,MAAM,CAErD;AAED,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEtD;AAMD;;;;;+EAK+E;AAC/E,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAoD1D;AAED;;;;;;;GAOG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAsDzE;AAED,0CAA0C;AAC1C,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,GAAE,GAAG,CAAC,MAAM,CAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CA8FtG;AAED,2FAA2F;AAC3F,wBAAsB,sBAAsB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,GAAE,GAAG,CAAC,MAAM,CAAa,EAAE,OAAO,UAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAyJ7H;AAED,4CAA4C;AAC5C,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,GAAE,GAAG,CAAC,MAAM,CAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAgFxG"}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Walk the project root looking for `import { foo, bar } from "okno
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* global). Matches BOTH the `okno:` (Vite virtual) and `okno/` (Next/tsconfig
|
|
9
|
-
* paths) forms so the placeholder emits regardless of which token a page uses.
|
|
2
|
+
* Walk the project root looking for `import { foo, bar } from "okno/<kind>"`
|
|
3
|
+
* statements and return the union of imported names. Used by both the runtime
|
|
4
|
+
* virtual modules and the type codegen to emit placeholder exports for content
|
|
5
|
+
* that doesn't exist yet, so a project can refer to `home.title` (and get
|
|
6
|
+
* types for it) before any schema is scaffolded — including for an
|
|
7
|
+
* optional/unscaffolded name (e.g. a `theme` global).
|
|
10
8
|
*/
|
|
11
9
|
export declare function scanImports(root: string, kind: "pages" | "collections" | "globals"): Promise<Set<string>>;
|
|
12
10
|
//# sourceMappingURL=scan-imports.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scan-imports.d.ts","sourceRoot":"","sources":["../../src/codegen/scan-imports.ts"],"names":[],"mappings":"AAiBA
|
|
1
|
+
{"version":3,"file":"scan-imports.d.ts","sourceRoot":"","sources":["../../src/codegen/scan-imports.ts"],"names":[],"mappings":"AAiBA;;;;;;;GAOG;AACH,wBAAsB,WAAW,CAChC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,OAAO,GAAG,aAAa,GAAG,SAAS,GACvC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CA0CtB"}
|