@lunora/astro 1.0.0-alpha.129 → 1.0.0-alpha.130

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-CSieksVN.mjs";import{withFrameworkWorker as t}from"@lunora/runtime";export{a as lunora,t as withLunora};
1
+ import{lunora as a}from"./packem_shared/lunora-DnV2_atg.mjs";import{withFrameworkWorker as t}from"@lunora/runtime";export{a as lunora,t as withLunora};
@@ -0,0 +1,6 @@
1
+ import{existsSync as u,readFileSync as E}from"node:fs";import{fileURLToPath as c}from"node:url";const p=String.raw`\/\*[\s\S]*?\*\/`,L=String.raw`\/\/[^\n]*`,f=String.raw`"(?:[^"\\\n]|\\.)*"`,m=String.raw`'(?:[^'\\\n]|\\.)*'`,v=String.raw`\x60(?:[^\x60\\$]|\\.|\$(?!\{))*\x60`,y=new RegExp([p,L,f,m,v].join("|"),"gu"),_=/[^\n]/gu,g=e=>e.replaceAll(_," "),R=e=>e.replaceAll(y,g),d=["// src/server.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
+ `),S=/\b(?:withLunora|withFrameworkWorker|buildFrameworkWorker)\s*\(/u,h="src/server.ts",s="src/worker.ts",k=(e={})=>{const n=(e.serverEntry??h).trim();return{hooks:{"astro:config:done":(o={})=>{if(n.length===0)throw new TypeError("@lunora/astro: `serverEntry` must be a non-empty path.");const t=o.config?.root;if(t===void 0)return;const a=r=>{o.logger?.warn?o.logger.warn(r):console.warn(r)},l=c(new URL(n,t));if(!u(l)){const r=e.serverEntry===void 0&&u(c(new URL(s,t)));a(r?`@lunora/astro: the default server entry is now "${h}", and this project still composes in "${s}". Rename it — \`lunora deploy\` passes a file at that exact path to wrangler positionally, and @astrojs/cloudflare's \`no_bundle\` redirect then uploads it untranspiled — or keep the old name with \`lunora({ serverEntry: "${s}" })\`.`:`@lunora/astro: server entry "${n}" 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
+ ${d}`);return}let i;try{i=E(l,"utf8")}catch(r){const w=r instanceof Error?r.message:String(r);a(`@lunora/astro: could not read server entry "${n}" (${w}) — skipping the \`withLunora\` check.`);return}S.test(R(i))||a(`@lunora/astro: couldn't find a \`withLunora(...)\` or \`.buildFrameworkWorker(...)\` call in the server entry "${n}" — \`/_lunora/*\` (Lunora realtime) will be unrouted and subscriptions will silently 404. Compose the Astro worker:
5
+
6
+ ${d}`)}},name:"@lunora/astro"}};export{k as lunora};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lunora/astro",
3
- "version": "1.0.0-alpha.129",
3
+ "version": "1.0.0-alpha.130",
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.94",
54
- "@lunora/runtime": "1.0.0-alpha.109"
53
+ "@lunora/client": "1.0.0-alpha.95",
54
+ "@lunora/runtime": "1.0.0-alpha.110"
55
55
  },
56
56
  "peerDependencies": {
57
57
  "astro": ">=6.0.0"
@@ -1,6 +0,0 @@
1
- import{existsSync as u,readFileSync as E}from"node:fs";import{fileURLToPath as c}from"node:url";const d=["// src/server.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
- `),p=/\b(?:withLunora|withFrameworkWorker|buildFrameworkWorker)\s*\(/u,L=String.raw`\/\*[\s\S]*?\*\/`,f=String.raw`\/\/[^\n]*`,m=String.raw`"(?:[^"\\\n]|\\.)*"`,v=String.raw`'(?:[^'\\\n]|\\.)*'`,y=String.raw`\x60(?:[^\x60\\$]|\\.|\$(?!\{))*\x60`,_=new RegExp([L,f,m,v,y].join("|"),"gu"),g=/[^\n]/gu,R=n=>n.replaceAll(_,e=>e.replaceAll(g," ")),h="src/server.ts",s="src/worker.ts",N=(n={})=>{const e=(n.serverEntry??h).trim();return{hooks:{"astro:config:done":(o={})=>{if(e.length===0)throw new TypeError("@lunora/astro: `serverEntry` must be a non-empty path.");const t=o.config?.root;if(t===void 0)return;const a=r=>{o.logger?.warn?o.logger.warn(r):console.warn(r)},l=c(new URL(e,t));if(!u(l)){const r=n.serverEntry===void 0&&u(c(new URL(s,t)));a(r?`@lunora/astro: the default server entry is now "${h}", and this project still composes in "${s}". Rename it — \`lunora deploy\` passes a file at that exact path to wrangler positionally, and @astrojs/cloudflare's \`no_bundle\` redirect then uploads it untranspiled — or keep the old name with \`lunora({ serverEntry: "${s}" })\`.`:`@lunora/astro: server entry "${e}" 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
- ${d}`);return}let i;try{i=E(l,"utf8")}catch(r){const w=r instanceof Error?r.message:String(r);a(`@lunora/astro: could not read server entry "${e}" (${w}) — skipping the \`withLunora\` check.`);return}p.test(R(i))||a(`@lunora/astro: couldn't find a \`withLunora(...)\` or \`.buildFrameworkWorker(...)\` call in the server entry "${e}" — \`/_lunora/*\` (Lunora realtime) will be unrouted and subscriptions will silently 404. Compose the Astro worker:
5
-
6
- ${d}`)}},name:"@lunora/astro"}};export{N as lunora};