@lunora/astro 1.0.0-alpha.61 → 1.0.0-alpha.63
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
|
@@ -1,19 +1,4 @@
|
|
|
1
1
|
export { type FrameworkHostHandler as AstroWorkerHandler, type LunoraWorker as ComposedWorker, type FrameworkWorkerOptions as LunoraOptions, withFrameworkWorker as withLunora } from '@lunora/runtime';
|
|
2
|
-
/**
|
|
3
|
-
* The Lunora Astro **integration** — an `AstroIntegration` object
|
|
4
|
-
* (`{ name, hooks }`) added to `astro.config.*`'s `integrations` array.
|
|
5
|
-
*
|
|
6
|
-
* Astro is multi-framework at the UI layer, so this integration is **not** a new
|
|
7
|
-
* reactive runtime. Its job is the *composition* seam (PLAN4 class-B): make the
|
|
8
|
-
* Worker `@astrojs/cloudflare` emits mount Lunora realtime under `/_lunora/*`
|
|
9
|
-
* via `withLunora`, and surface the framework-neutral server helpers
|
|
10
|
-
* (`@lunora/astro/server`) to Astro server endpoints / `.astro` frontmatter.
|
|
11
|
-
*
|
|
12
|
-
* Reactivity itself comes from whichever island adapter the app hydrates with —
|
|
13
|
-
* `@lunora/react`, `@lunora/solid`, `@lunora/svelte`, or `@lunora/vue` — each of
|
|
14
|
-
* which ships its own `hydratePreloaded(preloaded)` for the SSR-seed → live
|
|
15
|
-
* handoff. This package owns the server/composition half only.
|
|
16
|
-
*/
|
|
17
2
|
/**
|
|
18
3
|
* Structural subset of Astro's `AstroIntegration`. Declared locally (rather than
|
|
19
4
|
* importing `astro`'s type) so `@lunora/astro`'s public surface stays decoupled
|
|
@@ -54,18 +39,21 @@ interface LunoraIntegrationOptions {
|
|
|
54
39
|
*
|
|
55
40
|
* What it does:
|
|
56
41
|
*
|
|
57
|
-
* - Marks the build so the `@astrojs/cloudflare` server entry is wrapped with
|
|
58
|
-
* `withLunora` — the composed worker reserves `/_lunora/*` for Lunora realtime
|
|
59
|
-
* and forwards everything else to Astro's SSR handler (one worker, one deploy).
|
|
60
42
|
* - Documents the `serverEntry` (default `src/worker.ts`) where the
|
|
61
43
|
* `withLunora(astroWorker, { shardDO: env.SHARD, … })` composition lives.
|
|
44
|
+
* - Checks, at `astro:config:done`, that `serverEntry` exists and contains an
|
|
45
|
+
* actual `withLunora(...)` CALL (not merely an import of it) — and warns
|
|
46
|
+
* (does not fail the build) when it doesn't, so a missing wrapper is caught
|
|
47
|
+
* at build time instead of shipping a worker where `/_lunora/*` is unrouted
|
|
48
|
+
* and realtime silently 404s.
|
|
62
49
|
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
50
|
+
* This integration does NOT wrap the server entry itself — no file is written
|
|
51
|
+
* or modified. The load-bearing composition is the `withLunora` call the
|
|
52
|
+
* project author writes at the server-entry boundary (see `withLunora` for the
|
|
53
|
+
* `@astrojs/cloudflare` injection point); this object exists so the wiring is
|
|
54
|
+
* declared in `astro.config` the idiomatic Astro way, checked once at build
|
|
55
|
+
* time, and has a home for future build-time hooks (binding reconcile, dev
|
|
56
|
+
* middleware) without changing the public surface.
|
|
69
57
|
*/
|
|
70
58
|
declare const lunora: (options?: LunoraIntegrationOptions) => AstroIntegrationLike;
|
|
71
59
|
export { type AstroIntegrationLike, type LunoraIntegrationOptions, lunora };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,19 +1,4 @@
|
|
|
1
1
|
export { type FrameworkHostHandler as AstroWorkerHandler, type LunoraWorker as ComposedWorker, type FrameworkWorkerOptions as LunoraOptions, withFrameworkWorker as withLunora } from '@lunora/runtime';
|
|
2
|
-
/**
|
|
3
|
-
* The Lunora Astro **integration** — an `AstroIntegration` object
|
|
4
|
-
* (`{ name, hooks }`) added to `astro.config.*`'s `integrations` array.
|
|
5
|
-
*
|
|
6
|
-
* Astro is multi-framework at the UI layer, so this integration is **not** a new
|
|
7
|
-
* reactive runtime. Its job is the *composition* seam (PLAN4 class-B): make the
|
|
8
|
-
* Worker `@astrojs/cloudflare` emits mount Lunora realtime under `/_lunora/*`
|
|
9
|
-
* via `withLunora`, and surface the framework-neutral server helpers
|
|
10
|
-
* (`@lunora/astro/server`) to Astro server endpoints / `.astro` frontmatter.
|
|
11
|
-
*
|
|
12
|
-
* Reactivity itself comes from whichever island adapter the app hydrates with —
|
|
13
|
-
* `@lunora/react`, `@lunora/solid`, `@lunora/svelte`, or `@lunora/vue` — each of
|
|
14
|
-
* which ships its own `hydratePreloaded(preloaded)` for the SSR-seed → live
|
|
15
|
-
* handoff. This package owns the server/composition half only.
|
|
16
|
-
*/
|
|
17
2
|
/**
|
|
18
3
|
* Structural subset of Astro's `AstroIntegration`. Declared locally (rather than
|
|
19
4
|
* importing `astro`'s type) so `@lunora/astro`'s public surface stays decoupled
|
|
@@ -54,18 +39,21 @@ interface LunoraIntegrationOptions {
|
|
|
54
39
|
*
|
|
55
40
|
* What it does:
|
|
56
41
|
*
|
|
57
|
-
* - Marks the build so the `@astrojs/cloudflare` server entry is wrapped with
|
|
58
|
-
* `withLunora` — the composed worker reserves `/_lunora/*` for Lunora realtime
|
|
59
|
-
* and forwards everything else to Astro's SSR handler (one worker, one deploy).
|
|
60
42
|
* - Documents the `serverEntry` (default `src/worker.ts`) where the
|
|
61
43
|
* `withLunora(astroWorker, { shardDO: env.SHARD, … })` composition lives.
|
|
44
|
+
* - Checks, at `astro:config:done`, that `serverEntry` exists and contains an
|
|
45
|
+
* actual `withLunora(...)` CALL (not merely an import of it) — and warns
|
|
46
|
+
* (does not fail the build) when it doesn't, so a missing wrapper is caught
|
|
47
|
+
* at build time instead of shipping a worker where `/_lunora/*` is unrouted
|
|
48
|
+
* and realtime silently 404s.
|
|
62
49
|
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
50
|
+
* This integration does NOT wrap the server entry itself — no file is written
|
|
51
|
+
* or modified. The load-bearing composition is the `withLunora` call the
|
|
52
|
+
* project author writes at the server-entry boundary (see `withLunora` for the
|
|
53
|
+
* `@astrojs/cloudflare` injection point); this object exists so the wiring is
|
|
54
|
+
* declared in `astro.config` the idiomatic Astro way, checked once at build
|
|
55
|
+
* time, and has a home for future build-time hooks (binding reconcile, dev
|
|
56
|
+
* middleware) without changing the public surface.
|
|
69
57
|
*/
|
|
70
58
|
declare const lunora: (options?: LunoraIntegrationOptions) => AstroIntegrationLike;
|
|
71
59
|
export { type AstroIntegrationLike, type LunoraIntegrationOptions, lunora };
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{lunora as a}from"./packem_shared/lunora-
|
|
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};
|
|
@@ -0,0 +1,6 @@
|
|
|
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:
|
|
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:
|
|
5
|
+
|
|
6
|
+
${i}`)}},name:"@lunora/astro"}};export{m as lunora};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lunora/astro",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.63",
|
|
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.
|
|
54
|
-
"@lunora/runtime": "1.0.0-alpha.
|
|
53
|
+
"@lunora/client": "1.0.0-alpha.36",
|
|
54
|
+
"@lunora/runtime": "1.0.0-alpha.51"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
57
|
"astro": ">=6.0.0"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const t=(r={})=>{const o=(r.serverEntry??"src/worker.ts").trim();return{hooks:{"astro:config:done":()=>{if(o.length===0)throw new TypeError("@lunora/astro: `serverEntry` must be a non-empty path.")}},name:"@lunora/astro"}};export{t as lunora};
|