@lunora/nuxt 1.0.0-alpha.114 → 1.0.0-alpha.116

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/module.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "configKey": "lunora",
3
3
  "name": "@lunora/nuxt",
4
- "version": "1.0.0-alpha.113"
4
+ "version": "1.0.0-alpha.115"
5
5
  }
package/dist/module.mjs CHANGED
@@ -1 +1 @@
1
- import{existsSync as u,readFileSync as d}from"node:fs";import{join as s,resolve as h,dirname as p}from"node:path";import{defineNuxtModule as c,createResolver as v,addServerHandler as f,useLogger as i}from"@nuxt/kit";const m=(r,o,t)=>r.startsWith("~~/")?s(o,r.slice(3)):r.startsWith("~/")?s(t,r.slice(2)):r.startsWith("./")||r.startsWith("../")?s(o,r):r,g=/\.js$/,R=r=>{const o=s(r,"lunora");return{name:"lunora:nitro-ts-source-resolve",resolveId:{handler(t,e){if(!t.endsWith(".js"))return;let n;if(t.startsWith("#lunora/")?n=s(o,t.slice(8)):t.startsWith(".")&&e!==void 0&&(n=h(p(e),t)),n===void 0)return;const a=n.replace(g,".ts");return u(a)?a:void 0},order:"pre"}}},l='export { default } from "./.output/server/index.mjs"; export { ShardDO } from "./lunora/server";',S=/\bexport\b/u,E=/\bShardDO\b/u,D=/\bexport\s*\*\s*from\s*["'][^"']*lunora[^"']*["']/u,O=r=>S.test(r)?E.test(r)||D.test(r):!1,w=(r,o)=>{const t=s(r,"worker.ts");if(!u(t)){o(`missing worker.ts at the project root — add a wrapper that re-exports Nitro's handler and \`ShardDO\` (\`${l}\`) and point wrangler's \`main\` at it, so the SHARD Durable Object is exported from the deployed worker.`);return}let e;try{e=d(t,"utf8")}catch(n){const a=n instanceof Error?n.message:String(n);o(`could not read worker.ts at the project root (${a}) — skipping the \`ShardDO\` export check.`);return}O(e)||o(`worker.ts at the project root does not appear to export \`ShardDO\` — add \`export { ShardDO } from "./lunora/server";\` (e.g. \`${l}\`) and point wrangler's \`main\` at it, so the SHARD Durable Object is exported from the deployed worker.`)},T=/\bcreateLunora\b/u,k=r=>{try{return T.test(d(r,"utf8"))}catch{return!1}},_=(r,o)=>{const t=r.filter(e=>k(e.src));t.length===0||t.some(e=>e.mode!=="client")||o(`the only plugin providing a \`LunoraClient\` is client-only (${t.map(e=>e.src).join(", ")}) — \`@lunora/vue\`'s composables resolve the client during SSR too and throw \`useLunora(): no LunoraClient provided\` without one, so the first server-rendered page that touches Lunora answers 500. Drop the \`.client\` from the filename to make the plugin universal, and read the origin with \`useRequestURL().origin\`, which resolves from the incoming request on the server and from \`window.location\` in the browser. Ignore this if every Lunora usage is confined to \`<ClientOnly>\`, which never renders on the server.`)},y="/_lunora",L=c({defaults:{appEntry:"~/lunora/server"},meta:{configKey:"lunora",name:"@lunora/nuxt"},setup(r,o){const t=v(import.meta.url);o.options.alias["#lunora/app"]=m(r.appEntry,o.options.rootDir,o.options.srcDir),o.hook("nitro:config",e=>{const n=[...e.rollupConfig?.plugins??[],R(o.options.rootDir)];e.rollupConfig={...e.rollupConfig,plugins:n}}),f({handler:t.resolve("./runtime/server/lunora"),route:`${y}/**`}),w(o.options.rootDir,e=>{i("@lunora/nuxt").warn(e)}),o.hook("app:resolve",e=>{_(e.plugins,n=>{i("@lunora/nuxt").warn(n)})})}});export{_ as checkClientOnlyProvider,w as checkWorkerEntry,L as default};
1
+ import{existsSync as u,readFileSync as d}from"node:fs";import{join as s,resolve as h,dirname as p}from"node:path";import{defineNuxtModule as c,createResolver as m,addServerHandler as f,useLogger as l}from"@nuxt/kit";const v=(e,o,t)=>e.startsWith("~~/")?s(o,e.slice(3)):e.startsWith("~/")?s(t,e.slice(2)):e.startsWith("./")||e.startsWith("../")?s(o,e):e,g=/\.js$/,E=e=>{const o=s(e,"lunora");return{name:"lunora:nitro-ts-source-resolve",resolveId:{handler(t,r){if(!t.endsWith(".js"))return;let n;if(t.startsWith("#lunora/")?n=s(o,t.slice(8)):t.startsWith(".")&&r!==void 0&&(n=h(p(r),t)),n===void 0)return;const a=n.replace(g,".ts");return u(a)?a:void 0},order:"pre"}}},i='import nitro from "./.output/server/index.mjs"; import app, { ShardDO } from "./lunora/server"; export { ShardDO }; export default { ...nitro, email: (m, e, x) => app.email?.(m, e, x), queue: (b, e, x) => app.queue?.(b, e, x), scheduled: (c, e, x) => app.scheduled(c, e, x) };',R=/\bexport\b/u,S=/\bShardDO\b/u,w=/\bexport\s*\*\s*from\s*["'][^"']*lunora[^"']*["']/u,D=/\bscheduled\b/u,T=e=>R.test(e)?S.test(e)||w.test(e):!1,x=(e,o)=>{const t=s(e,"worker.ts");if(!u(t)){o(`missing worker.ts at the project root — add a wrapper that re-exports Nitro's handler and \`ShardDO\` (\`${i}\`) and point wrangler's \`main\` at it, so the SHARD Durable Object is exported from the deployed worker.`);return}let r;try{r=d(t,"utf8")}catch(n){const a=n instanceof Error?n.message:String(n);o(`could not read worker.ts at the project root (${a}) — skipping the \`ShardDO\` export check.`);return}T(r)||o(`worker.ts at the project root does not appear to export \`ShardDO\` — add \`export { ShardDO } from "./lunora/server";\` (e.g. \`${i}\`) and point wrangler's \`main\` at it, so the SHARD Durable Object is exported from the deployed worker.`),D.test(r)||o(`worker.ts at the project root does not forward \`scheduled\` — re-exporting Nitro's \`default\` gives Cloudflare a \`scheduled\` entrypoint that only fires an empty \`cloudflare:scheduled\` hook, so a cron declared in \`lunora/crons.ts\` is provisioned and then runs nothing. Compose the two instead (\`${i}\`), which forwards \`queue\` and \`email\` too — Nitro's exports for those fire empty hooks the same way, and a queue consumer that returns without throwing ACKS its batch.`)},O=/\bcreateLunora\b/u,k=e=>{try{return O.test(d(e,"utf8"))}catch{return!1}},y=(e,o)=>{const t=e.filter(r=>k(r.src));t.length===0||t.some(r=>r.mode!=="client")||o(`the only plugin providing a \`LunoraClient\` is client-only (${t.map(r=>r.src).join(", ")}) — \`@lunora/vue\`'s composables resolve the client during SSR too and throw \`useLunora(): no LunoraClient provided\` without one, so the first server-rendered page that touches Lunora answers 500. Drop the \`.client\` from the filename to make the plugin universal, and read the origin with \`useRequestURL().origin\`, which resolves from the incoming request on the server and from \`window.location\` in the browser. Ignore this if every Lunora usage is confined to \`<ClientOnly>\`, which never renders on the server.`)},b="/_lunora",L=c({defaults:{appEntry:"~/lunora/server"},meta:{configKey:"lunora",name:"@lunora/nuxt"},setup(e,o){const t=m(import.meta.url);o.options.alias["#lunora/app"]=v(e.appEntry,o.options.rootDir,o.options.srcDir),o.hook("nitro:config",r=>{const n=[...r.rollupConfig?.plugins??[],E(o.options.rootDir)];r.rollupConfig={...r.rollupConfig,plugins:n}}),f({handler:t.resolve("./runtime/server/lunora"),route:`${b}/**`}),x(o.options.rootDir,r=>{l("@lunora/nuxt").warn(r)}),o.hook("app:resolve",r=>{y(r.plugins,n=>{l("@lunora/nuxt").warn(n)})})}});export{y as checkClientOnlyProvider,x as checkWorkerEntry,L as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lunora/nuxt",
3
- "version": "1.0.0-alpha.114",
3
+ "version": "1.0.0-alpha.116",
4
4
  "description": "Nuxt module for Lunora — single-worker composition (mounts /_lunora/* into Nitro) plus reactive-loader server helpers",
5
5
  "keywords": [
6
6
  "cloudflare",
@@ -51,8 +51,8 @@
51
51
  "access": "public"
52
52
  },
53
53
  "dependencies": {
54
- "@lunora/client": "1.0.0-alpha.86",
55
- "@lunora/runtime": "1.0.0-alpha.101",
54
+ "@lunora/client": "1.0.0-alpha.88",
55
+ "@lunora/runtime": "1.0.0-alpha.103",
56
56
  "@nuxt/kit": "^4.5.2"
57
57
  },
58
58
  "peerDependencies": {