@lunora/config 1.0.0-alpha.293 → 1.0.0-alpha.295
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/cloudflare/index.d.mts +86 -13
- package/dist/cloudflare/index.d.ts +86 -13
- package/dist/cloudflare/index.mjs +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +1 -1
- package/dist/packem_shared/BINDING_MANIFEST_VERSION-CPGD7sr_.mjs +1 -0
- package/dist/packem_shared/GLOBAL_FETCH_STRICTLY_PUBLIC_FLAG-f8CnJha3.mjs +1 -0
- package/dist/packem_shared/REMOTE_ELIGIBLE_KEYS-DioKi8jL.mjs +1 -0
- package/dist/packem_shared/REQUIRED_COMPATIBILITY_DATE-DFsH8i4Z.mjs +1 -0
- package/dist/packem_shared/UNEXPORTED_CLASS_MARKER-BMNpympM.mjs +1 -0
- package/dist/packem_shared/{assertWranglerSatisfiesSchema-BiABHeMv.mjs → assertWranglerSatisfiesSchema-DBsJ8xZA.mjs} +1 -1
- package/dist/packem_shared/collectExportGaps-BOeuCzWm.mjs +2 -0
- package/dist/packem_shared/discoverSchemaInfo-BguahM6z.mjs +1 -0
- package/dist/packem_shared/infer-bindings-D5S20KYQ.mjs +1 -0
- package/dist/packem_shared/{schema-info.d-fEhxTb9k.d.mts → infer-bindings.d-Duw2Bq4_.d.mts} +78 -54
- package/dist/packem_shared/{schema-info.d-fEhxTb9k.d.ts → infer-bindings.d-Duw2Bq4_.d.ts} +78 -54
- package/dist/packem_shared/inferLunoraBindings-DLCakLqW.mjs +1 -0
- package/dist/packem_shared/{materializeServiceDevConfigs-Cjk9uh9u.mjs → materializeServiceDevConfigs-VcqRp-kv.mjs} +1 -1
- package/dist/packem_shared/mergeWranglerEnvironment-KtP_NGVx.mjs +1 -0
- package/dist/packem_shared/reconcileBindingsSafely-BDZqwxAJ.mjs +1 -0
- package/dist/packem_shared/validate-bindings-Djec3UWf.mjs +1 -0
- package/dist/packem_shared/withTailConsumer-Dz7FDSBy.mjs +1 -0
- package/dist/packem_shared/worker-entry-checks-9Vdz4d2f.mjs +1 -0
- package/dist/packem_shared/wranglerToAlchemy-Bpfy1abZ.mjs +6 -0
- package/package.json +5 -5
- package/dist/packem_shared/BINDING_MANIFEST_VERSION-BHfXhS_-.mjs +0 -1
- package/dist/packem_shared/REMOTE_ELIGIBLE_KEYS-CBKtw0E-.mjs +0 -1
- package/dist/packem_shared/REQUIRED_COMPATIBILITY_DATE-jTnj2MPJ.mjs +0 -1
- package/dist/packem_shared/UNEXPORTED_CLASS_MARKER-CugcZbPf.mjs +0 -1
- package/dist/packem_shared/collectExportGaps-CIYe_DRY.mjs +0 -2
- package/dist/packem_shared/discoverSchemaInfo-DJvevsCm.mjs +0 -1
- package/dist/packem_shared/inferLunoraBindings-DXLEJY9w.mjs +0 -1
- package/dist/packem_shared/mergeWranglerEnvironment-DOKJUNH8.mjs +0 -1
- package/dist/packem_shared/reconcileBindingsSafely-VBbLYoAx.mjs +0 -1
- package/dist/packem_shared/validate-bindings-Dnf1t0SY.mjs +0 -1
- package/dist/packem_shared/withTailConsumer-B1NoKIsj.mjs +0 -1
- package/dist/packem_shared/wranglerToAlchemy-BMOQYRyw.mjs +0 -6
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{existsSync as m}from"node:fs";import{discoverSchema as c,isHyperdriveGlobalTable as l,isD1GlobalTable as d}from"@lunora/codegen";import{Project as f}from"ts-morph";import{join as b}from"node:path";const y=(s,n)=>{const t=b(s,n,"schema.ts");if(!m(t))return{info:void 0};try{const a=new f({skipAddingFilesFromTsConfig:!0,useInMemoryFileSystem:!1}),r=c(a,t,s),i=e=>r.tables.find(o=>o.name===e)?.shape??{};return{info:{hasD1GlobalTable:r.tables.some(e=>d(e)),hasHyperdriveGlobalTable:r.tables.some(e=>l(e)),vectorIndexNames:r.vectorIndexes.map(e=>e.name),vectorMetadata:r.vectorIndexes.flatMap(e=>(e.metadata??[]).map(o=>({index:e.name,kind:i(e.table)[o]?.kind,property:o})))}}}catch(a){return{error:a instanceof Error?a.message:String(a),info:void 0}}};export{y as discoverSchemaInfo};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{existsSync as _,statSync as O,readFileSync as D,readdirSync as U}from"node:fs";import{discoverFlags as Y,FLAGS_FILENAME as M,discoverQueues as W,QUEUES_FILENAME as G,readServiceBindings as K}from"@lunora/codegen";import{parse as C,init as X}from"es-module-lexer";import{discoverAgentInfo as q}from"./discoverAgentInfo-CTdCSfYM.mjs";import{discoverContainerInfo as H}from"./discoverContainerInfo-EhZtEBQs.mjs";import{d as w}from"./discover-info-Vj9d4qYt.mjs";import{escapeRegExp as Q}from"./DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs";import{discoverSchemaInfo as V}from"./discoverSchemaInfo-DJvevsCm.mjs";import{resolveWorkerEntry as J,COMPOSED_ENTRY_DURABLE_OBJECTS as z,GENERATED_MODULE_DURABLE_OBJECTS as Z,GENERATED_DIRECTORY as k,DURABLE_OBJECT_BINDINGS as ee,detectExportedDurableObjects as se,detectClassExports as y}from"./COMPOSED_WORKER_ENTRY-C69wqbSP.mjs";import{discoverWorkflowInfo as re}from"./discoverWorkflowInfo-BsPvlo6O.mjs";import{join as m}from"node:path";const oe=(e,s)=>{const{error:o,value:r}=w(e,s,M,Y);return o===void 0?{flags:r}:{error:o}},L=/^\s*import\s+type\b/,te=new Set(["@lunora/agent","@lunora/agent/sandbox"]),h=["browserTool","jsCodeTool"],v=Object.fromEntries(h.map(e=>{const s=Q(e);return[e,{fallback:new RegExp(String.raw`import\s+\{[^}]*\b${s}\b[^}]*\}\s+from\s+["']@lunora\/agent(?:\/sandbox)?["']`,"u"),name:new RegExp(String.raw`\b${s}\b`,"u"),typeSpecifier:new RegExp(String.raw`\btype\s+${s}\b`,"u")}]})),ne=e=>{const s=e.indexOf("{");if(s===-1)return"";const o=e.indexOf("}",s+1);return o===-1?e.slice(s+1):e.slice(s+1,o)},ae=(e,s)=>{if(L.test(e))return!1;const o=ne(e);return v[s].name.test(o)&&!v[s].typeSpecifier.test(o)},ie=e=>{let s;try{const[o]=C(e);s=o.filter(r=>r.n!==void 0&&te.has(r.n)).map(r=>e.slice(r.ss,r.se))}catch{s=void 0}return Object.fromEntries(h.map(o=>[o,s===void 0?v[o].fallback.test(e):s.some(r=>ae(r,o))]))},ce=(e,s)=>{const{error:o,value:r}=w(e,s,G,W);return o===void 0?{queues:r??[]}:{error:o,queues:[]}},de=new Set([".cjs",".cts",".js",".jsx",".mjs",".mts",".ts",".tsx"]),ue=new Set([".git",".lunora-cache",".wrangler","dist",k,"node_modules"]),le=["lunora","src"],pe=/\benv\s*\.\s*DB\b/,me=/\benv\s*\.\s*AI\b/,P=/\bctx\s*\.\s*pipelines\b/,B=/\bctx\s*\.\s*r2sql\b/,E={usesAi:{pattern:/\bfrom\s+["']@lunora\/ai["']/,source:"@lunora/ai"},usesAnalytics:{pattern:/\bfrom\s+["']@lunora\/bindings\/analytics["']/,source:"@lunora/bindings/analytics"},usesAuth:{pattern:/\bfrom\s+["']@lunora\/auth["']/,source:"@lunora/auth"},usesBrowser:{pattern:/\bfrom\s+["']@lunora\/browser["']/,source:"@lunora/browser"},usesHyperdrive:{pattern:/\bfrom\s+["']@lunora\/hyperdrive["']/,source:"@lunora/hyperdrive"},usesImages:{pattern:/\bfrom\s+["']@lunora\/bindings\/images["']/,source:"@lunora/bindings/images"},usesKv:{pattern:/\bfrom\s+["']@lunora\/bindings\/kv["']/,source:"@lunora/bindings/kv"},usesMail:{pattern:/\bfrom\s+["']@lunora\/mail["']/,source:"@lunora/mail"},usesNotify:{pattern:/\bfrom\s+["']@lunora\/notify["']/,source:"@lunora/notify"},usesPayment:{pattern:/\bfrom\s+["']@lunora\/payment["']/,source:"@lunora/payment"},usesPipelines:{pattern:P,source:"@lunora/bindings/pipelines"},usesR2sql:{pattern:B,source:"@lunora/bindings/r2sql"},usesScheduler:{pattern:/\bfrom\s+["']@lunora\/scheduler["']/,source:"@lunora/scheduler"},usesStorage:{pattern:/\bfrom\s+["']@lunora\/storage["']/,source:"@lunora/storage"},usesX402Charge:{pattern:/\bfrom\s+["']@lunora\/x402\/charge["']/,source:"@lunora/x402/charge"},usesX402Pay:{pattern:/\bfrom\s+["']@lunora\/x402\/pay["']/,source:"@lunora/x402/pay"}},f=Object.keys(E),fe="STRIPE_SECRET_KEY + STRIPE_WEBHOOK_SECRET (Stripe) or POLAR_ACCESS_TOKEN + POLAR_WEBHOOK_SECRET (Polar)",j=[...f,"needsD1","usesWorkerLoader"],be=()=>{const e={};for(const s of j)e[s]=!1;return e},l=Object.freeze(be()),x=(e,s)=>{const o={};for(const r of j)o[r]=e[r]||s[r];return o},ge=e=>{for(const s of f)if(E[s].source===e)return{...l,[s]:!0};return l},he=e=>{const[s]=C(e);let o=l;for(const r of s){const t=r.n;!t||L.test(e.slice(r.ss,r.se))||(o=x(o,ge(t)))}return o},Ee=e=>{const s={...l};for(const o of f)s[o]=E[o].pattern.test(e);return s},Se=e=>{let s;try{s=he(e)}catch{s=Ee(e)}return x(s,{...l,needsD1:pe.test(e),usesAi:me.test(e),usesPipelines:P.test(e),usesR2sql:B.test(e)})},R=(e,s)=>{let o;try{o=U(e,{withFileTypes:!0})}catch{return}for(const r of o){if(r.isDirectory()){ue.has(r.name)||R(m(e,r.name),s);continue}const t=r.name.lastIndexOf(".");t!==-1&&de.has(r.name.slice(t))&&s.push(m(e,r.name))}},ye=(e,s)=>V(e,s).info?.hasD1GlobalTable??!1,ve=(e,s)=>{let o=l;for(const r of s){const t=m(e,r);if(!_(t)||!O(t).isDirectory())continue;const n=[];R(t,n);for(const a of n)o=x(o,Se(D(a,"utf8")))}return o},_e=(e,s)=>{const o=m(e,s),r=Object.fromEntries(h.map(n=>[n,!1]));if(!_(o)||!O(o).isDirectory())return r;const t=[];R(o,t);for(const n of t){const a=ie(D(n,"utf8"));for(const i of h)r[i]||=a[i]}return r},xe=(e,s,o)=>[...e.map(r=>r.exported?`${r.bindingName}/${r.className} (container "${r.exportName}" declared and exported)`:`hint: container "${r.exportName}" is declared but ${r.className} is not exported by the worker entry — add \`export * from "./lunora/_generated/containers"\``),...s.map(r=>r.exported?`exports.${r.className} (workflow "${r.exportName}" declared and exported)`:`hint: workflow "${r.exportName}" is declared but ${r.className} is not exported by the worker entry — add \`export * from "./lunora/_generated/workflows"\``),...o.map(r=>r.exported?`exports.${r.className} (agent "${r.exportName}" declared and exported)`:`hint: agent "${r.exportName}" is declared but ${r.className} is not exported by the worker entry — add \`export * from "./lunora/_generated/agents"\``)],Re=(e,s)=>[[e.usesAi,"AI (@lunora/ai imported or env.AI used)"],[e.usesAuth&&!s.has("SessionDO"),"hint: @lunora/auth is imported; its tables are D1-backed by default. For DO-backed auth (what @better-auth/scim needs), pass `namespace` to .auth() and export the generated auth DO class"],[e.usesScheduler&&!s.has("SchedulerDO"),"hint: @lunora/scheduler is imported but no SchedulerDO is exported by the worker entry"],[e.usesStorage,"hint: @lunora/storage is imported; add an r2_buckets binding (bucket binding names are user-defined)"],[e.usesMail,"hint: @lunora/mail is imported; set RESEND_API_KEY in .dev.vars (obtain at https://resend.com/api-keys)"],[e.usesPayment,`hint: @lunora/payment is imported; set the provider secrets in .dev.vars — ${fe}`],[e.usesBrowser,"browser (@lunora/browser imported) — self-describing { binding: BROWSER }"],[e.usesImages,"images (@lunora/bindings/images imported) — self-describing { binding: IMAGES }"],[e.usesAnalytics,"analytics_engine_datasets (@lunora/bindings/analytics imported) — self-describing { binding: ANALYTICS, dataset }"],[e.usesWorkerLoader,"worker_loaders (jsCodeTool imported in lunora/) — self-describing { binding: LOADER }"],[e.usesKv,"hint: @lunora/bindings/kv is imported; add a kv_namespaces binding ({ binding, id }) and pass env.<BINDING> to createKv() — the namespace id can't be auto-provisioned"],[e.usesHyperdrive,"hint: @lunora/hyperdrive is imported; run 'wrangler hyperdrive create' and add a 'hyperdrive' binding ({ binding, id }) — the id can't be auto-provisioned"],[e.usesPipelines,"hint: ctx.pipelines is used; run 'wrangler pipelines create <name>' and add a 'pipelines' binding ({ binding, stream }) — the pipeline resource can't be auto-provisioned"],[e.usesX402Charge,"hint: @lunora/x402/charge is imported; set the recipient wallet address as a [vars] entry (the var name is yours to choose) and pass it to the charge config — the x402 facilitator settles USDC to that address"],[e.usesX402Pay,"hint: @lunora/x402/pay is imported (ActionCtx-only, spends real funds); add a secrets_store_secrets[] binding for the agent wallet key (name it to match signer.secretName) and pair the pay rail with a spend policy — ctx.secrets reads a Secrets Store binding, not .dev.vars, so the key can't be auto-provisioned"]].filter(([r])=>r).map(([,r])=>r),Ie=(e,s,o,r=[],t=[],n=[])=>{const a=new Set(e.map(c=>c.className)),i=e.map(c=>`${c.binding}/${c.className} (exported by worker entry)`);return s&&i.push("DB (.global() table declared)"),i.push(...xe(r,t,n),...Re(o,a)),i},je=async e=>{await X;const s=e.schemaDir??"lunora",o=e.scanDirs??le,r=ve(e.projectRoot,o),t=_e(e.projectRoot,s),n={...r,usesBrowser:r.usesBrowser||t.browserTool,usesWorkerLoader:t.jsCodeTool},a=J(e.projectRoot);let i;a.composed?i=[...z,...Object.entries(Z).filter(([u])=>_(m(e.projectRoot,s,k,`${u}.ts`))).map(([,u])=>u)].map(u=>({binding:ee[u],className:u})):i=a.path===void 0?[]:se(a.path);const c=n.needsD1||ye(e.projectRoot,s),I=y(a,H(e.projectRoot,s).containers,"containers"),A=y(a,re(e.projectRoot,s).workflows,"workflows"),N=y(a,q(e.projectRoot,s).agents,"agents"),$=[...ce(e.projectRoot,s).queues],{flags:b}=oe(e.projectRoot,s),S=b?.provider==="flagship"&&b.mode==="binding"?b.bindingName:void 0,T={};for(const d of f)T[d]=n[d];const g=Ie(i,c,n,I,A,N);S!==void 0&&g.push(`hint: lunora/flags.ts uses Flagship in binding mode; add a flagship binding ({ binding: "${S}", app_id }) — the app_id can't be auto-provisioned`);const p=K(e.projectRoot),F=p.error===void 0?p.services:void 0;return p.error!==void 0&&g.push(`hint: lunora.config \`services\` not reconciled — ${p.error}`),g.push(...p.services.map(d=>`${d.binding} → ${d.worker} (lunora.config services.${d.name})`)),{agents:N,containers:I,durableObjects:i,flagshipBinding:S,needsD1:c,queues:$,services:F,signals:g,usesFlags:b!==void 0,usesWorkerLoader:n.usesWorkerLoader,workflows:A,...T}},$e=e=>{const s=[];for(const o of f)e[o]&&s.push(E[o].source);return s};export{je as inferLunoraBindings,$e as packageNamesFromBindings};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const c=["artifacts","containers","d1_databases","durable_objects","kv_namespaces","queues","r2_buckets","secrets","secrets_store_secrets","services","tail_consumers","vars","vectorize","workflows"],i=["assets","compatibility_date","exports","logpush","main","migrations","observability","placement"],m=(s,n)=>{if(n===void 0)return{merged:s,unverifiedKeys:[]};const t=s.env?.[n];if(t===void 0){const e=Object.keys(s.env??{}).toSorted((v,f)=>v.localeCompare(f)),l=e.length>0?` (declared: ${e.join(", ")}).`:" (no environments are declared).";return{error:`--env "${n}" names no environment declared in wrangler.jsonc's "env" block${l}`,merged:s,unverifiedKeys:[]}}const o={...s},r=Object.keys(t).filter(e=>e!=="env");for(const e of r)i.includes(e)&&(o[e]=t[e]);for(const e of c)o[e]=t[e];const a=new Set([...c,...i]),d=r.filter(e=>!a.has(e)).map(String);return{merged:o,unverifiedKeys:d}};export{m as mergeWranglerEnvironment};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{inferLunoraBindings as p}from"./inferLunoraBindings-DXLEJY9w.mjs";import{LUNORA_TAG as r}from"./LUNORA_TAG-CiQM3BkI.mjs";import{reconcileWranglerBindings as $}from"./collectExportGaps-CIYe_DRY.mjs";import{reconcileWranglerCompatibilityDate as g}from"./reconcileWranglerCompatibilityDate-hocXEuRA.mjs";import{reconcileWranglerCrons as m,describePreservedCrons as w}from"./describePreservedCrons-7gaDLxWx.mjs";const j=async(i,t,o)=>{try{const n=await p({projectRoot:i.projectRoot,schemaDir:i.schemaDir}),e=$(i.projectRoot,n),a=e.wranglerPath??"wrangler.jsonc";if(e.added.length>0&&t.info?.(`${r} inferred bindings → ${e.added.join(", ")} (written to ${a})`),e.updated.length>0&&t.info?.(`${r} updated bindings → ${e.updated.join(", ")} (written to ${a})`),e.devConfig!==void 0){const{added:s,path:d,updated:f}=e.devConfig;t.info?.(`${r} dev sidecar bindings → ${[...s,...f].join(", ")} (written to ${d})`)}for(const s of e.warnings)t.warn(`${r} ${s}`);e.exportGaps.length>0&&o?.(e.exportGaps)}catch(n){const e=n instanceof Error?n.message:String(n);t.warn(`${r} binding inference skipped: ${e}`)}},c=new Map,u=(i,t,o)=>{try{const n=m(i,t);n.changed&&o.info?.(`${r} synced ${t.length.toFixed(0)} cron trigger(s) into ${n.wranglerPath??"wrangler.jsonc"}`);for(const s of n.warnings)o.warn(`${r} ${s}`);const e=n.preserved.join("\0"),a=w(n.preserved);a!==void 0&&(n.changed||c.get(i)!==e)&&o.info?.(`${r} ${a}`),c.set(i,e)}catch(n){const e=n instanceof Error?n.message:String(n);o.warn(`${r} cron trigger sync skipped: ${e}`)}try{const n=g(i);n.changed&&o.info?.(`${r} bumped compatibility_date to ${n.date??"unknown"} (Workers Cache enabled) → ${n.wranglerPath??"wrangler.jsonc"}`)}catch(n){const e=n instanceof Error?n.message:String(n);o.warn(`${r} compatibility date sync skipped: ${e}`)}};export{j as reconcileBindingsSafely,u as reconcileWranglerExtras};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const f=[{of:e=>e.schedules===void 0?void 0:[...e.schedules],path:["schedules"]},{of:e=>e.limits?.steps,path:["limits","steps"]},{of:e=>e.defaultRetention?.successRetention,path:["default_retention","success_retention"]},{of:e=>e.defaultRetention?.errorRetention,path:["default_retention","error_retention"]}],D=[...new Set(f.map(({path:e})=>e[0]))],u=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),p=(e,n)=>{let i=e;for(const s of n)i=u(i)?i[s]:void 0;return i},O=e=>{const n={};for(const{of:i,path:s}of f){const a=i(e);if(a===void 0)continue;const[t,o]=s;n[t]=o===void 0?a:{...n[t],[o]:a}}return n},I=(e,n,i)=>{if(n.length===0)return;const s=e.vectorize??[],a=new Set(s.filter(Boolean).map(t=>t?.index_name));for(const t of n)a.has(t)||i.push(`schema declares vector index "${t}"; wrangler "vectorize" must include a binding with index_name "${t}"`)},v=new Set(["basic","dev","lite","standard","standard-1","standard-2","standard-3","standard-4"]),$={disk_mb:2e4,memory_mib:12288,vcpu:4},k=(e,n,i)=>{const s=e.instance_type;if(s===void 0)return;if(typeof s=="string"){v.has(s)||i.push(`${n} has unknown instance_type "${s}" — expected lite, basic, standard-1..4, or a custom { vcpu, memory_mib, disk_mb } object`);return}for(const[r,c]of Object.entries($)){const m=s[r];m!==void 0&&(typeof m!="number"||m<=0||m>c)&&i.push(`${n} custom instance_type ${r} must be a positive number ≤ ${String(c)} (got ${String(m)})`)}const{disk_mb:a,memory_mib:t,vcpu:o}=s;if(typeof o=="number"&&typeof t=="number"&&t<o*3072&&i.push(`${n} custom instance_type needs ≥ 3 GiB (3072 MiB) memory per vCPU (got ${String(t)} MiB for ${String(o)} vCPU)`),typeof t=="number"&&typeof a=="number"){const r=Math.floor(t/1024*2e3);a>r&&i.push(`${n} custom instance_type allows ≤ 2 GB disk per GiB memory (≤ ${String(r)} MB for ${String(t)} MiB memory; got ${String(a)} MB)`)}},w=(e,n,i)=>{for(const s of["image","instance_type","max_instances"])e[s]!==void 0&&i.push(`${n} sets "${s}", which the durable_object scheduling policy does not take — the Durable Object picks image and size at start`);for(const[s,a]of Object.entries(e.images??{}))[a?.dockerfile,a?.image].filter(o=>typeof o=="string"&&o.length>0).length!==1&&i.push(`${n} images["${s}"] must set exactly one of "dockerfile" or "image"`)},M=(e,n,i)=>{const{boundClasses:s,classKinds:a,errors:t,warnings:o}=i;if(!e||typeof e!="object"||typeof e.class_name!="string"||e.class_name.length===0){t.push(`${n} must have a non-empty "class_name" naming its container-enabled Durable Object class`);return}const r=e.scheduling_policy==="durable_object";e.scheduling_policy!==void 0&&e.scheduling_policy!=="default"&&!r&&t.push(`${n} ("${e.class_name}") has unknown scheduling_policy "${e.scheduling_policy}" — expected "default" or "durable_object"`),r?w(e,`${n} ("${e.class_name}")`,t):(typeof e.image!="string"||e.image.length===0)&&t.push(`${n} ("${e.class_name}") must have an "image" — a Dockerfile path or a registry reference`),s.has(e.class_name)||t.push(`${n} class "${e.class_name}" has no matching durable_objects binding — your dev server auto-reconciles this on startup; add { "name": "...", "class_name": "${e.class_name}" } to fix it by hand`);const c=a.get(e.class_name);c!=="sqlite"&&t.push(c==="classic"?`${n} class "${e.class_name}" is registered via "new_classes" but containers require SQLite-backed DOs — move it to "new_sqlite_classes"`:`${n} class "${e.class_name}" is missing from migrations — add a migration entry with "new_sqlite_classes": ["${e.class_name}"]`),k(e,`${n} ("${e.class_name}")`,t),e.max_instances===void 0&&!r&&o.push(`${n} ("${e.class_name}") declares no max_instances — set a cap so a traffic spike can't fan out unbounded container spend`)},d=e=>typeof e=="string"&&e.length>0,g=e=>Array.isArray(e)?e.filter(n=>n!==null&&typeof n=="object"):[],l=e=>Array.isArray(e)?e.filter(n=>d(n)):[],_=e=>{const n=new Map;for(const i of g(e)){for(const s of l(i.new_classes))n.set(s,"classic");for(const s of l(i.new_sqlite_classes))n.set(s,"sqlite");for(const s of g(i.renamed_classes))if(d(s.from)&&d(s.to)){const a=n.get(s.from)??"sqlite";n.delete(s.from),n.set(s.to,a)}for(const s of l(i.deleted_classes))n.delete(s)}return n},S=e=>new Set(_(e).keys()),N=(e,n)=>{const i=S(e.migrations);for(const s of g(e.durable_objects?.bindings))s.script_name===void 0&&d(s.class_name)&&!i.has(s.class_name)&&n.push(`durable_objects.bindings declares class "${s.class_name}" but it is missing from migrations — add a migration entry with "new_sqlite_classes": ["${s.class_name}"] (or "new_classes" for a non-SQLite-backed class), or let the dev server auto-reconcile it on the next start`)},C=(e,n,i)=>{if(e.containers===void 0)return;if(!Array.isArray(e.containers)){n.push("containers must be an array of { class_name, image, ... } entries");return}const s=e.containers;if(s.length===0)return;const a=new Set(g(e.durable_objects?.bindings).map(o=>o.class_name)),t=_(e.migrations);for(const[o,r]of s.entries())M(r,`containers[${String(o)}]`,{boundClasses:a,classKinds:t,errors:n,warnings:i});e.observability?.enabled!==!0&&i.push('containers are configured but observability is not enabled — container logs will not be captured (add { "observability": { "enabled": true } })')},b=e=>e,h=(e,n,i,s)=>{if(e!==void 0){if(!Array.isArray(e)){s.push(i.arrayMessage);return}for(const[a,t]of b(e).entries()){const o=`${n}[${String(a)}]`;if(!t||typeof t!="object"){s.push(i.objectMessage(o));continue}for(const r of i.fields)d(t[r.field])||s.push(r.message(o))}}},F={arrayMessage:"workflows must be an array of { name, binding, class_name } entries",fields:[{field:"binding",message:e=>`${e} must have a non-empty "binding" naming the Workflow binding (e.g. MY_WORKFLOW)`},{field:"class_name",message:e=>`${e} must have a non-empty "class_name" naming the exported WorkflowEntrypoint class`},{field:"name",message:e=>`${e} must have a non-empty "name" naming the deployed workflow`}],objectMessage:e=>`${e} must be a { name, binding, class_name } object`},j=(e,n)=>e===void 0||n&&d(e)||Array.isArray(e)&&e.length>0&&e.every(s=>d(s))?void 0:"schedules must be a non-empty array of cron expression strings",E=e=>{if(e!==void 0)return u(e)?e.steps===void 0||Number.isInteger(e.steps)&&e.steps>0?void 0:"limits.steps must be a positive integer":"limits must be an object"},x=e=>e===void 0?[]:u(e)?["success_retention","error_retention"].filter(n=>e[n]!==void 0&&!d(e[n])).map(n=>`default_retention.${n} must be a duration string (e.g. "7 days")`):["default_retention must be an object"],y=(e,n,i,s)=>{const a=[j(e.schedules,i),E(e.limits),...x(e.default_retention)];for(const t of a)t!==void 0&&s.push(`${n}.${t}`)},A=(e,n)=>f.map(({path:i})=>i).filter(i=>{const s=p(e,i),a=p(n,i),t=typeof a=="string"&&i[0]==="schedules"?[a]:a;return s!==void 0&&a!==void 0&&JSON.stringify(s)!==JSON.stringify(t)}).map(i=>i.join(".")),R=(e,n,i,s)=>{const a=`exports["${e}"]`,t=String(n.name);for(const o of i){if(!u(o)||o.name!==n.name)continue;const r=`workflows entry "${String(o.binding)}"`;if(o.script_name!==void 0){s.push(`${r} binds workflow "${t}" in another Worker, but ${a} declares a workflow with that name here — workflow names are unique per account`);continue}o.class_name!==e&&s.push(`${r} and ${a} both declare workflow "${t}" but name different classes ("${String(o.class_name)}" vs "${e}")`);for(const c of A(o,n))s.push(`${r} and ${a} set ${c} to different values for workflow "${t}" — set it in one place`)}},L=(e,n)=>{const i=Array.isArray(e.workflows)?b(e.workflows):[];for(const[a,t]of i.entries())u(t)&&y(t,`workflows[${String(a)}]`,!1,n);const s=u(e.exports)?Object.entries(e.exports):[];for(const[a,t]of s)!u(t)||t.type!=="workflow"||(d(t.name)?(y(t,`exports["${a}"]`,!0,n),R(a,t,i,n)):n.push(`exports["${a}"] is a workflow export and must have a non-empty "name" naming the deployed workflow`))},q={arrayMessage:"queues.producers must be an array of { binding, queue } entries",fields:[{field:"binding",message:e=>`${e} must have a non-empty "binding" naming the Queue producer (e.g. QUEUE_EMAIL)`},{field:"queue",message:e=>`${e} must have a non-empty "queue" naming the deployed queue`}],objectMessage:e=>`${e} must be a { binding, queue } object`},B={arrayMessage:"queues.consumers must be an array of { queue } entries",fields:[{field:"queue",message:e=>`${e} must have a non-empty "queue" naming the consumed queue`}],objectMessage:e=>`${e} must be a { queue } object`},U=(e,n)=>{if(e.queues!==void 0){if(typeof e.queues!="object"||Array.isArray(e.queues)){n.push("queues must be a { producers, consumers } object");return}h(e.queues.producers,"queues.producers",q,n),h(e.queues.consumers,"queues.consumers",B,n)}},T={arrayMessage:"secrets_store_secrets must be an array of { binding, store_id, secret_name } entries",fields:["binding","store_id","secret_name"].map(e=>({field:e,message:n=>`${n} must have a non-empty "${e}"`})),objectMessage:e=>`${e} must be a { binding, store_id, secret_name } object`},W=[{arrayMessage:"kv_namespaces must be an array of { binding, id } entries",bindingMessage:e=>`${e} must have a non-empty "binding" naming the KV namespace binding`,hintField:"id",hintMessage:(e,n)=>`${e} ("${n}") has no "id" — run \`wrangler kv namespace create\` and set the namespace id, or the binding can't resolve`,key:"kv_namespaces"},{arrayMessage:"flagship must be an array of { binding, app_id } entries",bindingMessage:e=>`${e} must have a non-empty "binding" naming the Flagship binding`,hintField:"app_id",hintMessage:(e,n)=>`${e} ("${n}") has no "app_id" — create a Flagship app and set its id, or the binding can't resolve`,key:"flagship"},{arrayMessage:"hyperdrive must be an array of { binding, id } entries",bindingMessage:e=>`${e} must have a non-empty "binding" naming the Hyperdrive binding`,hintField:"id",hintMessage:(e,n)=>`${e} ("${n}") has no "id" — run \`wrangler hyperdrive create\` and set the id, or the binding can't connect`,key:"hyperdrive"},{arrayMessage:"pipelines must be an array of { binding, stream } entries",bindingMessage:e=>`${e} must have a non-empty "binding" naming the Pipelines binding`,hintField:["stream","pipeline"],hintMessage:(e,n)=>`${e} ("${n}") has no "stream" — run \`wrangler pipelines create <name>\` and set the stream name, or the binding can't resolve`,key:"pipelines"},{arrayMessage:"analytics_engine_datasets must be an array of { binding, dataset } entries",bindingMessage:e=>`${e} must have a non-empty "binding" naming the Analytics Engine binding`,hintField:"dataset",hintMessage:(e,n)=>`${e} ("${n}") has no "dataset" — it defaults to the binding name; set it explicitly to avoid drift`,key:"analytics_engine_datasets"}],G=(e,n,i,s)=>{const a=e[n.key];if(a!==void 0){if(!Array.isArray(a)){i.push(n.arrayMessage);return}for(const[t,o]of b(a).entries()){const r=`${n.key}[${String(t)}]`;if(!o||typeof o!="object"||!d(o.binding)){i.push(n.bindingMessage(r));continue}(typeof n.hintField=="string"?[n.hintField]:n.hintField).some(m=>d(o[m]))||s.push(n.hintMessage(r,o.binding))}}},P=[{key:"browser",message:'browser must be an object with a non-empty "binding" (e.g. { "binding": "BROWSER" })'},{key:"images",message:'images must be an object with a non-empty "binding" (e.g. { "binding": "IMAGES" })'},{key:"media",message:'media must be an object with a non-empty "binding" (e.g. { "binding": "MEDIA" })'},{key:"stream",message:'stream must be an object with a non-empty "binding" (e.g. { "binding": "STREAM" })'}],K=(e,n,i)=>{const s=e[n.key];s!==void 0&&(typeof s!="object"||s===null||Array.isArray(s)||!d(s.binding))&&i.push(n.message)},Q=[{arrayMessage:"services must be an array of { binding, service, entrypoint? } entries",fields:[{field:"binding",message:e=>`${e} must have a non-empty "binding" naming the service binding`},{field:"service",message:e=>`${e} must have a non-empty "service" naming the target Worker`}],key:"services",objectMessage:e=>`${e} must be a { binding, service, entrypoint? } object`},{arrayMessage:"dispatch_namespaces must be an array of { binding, namespace } entries",fields:[{field:"binding",message:e=>`${e} must have a non-empty "binding"`},{field:"namespace",message:e=>`${e} must have a non-empty "namespace" naming the dispatch namespace`}],key:"dispatch_namespaces",objectMessage:e=>`${e} must be a { binding, namespace } object`},{arrayMessage:"mtls_certificates must be an array of { binding, certificate_id } entries",fields:[{field:"binding",message:e=>`${e} must have a non-empty "binding"`},{field:"certificate_id",message:e=>`${e} must have a non-empty "certificate_id" (upload via \`wrangler mtls-certificate upload\`)`}],key:"mtls_certificates",objectMessage:e=>`${e} must be a { binding, certificate_id } object`},{arrayMessage:"r2_buckets must be an array of { binding, bucket_name } entries",fields:[{field:"binding",message:e=>`${e} must have a non-empty "binding" naming the R2 bucket binding`},{field:"bucket_name",message:e=>`${e} must have a non-empty "bucket_name" naming the deployed bucket`}],key:"r2_buckets",objectMessage:e=>`${e} must be a { binding, bucket_name } object`},{arrayMessage:"vpc_services must be an array of { binding, service_id } entries",fields:[{field:"binding",message:e=>`${e} must have a non-empty "binding" naming the VPC Service binding`},{field:"service_id",message:e=>`${e} must have a non-empty "service_id" (create one with \`wrangler vpc service create\`)`}],key:"vpc_services",objectMessage:e=>`${e} must be a { binding, service_id } object`},{arrayMessage:"artifacts must be an array of { binding, namespace } entries",fields:[{field:"binding",message:e=>`${e} must have a non-empty "binding" naming the Artifacts binding`},{field:"namespace",message:e=>`${e} must have a non-empty "namespace" naming the Artifacts namespace`}],key:"artifacts",objectMessage:e=>`${e} must be a { binding, namespace } object`}],z=(e,n,i)=>{n?.hasD1GlobalTable&&!g(e.d1_databases).some(s=>s.binding==="DB")&&i.push('schema declares .global() tables; d1_databases must include a binding named "DB" — your dev server auto-reconciles this on startup, or add the binding manually'),n?.hasHyperdriveGlobalTable&&g(e.hyperdrive).length===0&&i.push('schema declares .global({ backend: "hyperdrive" }) tables; wrangler must declare a hyperdrive binding for `.hyperdriveGlobal({ exec })` to read — run `wrangler hyperdrive create <name> --connection-string=...` and add `"hyperdrive": [{ "binding": "HYPERDRIVE", "id": "<id>" }]` (any binding name works; your `exec` selector picks it)')},H=(e,n)=>{const{d1_databases:i}=e;if(i!==void 0){if(!Array.isArray(i)){n.push("d1_databases must be an array of { binding, database_id | database_name } entries");return}for(const[s,a]of b(i).entries()){const t=`d1_databases[${String(s)}]`;if(!a||typeof a!="object"){n.push(`${t} must be a { binding, database_id | database_name } object`);continue}d(a.binding)||n.push(`${t} must have a non-empty "binding" naming the D1 binding`),!d(a.database_id)&&!d(a.database_name)&&n.push(`${t} must have a "database_id" or a "database_name" — run \`wrangler d1 create\` and set one, or the binding can't resolve`)}}},V=(e,n)=>{const{vpc_networks:i}=e;if(i!==void 0){if(!Array.isArray(i)){n.push("vpc_networks must be an array of { binding, tunnel_id | network_id } entries");return}for(const[s,a]of b(i).entries()){const t=`vpc_networks[${String(s)}]`;if(!a||typeof a!="object"){n.push(`${t} must be a { binding, tunnel_id | network_id } object`);continue}d(a.binding)||n.push(`${t} must have a non-empty "binding" naming the VPC Network binding`),d(a.tunnel_id)===d(a.network_id)&&n.push(`${t} must set exactly one of "tunnel_id" (a Cloudflare Tunnel) or "network_id" ("cf1:network" for Cloudflare Mesh)`)}}};export{W as H,Q as R,P as S,F as W,z as a,H as b,I as c,C as d,h as e,L as f,U as g,G as h,K as i,V as j,T as k,d as l,D as m,l as n,g as o,f as p,p as s,N as v,O as w};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{l as d,o as p}from"./validate-bindings-Dnf1t0SY.mjs";const b=new Set(["1","enabled","on","true","yes"]),m=s=>typeof s=="string"&&b.has(s.trim().toLowerCase()),y=(s,t,e)=>{const i=s.send_email;if(i===void 0)return;if(!Array.isArray(i)){t.push("send_email must be an array of { name, destination_address? } entries");return}const n=i;for(const[o,a]of n.entries())(!a||typeof a!="object"||typeof a.name!="string"||a.name.length===0)&&e.push(`send_email[${String(o)}] has no non-empty "name" naming the send-email binding — set one before deploying`)},g=(s,t)=>{s.logpush!==void 0&&typeof s.logpush!="boolean"&&t.push('logpush must be a boolean (set "logpush": true to enable Cloudflare Logpush)')},v=(s,t)=>{const e=s.secrets;if(e===void 0)return;const i=typeof e=="object"&&e!==null&&!Array.isArray(e)?e.required:void 0;(!Array.isArray(i)||i.some(n=>typeof n!="string"||n===""))&&t.push('secrets must be an object whose "required" is an array of secret names (e.g. { "required": ["API_KEY"] })')},c=3e5,_=(s,t)=>{const{limits:e}=s;if(e===void 0)return;if(typeof e!="object"||Array.isArray(e)){t.push('limits must be an object (e.g. { "cpu_ms": 30000 })');return}const i=e.cpu_ms;if(i!==void 0){if(typeof i!="number"||!Number.isFinite(i)||!Number.isInteger(i)||i<=0){t.push("limits.cpu_ms must be a positive integer number of milliseconds");return}i>c&&t.push(`limits.cpu_ms must be at most ${String(c)} (Cloudflare's per-invocation ceiling)`)}},l=new Set(["off","smart","targeted"]),A=(s,t)=>{const{placement:e}=s;if(e===void 0)return;if(typeof e!="object"||e===null||Array.isArray(e)){t.push('placement must be an object (e.g. { "mode": "smart" })');return}const{mode:i}=e;i!==void 0&&(typeof i!="string"||!l.has(i))&&t.push(`placement.mode must be one of ${[...l].map(n=>`"${n}"`).join(", ")}`)},j=(s,t)=>{const{observability:e}=s;if(e===void 0)return;if(typeof e!="object"||Array.isArray(e)){t.push('observability must be an object (e.g. { "enabled": true, "head_sampling_rate": 1 })');return}const i=(n,o)=>{n!==void 0&&(typeof n!="number"||Number.isNaN(n)||n<0||n>1)&&t.push(`${o} must be a number in [0, 1] (the fraction of requests sampled)`)};i(e.head_sampling_rate,"observability.head_sampling_rate"),e.logs!==void 0&&(typeof e.logs!="object"||Array.isArray(e.logs)?t.push("observability.logs must be an object"):(i(e.logs.head_sampling_rate,"observability.logs.head_sampling_rate"),e.logs.invocation_logs!==void 0&&typeof e.logs.invocation_logs!="boolean"&&t.push('observability.logs.invocation_logs must be a boolean (set "invocation_logs": true to keep per-invocation summaries)')))},S=(s,t)=>{const{cache:e}=s;if(e!==void 0){if(typeof e!="object"||e===null||Array.isArray(e)){t.push('cache must be an object (e.g. { "enabled": true })');return}e.enabled!==void 0&&typeof e.enabled!="boolean"&&t.push("cache.enabled must be a boolean (true or false)")}},O=(s,t)=>{const{exports:e}=s;if(e!==void 0){if(typeof e!="object"||e===null||Array.isArray(e)){t.push("exports must be an object keyed by entrypoint name");return}for(const[i,n]of Object.entries(e)){if(typeof n!="object"||n===null){t.push(`exports["${i}"] must be an object`);continue}n.type!==void 0&&typeof n.type!="string"&&t.push(`exports["${i}"].type must be a string`),n.cache!==void 0&&(typeof n.cache!="object"||n.cache===null||Array.isArray(n.cache)?t.push(`exports["${i}"].cache must be an object`):n.cache.enabled!==void 0&&typeof n.cache.enabled!="boolean"&&t.push(`exports["${i}"].cache.enabled must be a boolean`))}}},E=(s,t)=>{const{assets:e}=s;if(e!==void 0){if(typeof e!="object"||Array.isArray(e)){t.push('assets must be an object (e.g. { "directory": "./dist/client", "binding": "ASSETS" })');return}(typeof e.directory!="string"||e.directory.length===0)&&t.push('assets must declare a non-empty "directory" pointing at the built client output (e.g. "./dist/client")'),e.binding!==void 0&&(typeof e.binding!="string"||e.binding.length===0)&&t.push('assets.binding must be a non-empty string (e.g. "ASSETS")'),e.html_handling!==void 0&&typeof e.html_handling!="string"&&t.push("assets.html_handling must be a string"),e.not_found_handling!==void 0&&typeof e.not_found_handling!="string"&&t.push("assets.not_found_handling must be a string")}},L=(s,t)=>{const e=s.tail_consumers;if(e===void 0)return;if(!Array.isArray(e)){t.push("tail_consumers must be an array of { service, environment? } entries");return}const i=e;for(const[n,o]of i.entries())(!o||typeof o!="object"||typeof o.service!="string"||o.service.length===0)&&t.push(`tail_consumers[${String(n)}] must have a non-empty "service" naming the consumer Worker`)},N=(s,t)=>{const e=s.tail_consumers??[];return e.some(n=>!!n&&n?.service===t.service&&n?.environment===t.environment)?s:{...s,tail_consumers:[...e,t]}},R=(s,t)=>{const{vars:e}=s;if(!e||typeof e!="object")return;const i=e.LUNORA_ALLOWED_ORIGINS,n=e.LUNORA_CORS_ALLOW_CREDENTIALS,o=typeof i=="string"&&i.split(",").some(u=>u.trim()==="*"),a=m(n);o&&a&&t.push('vars.LUNORA_ALLOWED_ORIGINS includes a "*" wildcard while vars.LUNORA_CORS_ALLOW_CREDENTIALS is on — browsers reject this combination and it defeats the allowlist; name explicit origins or drop credentials')},f=s=>p(s.durable_objects?.bindings).some(t=>t.class_name==="SchedulerDO"&&t.script_name===void 0),r="LUNORA_ORIGIN_URL",$=(s,t,e)=>{if(!f(s)||d(s.vars?.[r]))return;const i=t===void 0?"vars":`env.${t}.vars`,n=t===void 0?"":` --env ${t}`;e.push(`durable_objects.bindings declares the SchedulerDO but ${i}.${r} is unset — the DO reads its dispatch origin from its own env and refuses to schedule without it, so every ctx.scheduler.runAfter/runAt fails with ORIGIN_NOT_CONFIGURED. Set ${i}.${r} to the worker's public URL, or \`wrangler secret put ${r}${n}\` (ignore this if it is already set as a secret or in the dashboard).`)};export{E as validateAssets,S as validateCache,R as validateCorsVariables,O as validateExports,_ as validateLimits,g as validateLogpush,j as validateObservability,A as validatePlacement,$ as validateSchedulerOrigin,v as validateSecretsRequired,y as validateSendEmail,L as validateTailConsumers,N as withTailConsumer};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
const o=e=>JSON.stringify(e),$=/^[A-Z_a-z][\w$]*$/u,d=e=>$.test(e),u=e=>d(e)?e:`binding_${e.replaceAll(/\W/gu,"_")}`,m=(e,s=u(e))=>{const n=d(e);return n&&s===e?`${e},`:`${n?e:o(e)}: ${s},`},g=e=>{const s=new Set;for(const n of e.migrations??[])for(const r of n.new_sqlite_classes??[])s.add(r);return s},v=(e,s,n,r,c)=>{for(const a of e.durable_objects?.bindings??[])if(!(a.name===void 0||a.class_name===void 0)){if(a.script_name!==void 0){c.push(`durable_objects.${a.name} (external script_name "${a.script_name}")`);continue}n.add("DurableObjectNamespace"),r.push(m(a.name,`DurableObjectNamespace(${o(a.name)}, { className: ${o(a.class_name)}, sqlite: ${String(s.has(a.class_name))} })`))}},h=(e,s)=>{for(const[n,r]of Object.entries(e.vars??{}))s.push(m(n,o(r)))},w=["ai","analytics_engine_datasets","assets","browser","containers","flagship","hyperdrive","images","pipelines","secrets_store_secrets","send_email","services","tail_consumers","vectorize","worker_loaders","workflows","exports"],f=(e,s)=>{for(const n of w){const r=e[n];r!==void 0&&(!Array.isArray(r)||r.length>0)&&s.push(n)}(e.queues?.consumers?.length??0)>0&&s.push("queues.consumers")},k=e=>{const s=e.name??"worker",n=[],r=new Set(["Worker"]),c=[],a=[],p=g(e),b=[{construct:"D1Database",entries:(e.d1_databases??[]).map(t=>({binding:t.binding,name:t.database_name})),nameKey:"name"},{construct:"R2Bucket",entries:(e.r2_buckets??[]).map(t=>({binding:t.binding,name:t.bucket_name})),nameKey:"name"},{construct:"KVNamespace",entries:(e.kv_namespaces??[]).map(t=>({binding:t.binding,name:t.binding})),nameKey:"title"},{construct:"Queue",entries:(e.queues?.producers??[]).map(t=>({binding:t.binding,name:t.queue})),nameKey:"name"}];for(const{construct:t,entries:l,nameKey:y}of b)for(const i of l)i.binding!==void 0&&(r.add(t),c.push(`const ${u(i.binding)} = await ${t}(${o(i.binding)}, { adopt: true, ${y}: ${o(i.name??i.binding)} });`),a.push(m(i.binding)));v(e,p,r,a,n),h(e,a),f(e,n);const _=["adopt: true,",a.length===0?void 0:`bindings: {
|
|
2
|
-
${a.join(`
|
|
3
|
-
`)}
|
|
4
|
-
},`,e.compatibility_date===void 0?void 0:`compatibilityDate: ${o(e.compatibility_date)},`,e.compatibility_flags===void 0||e.compatibility_flags.length===0?void 0:`compatibilityFlags: ${o([...e.compatibility_flags])},`,e.triggers?.crons===void 0||e.triggers.crons.length===0?void 0:`crons: ${o([...e.triggers.crons])},`,e.main===void 0?void 0:`entrypoint: ${o(e.main)},`,`name: ${o(s)},`].filter(t=>t!==void 0);return{source:["// GENERATED by @lunora/config from wrangler.jsonc — do not edit.","// Re-generated on every `lunora deploy`; edit wrangler.jsonc instead.","",'import alchemy from "alchemy";',`import { ${[...r].toSorted((t,l)=>t.localeCompare(l)).join(", ")} } from "alchemy/cloudflare";`,"",`const app = await alchemy(${o(s)});`,"",...c.length===0?[]:[...c,""],`export const worker = await Worker(${o(s)}, {`,` ${_.join(`
|
|
5
|
-
`)}`,"});","","await app.finalize();",""].join(`
|
|
6
|
-
`),unsupported:n}};export{g as sqliteClasses,k as wranglerToAlchemy};
|