@lunora/nuxt 1.0.0-alpha.101 → 1.0.0-alpha.103
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/README.md +5 -4
- package/dist/module.d.mts +0 -2
- package/dist/module.d.ts +0 -2
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -79,19 +79,20 @@ export { ShardDO } from "./lunora/server";
|
|
|
79
79
|
`lunora/server.ts` is your built Lunora app (`defineApp().build()`) — its default
|
|
80
80
|
export is the worker (a `fetch` entrypoint), and it re-exports `ShardDO`. The
|
|
81
81
|
module aliases the `#lunora/app` virtual to it (configurable via the `lunora.appEntry`
|
|
82
|
-
option, default `~/lunora/server`) and serves it at the `/_lunora/**` route
|
|
83
|
-
(prefix configurable via `lunora.prefix`).
|
|
82
|
+
option, default `~/lunora/server`) and serves it at the `/_lunora/**` route.
|
|
84
83
|
|
|
85
84
|
## Options
|
|
86
85
|
|
|
87
86
|
| Option | Default | Description |
|
|
88
87
|
| ---------- | ----------------- | --------------------------------------------------------- |
|
|
89
88
|
| `appEntry` | `~/lunora/server` | Module specifier of the Lunora app entry (`#lunora/app`). |
|
|
90
|
-
|
|
89
|
+
|
|
90
|
+
The `/_lunora/**` mount is fixed: the worker routes on those exact paths and the
|
|
91
|
+
generated client calls them.
|
|
91
92
|
|
|
92
93
|
## How it works
|
|
93
94
|
|
|
94
|
-
- **The route** (`addServerHandler` at
|
|
95
|
+
- **The route** (`addServerHandler` at `/_lunora/**`): reconstructs a Web `Request`
|
|
95
96
|
from the H3 event, resolves the Cloudflare `env`/`ExecutionContext` off it
|
|
96
97
|
(tolerating both `event.context.cloudflare` and `event.req.runtime.cloudflare`),
|
|
97
98
|
and forwards to your app's `fetch`. A missing Cloudflare runtime answers a clear 500.
|
package/dist/module.d.mts
CHANGED
|
@@ -19,8 +19,6 @@ interface ModuleOptions {
|
|
|
19
19
|
* `ShardDO`. Aliased to the `#lunora/app` virtual the server route imports.
|
|
20
20
|
*/
|
|
21
21
|
appEntry: string;
|
|
22
|
-
/** URL prefix Lunora realtime is mounted at. */
|
|
23
|
-
prefix: string;
|
|
24
22
|
}
|
|
25
23
|
/**
|
|
26
24
|
* Return type of `defineNuxtModule<ModuleOptions>({...})` — the value overload of
|
package/dist/module.d.ts
CHANGED
|
@@ -19,8 +19,6 @@ interface ModuleOptions {
|
|
|
19
19
|
* `ShardDO`. Aliased to the `#lunora/app` virtual the server route imports.
|
|
20
20
|
*/
|
|
21
21
|
appEntry: string;
|
|
22
|
-
/** URL prefix Lunora realtime is mounted at. */
|
|
23
|
-
prefix: string;
|
|
24
22
|
}
|
|
25
23
|
/**
|
|
26
24
|
* Return type of `defineNuxtModule<ModuleOptions>({...})` — the value overload of
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
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
|
|
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 m,useLogger as f}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,O=/\bexport\s*\*\s*from\s*["'][^"']*lunora[^"']*["']/u,T=r=>E.test(r)?R.test(r)||O.test(r):!1,g=(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}T(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.`)},_="/_lunora",b=h({defaults:{appEntry:"~/lunora/server"},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}}),m({handler:o.resolve("./runtime/server/lunora"),route:`${_}/**`}),g(t.options.rootDir,e=>{f("@lunora/nuxt").warn(e)})}});export{g as checkWorkerEntry,b 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.103",
|
|
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.
|
|
55
|
-
"@lunora/runtime": "1.0.0-alpha.
|
|
54
|
+
"@lunora/client": "1.0.0-alpha.72",
|
|
55
|
+
"@lunora/runtime": "1.0.0-alpha.89",
|
|
56
56
|
"@nuxt/kit": "^4.5.2"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|