@lunora/vite 1.0.0-alpha.308 → 1.0.0-alpha.309

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.d.mts CHANGED
@@ -262,6 +262,8 @@ interface WorkerEntryComposition {
262
262
  appConfigModule?: string;
263
263
  /** The `_generated/` class modules that exist, each star-re-exported. */
264
264
  classModules?: ReadonlyArray<GeneratedClassModule>;
265
+ /** Codegen wrote the merge module: export one `LunoraDO` hosting the shard, scheduler and registry (plan 462). */
266
+ mergeDurableObjects?: boolean;
265
267
  /** Per-shard knobs, each key named after the builder method that sets it. */
266
268
  shard?: LunoraShardConfig;
267
269
  }
package/dist/index.d.ts CHANGED
@@ -262,6 +262,8 @@ interface WorkerEntryComposition {
262
262
  appConfigModule?: string;
263
263
  /** The `_generated/` class modules that exist, each star-re-exported. */
264
264
  classModules?: ReadonlyArray<GeneratedClassModule>;
265
+ /** Codegen wrote the merge module: export one `LunoraDO` hosting the shard, scheduler and registry (plan 462). */
266
+ mergeDurableObjects?: boolean;
265
267
  /** Per-shard knobs, each key named after the builder method that sets it. */
266
268
  shard?: LunoraShardConfig;
267
269
  }
package/dist/index.mjs CHANGED
@@ -1,3 +1,3 @@
1
- import{createRequire as p}from"node:module";import{cloudflare as m}from"@cloudflare/vite-plugin";import{detectAgentRules as v,claimAgentRulesHint as h,lunoraLine as u,AGENT_RULES_HINT as w,resolveDeployDriver as S,startCelldDevSession as k,formatLunoraEvent as P,detectFramework as R,targetRunsOwnDevServer as y,resolveTargetOrThrow as x,isRunnableTarget as E,runnableTargetIds as A}from"@lunora/config";import{GENERATED_CLASS_MODULES as Lr,detectFramework as Ur}from"@lunora/config";import _ from"@visulima/vite-overlay";import{reconcileBindingsSafely as O,findWranglerFile as C,readWranglerJsonc as D,warnCloudflareCliConfigOnce as T}from"@lunora/config/cloudflare";import{reconcileWranglerCrons as Fr}from"@lunora/config/cloudflare";import{r as W,a as $}from"./packem_shared/server-close-DWiO4Vxb.mjs";import b from"./packem_shared/codegenPlugin-8QF4FJr4.mjs";import L from"./packem_shared/containerLogsPlugin-67PZ8zmb.mjs";import U from"./packem_shared/devStatePlugin-CF4GDvBn.mjs";import N from"./packem_shared/devVariablesPlugin-DbD6cSF0.mjs";import{frameworkComposePlugin as F}from"./packem_shared/CLASS_A_WIRING-BAnDZbel.mjs";import{CLASS_A_WIRING as jr,LUNORA_WORKER_VIRTUAL_ID as Br,buildWorkerEntrySource as Vr,isAutoComposable as Hr}from"./packem_shared/CLASS_A_WIRING-BAnDZbel.mjs";import I from"./packem_shared/logStreamPlugin-EMXiy6pI.mjs";import{proxyCheckPlugin as j}from"./packem_shared/checkLunoraProxy-BNPgNWtV.mjs";import{checkLunoraProxy as Kr}from"./packem_shared/checkLunoraProxy-BNPgNWtV.mjs";import{remoteBindingsPlugin as B}from"./packem_shared/planViteRemoteBindings-ByOliZuE.mjs";import{planViteRemoteBindings as qr,withRemoteBindings as Jr}from"./packem_shared/planViteRemoteBindings-ByOliZuE.mjs";import{resolve as V}from"node:path";import{readServiceBindings as H}from"@lunora/codegen";import{lunoraSolutionFinders as M}from"./packem_shared/lunoraSolutionFinder--J0x2mAM.mjs";import{lunoraSolutionFinder as Qr}from"./packem_shared/lunoraSolutionFinder--J0x2mAM.mjs";import{studioPlugin as K}from"./packem_shared/buildStudioUrl-DMMWpguZ.mjs";import{buildStudioUrl as Yr}from"./packem_shared/buildStudioUrl-DMMWpguZ.mjs";import{withWorkerStartupHint as G}from"./packem_shared/WORKER_STARTUP_HINT-COlRTY32.mjs";import{WORKER_STARTUP_HINT as re,augmentWorkerStartupError as ee,isWorkerEntryEvalError as oe}from"./packem_shared/WORKER_STARTUP_HINT-COlRTY32.mjs";import{wranglerValidatorPlugin as q}from"./packem_shared/wranglerValidatorPlugin-BlGHjTXZ.mjs";import{default as ne}from"./packem_shared/LUNORA_API_UPDATED_EVENT-CO2Rv2re.mjs";import{STUDIO_PATH as ae}from"@lunora/config/studio-host";const J=e=>({apply:"serve",configureServer(r){return()=>{v(e.projectRoot).installed||!h()||r.config.logger.warn(`
1
+ import{createRequire as p}from"node:module";import{cloudflare as m}from"@cloudflare/vite-plugin";import{detectAgentRules as v,claimAgentRulesHint as h,lunoraLine as u,AGENT_RULES_HINT as w,resolveDeployDriver as S,startCelldDevSession as k,formatLunoraEvent as P,detectFramework as R,targetRunsOwnDevServer as y,resolveTargetOrThrow as x,isRunnableTarget as E,runnableTargetIds as A}from"@lunora/config";import{GENERATED_CLASS_MODULES as Lr,detectFramework as Ur}from"@lunora/config";import _ from"@visulima/vite-overlay";import{reconcileBindingsSafely as O,findWranglerFile as C,readWranglerJsonc as D,warnCloudflareCliConfigOnce as T}from"@lunora/config/cloudflare";import{reconcileWranglerCrons as Fr}from"@lunora/config/cloudflare";import{r as W,a as $}from"./packem_shared/server-close-DWiO4Vxb.mjs";import b from"./packem_shared/codegenPlugin-8QF4FJr4.mjs";import L from"./packem_shared/containerLogsPlugin-67PZ8zmb.mjs";import U from"./packem_shared/devStatePlugin-CF4GDvBn.mjs";import N from"./packem_shared/devVariablesPlugin-DbD6cSF0.mjs";import{frameworkComposePlugin as F}from"./packem_shared/CLASS_A_WIRING-DCI5QzA9.mjs";import{CLASS_A_WIRING as jr,LUNORA_WORKER_VIRTUAL_ID as Br,buildWorkerEntrySource as Vr,isAutoComposable as Hr}from"./packem_shared/CLASS_A_WIRING-DCI5QzA9.mjs";import I from"./packem_shared/logStreamPlugin-EMXiy6pI.mjs";import{proxyCheckPlugin as j}from"./packem_shared/checkLunoraProxy-BNPgNWtV.mjs";import{checkLunoraProxy as Kr}from"./packem_shared/checkLunoraProxy-BNPgNWtV.mjs";import{remoteBindingsPlugin as B}from"./packem_shared/planViteRemoteBindings-ByOliZuE.mjs";import{planViteRemoteBindings as qr,withRemoteBindings as Jr}from"./packem_shared/planViteRemoteBindings-ByOliZuE.mjs";import{resolve as V}from"node:path";import{readServiceBindings as H}from"@lunora/codegen";import{lunoraSolutionFinders as M}from"./packem_shared/lunoraSolutionFinder--J0x2mAM.mjs";import{lunoraSolutionFinder as Qr}from"./packem_shared/lunoraSolutionFinder--J0x2mAM.mjs";import{studioPlugin as K}from"./packem_shared/buildStudioUrl-DMMWpguZ.mjs";import{buildStudioUrl as Yr}from"./packem_shared/buildStudioUrl-DMMWpguZ.mjs";import{withWorkerStartupHint as G}from"./packem_shared/WORKER_STARTUP_HINT-COlRTY32.mjs";import{WORKER_STARTUP_HINT as re,augmentWorkerStartupError as ee,isWorkerEntryEvalError as oe}from"./packem_shared/WORKER_STARTUP_HINT-COlRTY32.mjs";import{wranglerValidatorPlugin as q}from"./packem_shared/wranglerValidatorPlugin-BlGHjTXZ.mjs";import{default as ne}from"./packem_shared/LUNORA_API_UPDATED_EVENT-CO2Rv2re.mjs";import{STUDIO_PATH as ae}from"@lunora/config/studio-host";const J=e=>({apply:"serve",configureServer(r){return()=>{v(e.projectRoot).installed||!h()||r.config.logger.warn(`
2
2
  ${u(w)}
3
3
  `)}},name:"lunora:agent-rules-hint"}),z=e=>({async config(r,t){t.isPreview!==!0&&await O(e,{info:o=>{console.info(o)},warn:o=>{console.warn(o)}})},enforce:"pre",name:"lunora:bindings-provision"}),f="/_lunora",Q=8787,c=new Map,g=e=>e.command==="serve"&&e.isPreview!==!0,X=(e,r)=>{let t;return()=>{if(t===void 0)try{S(r).projectConfig?.(e,"dev"),t={runs:!0}}catch(o){t={reason:o instanceof Error?o.message:String(o),runs:!1}}return t}},Y=e=>{const r=C(e),t=r===void 0?void 0:D(r).parsed?.dev?.port;return typeof t=="number"?t:Q},Z=(e,r)=>e.map(t=>{const o=t.apply;return{...t,apply:(n,a)=>g(a)&&r()?!1:typeof o=="function"?o(n,a):o===void 0||o===a.command}}),rr=(e,r,{stream:t,tag:o})=>{const n=P(r);n!==void 0?e[n.level](`[lunora] ${n.text}`):t==="stderr"?e.warn(`[${o}] ${r}`):e.info(`[${o}] ${r}`)},er=(e,r)=>{const t=Y(e),o=new Map;return{apply:(n,a)=>g(a)&&r(),buildEnd(){$(o,this.environment)},config:n=>{if(n.server?.proxy?.[f]===void 0)return{server:{proxy:{[f]:{changeOrigin:!0,target:`http://127.0.0.1:${String(t)}`,ws:!0}}}}},async configureServer(n){const{logger:a}=n.config;await c.get(e)?.stop(),c.delete(e),a.info(`[lunora] starting the worker on celld at http://127.0.0.1:${String(t)} …`);const s=await k({log:(i,d)=>{rr(a,i,d)},port:t,projectRoot:e});c.set(e,s);const l=i=>{a.error(`[lunora] the worker on celld exited (code ${String(i)}) — restart vite dev to bring it back`)};s.exited.then(l).catch(()=>{}),W(n,o,()=>{c.get(e)===s&&c.delete(e),s.stop().catch(i=>{a.error(`[lunora] stopping celld failed: ${i instanceof Error?i.message:String(i)}`)})})},name:"lunora:celld-dev"}},or=e=>({configResolved(r){T(e.projectRoot,t=>{r.logger.warn(u(t))})},name:"lunora:cf-config-warning"}),tr=()=>({}),nr={astro:"Astro",none:"standalone (SPA / SSR-less)",nuxt:"Nuxt","react-router":"React Router","solid-start":"SolidStart",sveltekit:"SvelteKit","tanstack-start":"TanStack Start","tanstack-start-solid":"TanStack Start (Solid)",vinext:"Next.js on Vite (vinext)"},ir=e=>{const r=nr[e.framework];return e.framework==="none"?u("no meta-framework detected — running standalone."):e.class==="B"?u(`detected ${r} — composition is handled by the framework adapter.`):u(`detected ${r} — composing the Lunora worker into one Cloudflare Worker.`)},ar=(e,r)=>{let t=!1;const o=()=>{r.framework??=R(e.projectRoot)};return{config(){o()},configResolved(){o()},configureServer(){o(),!t&&r.framework!==void 0&&(t=!0,console.info(ir(r.framework)))},name:"lunora:framework-detect"}},sr=(e,r)=>({config(t,o){if(o.command!=="serve")return;const{services:n}=H(r),a=Array.isArray(e.auxiliaryWorkers)?e.auxiliaryWorkers:[],s=new Set(a.map(i=>i.configPath===void 0?"":V(r,i.configPath))),l=[...new Set(n.map(i=>i.wranglerPath))].filter(i=>!s.has(i)).map(i=>({configPath:i}));l.length>0&&(e.auxiliaryWorkers=[...a,...l])},enforce:"pre",name:"lunora:service-workers"}),lr=e=>{if(e===!1)return!1;const r=e===!0||e===void 0?{}:e;return{...r,forwardedConsoleMethods:r.forwardedConsoleMethods??["error","warn"],solutionFinders:[...M,...r.solutionFinders??[]]}},cr=(e,r)=>{const t=x(e,r);if(!E(t)){const o=A();throw new Error(`target "${t}" has no command-line toolchain, so the Lunora Vite plugin cannot build or serve it — it can only generate for it (\`lunora codegen --target ${t}\`). Buildable targets: ${o.join(", ")}`)}return t},ur=e=>{const r=e??{},t=r.schemaDir??"lunora";let o;r.cloudflare===!1?o=!1:r.cloudflare===!0||r.cloudflare===void 0?o={}:o=r.cloudflare;const n=r.projectRoot??process.cwd(),a=cr(n,r.target);return{allowUnauthenticatedShardAccess:r.allowUnauthenticatedShardAccess??!1,apiSpec:r.apiSpec??"openapi",cloudflare:o,studio:r.studio??!0,generatedDir:`${t}/_generated`,overlay:lr(r.overlay),projectRoot:n,schemaDir:t,shard:r.shard??{},target:a,validateWrangler:r.validateWrangler??!0}},Tr=e=>{const r=ur(e),t=tr(),o=[ar(r,t),F(r,t),N(r),z(r),b(r),I(),U(r),J(r),or(r),j()];r.studio&&o.push(K(r)),r.validateWrangler&&o.push(q(r)),r.overlay!==!1&&o.push(_(r.overlay)),o.push(L(r));const n=r.cloudflare===!1?void 0:{...r.cloudflare};if(o.push(B(n,{projectRoot:r.projectRoot})),n!==void 0){o.push(sr(n,r.projectRoot));const a=y(r.target),s=X(r.projectRoot,r.target),l=()=>a&&s().runs;o.push(...Z(G(m(n)),l)),a&&o.push(er(r.projectRoot,l),{apply:(i,d)=>d.command==="serve"&&d.isPreview!==!0&&!l(),configureServer(i){i.config.logger.warn(`[lunora] target "${r.target}": vite dev serves the worker in workerd, not on ${r.target} — ${s().reason??"it cannot run this project"}. \`vite build\` then \`lunora deploy\` ships it to ${r.target}.`)},name:"lunora:target-runtime-notice"})}return o},Wr=p(import.meta.url)("../package.json").version;export{jr as CLASS_A_WIRING,Lr as GENERATED_CLASS_MODULES,ne as LUNORA_API_UPDATED_EVENT,Br as LUNORA_WORKER_VIRTUAL_ID,ae as STUDIO_PATH,Wr as VERSION,re as WORKER_STARTUP_HINT,ee as augmentWorkerStartupError,Yr as buildStudioUrl,Vr as buildWorkerEntrySource,Kr as checkLunoraProxy,b as codegenPlugin,L as containerLogsPlugin,Ur as detectFramework,U as devStatePlugin,N as devVariablesPlugin,F as frameworkComposePlugin,Hr as isAutoComposable,oe as isWorkerEntryEvalError,I as logStreamPlugin,Tr as lunora,Qr as lunoraSolutionFinder,M as lunoraSolutionFinders,qr as planViteRemoteBindings,j as proxyCheckPlugin,Fr as reconcileWranglerCrons,B as remoteBindingsPlugin,lr as resolveOverlayOption,K as studioPlugin,Jr as withRemoteBindings,G as withWorkerStartupHint,q as wranglerValidatorPlugin};
@@ -0,0 +1,26 @@
1
+ import{existsSync as w}from"node:fs";import{resolve as _,join as M}from"node:path";import{loadProjectConfig as C,findProjectConfigFile as L}from"@lunora/codegen";import{GENERATED_CLASS_MODULES as b,isMergedProject as k,DURABLE_OBJECT_BINDINGS as m,GENERATED_MODULE_DURABLE_OBJECTS as j,isMergedRoleModule as y,MERGED_DURABLE_OBJECTS_MODULE as I}from"@lunora/config";import{LunoraError as N}from"@lunora/errors";const $="virtual:lunora/worker",x="\0",f=`${x}${$}`,U=`// @lunora/vite — the composed worker entry is worker-only and unavailable in the client environment.
2
+ export default {};
3
+ `,T=/\/$/,R={"react-router":{handler:'{ fetch: (request) => createRequestHandler(() => import("virtual:react-router/server-build"), import.meta.env.MODE)(request) }',imports:'import { createRequestHandler } from "react-router";'},"solid-start":{handler:"ssrModule.default",imports:'import * as ssrModule from "@solidjs/start/server-handler";'},"tanstack-start":{handler:"ssrModule.default",imports:'import * as ssrModule from "@tanstack/react-start/server-entry";'},"tanstack-start-solid":{handler:"ssrModule.default",imports:'import * as ssrModule from "@tanstack/solid-start/server-entry";'},vinext:{handler:"ssrModule.default",imports:'import * as ssrModule from "vinext/server/fetch-handler";'}},h=r=>{const o=r.framework;return o?.class==="A"&&R[o.framework]!==void 0},B=(r,o,s)=>{if(!s)return{classExport:"export const ShardDO = app.ShardDO;",imports:"",namespace:e=>`env.${e==="scheduler"?m.SchedulerDO:m.ShardRegistryDO}`,reexported:()=>!0};const a=o.flatMap(e=>{const t=j[e];return t===void 0?[]:[{className:t,module:e}]});return{classExport:`export const LunoraDO = mergeDurableObjects({ shard: app.ShardDO${a.map(({className:e,module:t})=>`, ${t}: ${e}`).join("")} });`,imports:[`
4
+ import { mergeDurableObjects, roleNamespace } from "${r}/${I}";`,...a.map(({className:e,module:t})=>`
5
+ import { ${e} } from "${r}/${t}";`)].join(""),namespace:e=>`roleNamespace(env.SHARD, "${e}")`,reexported:e=>!y(e)}},G=(r,o,s={})=>{const{allowUnauthenticatedShardAccess:a=!1,appConfigModule:e,classModules:t=[],mergeDurableObjects:c=!1,shard:d={}}=s,i=R[r];if(i===void 0)throw new N("INTERNAL",`[lunora] no class-A worker wiring for framework "${r}"`);const p=o.replaceAll("\\","/"),l=B(p,t,c),v=t.filter(n=>l.reexported(n)).map(n=>`
6
+ export * from "${p}/${n}";
7
+ `).join(""),E=t.includes("scheduler")?`
8
+ .scheduler({ namespace: (env) => ${l.namespace("scheduler")} })`:"",g=t.includes("shardRegistry")?`
9
+ .shardRegistry((env) => ${l.namespace("shardRegistry")})`:"",A=e===void 0?"":`
10
+ import lunoraConfig from "${e}";`,[D,O]=e===void 0?["",""]:["lunoraConfig.app(",")"],S=Object.entries(d).filter(([,n])=>n!==void 0).toSorted(([n],[u])=>n.localeCompare(u)).map(([n,u])=>`
11
+ .${n}(${JSON.stringify(u)})`).join("");return`// Generated by @lunora/vite — class-A worker composition (PLAN4 M2).
12
+ // Do not edit: emitted from the detected framework (${r}). Point your
13
+ // wrangler \`main\` here (or re-export it) instead of hand-wiring createWorker.
14
+ ${i.imports}
15
+ import { defineApp } from "${p}/app";${l.imports}${A}
16
+
17
+ const app = ${D}defineApp()
18
+ .shard((env) => env.SHARD)${E}${g}${O}
19
+ .httpRouter(${i.handler})${S}${a?`
20
+ .extend(() => ({ allowUnauthenticatedShardAccess: true }))`:""}
21
+ .build();
22
+
23
+ ${l.classExport}
24
+ ${v}
25
+ export default app;
26
+ `},P=async r=>{const{config:o,error:s}=await C(r);return s!==void 0?{error:s}:typeof o?.app!="function"?{}:{specifier:L(r)?.replaceAll("\\","/")}},K=(r,o)=>{const s=_(r.projectRoot,r.generatedDir.replace(T,""));return{async load(a){if(a===f&&h(o)&&o.framework!==void 0){if(this.environment.name==="client")return U;const e=b.filter(i=>w(M(s,`${i}.ts`))),t=k(s),{error:c,specifier:d}=await P(r.projectRoot);return c!==void 0&&this.warn(`[lunora] lunora.config could not be loaded, so its \`app\` hook was not composed: ${c}`),G(o.framework.framework,s,{allowUnauthenticatedShardAccess:r.allowUnauthenticatedShardAccess,appConfigModule:d,classModules:e,mergeDurableObjects:t,shard:r.shard})}},name:"lunora:framework-compose",resolveId(a){if(a===$&&h(o))return f}}};export{R as CLASS_A_WIRING,$ as LUNORA_WORKER_VIRTUAL_ID,f as RESOLVED_LUNORA_WORKER_ID,G as buildWorkerEntrySource,K as frameworkComposePlugin,h as isAutoComposable};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lunora/vite",
3
- "version": "1.0.0-alpha.308",
3
+ "version": "1.0.0-alpha.309",
4
4
  "description": "The Lunora Vite plugin: codegen, type sync, wrangler validation, and an error overlay over @cloudflare/vite-plugin",
5
5
  "keywords": [
6
6
  "cloudflare",
@@ -46,8 +46,8 @@
46
46
  },
47
47
  "dependencies": {
48
48
  "@cloudflare/vite-plugin": "1.62.5",
49
- "@lunora/codegen": "1.0.0-alpha.266",
50
- "@lunora/config": "1.0.0-alpha.310",
49
+ "@lunora/codegen": "1.0.0-alpha.267",
50
+ "@lunora/config": "1.0.0-alpha.311",
51
51
  "@lunora/errors": "1.0.0-alpha.50",
52
52
  "@visulima/vite-overlay": "2.0.41"
53
53
  },
@@ -1,24 +0,0 @@
1
- import{existsSync as $}from"node:fs";import{resolve as E,join as k}from"node:path";import{loadProjectConfig as C,findProjectConfigFile as L}from"@lunora/codegen";import{GENERATED_CLASS_MODULES as _}from"@lunora/config";import{LunoraError as y}from"@lunora/errors";const f="virtual:lunora/worker",I="\0",p=`${I}${f}`,M=`// @lunora/vite — the composed worker entry is worker-only and unavailable in the client environment.
2
- export default {};
3
- `,D=/\/$/,m={"react-router":{handler:'{ fetch: (request) => createRequestHandler(() => import("virtual:react-router/server-build"), import.meta.env.MODE)(request) }',imports:'import { createRequestHandler } from "react-router";'},"solid-start":{handler:"ssrModule.default",imports:'import * as ssrModule from "@solidjs/start/server-handler";'},"tanstack-start":{handler:"ssrModule.default",imports:'import * as ssrModule from "@tanstack/react-start/server-entry";'},"tanstack-start-solid":{handler:"ssrModule.default",imports:'import * as ssrModule from "@tanstack/solid-start/server-entry";'},vinext:{handler:"ssrModule.default",imports:'import * as ssrModule from "vinext/server/fetch-handler";'}},u=r=>{const e=r.framework;return e?.class==="A"&&m[e.framework]!==void 0},O=(r,e,o={})=>{const{allowUnauthenticatedShardAccess:a=!1,appConfigModule:n,classModules:s=[],shard:l={}}=o,i=m[r];if(i===void 0)throw new y("INTERNAL",`[lunora] no class-A worker wiring for framework "${r}"`);const c=e.replaceAll("\\","/"),h=s.map(t=>`
4
- export * from "${c}/${t}";
5
- `).join(""),v=s.includes("scheduler")?`
6
- .scheduler({ namespace: (env) => env.SCHEDULER })`:"",R=s.includes("shardRegistry")?`
7
- .shardRegistry((env) => env.SHARD_REGISTRY)`:"",w=n===void 0?"":`
8
- import lunoraConfig from "${n}";`,[A,S]=n===void 0?["",""]:["lunoraConfig.app(",")"],g=Object.entries(l).filter(([,t])=>t!==void 0).toSorted(([t],[d])=>t.localeCompare(d)).map(([t,d])=>`
9
- .${t}(${JSON.stringify(d)})`).join("");return`// Generated by @lunora/vite — class-A worker composition (PLAN4 M2).
10
- // Do not edit: emitted from the detected framework (${r}). Point your
11
- // wrangler \`main\` here (or re-export it) instead of hand-wiring createWorker.
12
- ${i.imports}
13
- import { defineApp } from "${c}/app";${w}
14
-
15
- const app = ${A}defineApp()
16
- .shard((env) => env.SHARD)${v}${R}${S}
17
- .httpRouter(${i.handler})${g}${a?`
18
- .extend(() => ({ allowUnauthenticatedShardAccess: true }))`:""}
19
- .build();
20
-
21
- export const ShardDO = app.ShardDO;
22
- ${h}
23
- export default app;
24
- `},U=async r=>{const{config:e,error:o}=await C(r);return o!==void 0?{error:o}:typeof e?.app!="function"?{}:{specifier:L(r)?.replaceAll("\\","/")}},H=(r,e)=>{const o=E(r.projectRoot,r.generatedDir.replace(D,""));return{async load(a){if(a===p&&u(e)&&e.framework!==void 0){if(this.environment.name==="client")return M;const n=_.filter(i=>$(k(o,`${i}.ts`))),{error:s,specifier:l}=await U(r.projectRoot);return s!==void 0&&this.warn(`[lunora] lunora.config could not be loaded, so its \`app\` hook was not composed: ${s}`),O(e.framework.framework,o,{allowUnauthenticatedShardAccess:r.allowUnauthenticatedShardAccess,appConfigModule:l,classModules:n,shard:r.shard})}},name:"lunora:framework-compose",resolveId(a){if(a===f&&u(e))return p}}};export{m as CLASS_A_WIRING,f as LUNORA_WORKER_VIRTUAL_ID,p as RESOLVED_LUNORA_WORKER_ID,O as buildWorkerEntrySource,H as frameworkComposePlugin,u as isAutoComposable};