@lunora/astro 1.0.0-alpha.103 → 1.0.0-alpha.104

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.mjs CHANGED
@@ -1 +1 @@
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
+ import{lunora as a}from"./packem_shared/lunora-DOdRz5Mw.mjs";import{withFrameworkWorker as t}from"@lunora/runtime";export{a as lunora,t as withLunora};
@@ -0,0 +1,6 @@
1
+ import{existsSync as c,readFileSync as h}from"node:fs";import{fileURLToPath as w}from"node:url";const i=["// src/worker.ts",'import { handle } from "@astrojs/cloudflare/handler";','import { withLunora } from "@lunora/astro";',"","// `shardDO` lives on `env` (per request), so pass an `(env) => options` factory.","export default withLunora("," (req, env, ctx) => handle(req, env, ctx),"," (env) => ({ shardDO: env.SHARD /* , … */ }),",");"].join(`
2
+ `),d=/\bwithLunora\s*\(/u,v=(l={})=>{const o=(l.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(!c(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
+
4
+ ${i}`);return}let s;try{s=h(a,"utf8")}catch(r){const u=r instanceof Error?r.message:String(r);n(`@lunora/astro: could not read server entry "${o}" (${u}) — 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
+
6
+ ${i}`)}},name:"@lunora/astro"}};export{v as lunora};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lunora/astro",
3
- "version": "1.0.0-alpha.103",
3
+ "version": "1.0.0-alpha.104",
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.66",
54
- "@lunora/runtime": "1.0.0-alpha.83"
53
+ "@lunora/client": "1.0.0-alpha.67",
54
+ "@lunora/runtime": "1.0.0-alpha.84"
55
55
  },
56
56
  "peerDependencies": {
57
57
  "astro": ">=6.0.0"
@@ -1,6 +0,0 @@
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,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
-
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
-
6
- ${i}`)}},name:"@lunora/astro"}};export{y as lunora};