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.
@@ -1,4 +1,4 @@
1
- import { o as i } from "../plugin-sAwHmkG8.js";
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:instant-middleware", order: "pre" });
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 the
8
- * X-Okno-Repo header) from the app's git origin + current branch. A deployed
9
- * site is exactly one repo, so the editor adopts this and skips the picker on
10
- * live. Returns null outside a GitHub checkout (no origin / no git) — the editor
11
- * then falls back to the picker. git resolves the repo from any cwd inside the
12
- * tree, so process.cwd() (the build's working dir, = the app dir even in a
13
- * monorepo) is enough. */
14
- export declare function bakeRepoIdentity(): string | null;
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. */
@@ -1 +1 @@
1
- {"version":3,"file":"bake.d.ts","sourceRoot":"","sources":["../src/bake.ts"],"names":[],"mappings":"AAmBA;;;;sEAIsE;AACtE,wBAAgB,UAAU,IAAI,MAAM,CAWnC;AAED;;;;;;2BAM2B;AAC3B,wBAAgB,gBAAgB,IAAI,MAAM,GAAG,IAAI,CAMhD;AAED;;+EAE+E;AAC/E,wBAAgB,YAAY,IAAI,MAAM,CAIrC"}
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:<kind>"` so names referenced before scaffolding
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,iBAoLhE"}
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:content"` → okno.pages / .globals /
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,M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,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:<kind>"`
3
- * (or the colon-free `okno/<kind>` token) statements and return the union of
4
- * imported names. Used by both the runtime virtual modules and the type codegen
5
- * to emit placeholder exports for content that doesn't exist yet, so a project
6
- * can refer to `home.title` (and get types for it) before any schema is
7
- * scaffolded — including for an optional/unscaffolded name (e.g. a `theme`
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;;;;;;;;;GASG;AACH,wBAAsB,WAAW,CAChC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,OAAO,GAAG,aAAa,GAAG,SAAS,GACvC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CA0CtB"}
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"}