@lunora/nuxt 1.0.0-alpha.53 → 1.0.0-alpha.55
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.d.ts +13 -1
- package/dist/module.js +1 -1
- package/dist/module.json +1 -1
- package/package.json +3 -3
package/dist/module.d.ts
CHANGED
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
import { defineNuxtModule } from '@nuxt/kit';
|
|
2
|
+
/**
|
|
3
|
+
* Check that `worker.ts` at the project root actually re-exports `ShardDO` —
|
|
4
|
+
* not just that the file exists. Extracted from `setup()` so it is testable
|
|
5
|
+
* without booting Nuxt (`defineNuxtModule`'s `setup` needs full Nuxt Kit
|
|
6
|
+
* scaffolding to invoke; this plain function does not).
|
|
7
|
+
*
|
|
8
|
+
* All three outcomes — missing file, unreadable file, present-but-no-`ShardDO`-
|
|
9
|
+
* export — WARN and return; none of them throws. Matches the module's existing
|
|
10
|
+
* stance ("we can't write the user's file, so warn... rather than fail an
|
|
11
|
+
* otherwise-valid build") and the `@lunora/astro` precedent this mirrors.
|
|
12
|
+
*/
|
|
13
|
+
declare const checkWorkerEntry: (rootDirectory: string, warn: (message: string) => void) => void;
|
|
2
14
|
/** Options for the `@lunora/nuxt` module (configurable under the `lunora` key in `nuxt.config`). */
|
|
3
15
|
interface ModuleOptions {
|
|
4
16
|
/**
|
|
@@ -21,4 +33,4 @@ type LunoraNuxtModule = typeof defineNuxtModule<ModuleOptions> extends {
|
|
|
21
33
|
(): unknown;
|
|
22
34
|
} ? Result : never;
|
|
23
35
|
declare const lunoraNuxtModule: LunoraNuxtModule;
|
|
24
|
-
export { ModuleOptions, lunoraNuxtModule as default };
|
|
36
|
+
export { ModuleOptions, checkWorkerEntry, lunoraNuxtModule as default };
|
package/dist/module.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{existsSync as
|
|
1
|
+
import{existsSync as l,readFileSync as p}from"node:fs";import{join as n,resolve as u,dirname as d}from"node:path";import{defineNuxtModule as c,createResolver as h,addServerHandler as f,useLogger as m}from"@nuxt/kit";const x=(r,t,e)=>r.startsWith("~~/")?n(t,r.slice(3)):r.startsWith("~/")?n(e,r.slice(2)):r.startsWith("./")||r.startsWith("../")?n(t,r):r,g=/\.js$/,v=r=>{const t=n(r,"lunora");return{name:"lunora:nitro-ts-source-resolve",resolveId:{handler(e,o){if(!e.endsWith(".js"))return;let s;if(e.startsWith("#lunora/")?s=n(t,e.slice(8)):e.startsWith(".")&&o!==void 0&&(s=u(d(o),e)),s===void 0)return;const a=s.replace(g,".ts");return l(a)?a:void 0},order:"pre"}}},i='export { default } from "./.output/server/index.mjs"; export { ShardDO } from "./lunora/server";',D=/\bexport\b/u,S=/\bShardDO\b/u,k=/\bexport\s*\*\s*from\s*["'][^"']*lunora[^"']*["']/u,w=r=>D.test(r)?S.test(r)||k.test(r):!1,b=(r,t)=>{const e=n(r,"worker.ts");if(!l(e)){t(`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 o;try{o=p(e,"utf8")}catch(s){const a=s instanceof Error?s.message:String(s);t(`could not read worker.ts at the project root (${a}) — skipping the \`ShardDO\` export check.`);return}w(o)||t(`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.`)},W=c({defaults:{appEntry:"~/lunora/server",prefix:"/_lunora"},meta:{configKey:"lunora",name:"@lunora/nuxt"},setup(r,t){const e=h(import.meta.url);t.options.alias["#lunora/app"]=x(r.appEntry,t.options.rootDir,t.options.srcDir),t.hook("nitro:config",o=>{const s=[...o.rollupConfig?.plugins??[],v(t.options.rootDir)];o.rollupConfig={...o.rollupConfig,plugins:s}}),f({handler:e.resolve("./runtime/server/lunora"),route:`${r.prefix}/**`}),b(t.options.rootDir,o=>{m("@lunora/nuxt").warn(o)})}});export{b as checkWorkerEntry,W as default};
|
package/dist/module.json
CHANGED
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.55",
|
|
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.36",
|
|
55
|
+
"@lunora/runtime": "1.0.0-alpha.50",
|
|
56
56
|
"@nuxt/kit": "^4.5.0"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|