@lunora/nuxt 1.0.0-alpha.70 → 1.0.0-alpha.71
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.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{existsSync as
|
|
1
|
+
import{existsSync as i,readFileSync as u}from"node:fs";import{join as s,resolve as d,dirname as p}from"node:path";import{defineNuxtModule as h,createResolver as c,addServerHandler as f,useLogger as m}from"@nuxt/kit";const S=(r,t,o)=>r.startsWith("~~/")?s(t,r.slice(3)):r.startsWith("~/")?s(o,r.slice(2)):r.startsWith("./")||r.startsWith("../")?s(t,r):r,v=/\.js$/,D=r=>{const t=s(r,"lunora");return{name:"lunora:nitro-ts-source-resolve",resolveId:{handler(o,e){if(!o.endsWith(".js"))return;let n;if(o.startsWith("#lunora/")?n=s(t,o.slice(8)):o.startsWith(".")&&e!==void 0&&(n=d(p(e),o)),n===void 0)return;const a=n.replace(v,".ts");return i(a)?a:void 0},order:"pre"}}},l='export { default } from "./.output/server/index.mjs"; export { ShardDO } from "./lunora/server";',E=/\bexport\b/u,R=/\bShardDO\b/u,g=/\bexport\s*\*\s*from\s*["'][^"']*lunora[^"']*["']/u,x=r=>E.test(r)?R.test(r)||g.test(r):!1,O=(r,t)=>{const o=s(r,"worker.ts");if(!i(o)){t(`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=u(o,"utf8")}catch(n){const a=n instanceof Error?n.message:String(n);t(`could not read worker.ts at the project root (${a}) — skipping the \`ShardDO\` export check.`);return}x(e)||t(`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.`)},N=h({defaults:{appEntry:"~/lunora/server",prefix:"/_lunora"},meta:{configKey:"lunora",name:"@lunora/nuxt"},setup(r,t){const o=c(import.meta.url);t.options.alias["#lunora/app"]=S(r.appEntry,t.options.rootDir,t.options.srcDir),t.hook("nitro:config",e=>{const n=[...e.rollupConfig?.plugins??[],D(t.options.rootDir)];e.rollupConfig={...e.rollupConfig,plugins:n}}),f({handler:o.resolve("./runtime/server/lunora"),route:`${r.prefix}/**`}),O(t.options.rootDir,e=>{m("@lunora/nuxt").warn(e)})}});export{O as checkWorkerEntry,N as default};
|
package/dist/module.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const r=n=>{const e=n.context?.cloudflare;if(e?.env)return{ctx:e.context??e.ctx,env:e.env};const t=n.req?.runtime?.cloudflare;return t?.env?{ctx:t.ctx??t.context,env:t.env}:{}};export{r as resolveCloudflare};
|
package/dist/runtime/handler.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{NOOP_EXECUTION_CONTEXT as n}from"@lunora/runtime";import{NOOP_EXECUTION_CONTEXT as l}from"@lunora/runtime";const
|
|
1
|
+
import{NOOP_EXECUTION_CONTEXT as n}from"@lunora/runtime";import{NOOP_EXECUTION_CONTEXT as l}from"@lunora/runtime";const s=async(o,r,e,t)=>e?o.fetch(r,e,t??n):Response.json({error:{code:"LUNORA_RUNTIME_UNAVAILABLE",message:"Lunora could not read the Cloudflare bindings from the request. The `/_lunora/**` route only works on the Cloudflare Workers runtime (deployed, or `nuxt dev` with `nitro-cloudflare-dev`)."}},{status:500});export{l as NOOP_EXECUTION_CONTEXT,s as delegateToLunora};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as
|
|
1
|
+
import*as e from"h3";import a from"#lunora/app";import{resolveCloudflare as l}from"../cloudflare.js";import{resolveWebRequest as m}from"../h3-request.js";import{delegateToLunora as s}from"../handler.js";const i=e.defineEventHandler(async r=>{const{ctx:o,env:t}=l(r),n=m(e,r);return s(a,n,t,o)});export{i as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lunora/nuxt",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.71",
|
|
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,9 +51,9 @@
|
|
|
51
51
|
"access": "public"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@lunora/client": "1.0.0-alpha.
|
|
54
|
+
"@lunora/client": "1.0.0-alpha.50",
|
|
55
55
|
"@lunora/runtime": "1.0.0-alpha.62",
|
|
56
|
-
"@nuxt/kit": "^4.5.
|
|
56
|
+
"@nuxt/kit": "^4.5.2"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
59
|
"h3": "^1.15.0",
|