@lunora/astro 1.0.0-alpha.75 → 1.0.0-alpha.77

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/index.d.mts CHANGED
@@ -56,4 +56,50 @@ interface LunoraIntegrationOptions {
56
56
  * middleware) without changing the public surface.
57
57
  */
58
58
  declare const lunora: (options?: LunoraIntegrationOptions) => AstroIntegrationLike;
59
- export { type AstroIntegrationLike, type LunoraIntegrationOptions, lunora };
59
+ export {
60
+ /**
61
+ * `@lunora/astro` — the Astro integration for Lunora (PLAN4 class-B:
62
+ * own-CF-adapter, hook-injection composition).
63
+ *
64
+ * Astro is multi-framework at the UI layer, so this package is **not** a new
65
+ * reactive layer. Reactivity comes from whichever island adapter the app
66
+ * hydrates with (`@lunora/react`, `@lunora/solid`, `@lunora/svelte`,
67
+ * `@lunora/vue`). `@lunora/astro` owns two server-side seams instead.
68
+ *
69
+ * Seam 1 — single-worker composition: `withLunora` wraps the Worker
70
+ * `@astrojs/cloudflare` emits so Lunora realtime (`/_lunora/rpc`, `/_lunora/ws`,
71
+ * `/_lunora/admin/*` + `ShardDO`) is mounted *inside* it, while everything else
72
+ * falls through to Astro's SSR handler — one worker, one deploy. `lunora` is the
73
+ * matching `astro.config` integration.
74
+ *
75
+ * Seam 2 — reactive-loader server helpers: the framework-neutral `@lunora/client/ssr`
76
+ * contract (`createServerClient`, `preloadQuery`, `getServerSession`,
77
+ * `serializePreloaded`) is re-exported from `@lunora/astro/server` for use in
78
+ * Astro server endpoints / `.astro` frontmatter. Preload a query there, then
79
+ * hand the `Preloaded` token to your island adapter's `hydratePreloaded` for the
80
+ * "your loaders are live" SSR-seed → live handoff.
81
+ */
82
+ type AstroIntegrationLike,
83
+ /**
84
+ * `@lunora/astro` — the Astro integration for Lunora (PLAN4 class-B:
85
+ * own-CF-adapter, hook-injection composition).
86
+ *
87
+ * Astro is multi-framework at the UI layer, so this package is **not** a new
88
+ * reactive layer. Reactivity comes from whichever island adapter the app
89
+ * hydrates with (`@lunora/react`, `@lunora/solid`, `@lunora/svelte`,
90
+ * `@lunora/vue`). `@lunora/astro` owns two server-side seams instead.
91
+ *
92
+ * Seam 1 — single-worker composition: `withLunora` wraps the Worker
93
+ * `@astrojs/cloudflare` emits so Lunora realtime (`/_lunora/rpc`, `/_lunora/ws`,
94
+ * `/_lunora/admin/*` + `ShardDO`) is mounted *inside* it, while everything else
95
+ * falls through to Astro's SSR handler — one worker, one deploy. `lunora` is the
96
+ * matching `astro.config` integration.
97
+ *
98
+ * Seam 2 — reactive-loader server helpers: the framework-neutral `@lunora/client/ssr`
99
+ * contract (`createServerClient`, `preloadQuery`, `getServerSession`,
100
+ * `serializePreloaded`) is re-exported from `@lunora/astro/server` for use in
101
+ * Astro server endpoints / `.astro` frontmatter. Preload a query there, then
102
+ * hand the `Preloaded` token to your island adapter's `hydratePreloaded` for the
103
+ * "your loaders are live" SSR-seed → live handoff.
104
+ */
105
+ type LunoraIntegrationOptions, lunora };
package/dist/index.d.ts CHANGED
@@ -56,4 +56,50 @@ interface LunoraIntegrationOptions {
56
56
  * middleware) without changing the public surface.
57
57
  */
58
58
  declare const lunora: (options?: LunoraIntegrationOptions) => AstroIntegrationLike;
59
- export { type AstroIntegrationLike, type LunoraIntegrationOptions, lunora };
59
+ export {
60
+ /**
61
+ * `@lunora/astro` — the Astro integration for Lunora (PLAN4 class-B:
62
+ * own-CF-adapter, hook-injection composition).
63
+ *
64
+ * Astro is multi-framework at the UI layer, so this package is **not** a new
65
+ * reactive layer. Reactivity comes from whichever island adapter the app
66
+ * hydrates with (`@lunora/react`, `@lunora/solid`, `@lunora/svelte`,
67
+ * `@lunora/vue`). `@lunora/astro` owns two server-side seams instead.
68
+ *
69
+ * Seam 1 — single-worker composition: `withLunora` wraps the Worker
70
+ * `@astrojs/cloudflare` emits so Lunora realtime (`/_lunora/rpc`, `/_lunora/ws`,
71
+ * `/_lunora/admin/*` + `ShardDO`) is mounted *inside* it, while everything else
72
+ * falls through to Astro's SSR handler — one worker, one deploy. `lunora` is the
73
+ * matching `astro.config` integration.
74
+ *
75
+ * Seam 2 — reactive-loader server helpers: the framework-neutral `@lunora/client/ssr`
76
+ * contract (`createServerClient`, `preloadQuery`, `getServerSession`,
77
+ * `serializePreloaded`) is re-exported from `@lunora/astro/server` for use in
78
+ * Astro server endpoints / `.astro` frontmatter. Preload a query there, then
79
+ * hand the `Preloaded` token to your island adapter's `hydratePreloaded` for the
80
+ * "your loaders are live" SSR-seed → live handoff.
81
+ */
82
+ type AstroIntegrationLike,
83
+ /**
84
+ * `@lunora/astro` — the Astro integration for Lunora (PLAN4 class-B:
85
+ * own-CF-adapter, hook-injection composition).
86
+ *
87
+ * Astro is multi-framework at the UI layer, so this package is **not** a new
88
+ * reactive layer. Reactivity comes from whichever island adapter the app
89
+ * hydrates with (`@lunora/react`, `@lunora/solid`, `@lunora/svelte`,
90
+ * `@lunora/vue`). `@lunora/astro` owns two server-side seams instead.
91
+ *
92
+ * Seam 1 — single-worker composition: `withLunora` wraps the Worker
93
+ * `@astrojs/cloudflare` emits so Lunora realtime (`/_lunora/rpc`, `/_lunora/ws`,
94
+ * `/_lunora/admin/*` + `ShardDO`) is mounted *inside* it, while everything else
95
+ * falls through to Astro's SSR handler — one worker, one deploy. `lunora` is the
96
+ * matching `astro.config` integration.
97
+ *
98
+ * Seam 2 — reactive-loader server helpers: the framework-neutral `@lunora/client/ssr`
99
+ * contract (`createServerClient`, `preloadQuery`, `getServerSession`,
100
+ * `serializePreloaded`) is re-exported from `@lunora/astro/server` for use in
101
+ * Astro server endpoints / `.astro` frontmatter. Preload a query there, then
102
+ * hand the `Preloaded` token to your island adapter's `hydratePreloaded` for the
103
+ * "your loaders are live" SSR-seed → live handoff.
104
+ */
105
+ type LunoraIntegrationOptions, lunora };
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{lunora as a}from"./packem_shared/lunora-DUrBrtb9.mjs";import{withFrameworkWorker as t}from"@lunora/runtime";export{a as lunora,t as withLunora};
1
+ import{lunora as a}from"./packem_shared/lunora-D3tdDncx.mjs";import{withFrameworkWorker as t}from"@lunora/runtime";export{a as lunora,t as withLunora};
@@ -1,6 +1,6 @@
1
1
  import{existsSync as h,readFileSync as c}from"node:fs";import{fileURLToPath as w}from"node:url";const i=['import { withLunora } from "@lunora/astro/server";',"","export default withLunora(astroWorker, { shardDO: env.SHARD /* , … */ });"].join(`
2
- `),d=/\bwithLunora\s*\(/u,m=(u={})=>{const t=(u.serverEntry??"src/worker.ts").trim();return{hooks:{"astro:config:done":(o={})=>{if(t.length===0)throw new TypeError("@lunora/astro: `serverEntry` must be a non-empty path.");const e=o.config?.root;if(e===void 0)return;const n=r=>{o.logger?.warn?o.logger.warn(r):console.warn(r)},a=w(new URL(t,e));if(!h(a)){n(`@lunora/astro: server entry "${t}" not found — add it (or point \`lunora({ serverEntry })\` at the right path) and wrap the Astro worker with \`withLunora\`, or \`/_lunora/*\` (Lunora realtime) will be unrouted:
2
+ `),d=/\bwithLunora\s*\(/u,y=(u={})=>{const o=(u.serverEntry??"src/worker.ts").trim();return{hooks:{"astro:config:done":(t={})=>{if(o.length===0)throw new TypeError("@lunora/astro: `serverEntry` must be a non-empty path.");const e=t.config?.root;if(e===void 0)return;const n=r=>{t.logger?.warn?t.logger.warn(r):console.warn(r)},a=w(new URL(o,e));if(!h(a)){n(`@lunora/astro: server entry "${o}" not found — add it (or point \`lunora({ serverEntry })\` at the right path) and wrap the Astro worker with \`withLunora\`, or \`/_lunora/*\` (Lunora realtime) will be unrouted:
3
3
 
4
- ${i}`);return}let s;try{s=c(a,"utf8")}catch(r){const l=r instanceof Error?r.message:String(r);n(`@lunora/astro: could not read server entry "${t}" (${l}) — skipping the \`withLunora\` check.`);return}d.test(s)||n(`@lunora/astro: couldn't find a \`withLunora(...)\` call in the server entry "${t}" — \`/_lunora/*\` (Lunora realtime) will be unrouted and subscriptions will silently 404. Wrap the Astro worker:
4
+ ${i}`);return}let s;try{s=c(a,"utf8")}catch(r){const l=r instanceof Error?r.message:String(r);n(`@lunora/astro: could not read server entry "${o}" (${l}) — skipping the \`withLunora\` check.`);return}d.test(s)||n(`@lunora/astro: couldn't find a \`withLunora(...)\` call in the server entry "${o}" — \`/_lunora/*\` (Lunora realtime) will be unrouted and subscriptions will silently 404. Wrap the Astro worker:
5
5
 
6
- ${i}`)}},name:"@lunora/astro"}};export{m as lunora};
6
+ ${i}`)}},name:"@lunora/astro"}};export{y as lunora};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lunora/astro",
3
- "version": "1.0.0-alpha.75",
3
+ "version": "1.0.0-alpha.77",
4
4
  "description": "Astro integration for Lunora — single-worker composition plus reactive-loader server helpers",
5
5
  "keywords": [
6
6
  "astro",
@@ -50,8 +50,8 @@
50
50
  "access": "public"
51
51
  },
52
52
  "dependencies": {
53
- "@lunora/client": "1.0.0-alpha.48",
54
- "@lunora/runtime": "1.0.0-alpha.61"
53
+ "@lunora/client": "1.0.0-alpha.50",
54
+ "@lunora/runtime": "1.0.0-alpha.62"
55
55
  },
56
56
  "peerDependencies": {
57
57
  "astro": ">=6.0.0"