@lunora/vite 1.0.0-alpha.333 → 1.0.0-alpha.334

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
@@ -3,7 +3,7 @@ import errorOverlayPlugin from '@visulima/vite-overlay';
3
3
  import { Plugin } from 'vite';
4
4
  import { FrameworkDetection, DetectedFramework, GeneratedClassModule, readProjectRemotePreference } from '@lunora/config';
5
5
  export { type DetectedFramework, type FrameworkClass, type FrameworkDetection, GENERATED_CLASS_MODULES, type GeneratedClassModule, detectFramework } from '@lunora/config';
6
- import { materializeRemoteWranglerConfig } from '@lunora/config/cloudflare';
6
+ import { materializeDevWranglerConfig } from '@lunora/config/cloudflare';
7
7
  export { type ReconcileCronsResult as ReconcileResult, reconcileWranglerCrons } from '@lunora/config/cloudflare';
8
8
  import { AddressInfo } from 'node:net';
9
9
  export { STUDIO_PATH } from '@lunora/config/studio-host';
@@ -342,11 +342,13 @@ interface ViteRemotePlan {
342
342
  enabled: boolean;
343
343
  /** Why remote mode didn't take effect despite being requested, for logging. */
344
344
  reason?: string;
345
+ /** `ai` bindings left out for lack of Cloudflare credentials, for the dev warning. */
346
+ withheld: string[];
345
347
  }
346
348
  /** Inputs to the Vite remote-binding decision — injectable so tests don't touch the env/fs. */
347
349
  interface PlanViteRemoteOptions {
348
350
  /** Injection seam — defaults to the real materializer. */
349
- materialize?: typeof materializeRemoteWranglerConfig;
351
+ materialize?: typeof materializeDevWranglerConfig;
350
352
  /** Project root containing `wrangler.jsonc` + the optional `lunora.config.*`. */
351
353
  projectRoot: string;
352
354
  /** Injection seam — defaults to the real `lunora.config.*` reader. */
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@ import errorOverlayPlugin from '@visulima/vite-overlay';
3
3
  import { Plugin } from 'vite';
4
4
  import { FrameworkDetection, DetectedFramework, GeneratedClassModule, readProjectRemotePreference } from '@lunora/config';
5
5
  export { type DetectedFramework, type FrameworkClass, type FrameworkDetection, GENERATED_CLASS_MODULES, type GeneratedClassModule, detectFramework } from '@lunora/config';
6
- import { materializeRemoteWranglerConfig } from '@lunora/config/cloudflare';
6
+ import { materializeDevWranglerConfig } from '@lunora/config/cloudflare';
7
7
  export { type ReconcileCronsResult as ReconcileResult, reconcileWranglerCrons } from '@lunora/config/cloudflare';
8
8
  import { AddressInfo } from 'node:net';
9
9
  export { STUDIO_PATH } from '@lunora/config/studio-host';
@@ -342,11 +342,13 @@ interface ViteRemotePlan {
342
342
  enabled: boolean;
343
343
  /** Why remote mode didn't take effect despite being requested, for logging. */
344
344
  reason?: string;
345
+ /** `ai` bindings left out for lack of Cloudflare credentials, for the dev warning. */
346
+ withheld: string[];
345
347
  }
346
348
  /** Inputs to the Vite remote-binding decision — injectable so tests don't touch the env/fs. */
347
349
  interface PlanViteRemoteOptions {
348
350
  /** Injection seam — defaults to the real materializer. */
349
- materialize?: typeof materializeRemoteWranglerConfig;
351
+ materialize?: typeof materializeDevWranglerConfig;
350
352
  /** Project root containing `wrangler.jsonc` + the optional `lunora.config.*`. */
351
353
  projectRoot: string;
352
354
  /** Injection seam — defaults to the real `lunora.config.*` reader. */
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-BsLFhhzx.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
- ${u(w)}
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};
1
+ import{createRequire as S}from"node:module";import{cloudflare as k}from"@cloudflare/vite-plugin";import{detectAgentRules as R,claimAgentRulesHint as P,lunoraLine as d,AGENT_RULES_HINT as y,resolveDeployDriver as x,startCelldDevSession as A,formatLunoraEvent as C,detectFramework as W,targetRunsOwnDevServer as E,resolveTargetOrThrow as _,isRunnableTarget as D,runnableTargetIds as O}from"@lunora/config";import{GENERATED_CLASS_MODULES as Me,detectFramework as Ke}from"@lunora/config";import T from"@visulima/vite-overlay";import{reconcileBindingsSafely as b,findWranglerFile as $,readWranglerJsonc as L,warnCloudflareCliConfigOnce as U,hasCloudflareCredentials as N,withheldWorkersAi as j,describeWithheldWorkersAi as F}from"@lunora/config/cloudflare";import{reconcileWranglerCrons as qe}from"@lunora/config/cloudflare";import{r as I,a as B}from"./packem_shared/server-close-DWiO4Vxb.mjs";import V from"./packem_shared/codegenPlugin-BsLFhhzx.mjs";import H from"./packem_shared/containerLogsPlugin-67PZ8zmb.mjs";import M from"./packem_shared/devStatePlugin-CF4GDvBn.mjs";import K from"./packem_shared/devVariablesPlugin-DbD6cSF0.mjs";import{frameworkComposePlugin as G}from"./packem_shared/CLASS_A_WIRING-DCI5QzA9.mjs";import{CLASS_A_WIRING as Je,LUNORA_WORKER_VIRTUAL_ID as Qe,buildWorkerEntrySource as Xe,isAutoComposable as Ye}from"./packem_shared/CLASS_A_WIRING-DCI5QzA9.mjs";import q from"./packem_shared/logStreamPlugin-EMXiy6pI.mjs";import{proxyCheckPlugin as z}from"./packem_shared/checkLunoraProxy-BNPgNWtV.mjs";import{checkLunoraProxy as er}from"./packem_shared/checkLunoraProxy-BNPgNWtV.mjs";import{remoteBindingsPlugin as J}from"./packem_shared/planViteRemoteBindings-CNz2theU.mjs";import{planViteRemoteBindings as or,withRemoteBindings as tr}from"./packem_shared/planViteRemoteBindings-CNz2theU.mjs";import{resolve as Q}from"node:path";import{readServiceBindings as X}from"@lunora/codegen";import{lunoraSolutionFinders as Y}from"./packem_shared/lunoraSolutionFinder--J0x2mAM.mjs";import{lunoraSolutionFinder as ir}from"./packem_shared/lunoraSolutionFinder--J0x2mAM.mjs";import{studioPlugin as Z}from"./packem_shared/buildStudioUrl-DMMWpguZ.mjs";import{buildStudioUrl as sr}from"./packem_shared/buildStudioUrl-DMMWpguZ.mjs";import{withWorkerStartupHint as ee}from"./packem_shared/WORKER_STARTUP_HINT-COlRTY32.mjs";import{WORKER_STARTUP_HINT as cr,augmentWorkerStartupError as ur,isWorkerEntryEvalError as dr}from"./packem_shared/WORKER_STARTUP_HINT-COlRTY32.mjs";import{wranglerValidatorPlugin as re}from"./packem_shared/wranglerValidatorPlugin-BlGHjTXZ.mjs";import{default as gr}from"./packem_shared/LUNORA_API_UPDATED_EVENT-CO2Rv2re.mjs";import{STUDIO_PATH as mr}from"@lunora/config/studio-host";const oe=r=>({apply:"serve",configureServer(e){return()=>{R(r.projectRoot).installed||!P()||e.config.logger.warn(`
2
+ ${d(y)}
3
+ `)}},name:"lunora:agent-rules-hint"}),te=r=>({async config(e,t){t.isPreview!==!0&&await b(r,{info:o=>{console.info(o)},warn:o=>{console.warn(o)}})},enforce:"pre",name:"lunora:bindings-provision"}),h="/_lunora",ne=8787,f=new Map,w=r=>r.command==="serve"&&r.isPreview!==!0,ie=(r,e)=>{let t;return()=>{if(t===void 0)try{x(e).projectConfig?.(r,"dev"),t={runs:!0}}catch(o){t={reason:o instanceof Error?o.message:String(o),runs:!1}}return t}},ae=r=>{const e=$(r),t=e===void 0?void 0:L(e).parsed?.dev?.port;return typeof t=="number"?t:ne},se=(r,e)=>r.map(t=>{const o=t.apply;return{...t,apply:(i,a)=>w(a)&&e()?!1:typeof o=="function"?o(i,a):o===void 0||o===a.command}}),le=(r,e,{stream:t,tag:o})=>{const i=C(e);i!==void 0?r[i.level](`[lunora] ${i.text}`):t==="stderr"?r.warn(`[${o}] ${e}`):r.info(`[${o}] ${e}`)},ce=(r,e)=>{const t=ae(r),o=new Map;return{apply:(i,a)=>w(a)&&e(),buildEnd(){B(o,this.environment)},config:i=>{if(i.server?.proxy?.[h]===void 0)return{server:{proxy:{[h]:{changeOrigin:!0,target:`http://127.0.0.1:${String(t)}`,ws:!0}}}}},async configureServer(i){const{logger:a}=i.config;await f.get(r)?.stop(),f.delete(r),a.info(`[lunora] starting the worker on celld at http://127.0.0.1:${String(t)} …`);const c=await A({log:(n,s)=>{le(a,n,s)},port:t,projectRoot:r});f.set(r,c);const l=n=>{a.error(`[lunora] the worker on celld exited (code ${String(n)}) — restart vite dev to bring it back`)};c.exited.then(l).catch(()=>{}),I(i,o,()=>{f.get(r)===c&&f.delete(r),c.stop().catch(n=>{a.error(`[lunora] stopping celld failed: ${n instanceof Error?n.message:String(n)}`)})})},name:"lunora:celld-dev"}},ue=r=>({configResolved(e){U(r.projectRoot,t=>{e.logger.warn(d(t))})},name:"lunora:cf-config-warning"}),de=()=>({}),fe={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)"},ge=r=>{const e=fe[r.framework];return r.framework==="none"?d("no meta-framework detected — running standalone."):r.class==="B"?d(`detected ${e} — composition is handled by the framework adapter.`):d(`detected ${e} — composing the Lunora worker into one Cloudflare Worker.`)},pe=(r,e)=>{let t=!1;const o=()=>{e.framework??=W(r.projectRoot)};return{config(){o()},configResolved(){o()},configureServer(){o(),!t&&e.framework!==void 0&&(t=!0,console.info(ge(e.framework)))},name:"lunora:framework-detect"}},p=new WeakSet,me=(r,e={})=>{let t=!1;const o=r.experimental?.newConfig,i=o!==void 0&&o!==!1,a=e.hasCredentials??(()=>N({projectRoot:e.projectRoot})),c=l=>{const n=(s,...u)=>{const m=typeof l=="function"?l(s,...u):l,g=m===void 0?void 0:{...m},v=t?j(s.ai??g?.ai,a):void 0;return v!==void 0&&(delete s.ai,delete g?.ai,console.warn(d(F(v)))),g};return p.add(n),n};return{config(l,n){if(t=n.command==="serve"&&n.isPreview!==!0,i)return;const s=r;p.has(s.config)||(s.config=c(s.config)),Array.isArray(s.auxiliaryWorkers)&&(s.auxiliaryWorkers=s.auxiliaryWorkers.map(u=>p.has(u.config)?u:{...u,config:c(u.config)}))},enforce:"pre",name:"lunora:local-ai-binding"}},ve=(r,e)=>({config(t,o){if(o.command!=="serve")return;const{services:i}=X(e),a=Array.isArray(r.auxiliaryWorkers)?r.auxiliaryWorkers:[],c=new Set(a.map(n=>n.configPath===void 0?"":Q(e,n.configPath))),l=[...new Set(i.map(n=>n.wranglerPath))].filter(n=>!c.has(n)).map(n=>({configPath:n}));l.length>0&&(r.auxiliaryWorkers=[...a,...l])},enforce:"pre",name:"lunora:service-workers"}),he=r=>{if(r===!1)return!1;const e=r===!0||r===void 0?{}:r;return{...e,forwardedConsoleMethods:e.forwardedConsoleMethods??["error","warn"],solutionFinders:[...Y,...e.solutionFinders??[]]}},we=(r,e)=>{const t=_(r,e);if(!D(t)){const o=O();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},Se=r=>{const e=r??{},t=e.schemaDir??"lunora";let o;e.cloudflare===!1?o=!1:e.cloudflare===!0||e.cloudflare===void 0?o={}:o=e.cloudflare;const i=e.projectRoot??process.cwd(),a=we(i,e.target);return{allowUnauthenticatedShardAccess:e.allowUnauthenticatedShardAccess??!1,apiSpec:e.apiSpec??"openapi",cloudflare:o,studio:e.studio??!0,generatedDir:`${t}/_generated`,overlay:he(e.overlay),projectRoot:i,schemaDir:t,shard:e.shard??{},target:a,validateWrangler:e.validateWrangler??!0}},Ie=r=>{const e=Se(r),t=de(),o=[pe(e,t),G(e,t),K(e),te(e),V(e),q(),M(e),oe(e),ue(e),z()];e.studio&&o.push(Z(e)),e.validateWrangler&&o.push(re(e)),e.overlay!==!1&&o.push(T(e.overlay)),o.push(H(e));const i=e.cloudflare===!1?void 0:{...e.cloudflare};if(o.push(J(i,{projectRoot:e.projectRoot})),i!==void 0){o.push(ve(i,e.projectRoot));const a=E(e.target),c=ie(e.projectRoot,e.target),l=()=>a&&c().runs;o.push(...se([me(i,{projectRoot:e.projectRoot}),...ee(k(i))],l)),a&&o.push(ce(e.projectRoot,l),{apply:(n,s)=>s.command==="serve"&&s.isPreview!==!0&&!l(),configureServer(n){n.config.logger.warn(`[lunora] target "${e.target}": vite dev serves the worker in workerd, not on ${e.target} — ${c().reason??"it cannot run this project"}. \`vite build\` then \`lunora deploy\` ships it to ${e.target}.`)},name:"lunora:target-runtime-notice"})}return o},Be=S(import.meta.url)("../package.json").version;export{Je as CLASS_A_WIRING,Me as GENERATED_CLASS_MODULES,gr as LUNORA_API_UPDATED_EVENT,Qe as LUNORA_WORKER_VIRTUAL_ID,mr as STUDIO_PATH,Be as VERSION,cr as WORKER_STARTUP_HINT,ur as augmentWorkerStartupError,sr as buildStudioUrl,Xe as buildWorkerEntrySource,er as checkLunoraProxy,V as codegenPlugin,H as containerLogsPlugin,Ke as detectFramework,M as devStatePlugin,K as devVariablesPlugin,G as frameworkComposePlugin,Ye as isAutoComposable,dr as isWorkerEntryEvalError,q as logStreamPlugin,Ie as lunora,ir as lunoraSolutionFinder,Y as lunoraSolutionFinders,or as planViteRemoteBindings,z as proxyCheckPlugin,qe as reconcileWranglerCrons,J as remoteBindingsPlugin,he as resolveOverlayOption,Z as studioPlugin,tr as withRemoteBindings,ee as withWorkerStartupHint,re as wranglerValidatorPlugin};
@@ -0,0 +1 @@
1
+ import{readProjectRemotePreference as s,lunoraLine as c}from"@lunora/config";import{resolveRemoteEnabled as g,materializeDevWranglerConfig as h,describeWithheldWorkersAi as u}from"@lunora/config/cloudflare";const l=()=>{},m=e=>{const t=e.readPreference??s;if(!g({configPreference:t(e.projectRoot),envValue:e.remoteEnv??process.env.LUNORA_REMOTE}))return{cleanup:l,enabled:!1,withheld:[]};const i=(e.materialize??h)({projectRoot:e.projectRoot,remote:!0});return{cleanup:i.cleanup,configPath:i.configPath,enabled:!0,reason:i.reason,withheld:i.withheld}},P=(e,t)=>!t.enabled||t.configPath===void 0||typeof e.configPath=="string"?e:{...e,configPath:t.configPath},R=(e,t)=>{let n={cleanup:l,enabled:!1,withheld:[]},o;const i=()=>{n.cleanup()};return{buildEnd:i,closeBundle:i,config(b,d){if(d.command!=="serve")return;n.cleanup(),n=m(t);for(const f of n.withheld)console.warn(c(u(f)));if(e===void 0){n.enabled&&n.configPath!==void 0&&console.info(c(`remote bindings are materialized at ${n.configPath} — this project adds @cloudflare/vite-plugin itself (\`cloudflare: false\`), so pass that path as its \`configPath\` to use them.`));return}const r=e;o!==void 0&&r.configPath===o&&delete r.configPath;const a=P(e,n);a.configPath!==void 0&&r.configPath===void 0?(r.configPath=a.configPath,o=a.configPath):n.enabled&&n.configPath===void 0&&n.reason!==void 0&&console.info(c(`remote bindings requested but not applied: ${n.reason}`))},enforce:"pre",name:"lunora:remote-bindings"}};export{m as planViteRemoteBindings,R as remoteBindingsPlugin,P as withRemoteBindings};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lunora/vite",
3
- "version": "1.0.0-alpha.333",
3
+ "version": "1.0.0-alpha.334",
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.63.1",
49
- "@lunora/codegen": "1.0.0-alpha.290",
50
- "@lunora/config": "1.0.0-alpha.335",
49
+ "@lunora/codegen": "1.0.0-alpha.291",
50
+ "@lunora/config": "1.0.0-alpha.336",
51
51
  "@lunora/errors": ">=1.0.0-alpha.51 <2.0.0-0",
52
52
  "@visulima/vite-overlay": "2.0.41"
53
53
  },
@@ -1 +0,0 @@
1
- import{readProjectRemotePreference as d,lunoraLine as c}from"@lunora/config";import{resolveRemoteEnabled as s,materializeRemoteWranglerConfig as g}from"@lunora/config/cloudflare";const l=()=>{},u=e=>{const t=e.readPreference??d;if(!s({configPreference:t(e.projectRoot),envValue:e.remoteEnv??process.env.LUNORA_REMOTE}))return{cleanup:l,enabled:!1};const o=(e.materialize??g)({enabled:!0,projectRoot:e.projectRoot});return{cleanup:o.cleanup,configPath:o.configPath,enabled:!0,reason:o.reason}},m=(e,t)=>!t.enabled||t.configPath===void 0||typeof e.configPath=="string"?e:{...e,configPath:t.configPath},p=(e,t)=>{let n={cleanup:l,enabled:!1},i;const o=()=>{n.cleanup()};return{buildEnd:o,closeBundle:o,config(P,f){if(f.command!=="serve")return;if(n.cleanup(),n=u(t),e===void 0){n.enabled&&n.configPath!==void 0&&console.info(c(`remote bindings are materialized at ${n.configPath} — this project adds @cloudflare/vite-plugin itself (\`cloudflare: false\`), so pass that path as its \`configPath\` to use them.`));return}const a=e;i!==void 0&&a.configPath===i&&delete a.configPath;const r=m(e,n);r.configPath!==void 0&&a.configPath===void 0?(a.configPath=r.configPath,i=r.configPath):n.enabled&&n.configPath===void 0&&n.reason!==void 0&&console.info(c(`remote bindings requested but not applied: ${n.reason}`))},enforce:"pre",name:"lunora:remote-bindings"}};export{u as planViteRemoteBindings,p as remoteBindingsPlugin,m as withRemoteBindings};