@lunora/cli 1.0.0-alpha.416 → 1.0.0-alpha.417
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/bin.mjs +1 -1
- package/dist/index.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.mjs +1 -1
- package/dist/packem_chunks/handler.mjs +25 -1
- package/dist/packem_chunks/handler10.mjs +1 -1
- package/dist/packem_chunks/handler11.mjs +1 -1
- package/dist/packem_chunks/handler12.mjs +1 -1
- package/dist/packem_chunks/handler13.mjs +1 -3
- package/dist/packem_chunks/handler14.mjs +3 -1
- package/dist/packem_chunks/handler15.mjs +1 -1
- package/dist/packem_chunks/handler16.mjs +1 -1
- package/dist/packem_chunks/handler17.mjs +1 -7
- package/dist/packem_chunks/handler18.mjs +7 -1
- package/dist/packem_chunks/handler19.mjs +2 -1
- package/dist/packem_chunks/handler2.mjs +1 -1
- package/dist/packem_chunks/handler20.mjs +1 -3
- package/dist/packem_chunks/handler21.mjs +3 -3
- package/dist/packem_chunks/handler22.mjs +3 -1
- package/dist/packem_chunks/handler23.mjs +1 -2
- package/dist/packem_chunks/handler24.mjs +2 -99
- package/dist/packem_chunks/handler25.mjs +99 -2
- package/dist/packem_chunks/handler26.mjs +2 -9
- package/dist/packem_chunks/handler27.mjs +9 -1
- package/dist/packem_chunks/handler28.mjs +1 -0
- package/dist/packem_chunks/handler3.mjs +1 -1
- package/dist/packem_chunks/handler4.mjs +1 -3
- package/dist/packem_chunks/handler5.mjs +3 -1
- package/dist/packem_chunks/handler6.mjs +1 -1
- package/dist/packem_chunks/handler7.mjs +1 -1
- package/dist/packem_chunks/handler8.mjs +1 -2
- package/dist/packem_chunks/handler9.mjs +2 -1
- package/dist/packem_chunks/runDevCommand.mjs +1 -1
- package/dist/packem_chunks/runInitCommand.mjs +16 -16
- package/dist/packem_shared/{COMMANDS-Bl9QXbmy.mjs → COMMANDS-BCSDC-pv.mjs} +1 -1
- package/dist/packem_shared/cli-BbgDNGew.mjs +2 -0
- package/dist/packem_shared/runDeployCommand-D40F3PLQ.mjs +1 -0
- package/package.json +6 -6
- package/skills/lunora-quickstart/SKILL.md +0 -1
- package/dist/packem_chunks/runDeployCommand.mjs +0 -25
- package/dist/packem_shared/cli-DP6QFela.mjs +0 -2
|
@@ -1 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{r as v}from"../packem_shared/admin-token-VdUnvnKW.mjs";import{r as M,a as y}from"../packem_shared/admin-url-DJB8P6Jh.mjs";import{d as x}from"../packem_shared/command-CB4JM-Jl.mjs";import{EXIT_CODE as u,exitCodeForStatus as T}from"../packem_shared/EXIT_CODE-D_XCixv8.mjs";import{a as I}from"../packem_shared/resolve-target-C_ZloTvd.mjs";const O="__lunora_admin__:getFunctionStats",_=10,f=(r,o)=>({calls:r.calls,conflicts:r.conflicts??0,errors:r.errors,lastErrorMessage:r.lastErrorMessage,maxDurationMs:r.maxDurationMs,meanDurationMs:r.calls===0?0:r.totalDurationMs/r.calls,path:r.path,rate:o}),k=(r,o)=>{const t=r.filter(e=>(e.conflicts??0)>0).map(e=>f(e,e.calls===0?0:(e.conflicts??0)/e.calls)).toSorted((e,s)=>s.rate-e.rate||s.conflicts-e.conflicts).slice(0,o),n=r.filter(e=>e.errors>0).map(e=>f(e,e.calls===0?0:e.errors/e.calls)).toSorted((e,s)=>s.rate-e.rate||s.errors-e.errors).slice(0,o),a=r.map(e=>f(e,0)).toSorted((e,s)=>s.maxDurationMs-e.maxDurationMs).slice(0,o);return{errorHotspots:n,latencyOutliers:a,totalFunctions:r.length,writeContention:t}},p=r=>`${(r*100).toFixed(1)}%`,$=r=>r<1e3?`${Math.round(r).toString()}ms`:`${(r/1e3).toFixed(2)}s`,m=(r,o,t,n)=>[r,...o.length===0?[` ${t}`]:o.map(a=>` ${n(a)}`)],E=r=>{const o=t=>t.lastErrorMessage?` — ${t.lastErrorMessage}`:"";return[`Insights over ${r.totalFunctions.toString()} function${r.totalFunctions===1?"":"s"}`,"",...m("Write-conflict hot-spots (OCC contention — candidates for sharding):",r.writeContention,"none — no write conflicts observed",t=>`${t.path} ${t.conflicts.toString()}/${t.calls.toString()} calls (${p(t.rate)})`),"",...m("Error hot-spots:",r.errorHotspots,"none — no errors observed",t=>`${t.path} ${t.errors.toString()}/${t.calls.toString()} calls (${p(t.rate)})${o(t)}`),"",...m("Latency outliers (slowest single call):",r.latencyOutliers,"none — no functions have run",t=>`${t.path} max ${$(t.maxDurationMs)}, mean ${$(t.meanDurationMs)} over ${t.calls.toString()} calls`)].join(`
|
|
2
|
+
`)},i=(r,o,t)=>(r.error(o),{code:t,error:o}),F=r=>r===void 0||!Number.isFinite(r)||r<=0?_:Math.floor(r),A=async r=>{const{logger:o}=r;if(r.prod&&r.url===void 0)return i(o,"--prod requires an explicit --url (refusing to report from the implicit localhost worker)",u.USAGE);const t=M(r.url,o,r.cwd);if(t===void 0)return{code:u.USAGE,error:"could not resolve a usable worker URL"};const{token:n}=v({cwd:r.cwd??process.cwd(),token:r.token,url:t});if(!n)return i(o,"admin token required — pass --token, set LUNORA_ADMIN_TOKEN, or add it to .dev.vars (local targets only)",u.AUTH);const a=`${t}/_lunora/rpc`,e=y,s={args:{},functionPath:O};r.shard!==void 0&&(s.shardKey=r.shard),o.info(`POST ${a} -> insights`);const l=await e(a,{body:JSON.stringify(s),headers:{authorization:`Bearer ${n}`,"content-type":"application/json"},method:"POST"}),c=await l.text();if(!l.ok)return i(o,`insights failed: HTTP ${String(l.status)}: ${c}`,T(l.status));let d;try{d=JSON.parse(c)}catch{return i(o,`insights failed: worker returned non-JSON: ${c}`,1)}const S=d.result??d,{functions:h}=S;if(!Array.isArray(h))return i(o,"insights failed: response carried no `functions` array",1);const g=k(h,F(r.limit));return r.format!=="json"&&o.info(E(g)),{code:0,report:g}},L=x(async({cwd:r,format:o,logger:t,options:n})=>{const a=n.limit===void 0?void 0:Number.parseInt(n.limit,10),e=await A({cwd:r,fetchImpl:void 0,format:o,limit:a,logger:t,prod:n.prod,shard:n.shard,token:n.token,url:I({cwd:r,prod:n.prod===!0,url:n.url})});return{code:e.code,data:e.report,error:e.error}});export{k as buildInsightsReport,L as execute,E as formatInsightsReport,A as runInsightsCommand};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{readServiceBindings as G,runCodegen as M}from"@lunora/codegen";import{runPostCodegenHook as X,resolveLazyFunctions as E,detectAgentRules as W,updateDevServerState as H,readDevServerState as Y,DEV_DAEMON_ENV as x,detectAiAgent as J,readProjectRemotePreference as K,readLiveDevServerState as V,createDiscoveryCache as Q,DEV_HANDOFF_ENV as _,clearDevServerState as Z,claimDevServerState as q,DEV_LOG_FILE_ENV as ee,inferLunoraBindings as re,resolveSchemaDirectory as te,secretSourcesFromBindings as ne,ensureDevVarsExample as oe,ensureDevVariables as ae,isInteractive as ie,DEV_VARS_FILE as T,DEV_VARS_EXAMPLE_FILE as se,fillDevSecrets as ce,DEV_BINDINGS_FILE as de,DEV_STATE_FILE as B,claimAgentRulesHint as le,AGENT_RULES_HINT as ue}from"@lunora/config";import{wranglerCodegenInputs as U,resolveRemoteEnabled as fe,startLocalHyperdrive as ve,describeWithheld as ge}from"@lunora/config/cloudflare";import{p as me}from"../packem_shared/api-spec-lYyq4vL6.mjs";import{w as we}from"../packem_shared/binding-manifest-file-CQ1eQYy1.mjs";import{existsSync as he,watch as A}from"node:fs";import{join as ye,dirname as Se}from"node:path";import{a as pe}from"../packem_shared/codegen-error-AmH54ofi.mjs";import{a as Ee}from"../packem_shared/platform-diagnostics-Cn2g6Jh-.mjs";import{d as be}from"../packem_shared/command-CB4JM-Jl.mjs";import{a as De}from"../packem_shared/deploy-target-resolve-BTCW1Iv4.mjs";import{EXIT_CODE as k}from"../packem_shared/EXIT_CODE-D_XCixv8.mjs";import{forceJsonLogging as _e}from"../packem_shared/createLogger-4TujevyB.mjs";import{createServer as ke,request as Re}from"node:http";import{connect as Te}from"node:net";import{pipeline as Ae}from"node:stream";import{loadStudioAssets as P,studioAssetsStamp as C,renderStudioHtml as Pe,resolveAdminToken as Ce,requestPathname as O,transportRejectionReason as $,SCHEMA_EDIT_ENDPOINT as Oe,POLICY_SCAFFOLD_ENDPOINT as $e,SEED_ENDPOINT as Le,sendStudioDocument as Fe,serveJsonHandler as Ne,isStandaloneModulePath as Ie,readStandaloneAsset as je,assetContentType as Me,handleSchemaEditRequest as We,handlePolicyScaffoldRequest as He,handleSeedRequest as xe,applyStudioAssetCache as Ve}from"@lunora/config/studio-host";import{c as Be}from"../packem_shared/tui-prompts-B3YwUhGw.mjs";import{setTimeout as Ue}from"node:timers/promises";import{r as ze,d as Ge,P as Xe,a as Ye,b as R,c as Je,s as Ke,n as z,e as Qe,f as Ze,g as qe,h as er,i as L,w as rr,j as tr,k as nr,t as or,l as ar,m as ir,o as sr}from"../packem_shared/plan-DFY3CqHD.mjs";import{
|
|
1
|
+
import{readServiceBindings as G,runCodegen as M}from"@lunora/codegen";import{runPostCodegenHook as X,resolveLazyFunctions as E,detectAgentRules as W,updateDevServerState as H,readDevServerState as Y,DEV_DAEMON_ENV as x,detectAiAgent as J,readProjectRemotePreference as K,readLiveDevServerState as V,createDiscoveryCache as Q,DEV_HANDOFF_ENV as _,clearDevServerState as Z,claimDevServerState as q,DEV_LOG_FILE_ENV as ee,inferLunoraBindings as re,resolveSchemaDirectory as te,secretSourcesFromBindings as ne,ensureDevVarsExample as oe,ensureDevVariables as ae,isInteractive as ie,DEV_VARS_FILE as T,DEV_VARS_EXAMPLE_FILE as se,fillDevSecrets as ce,DEV_BINDINGS_FILE as de,DEV_STATE_FILE as B,claimAgentRulesHint as le,AGENT_RULES_HINT as ue}from"@lunora/config";import{wranglerCodegenInputs as U,resolveRemoteEnabled as fe,startLocalHyperdrive as ve,describeWithheld as ge}from"@lunora/config/cloudflare";import{p as me}from"../packem_shared/api-spec-lYyq4vL6.mjs";import{w as we}from"../packem_shared/binding-manifest-file-CQ1eQYy1.mjs";import{existsSync as he,watch as A}from"node:fs";import{join as ye,dirname as Se}from"node:path";import{a as pe}from"../packem_shared/codegen-error-AmH54ofi.mjs";import{a as Ee}from"../packem_shared/platform-diagnostics-Cn2g6Jh-.mjs";import{d as be}from"../packem_shared/command-CB4JM-Jl.mjs";import{a as De}from"../packem_shared/deploy-target-resolve-BTCW1Iv4.mjs";import{EXIT_CODE as k}from"../packem_shared/EXIT_CODE-D_XCixv8.mjs";import{forceJsonLogging as _e}from"../packem_shared/createLogger-4TujevyB.mjs";import{createServer as ke,request as Re}from"node:http";import{connect as Te}from"node:net";import{pipeline as Ae}from"node:stream";import{loadStudioAssets as P,studioAssetsStamp as C,renderStudioHtml as Pe,resolveAdminToken as Ce,requestPathname as O,transportRejectionReason as $,SCHEMA_EDIT_ENDPOINT as Oe,POLICY_SCAFFOLD_ENDPOINT as $e,SEED_ENDPOINT as Le,sendStudioDocument as Fe,serveJsonHandler as Ne,isStandaloneModulePath as Ie,readStandaloneAsset as je,assetContentType as Me,handleSchemaEditRequest as We,handlePolicyScaffoldRequest as He,handleSeedRequest as xe,applyStudioAssetCache as Ve}from"@lunora/config/studio-host";import{c as Be}from"../packem_shared/tui-prompts-B3YwUhGw.mjs";import{setTimeout as Ue}from"node:timers/promises";import{r as ze,d as Ge,P as Xe,a as Ye,b as R,c as Je,s as Ke,n as z,e as Qe,f as Ze,g as qe,h as er,i as L,w as rr,j as tr,k as nr,t as or,l as ar,m as ir,o as sr}from"../packem_shared/plan-DFY3CqHD.mjs";import{b as cr}from"./handler.mjs";const dr=100,lr=/(?:\.[cm]?[jt]sx?|(?:^|[/\\])tsconfig(?:\..+)?\.json)$/u,ur=300,F=/[/\\]/u,fr=(e,r,n)=>{const{apiSpec:t,lazyFunctions:o,logger:i,projectRoot:l,target:d}=e;try{const a=M({apiSpec:t,lazyFunctions:E(o),lunoraDirectory:r,projectRoot:l,target:d,...U(l)});i.success(`codegen: wrote ${r}/_generated (${n})`),Ee(a.platformDiagnostics,i)}catch(a){return i.error(pe(a,n)),!1}return!0},vr=e=>{const r=e.lunoraDirectory??"lunora",n=ye(e.projectRoot,r),t=e.debounceMs??dr;let o=!1,i=!1,l=!1,d,a=0,f=Promise.resolve(),S;const y=new Promise(v=>{S=v}),w=v=>{o||(d=v,!i&&(i=!0,f=(async()=>{try{for(;d!==void 0;){const g=d;if(d=void 0,!!fr(e,r,g)){l=!0;try{(await X({cwd:e.projectRoot,logger:e.logger,spawner:e.spawner,stdoutToStderr:e.jsonLogs})).ran&&(a=Date.now())}finally{l=!1}}}}catch(g){e.logger.error(`codegen watch: ${g instanceof Error?g.message:String(g)}`)}finally{i=!1,S()}})()))};w("startup");const c=v=>(e.logger.warn(`codegen watch unavailable (${v}) — schema edits will NOT auto-regenerate. Run \`lunora codegen\` manually after each edit.`),{close:()=>(o=!0,d=void 0,f),ready:y,watchAvailable:!1});let s,u;if(!he(n))return c(`no such directory: ${n}`);const m=v=>{if(l||Date.now()-a<ur){s&&(clearTimeout(s),s=void 0);return}s&&clearTimeout(s),s=setTimeout(()=>{w(`change: ${v??"?"}`)},t)},h=[];try{u=A(n,{recursive:!0},(v,g)=>{typeof g=="string"&&g.split(F).includes("_generated")||m(g)});for(const v of G(e.projectRoot).services)if(v.rpcEntrypoint!==void 0){const g=A(Se(v.wranglerPath),{recursive:!0},(D,b)=>{typeof b=="string"&&lr.test(b)&&!b.split(F).includes("node_modules")&&m(b)});g.on("error",D=>{e.logger.warn(`codegen watch: stopped watching service "${v.name}" (${D.message})`),g.close()}),h.push(g)}}catch(v){u?.close();for(const g of h)g.close();return c(v instanceof Error?v.message:String(v))}const p=u;return{close:()=>{o=!0,d=void 0,s&&clearTimeout(s),p.close();for(const v of h)v.close();return f},ready:y,watchAvailable:!0}},N="/_lunora",I=3e4,j=(e,r,n)=>{const t=Re({headers:{...e.headers,host:n.host},hostname:n.hostname,method:e.method,path:e.url,port:n.port},o=>{r.writeHead(o.statusCode??502,o.headers),Ae(o,r,()=>{})});t.setTimeout(I,()=>{t.destroy(new Error(`no response within ${String(I)}ms`))}),t.on("error",o=>{if(r.headersSent){r.destroy();return}r.statusCode=o.message.startsWith("no response within")?504:502,r.end(`lunora dev: worker unreachable (${o.message})`)}),r.on("close",()=>{r.writableFinished||t.destroy()}),e.pipe(t)},gr=5e3,mr=(e,r,n,t)=>{const o=Te({host:t.hostname,port:Number(t.port)},()=>{o.setTimeout(0);const i=[`${e.method??"GET"} ${e.url??"/"} HTTP/1.1`];for(const[l,d]of Object.entries(e.headers))if(l!=="host")for(const a of Array.isArray(d)?d:[d])a!==void 0&&i.push(`${l}: ${a}`);i.push(`host: ${t.host}`,"",""),o.write(i.join(`\r
|
|
2
2
|
`)),n.length>0&&o.write(n),o.pipe(r),r.pipe(o)});o.setTimeout(gr,()=>o.destroy()),o.on("error",()=>r.destroy()),r.on("error",()=>o.destroy())},wr=async e=>{const r=e.host??"127.0.0.1",n=r==="127.0.0.1"||r==="localhost"||r==="::1",t=new URL(e.workerOrigin);let o=P(e.logger,import.meta.url),i=C(import.meta.url);const l=Pe({adminToken:n?Ce(e.cwd):void 0,basePath:"/",dataEditable:n,rulesInstalled:W(e.cwd).installed,runAsIdentity:n,schemaEditable:n,scriptSrc:"/studio.js",styleHref:"/styles.css"}),d=(c,s,u,m,h)=>{Ve(c,s,h,i)||(s.statusCode=200,s.setHeader("Content-Type",m),s.end(u))},a=(c,s,u)=>{c.statusCode=s,c.setHeader("Content-Type","text/plain"),c.end(u)},f=(c,s,u,m)=>{if(n){Ne(c,s,u,e.cwd,{apiSpec:e.apiSpec,lazyFunctions:E(e.lazyFunctions)});return}a(s,403,m)},S=(c,s,u)=>{const m=c==="/styles.css",h=Ie(c);if(!m&&!h)return!1;const p=C(import.meta.url);if(p!==i&&(o=P(e.logger,import.meta.url),i=p),o===void 0)return a(u,501,"Lunora studio assets not found — install and build @lunora/studio."),!0;if(m)return d(s,u,o.styles,"text/css; charset=utf-8","styles.css"),!0;const v=c.slice(c.lastIndexOf("/")+1),g=je(v,import.meta.url);return g===void 0?(a(u,404,"Not found"),!0):(d(s,u,g,Me(v),v),!0)},y=Buffer.from(l),w=ke((c,s)=>{const u=O(c.url??"/");if(n){const h=$(c,e.logger);if(h!==void 0){a(s,403,h);return}}if(u.startsWith(N)){if(!n){a(s,403,"Lunora studio: the worker admin proxy is only available on a loopback bind.");return}j(c,s,t);return}if(u===Oe){f(c,s,We,"Lunora schema editing is only available on loopback hosts in dev.");return}if(u===$e){f(c,s,He,"Lunora policy scaffolding is only available on loopback hosts in dev.");return}if(u===Le){f(c,s,xe,"Lunora data seeding is only available on loopback hosts in dev.");return}if(S(u,c,s))return;const m=c.headers["sec-fetch-mode"];if(n&&typeof m=="string"&&m!=="navigate"){j(c,s,t);return}Fe(s,y)});return w.on("upgrade",(c,s,u)=>{if(!n||$(c,e.logger)!==void 0){s.destroy();return}O(c.url??"").startsWith(N)?mr(c,s,u,t):s.destroy()}),await new Promise((c,s)=>{w.once("error",u=>{u.code==="EADDRINUSE"?s(new Error(`studio port ${String(e.port)} is already in use — pass a different port with --port, or stop the process using it`,{cause:u})):s(u)}),w.listen(e.port,r,()=>{c()})}),{close:()=>new Promise(c=>{w.close(()=>{c()})}),url:`http://${r==="0.0.0.0"||r==="::"?"localhost":r}:${String(e.port)}`}},hr=async e=>{const{cwd:r,logger:n,origin:t,signal:o}=e,i=e.probe??Ge,l=ze(e.readyTimeoutMs),d=Date.now()+l,a=()=>o.aborted;for(;!a()&&Date.now()<d;){let f=!1;try{f=await i(t,o)}catch{}if(a()||Date.now()>=d)break;if(f)return H(r,{readyAt:new Date().toISOString()},{expectedPid:process.pid}),Y(r)?.readyAt!==void 0;try{await Ue(Xe,void 0,{signal:o})}catch{}}return a()||n.warn(`server did not answer on ${t} within ${String(Math.round(l/1e3))}s — .lunora/dev.json will have no readyAt, so anything polling for readiness will keep waiting. The server itself is unaffected; raise LUNORA_DEV_READY_TIMEOUT_MS if it is just slow to boot.`),!1},yr=(e,r,n,t)=>{e.info(""),e.success("Lunora dev"),e.info(` ➜ Worker: ${r.workerOrigin}`),n!==void 0&&e.info(` ➜ Studio: ${n}`),r.runsCodegenWatch&&e.info(" ➜ Codegen: watching lunora/"),t!==void 0&&e.info(` ➜ Supervisor: ${t} (needs) · ${B} (status)`),r.remote.enabled&&(r.remote.bindings.length>0?e.info(` ➜ Remote: ${r.remote.bindings.join(", ")} → deployed worker`):r.remote.reason!==void 0&&e.warn(` ➜ Remote: requested but inactive (${r.remote.reason}) — running fully local`));for(const o of r.remote.withheld)e.warn(` ➜ ${ge(o)}`);e.info("")},Sr=(e,r)=>{W(r).installed||!le()||(e.info(` ⓘ ${ue}`),e.info(""))},pr=async(e,r,n)=>{try{const o=await re({cache:n,projectRoot:r,schemaDir:te(r)}),i=ne(o),l=(e.ensureExample??oe)(r,i);if(l.length>0){const d=i.map(a=>a.includes(":")?`${a.replace(":"," (")})`:a);e.logger.info(`Updated .dev.vars.example with secrets for: ${d.join(", ")} (${l.join(", ")})`)}}catch{}(await(e.ensureEnv??ae)({confirm:Be(),cwd:r,info:o=>{e.logger.info(o)}})).status==="declined"&&!ie()&&e.logger.info(`hint: ${T} was not scaffolded (non-interactive run). Copy ${se} → ${T} and fill in secrets, or run \`lunora dev\` in an interactive terminal to scaffold automatically.`);try{(e.fillSecrets??ce)({cwd:r,info:o=>{e.logger.info(o)}})}catch{}},Er=(e,r,n,t,o)=>{if(e.flavor!=="wrangler")return;t!==void 0&&H(r,{studioUrl:t});let i;try{i=sr(r,n)}catch{}return yr(n,e,t,o),i},br=(e,r)=>{const n=Number(process.env[_]),t=q(r,{background:process.env[x]==="1",logFile:process.env[ee],mode:"cli",pid:process.pid,startedAt:new Date().toISOString(),url:e.workerOrigin},Number.isInteger(n)&&n>0?{supersedePid:n}:void 0);return t.ok?void 0:t.existing},Dr=e=>{const{cwd:r,destination:n,logger:t,plan:o}=e,i=n!==void 0,l=n??de,d=we({destination:l,dev:{...o.flavor==="wrangler"?{origin:o.workerOrigin}:{},statusFile:B},logger:i?t:{...t,success:()=>{},warn:()=>{}},projectRoot:r});return d.error!==void 0?i?d:(t.debug?.(`skipped the default binding manifest: ${d.error}`),{}):{written:l}},_r=async(e,r,n,t)=>{if(r.studioEnabled)try{return await(e.startStudio??wr)({apiSpec:e.apiSpec,lazyFunctions:E(e.lazyFunctions),cwd:n,logger:{warnOnce:o=>{t.warn(o)}},port:r.studioPort,workerOrigin:r.workerOrigin})}catch(o){t.warn(`studio server failed to start (${o instanceof Error?o.message:String(o)}) — continuing without it`);return}},kr=e=>{const r=[e.runsCodegenWatch?"codegen watch":void 0,e.studioEnabled?"studio":void 0].filter(t=>t!==void 0);return`--no-worker: not starting wrangler. ${r.length>0?`${r.join(" + ")} running`:"nothing else to run"}; your task runner owns the worker on ${e.workerOrigin}.`},Rr=(e,r,n,t,o)=>{if(!(e.sidecar===void 0||!ar(r)))try{M({apiSpec:r.apiSpec,lazyFunctions:E(r.lazyFunctions),lunoraDirectory:"lunora",projectRoot:n,target:o,...U(n)})}catch(i){t.warn(`codegen (pre-sidecar) failed: ${i instanceof Error?i.message:String(i)} — the framework dev server will retry`)}},Tr=e=>e.flavor==="vite"?"starting vite dev (worker + studio + codegen run inside Vite via @lunora/vite)":`starting ${e.wrangler.tag} dev + studio`,Ar=async(e,r,n,t,o)=>{try{return e.celldSession===!0?await ir({logger:o,port:e.workerPort,projectRoot:t,start:r.startCelldSession}):n(e.wrangler,o)}catch(i){o.error(`could not start the worker: ${i instanceof Error?i.message:String(i)}`);return}},Pr=async(e,r,n)=>{const t=await(e.startHyperdrive??ve)({onWarning:o=>{n.warn(o)},projectRoot:r});return t!==void 0&&t.bindings.length>0&&n.info(`Hyperdrive ${t.bindings.join(", ")}: embedded Postgres (PGlite), data in .wrangler/state/lunora-pglite. Set CLOUDFLARE_HYPERDRIVE_LOCAL_CONNECTION_STRING_<BINDING> to use your own.`),t},Cr=async e=>{const{logger:r}=e,n=Q(),t=e.cwd??process.cwd(),o=e.flavor??Qe(t),i=De(t,e.target);if(i.target===void 0)throw new Error(i.error??"unknown deploy target");const{target:l}=i,d=Ze(l,o,r);d==="wrangler"&&await cr(t,r,void 0,l,void 0,n);const a=await qe({...e,flavor:d,target:l}),f={remoteCleanup:a.remote.cleanup,serviceConfigCleanup:a.serviceConfigCleanup};try{const S=Number(process.env[_]),y=V(t);if(y!==void 0&&y.pid!==process.pid&&y.pid!==S)return R(r,y),{code:0,plan:a};const w=br(a,t);if(w!==void 0)return R(r,w),{code:0,plan:a};(a.flavor==="vite"||a.flavor==="framework-worker")&&(a.wrangler.env={...a.wrangler.env,[_]:String(process.pid)}),a.workerEnabled&&l==="cloudflare"&&(f.hyperdrive=await Pr(e,t,r)),await pr(e,t,n),r.info(Tr(a)),er(r,t),a.ipv4LoopbackForced&&r.info("no IPv6 loopback (::1) on this host — binding the worker to 127.0.0.1 (--ip) so wrangler dev doesn't crash. Pin `dev.ip` in wrangler.jsonc to override."),a.runsCodegenWatch&&(f.codegen=(e.startCodegen??vr)({apiSpec:e.apiSpec,lazyFunctions:E(e.lazyFunctions),jsonLogs:e.jsonLogs,logger:r,projectRoot:t,target:l})),f.studio=await _r(e,a,t,r);const c=Dr({cwd:t,destination:e.emitBindings,logger:r,plan:a});if(c.error!==void 0)return r.error(c.error),{code:k.USAGE,plan:a};await f.codegen?.ready;const s=f.studio?.url;a.frameworkHint!==void 0&&r.warn(a.frameworkHint);const u=()=>{a.flavor==="wrangler"&&(f.readyProbe=new AbortController,hr({cwd:t,logger:r,origin:a.workerOrigin,probe:e.probeReady,signal:f.readyProbe.signal}))};if(!a.workerEnabled)return u(),r.info(kr(a)),f.tunnel=L({cwd:t,logger:r,plan:a,tunnel:e.tunnel}),{code:await(e.waitForInterrupt??rr)(r),plan:a};Rr(a,e,t,r,l);const m=e.startWorker??tr,h=await Ar(a,e,m,t,r);if(h===void 0)return{code:k.FAILURE,plan:a};const p=a.sidecar===void 0?void 0:m(a.sidecar,r);return u(),f.containerLogs=Er(a,t,r,s,c.written),f.tunnel=L({cwd:t,logger:r,plan:a,tunnel:e.tunnel}),Sr(r,t),{code:await nr(h,p,r),plan:a}}finally{f.readyProbe?.abort(),Z(t,process.pid),await or(f)}},Or=e=>({codegen:e.codegen===!1?!1:void 0,studio:e.studio===!1?!1:void 0,worker:e.worker===!1?!1:void 0}),$r=e=>{if(e.local===!0&&e.remote===!0)return"`--local` and `--remote` are mutually exclusive — pass at most one.";const{entries:r,invalid:n}=z(e.allowMail);if(n.length>0)return`\`--allow-mail\` takes email addresses or '*@domain' — not ${n.map(t=>`"${t}"`).join(", ")}.`;if(r.length>0&&e.tunnel!==!0)return"`--allow-mail` only applies to a tunnel — add `--tunnel`."},Lr=e=>e.tunnel===!0?{allowMail:z(e.allowMail).entries}:void 0,rt=be(async({argument:e,cwd:r,logger:n,options:t})=>{const o=t.json===!0,i=Ye({cwd:r,json:o,lines:t.lines,logger:n,subcommand:e[0]});if(i!==void 0)return i;const l=process.env[x]==="1",d=l?void 0:J(),a=o||d!==void 0;a&&_e(),d!==void 0&&t.background!==!0&&n.info(`AI agent detected (${d.name} via ${d.variable}) — starting the dev server in background mode with JSON logs. Set LUNORA_AGENT_MODE=0 to opt out.`);const f=$r(t);if(f!==void 0)return n.error(`dev: ${f}`),{code:k.USAGE};const S=Lr(t),y=t.local===!0?!1:fe({configPreference:K(r),envValue:process.env.LUNORA_REMOTE,flag:t.remote});if(!l&&(t.background===!0||d!==void 0)){const w=V(r);return w!==void 0?(R(n,w),{code:0}):(S?.allowMail.length===0&&Je(n),Ke({cwd:r,jsonLogs:a,logger:n,options:t,remote:y}))}return Cr({apiSpec:me(t.apiSpec),cwd:r,emitBindings:t.emitBindings,inspectorPort:t.inspectorPort,lazyFunctions:E(t.lazyFunctions),jsonLogs:a,local:t.local,logger:n,port:t.port,remote:y,target:t.target,tunnel:S,workerPort:t.workerPort,...Or(t)})});export{$r as devFlagConflict,rt as execute,Or as negatableDevFlags,Cr as runDevCommand};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{existsSync as v,mkdirSync as M,writeFileSync as w,readFileSync as T,readdirSync as de,rmSync as $,lstatSync as ue,mkdtempSync as pe,copyFileSync as Je,renameSync as Xe}from"node:fs";import{tmpdir as he}from"node:os";import{detectFramework as Qe,isInteractive as y,LUNA_ART as Ze,LUNA_NAME as et,LUNA_SIGNOFF as tt,BADGES as g,paintAnswer as rt,detectLintTools as at,readProjectDependencies as me,applyLintIgnores as ot,readProjectManifest as nt}from"@lunora/config";import{readJsonSync as
|
|
1
|
+
import{existsSync as v,mkdirSync as M,writeFileSync as w,readFileSync as T,readdirSync as de,rmSync as $,lstatSync as ue,mkdtempSync as pe,copyFileSync as Je,renameSync as Xe}from"node:fs";import{tmpdir as he}from"node:os";import{detectFramework as Qe,isInteractive as y,LUNA_ART as Ze,LUNA_NAME as et,LUNA_SIGNOFF as tt,BADGES as g,paintAnswer as rt,detectLintTools as at,readProjectDependencies as me,applyLintIgnores as ot,readProjectManifest as nt}from"@lunora/config";import{readJsonSync as st,walkSync as it}from"@visulima/fs";import{join as p,dirname as S,basename as N,resolve as fe,relative as ge}from"@visulima/path";import{downloadTemplate as ve}from"giget";import{modify as lt,applyEdits as ct}from"jsonc-parser";import{join as K,dirname as dt}from"node:path";import{installArgsFor as we,execArgsFor as ut,detectPackageManager as P,detectInstalledManagers as pt,runScriptCommand as ht,addArgsFor as mt}from"@lunora/config/cli";import{d as ft}from"../packem_shared/command-CB4JM-Jl.mjs";import{EXIT_CODE as m}from"../packem_shared/EXIT_CODE-D_XCixv8.mjs";import gt from"magic-string";import{Project as vt,SyntaxKind as f}from"ts-morph";import{P as q}from"../packem_shared/prompt-cancelled-BvsNxg_Q.mjs";import{l as ye,m as wt,n as be,o as xe,a as yt}from"../packem_shared/resolve-Bdc9KEUv.mjs";import{defaultSpawner as ke}from"../packem_shared/createRecordingSpawner-Ch7zuQQE.mjs";import{d as bt,e as xt,f as kt,a as Ce,t as G,g as Se,h as Ct,b as Le,i as Me,w as St,j as Lt,k as Ae,l as Mt}from"../packem_shared/tui-prompts-B3YwUhGw.mjs";import{A as Ee,E as Ne,p as At,w as Et,M as Nt,r as It,k as _t,e as Rt,c as Ie,l as _e,i as $t,f as Ot}from"../packem_shared/storage-DNzYhXR-.mjs";import{r as Tt}from"../packem_shared/commands-DvSfLvyt.mjs";import{logStep as Q}from"../packem_shared/createLogger-4TujevyB.mjs";import{r as Pt}from"../packem_shared/lint-ignore-report-DKZagpqk.mjs";import{DEFAULT_OBSERVABILITY as Dt,CLOUDFLARE_TOOLCHAIN_VERSIONS as Z}from"@lunora/config/cloudflare";import Bt from"node:dns/promises";const Y={bun:{githubCacheKey:void 0,githubSetupStep:` - uses: oven-sh/setup-bun@v2
|
|
2
2
|
`,gitlabImage:"oven/bun:1",gitlabProvisionScript:[],installCmd:"bun install --frozen-lockfile",lockfile:"bun.lockb"},npm:{githubCacheKey:"npm",githubSetupStep:"",gitlabImage:"node:22",gitlabProvisionScript:[],installCmd:"npm ci",lockfile:"package-lock.json"},pnpm:{githubCacheKey:"pnpm",githubSetupStep:` - uses: pnpm/action-setup@v4
|
|
3
3
|
with:
|
|
4
4
|
version: latest
|
|
@@ -84,16 +84,16 @@ preview:
|
|
|
84
84
|
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
|
85
85
|
script:
|
|
86
86
|
- ${L(e,["deploy","--preview"])}
|
|
87
|
-
`},
|
|
87
|
+
`},Re={github:{file:K(".github","workflows","deploy.yml"),secretsHint:"repository secrets (Settings → Secrets and variables → Actions)"},gitlab:{file:".gitlab-ci.yml",secretsHint:"masked CI/CD variables (Settings → CI/CD → Variables)"}},Vt=(e,t)=>e==="github"?jt(t):Ut(t),Ft=e=>e==="github"||e==="gitlab",Wt=(e,t,r,a={})=>{const o=K(e,Re[t].file);return v(o)&&a.overwrite!==!0?{path:o,skipped:!0,written:!1}:(M(dt(o),{recursive:!0}),w(o,Vt(t,r),"utf8"),{path:o,skipped:!1,written:!0})},Ht=(e,t,r,a,o={})=>{const n=Re[t];try{const s=Wt(e,t,r,o);if(s.skipped)a.info(`--ci ${t}: ${n.file} already exists — left unchanged (re-run with overwrite to replace).`);else{const i=we(r),l=[i.command,...i.args].join(" "),{installCmd:c,lockfile:u}=Y[r];a.success(`--ci ${t}: wrote ${n.file}`),a.info(`--ci ${t}: set CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID as ${n.secretsHint} to enable deploys.`),a.info(`--ci ${t}: run \`${l}\` and commit ${u} before pushing — the pipeline runs \`${c}\`.`)}return s}catch(s){const i=s instanceof Error?s.message:String(s);return a.warn(`--ci ${t}: could not write ${n.file} (${i})`),{path:K(e,n.file),skipped:!1,written:!1}}},zt={astro:"@lunora/react",none:"@lunora/react",nuxt:"@lunora/vue","react-router":"@lunora/react","solid-start":"@lunora/solid",sveltekit:"@lunora/svelte","tanstack-start":"@lunora/react","tanstack-start-solid":"@lunora/solid",vinext:"@lunora/react"},Kt=e=>{const t=Qe(e);return{...t,adapter:zt[t.framework]}},R="lunora()",te='import { lunora } from "@lunora/vite";',qt="@lunora/vite",Gt="lunora",Yt=e=>{for(const t of e.getStatements()){if(t.getKind()!==f.ExportAssignment)continue;const r=t.asKindOrThrow(f.ExportAssignment).getExpression();if(r.getKind()!==f.CallExpression)continue;const a=r.asKindOrThrow(f.CallExpression);if(a.getExpression().getText()!=="defineConfig")continue;const o=a.getArguments()[0];if(o?.getKind()===f.ObjectLiteralExpression)return o.asKindOrThrow(f.ObjectLiteralExpression)}},Jt=e=>{for(const t of e.getStatements()){if(t.getKind()!==f.ExportAssignment)continue;const r=t.asKindOrThrow(f.ExportAssignment).getExpression();if(r.getKind()===f.ObjectLiteralExpression)return r.asKindOrThrow(f.ObjectLiteralExpression)}},Xt=e=>e.getDescendantsOfKind(f.CallExpression).some(t=>t.getExpression().getText()===Gt),Qt=e=>e.getImportDeclarations().some(t=>t.getModuleSpecifierValue()===qt),Zt=e=>new vt({compilerOptions:{allowJs:!0},useInMemoryFileSystem:!0}).createSourceFile("vite.config.ts",e,{overwrite:!0}),er=(e,t)=>{const r=t.getImportDeclarations().at(-1)?.getEnd()??0;r===0?e.prepend(`${te}
|
|
88
88
|
`):e.appendLeft(r,`
|
|
89
|
-
${te}`)},tr=(e,t)=>{const r=t.getProperty("plugins");if(r===void 0){const
|
|
90
|
-
`);return}const a=r.getDescendantsOfKind(f.ArrayLiteralExpression)[0];if(a===void 0)return"the Vite config's `plugins` is not an array literal — add `lunora()` to it by hand";const o=a.getElements();if(o.length===0){e.appendLeft(a.getStart()+1,
|
|
89
|
+
${te}`)},tr=(e,t)=>{const r=t.getProperty("plugins");if(r===void 0){const s=t.getProperties(),i=t.getStart()+1;if(s.length===0){e.appendLeft(i,` plugins: [${R}] `);return}const l=s[0];if(l===void 0)return"could not locate the start of the Vite config object's first property";e.appendLeft(l.getStart(),`plugins: [${R}],
|
|
90
|
+
`);return}const a=r.getDescendantsOfKind(f.ArrayLiteralExpression)[0];if(a===void 0)return"the Vite config's `plugins` is not an array literal — add `lunora()` to it by hand";const o=a.getElements();if(o.length===0){e.appendLeft(a.getStart()+1,R);return}const n=o[0];if(n===void 0)return"could not locate the first entry of the Vite config's `plugins` array";e.appendLeft(n.getStart(),`${R}, `)},$e=e=>{const t=Zt(e);if(Xt(t))return{changed:!1,code:e,reason:"lunora plugin already present"};const r=Yt(t)??Jt(t);if(r===void 0)return{changed:!1,code:e,reason:"could not locate a Vite config plugins array to patch"};const a=new gt(e);Qt(t)||er(a,t);const o=tr(a,r);return o!==void 0?{changed:!1,code:e,reason:o}:{changed:!0,code:a.toString()}},rr=/enotfound|eai_again|econnrefused|etimedout|network|fetch failed|getaddrinfo/u,ar=/404|not found|could not find|no such/u,or=(e,t)=>{const r=e instanceof Error?e.message:String(e),a=r.toLowerCase(),o=`failed to download template "${t.templateType}" from ${t.remote}: ${r}`;return ar.test(a)?{hints:[`Check the template name "${t.templateType}" and the ref "${t.ref}".`,"List/inspect available templates, or target a branch/tag with `--ref <branch>`."],message:`template "${t.templateType}" not found at ${t.remote}: ${r}`}:rr.test(a)?{hints:["You appear to be offline or unable to reach GitHub.","To scaffold without a network, point at a local template root: `lunora init --from <dir>`."],message:o}:{hints:["If this is a network/offline issue, scaffold from a local root with `lunora init --from <dir>`."],message:o}},O=async(e,t,r)=>{if(y()){await xt(g[e],t,r);return}if(process.stdout.write(`
|
|
91
91
|
`),r===void 0||r===""){Q(e,t);return}const a=r.split(`
|
|
92
92
|
`).map(o=>rt(o)).join(`
|
|
93
93
|
`);Q(e,`${t}
|
|
94
94
|
${a}`)},nr=async e=>{if(y()){await bt();return}e.info(`
|
|
95
95
|
${Ze}
|
|
96
|
-
${et}: ${tt}`)},Oe=[{description:"LLMs via Workers AI (summarize, generate, stream)",label:"AI",value:"ai"},{description:"Sign-up / sign-in (asks which provider)",label:"Authentication",value:"auth"},{description:"Copy-in auth screens for your framework (sign in/up, reset, 2FA)",label:"Auth UI",value:"auth-ui"},{description:"Snapshot + restore your Durable Object data",label:"Backups",value:"backup"},{description:"Headless browser screenshots + PDFs",label:"Browser rendering",value:"browser"},{description:"Zero Trust identity via Cloudflare Access",label:"Cloudflare Access",value:"cloudflare-access"},{description:"Scheduled jobs via Cron Triggers (@lunora/scheduler)",label:"Cron jobs",value:"crons"},{description:"Cloudflare Email Workers + a dev mail catcher",label:"Transactional email",value:"email"},{description:"OpenFeature feature flags (ctx.flags)",label:"Feature flags",value:"flags"},{description:"External Postgres/MySQL via Hyperdrive",label:"Hyperdrive",value:"hyperdrive"},{description:"Stripe-first payments (checkout, subscription, webhooks)",label:"Payments",value:"payment"},{description:"Live presence / who's-online over hibernated WebSockets",label:"Presence",value:"presence"},{description:"Async message queues (push/pull consumers)",label:"Queues",value:"queue"},{description:"Typed R2 buckets + signed URLs (@lunora/storage)",label:"File storage",value:"storage"},{description:"Durable long-running workflows (step.do, sleep, branch)",label:"Workflows",value:"workflow"}],re=Oe.map(e=>e.value),
|
|
96
|
+
${et}: ${tt}`)},Oe=[{description:"LLMs via Workers AI (summarize, generate, stream)",label:"AI",value:"ai"},{description:"Sign-up / sign-in (asks which provider)",label:"Authentication",value:"auth"},{description:"Copy-in auth screens for your framework (sign in/up, reset, 2FA)",label:"Auth UI",value:"auth-ui"},{description:"Snapshot + restore your Durable Object data",label:"Backups",value:"backup"},{description:"Headless browser screenshots + PDFs",label:"Browser rendering",value:"browser"},{description:"Zero Trust identity via Cloudflare Access",label:"Cloudflare Access",value:"cloudflare-access"},{description:"Scheduled jobs via Cron Triggers (@lunora/scheduler)",label:"Cron jobs",value:"crons"},{description:"Cloudflare Email Workers + a dev mail catcher",label:"Transactional email",value:"email"},{description:"OpenFeature feature flags (ctx.flags)",label:"Feature flags",value:"flags"},{description:"External Postgres/MySQL via Hyperdrive",label:"Hyperdrive",value:"hyperdrive"},{description:"Stripe-first payments (checkout, subscription, webhooks)",label:"Payments",value:"payment"},{description:"Live presence / who's-online over hibernated WebSockets",label:"Presence",value:"presence"},{description:"Async message queues (push/pull consumers)",label:"Queues",value:"queue"},{description:"Typed R2 buckets + signed URLs (@lunora/storage)",label:"File storage",value:"storage"},{description:"Durable long-running workflows (step.do, sleep, branch)",label:"Workflows",value:"workflow"}],re=Oe.map(e=>e.value),sr=e=>e==="email"?Ne:e,ir=(e,t)=>{const r=[];for(const a of e.split(",").map(o=>o.trim()).filter(Boolean))re.includes(a)?r.includes(a)||r.push(a):t(`init: unknown --add feature "${a}" — expected ${re.join(" | ")}; skipping.`);return r},Te=e=>e.resolveAuthUiItem===void 0?"auth-ui-react":e.resolveAuthUiItem(),lr=async e=>{const t=await Rt(e.select),r=await Ie(e.text,e.projectName);return{label:"auth",names:[t],transformManifest:a=>_e(a,r)}},cr=async e=>{const t=await e.text(Nt,{placeholder:"you@yourdomain.com"}),r=It(t,a=>{e.logger.warn(a)});return{label:"email",names:[Ne],transformManifest:r===void 0?void 0:a=>_t(a,r)}},dr=async(e,t)=>{const r=Te(e);if(r===void 0){e.logger.error(`init: ${Ee}`);return}if(t)return{label:"auth-ui",names:[r]};const a=await Ie(e.text,e.projectName);return{label:"auth-ui",names:[r],transformManifest:o=>_e(o,a)}},ur=async e=>{const t=await At(e.text,e.projectName);return{label:"storage",names:["storage"],transformManifest:r=>Et(r,t)}},pr=(e,t)=>{const r=[];let a=!1;for(const o of t){if(o!=="auth-ui"){r.push({label:o,names:[sr(o)]});continue}const n=Te(e);if(n===void 0){e.logger.error(`init: ${Ee}`),a=!0;continue}r.push({label:o,names:[n]})}return{plans:r,refused:a}},hr={auth:lr,"auth-ui":async(e,t)=>dr(e,t.includes("auth")),email:cr,storage:ur},ae=async e=>{if(e.preselected!==void 0&&e.preselected.length>0){const{plans:a,refused:o}=pr(e,e.preselected);return await e.applyAll(a)&&!o}if(!e.interactive)return e.logger.info("tip: add features later with `lunora add <ai|auth|backup|browser|cloudflare-access|crons|email|flags|hyperdrive|payment|presence|queue|storage|workflow>`."),!0;const t=await e.multiSelect("Which features do you want to add?",Oe,{defaults:[]});if(t.length===0)return!0;const r=[];for(const a of t){const o=hr[a],n=o?await o(e,t):{label:a,names:[a]};n!==void 0&&r.push(n)}return await e.applyAll(r),!0},mr=[{description:"Adds an ignores entry to eslint.config.js",label:"ESLint",value:"eslint"},{description:"Writes .prettierignore",label:"Prettier",value:"prettier"},{description:"Adds negated patterns to biome.json",label:"Biome",value:"biome"},{description:"Writes ignorePatterns to .oxlintrc.json",label:"oxlint (oxc)",value:"oxlint"}],fr="Which linter/formatter do you use? We'll tell it to skip Lunora's generated files.",gr=async e=>{const t=e.interactive?await e.multiSelect(fr,mr,{defaults:e.detected}):[...e.detected];if(t.length===0)return[];const r=e.apply(t);return Pt(r,e.logger),r},I="M 259.500 10.552 C 220.080 15.859, 182.424 32.566, 152.500 58.025 C 110.179 94.031, 85.380 137.183, 77.518 188.500 C 75.410 202.255, 74.569 225.677, 75.796 236.466 C 76.757 244.917, 76.683 245.692, 74.518 249.966 C 63.118 272.466, 53.141 303.876, 51.382 322.799 L 50.718 329.943 71.960 320.471 C 83.643 315.262, 93.326 311, 93.478 311 C 93.630 311, 96.547 316.063, 99.959 322.250 C 103.371 328.438, 107.249 334.850, 108.577 336.500 L 110.990 339.500 110.981 336 C 110.977 334.075, 111.499 324.991, 112.143 315.813 L 113.312 299.127 121.406 293.336 C 132.495 285.403, 149.593 271.554, 161 261.268 C 171.556 251.748, 189.116 235, 188.540 235 C 188.337 235, 183.069 238.648, 176.835 243.106 C 142.318 267.789, 68.537 314, 63.646 314 C 61.843 314, 72.791 281.179, 80.905 262.259 C 92.233 235.845, 107.473 212.389, 132.106 183.453 L 138.451 176 148.268 176 C 176.192 176, 197.512 187.154, 212.868 209.797 C 216.470 215.108, 217.035 216.595, 216.477 219.297 C 211.386 243.968, 202.359 274.496, 193.797 296 C 183.898 320.861, 167.147 352.101, 152.395 373.215 L 147.004 380.930 152.891 385.830 C 161.400 392.911, 165.563 396, 166.594 395.998 C 167.092 395.998, 168.772 391.641, 170.327 386.317 C 176.279 365.934, 188.422 338.749, 200.942 317.778 C 223.060 280.731, 256.432 244.369, 294.500 215.836 C 309.956 204.252, 313.937 201.603, 314.719 202.385 C 315.116 202.783, 315.449 213.096, 315.460 225.304 C 315.474 241.855, 315.021 250.405, 313.680 258.924 C 307.009 301.272, 291.175 336.677, 263.112 372 C 255.259 381.883, 227.182 410.673, 218.516 417.727 L 213.532 421.783 223.439 424.880 C 281.705 443.093, 349.165 436.018, 398.616 406.508 C 446.728 377.797, 483.322 331.466, 497.366 281.481 C 503.381 260.075, 504.480 250.741, 504.491 221 C 504.501 191.997, 503.598 184.047, 497.987 163.732 C 484.768 115.871, 452.505 72.708, 407.718 42.964 C 381.051 25.254, 352.818 14.828, 319.695 10.460 C 305.932 8.645, 273.298 8.695, 259.500 10.552",E=`/* The welcome page is a full-bleed starter — reset the browser's default
|
|
97
97
|
body margin/padding so it sits flush; everything else is scoped under
|
|
98
98
|
.lunora-welcome (collision-safe). */
|
|
99
99
|
body {
|
|
@@ -1206,7 +1206,7 @@ const app = defineApp<Env>()
|
|
|
1206
1206
|
|
|
1207
1207
|
export const ShardDO = app.ShardDO;
|
|
1208
1208
|
export default app;
|
|
1209
|
-
`,
|
|
1209
|
+
`,_r=`{ ${Object.entries(Dt).map(([e,t])=>`${JSON.stringify(e)}: ${JSON.stringify(t)}`).join(", ")} }`,Rr=`{
|
|
1210
1210
|
"$schema": "node_modules/wrangler/config-schema.json",
|
|
1211
1211
|
"name": "__NAME__",
|
|
1212
1212
|
"main": "src/server.ts",
|
|
@@ -1216,21 +1216,21 @@ export default app;
|
|
|
1216
1216
|
"bindings": [{ "name": "SHARD", "class_name": "ShardDO" }],
|
|
1217
1217
|
},
|
|
1218
1218
|
"migrations": [{ "tag": "v1", "new_sqlite_classes": ["ShardDO"] }],
|
|
1219
|
-
"observability": ${
|
|
1219
|
+
"observability": ${_r},
|
|
1220
1220
|
}
|
|
1221
1221
|
`,oe=[".wrangler",".env",".env.*","!.env.example",".dev.vars",".dev.vars.*","!.dev.vars.example",".lunora/",".lunora-cache","lunora/_generated"],$r=`# Lunora endpoint for the browser client.
|
|
1222
1222
|
# Vite statically replaces \`import.meta.env.VITE_LUNORA_URL\` at \`vite dev\` / build.
|
|
1223
1223
|
# Leave it unset to use the page origin; set it to point at a deployed Worker:
|
|
1224
1224
|
#
|
|
1225
1225
|
# VITE_LUNORA_URL=https://my-app.example.workers.dev
|
|
1226
|
-
`,Or={"@cloudflare/workers-types":Z["@cloudflare/workers-types"],wrangler:Z.wrangler},k=(e,t,r,a)=>{const o=p(e,t);M(S(o),{recursive:!0}),w(o,r,"utf8"),a.push(o)},Tr=/\r?\n/,Pr=e=>{const t=p(e,".gitignore"),r=v(t)?T(t,"utf8"):"",a=new Set(r.split(Tr)),o=oe.filter(
|
|
1226
|
+
`,Or={"@cloudflare/workers-types":Z["@cloudflare/workers-types"],wrangler:Z.wrangler},k=(e,t,r,a)=>{const o=p(e,t);M(S(o),{recursive:!0}),w(o,r,"utf8"),a.push(o)},Tr=/\r?\n/,Pr=e=>{const t=p(e,".gitignore"),r=v(t)?T(t,"utf8"):"",a=new Set(r.split(Tr)),o=oe.filter(i=>!a.has(i));if(o.length===0)return;const n=o.some(i=>!i.startsWith("!"))?[...o.filter(i=>!i.startsWith("!")),...oe.filter(i=>i.startsWith("!"))]:o,s=r.length>0&&!r.endsWith(`
|
|
1227
1227
|
`)?`
|
|
1228
|
-
`:"";w(t,`${r}${
|
|
1228
|
+
`:"";w(t,`${r}${s}
|
|
1229
1229
|
# Lunora
|
|
1230
1230
|
${n.join(`
|
|
1231
1231
|
`)}
|
|
1232
|
-
`,"utf8")},U=e=>e==="lunorash"||e.startsWith("@lunora/"),Dr=(e,t,r,a)=>U(e)?a.get(e)??r:t,C=(e,t,r)=>({...e,[t]:r}),ne=(e,t,r)=>Object.fromEntries(Object.entries(e).map(([a,o])=>[a,Dr(a,o,t,r)])),Br=async(e,t,r,a)=>{const o=p(e,"package.json"),n=
|
|
1233
|
-
`,"utf8")},jr=["vite.config.ts","vite.config.mts","vite.config.js","vite.config.mjs"],Pe=e=>jr.map(t=>p(e,t)).find(t=>v(t)),Ur=(e,t)=>{const r=Pe(e);if(r===void 0){t.warn("overlay: no vite.config found in the create-vite base — add `lunora()` to your Vite plugins manually.");return}const a=$e(T(r,"utf8"));a.changed&&w(r,a.code,"utf8")},Vr=async e=>{const{adapter:t,distTag:r,logger:a,name:o,target:n}=e,
|
|
1232
|
+
`,"utf8")},U=e=>e==="lunorash"||e.startsWith("@lunora/"),Dr=(e,t,r,a)=>U(e)?a.get(e)??r:t,C=(e,t,r)=>({...e,[t]:r}),ne=(e,t,r)=>Object.fromEntries(Object.entries(e).map(([a,o])=>[a,Dr(a,o,t,r)])),Br=async(e,t,r,a)=>{const o=p(e,"package.json"),n=st(o);let s=C(n.dependencies??{},"lunorash",a);s=C(s,"@lunora/ratelimit",a),r.adapter.startsWith("@lunora/")&&(s=C(s,r.adapter,a));for(const[u,h]of Object.entries(r.extraDependencies??{}))s=C(s,u,h);let i=C(n.devDependencies??{},"@lunora/vite",a);i=C(i,"@lunora/studio",a);for(const[u,h]of Object.entries(Or))i=C(i,u,h);const l=[...Object.keys(s),...Object.keys(i)].filter(u=>U(u)),c=await ye(l,a);n.name=t,n.imports={...n.imports,"#lunora/*":"./lunora/*"},n.dependencies=ne(s,a,c),n.devDependencies=ne(i,a,c),n.scripts={...n.scripts,codegen:"lunora codegen",deploy:"lunora deploy"},w(o,`${JSON.stringify(n,void 0,4)}
|
|
1233
|
+
`,"utf8")},jr=["vite.config.ts","vite.config.mts","vite.config.js","vite.config.mjs"],Pe=e=>jr.map(t=>p(e,t)).find(t=>v(t)),Ur=(e,t)=>{const r=Pe(e);if(r===void 0){t.warn("overlay: no vite.config found in the create-vite base — add `lunora()` to your Vite plugins manually.");return}const a=$e(T(r,"utf8"));a.changed&&w(r,a.code,"utf8")},Vr=async e=>{const{adapter:t,distTag:r,logger:a,name:o,target:n}=e,s=[];k(n,p("lunora","ratelimit","schema.ts"),Ar,s),k(n,p("lunora","schema.ts"),Er,s),k(n,p("lunora","messages.ts"),Nr,s),k(n,p("src","server.ts"),Ir,s),k(n,"wrangler.jsonc",Rr.replaceAll("__NAME__",o),s),k(n,".env.example",$r,s);for(const i of t.files)k(n,i.path,i.contents,s);return Ur(n,a),await Br(n,o,t,r),Pr(n),s},Fr=["lunar","silver","silent","waning","waxing","crescent","cosmic","stellar","orbital","gibbous","twilight","midnight","shimmering","drifting","weightless"],Wr=["moon","tide","crater","comet","eclipse","halo","orbit","nebula","voyager","lander","rover","beacon","harbor","meadow","fox"],se=e=>e[Math.floor(Math.random()*e.length)],Hr=()=>`${se(Fr)}-${se(Wr)}`,zr=async()=>Bt.lookup("github.com").then(()=>!0,()=>!1),Kr=/^(?:gh|github):([^/]+)\/([^#/]+)(?:\/[^#]*)?(?:#(.+))?$/,De=e=>{const t=Kr.exec(e);if(t===null)return;const[,r,a,o]=t;if(!(r===void 0||a===void 0))return{owner:r,ref:o??"HEAD",repo:a}},qr=async e=>{const t=De(e);if(t===void 0)return;const r=`https://codeload.github.com/${t.owner}/${t.repo}/tar.gz/${t.ref}`;try{const a=await fetch(r,{method:"HEAD"});return a.status===404?!1:a.ok?!0:void 0}catch{return}},Be=async e=>e.isLocal||!(e.source===void 0||De(e.source)!==void 0)?!0:await zr()?e.source!==void 0&&await qr(e.source)===!1?(e.logger.error(`template source not found: ${e.source} — double-check --ref / --source, or browse the templates at https://lunora.sh/docs.`),!1):!0:(e.logger.error("you appear to be offline — connect to the internet and try again, or scaffold from a local template with `--from <dir>`."),!1),x={extras:"Let's finish setting up your app.",framework:"Which framework should we launch?",git:"Initialize a new git repository? (optional)",install:"Install dependencies now?",name:"Where should we land your project?",nextHeader:"Liftoff confirmed — explore your project!",packageManager:"Which package manager?"},Gr=new Set([".gitignore",".html",".js",".json",".jsonc",".md",".mjs",".ts",".tsx"]),Yr=`import { defineConfig } from "vite";
|
|
1234
1234
|
import { lunora } from "@lunora/vite";
|
|
1235
1235
|
|
|
1236
1236
|
export default defineConfig({ plugins: [lunora()] });
|
|
@@ -1257,8 +1257,8 @@ export const send = mutation
|
|
|
1257
1257
|
.mutation(async ({ args }) => {
|
|
1258
1258
|
return { channelId: args.channelId, text: args.text };
|
|
1259
1259
|
});
|
|
1260
|
-
`,Qr="gh:anolilab/lunora/templates",Zr=e=>{const t=e.lastIndexOf(".");return t===-1?!1:Gr.has(e.slice(t))},ea=/^[a-z0-9_][a-z0-9\-_]*$/u,ta=/([a-z0-9])([A-Z])/gu,ra=/[^a-z0-9_]/gu,aa=e=>{const t=e.replaceAll(ta,"$1-$2").toLowerCase().replaceAll(ra,"-").split("-").filter(r=>r.length>0);return t.length>0?t.join("-"):"my-app"},oa=(e,t)=>e.replaceAll("{{name}}",t),na=async(e,t)=>{const r=new Set;for(const a of e)if(N(a)==="package.json")for(const o of Object.keys(me(S(a))))U(o)&&r.add(o);return ye(r,t)},
|
|
1261
|
-
`),Ue=e=>{const t=p(e,je);v(t)||w(t,ca(),"utf8")},V=e=>{const t=[];for(const r of
|
|
1262
|
-
`),e.success(`scaffolded ${String(t.length)} files into ${r}`)},ua=(e,t)=>{const{args:r,command:a}=mt(e,t);return`${a} ${r.join(" ")}`},He=(e,t)=>{let r=fe(e);for(;;){if(t(r))return!0;const a=S(r);if(a===r)return!1;r=a}},pa=e=>v(p(e,je))?!0:nt(e)?.workspaces!==void 0,X=e=>He(e,pa),ha=e=>He(e,t=>v(p(t,".git"))),ma=async(e,t)=>{if(e.yes===!0||!y()||ha(S(t)))return;if(!await Le(x.git,{badge:g.git,defaultYes:!1})){await Me("Sounds good! You can always run git init manually.");return}if(e.dryRun===!0){A(e.logger,"initialize a git repository");return}const r=e.spawner??ke;(await St("Initializing a git repository…",()=>r({args:["init"],command:"git",cwd:t}))).code===0?await O("git","Initialized an empty git repository."):e.logger.warn("`git init` failed — initialize it yourself later with `git init`.")},fa=async(e,t,r,a)=>{const o=[{code:`cd ./${e}`,lead:"Enter your project directory using"}];t===void 0&&o.push({code:`${r} install`,lead:"Install dependencies with",tail:a?" from the workspace root":void 0}),o.push({code:ht(r,"dev"),lead:"Run",tail:" to start the dev server."},{code:"lunora add",lead:"Add features like auth or storage using"});const n=[{code:"https://lunora.sh/docs",lead:"Read the docs at"},{code:"https://lunora.sh/chat",lead:"Stuck? Join the chat at"}];if(y()){await Lt(g.next,x.nextHeader,o,n);return}const
|
|
1263
|
-
`))},ga=e=>e.yes!==!0&&(e.installPrompt!==void 0||y()),va=async(e,t)=>{if(!ga(e)||X(S(t)))return;const r=pt(e.packageManagerProbe),[a]=r;if(a===void 0)return;if(!await(e.installPrompt?.confirmInstall??(async()=>Le(x.install,{badge:g.deps,defaultYes:!0})))()){await Me("No problem! Remember to install dependencies after setup.");return}let n=a;if(r.length>1&&(n=e.installPrompt?await e.installPrompt.selectManager(r):await G(x.packageManager,r.map(u=>({label:u,value:u})),{badge:g.deps,default:a})??a),e.dryRun===!0){A(e.logger,`install dependencies with ${n}`);return}n==="pnpm"&&Ue(t);const
|
|
1264
|
-
`),t.info(d?.commit?`template: ${d.source} @ ${d.commit} (${String(R.length)} files)`:`template: ${d?.source??h} (${String(R.length)} files)`),J(t,b,i),{code:0,files:b,target:i}}catch(u){if(u instanceof q)throw u;const{hints:h,message:d}=or(u,{ref:xe(o),remote:H(s,n,o),templateType:s});t.error(d);for(const b of h)t.warn(b);return{code:1,files:[],target:i}}finally{$(l,{force:!0,recursive:!0})}},ba=e=>{for(const t of["_gitignore","_npmrc","_gitattributes"]){const r=p(e,t);v(r)&&Xe(r,p(e,`.${t.slice(1)}`))}},xa=async e=>{const{framework:t,logger:r,markComplete:a,name:o,overlayBaseFrom:n,target:i}=e,s=B[t],l=pe(p(he(),"lunora-vite-base-"));try{let c;if(n!==void 0&&(c=p(n,`template-${s.createViteTemplate}`),!v(c)))return r.error(`create-vite base not found on disk: ${c}`),{code:m.NOT_FOUND,files:[],target:i};const u=async()=>{if(c!==void 0){le(c,i);return}const d=p(l,"base"),b=await wt(se,"main",r),R=`github:${se}/packages/create-vite/template-${s.createViteTemplate}#${b}`;await ve(R,{cwd:l,dir:d,force:!0,install:!1,silent:!0}),ba(d),le(d,i)};let h=[];return await Ae([{label:`create-vite (${s.label}) base ready`,run:u},{label:`Lunora overlay applied (${s.label})`,run:async()=>{h=await Vr({adapter:s,distTag:be(),logger:r,name:o,target:i})}}],{end:We,start:"Project initializing…"}),a(),J(r,h,i),{code:0,files:[...V(i)],target:i}}catch(c){if(c instanceof q)throw c;const u=c instanceof Error?c.message:String(c);return r.error(`failed to scaffold the ${s.label} base: ${u}`),{code:1,files:[],target:i}}finally{$(l,{force:!0,recursive:!0})}},z=(e,t,r,a,o)=>(o.error(`init --in-place: could not ${e} ${t}: ${r instanceof Error?r.message:String(r)}`),{code:1,files:[],target:a}),ka=(e,t)=>{const r=p(e,"vite.config.ts");try{w(r,Yr,"utf8")}catch(a){return z("write",r,a,e,t)}return t.success(`created ${r} with lunora() plugin`),{code:0,files:[r],target:e}},Ca=(e,t,r)=>{let a;try{a=T(e,"utf8")}catch(n){return z("read",e,n,t,r)}const o=$e(a);if(!o.changed)return r.info(`${e}: ${o.reason??"no changes needed"}`),{code:0,files:[],target:t};try{w(e,o.code,"utf8")}catch(n){return z("write",e,n,t,r)}return r.success(`patched ${e} — added lunora() plugin`),{code:0,files:[e],target:t}},Sa=(e,t)=>{const r=p(e,"lunora"),a=p(r,"schema.ts");if(v(a))return t.info(`lunora/ already present — left ${a} untouched`),[];const o=[];try{M(r,{recursive:!0}),w(a,Jr,"utf8"),o.push(a);const n=p(r,"messages.ts");v(n)||(w(n,Xr,"utf8"),o.push(n)),t.success(`scaffolded lunora/ (${String(o.length)} file(s))`)}catch(n){const i=n instanceof Error?n.message:String(n);t.error(`init --here: could not scaffold lunora/: ${i}`)}return o},ze=e=>e==="sveltekit"||e==="nuxt"||e==="astro",La=(e,t,r)=>{const{adapter:a,class:o,framework:n}=e;r.info(""),r.info(`detected framework: ${n} (class ${o})`),r.info("next steps:");const i=[a,"@lunora/client","@lunora/runtime","@lunora/server"];ze(n)||i.push("@lunora/vite"),r.info(` 1. install the adapter: ${ua(t,i)}`),r.info(" 2. run codegen: lunora codegen"),o==="A"?(r.info(" 3. compose one worker: wrap your worker entry with"),r.info(" createWorker({ httpRouter: <your framework SSR handler>, shardDO: ShardDO, ... })"),r.info(` 4. add the provider: mount the ${a} provider in your root layout/route`),r.info(" 5. make a loader live: preloadQuery() in a loader, usePreloadedQuery() in the component"),r.info(" see https://lunora.sh/docs/frameworks/reactive-loaders")):o==="B"?(r.info(" 3. inject Lunora: mount Lunora realtime under /_lunora/* in your server hook"),r.info(` (${n} owns its Cloudflare adapter — Lunora composes into its server entry)`),r.info(` 4. add the provider: mount the ${a} provider in your root layout`),r.info(" 5. read the guide: https://lunora.sh/docs/frameworks/deploy")):(r.info(" 3. add the provider: wrap your app with the LunoraProvider from @lunora/react"),r.info(" 4. read the guide: https://lunora.sh/docs/frameworks/bring-your-framework")),r.info("")},Ma=(e,t,r)=>{if(ze(t))return r.info(`${t} wires Lunora through its server entry, not a lunora() Vite plugin — leaving the Vite config alone (see next steps)`),{code:0,files:[],target:e};const a=Pe(e);return a===void 0?ka(e,r):Ca(a,e,r)},Aa=(e,t)=>{const r=Kt(e),a=Ma(e,r.framework,t);if(a.code!==0)return a;const o=Sa(e,t);return La(r,P(e),t),{code:0,files:[...a.files,...o],target:e}},Ea=e=>e.yes!==!0&&(e.prompt!==void 0||(e.interactive??y())),ce=async(e,t,r)=>{r.dryRun!==!0&&await gr({apply:a=>ot(e,a),detected:at(e),interactive:t,logger:r.logger,multiSelect:r.lintPrompt??((a,o,n)=>Se(a,o,{...n,badge:g.add}))})},Na=async(e,t)=>{const r=Ea(e),a=e.add===void 0?[]:sr(e.add,i=>{e.logger.warn(i)}),n={applyAll:async i=>{if(i.length===0)return!0;if(e.dryRun===!0)return A(e.logger,`add ${i.map(d=>d.label).join(", ")}`),!0;const s=[],l=y()?{error:d=>{s.push({level:"error",message:d})},info:()=>{},success:()=>{},warn:d=>{s.push({level:"warn",message:d})}}:e.logger,c=i.map(d=>({running:`adding ${d.label}…`,task:()=>Tt({allowUnsafeSource:e.allowUnsafeSource,cwd:t,from:e.registryFrom,logger:l,names:[...d.names],ref:e.ref,source:e.registrySource,transformManifest:d.transformManifest,yes:!0})})),u=`added ${i.map(d=>d.label).join(", ")}`,h=await Mt(g.add,c,u);for(const{level:d,message:b}of s)e.logger[d](b);return h.every(d=>d.code===0)},interactive:r,logger:e.logger,multiSelect:e.prompt?.multiSelect??((i,s,l)=>Se(i,s,{...l,badge:g.add})),preselected:a.length>0?a:void 0,projectName:N(t),resolveAuthUiItem:()=>{const i=me(t);if(!$t(i))return Ot(i)??"auth-ui-react"},select:e.prompt?.select??((i,s,l)=>G(i,s,{...l,badge:g.add})),text:e.prompt?.text??((i,s)=>Ce(i,{...s,badge:g.add}))};if(a.length>0){const i=await ae(n);return await ce(t,r,e),i}return y()&&await Ct(x.extras),await ae(n),await ce(t,r,e),!0},F="react",Ke=[{description:"React SPA — official create-vite base + the Lunora layer (the default)",label:"React",value:"react"},{description:"Vue SPA — create-vite base + Lunora",label:"Vue",value:"vue"},{description:"Solid SPA — create-vite base + Lunora",label:"Solid",value:"solid"},{description:"Solid 2.0 SPA — the Solid 2 line (@solidjs/web, vite-plugin-solid 3)",label:"Solid 2",value:"solid-v2"},{description:"Svelte SPA — create-vite base + Lunora",label:"Svelte",value:"svelte"},{description:"React SPA on Rsbuild — the Worker runs under wrangler dev behind the dev server",label:"React · Rsbuild",value:"rspack-react"},{description:"Next.js (App Router) — OpenNext on Cloudflare + a standalone Lunora worker",label:"Next.js",value:"next"},{description:"TanStack Start (React) — SSR with live-loader routes",label:"TanStack Start · React",value:"tanstack-start-react"},{description:"TanStack Start (React) on Rsbuild — SSR composed into the Lunora worker",label:"TanStack Start · React · Rsbuild",value:"tanstack-start-react-rspack"},{description:"TanStack Start (Solid)",label:"TanStack Start · Solid",value:"tanstack-start-solid"},{description:"Next.js App Router on Vite (vinext) — composed into the Lunora worker (experimental)",label:"vinext · App Router",value:"vinext"},{description:"Next.js Pages Router on Vite (vinext) — composed into one worker (experimental)",label:"vinext · Pages Router",value:"vinext-pages"},{description:"React Router (v7, framework mode) — SSR composed into the Lunora worker",label:"React Router",value:"react-router"},{description:"Astro (islands) — single-worker, Lunora composed into the adapter worker",label:"Astro",value:"astro"},{description:"AnalogJS (Angular) — single-worker, Lunora mounted in Nitro",label:"Analog",value:"analog"},{description:"Nuxt (Vue) — single-worker, Lunora mounted in Nitro",label:"Nuxt",value:"nuxt"},{description:"SvelteKit — single-worker, Lunora composed into the adapter worker",label:"SvelteKit",value:"sveltekit"},{description:"React Native (Expo) — an iOS/Android/web app + a Lunora worker backend",label:"React Native · Expo",value:"expo"},{description:"Worker only — no frontend",label:"Standalone",value:"standalone"}],qe=Object.keys(B).join("|"),Ge=Ke.filter(e=>!j(e.value)).map(e=>e.value),Ye=Ge.join("|"),Ia=e=>j(e)?{framework:e,kind:"overlay"}:{kind:"template",templateType:e},Ra=async e=>e.vite!==void 0?{framework:e.vite,kind:"overlay"}:e.templateType!==void 0?{kind:"template",templateType:e.templateType}:!y()||e.yes===!0?{framework:F,kind:"overlay"}:Ia(await G(x.framework,Ke,{badge:g.tmpl,default:F})??F),_a=e=>{if(y()||e.yes===!0)return;const t=[];if(e.name===void 0&&t.push("a project name (`lunora init <name>`)"),e.templateType===void 0&&e.vite===void 0&&t.push(`a framework — \`--vite <${qe}>\` for an SPA, or \`-t <${Ye}>\` for a bespoke template`),t.length!==0)return`lunora init can't prompt in a non-interactive terminal — provide ${t.join(" and ")}, or pass --yes to accept the defaults.`},$a=async(e,t,r,a,o)=>j(t)?await Be({isLocal:e.overlayBaseFrom!==void 0,logger:e.logger})?(M(a,{recursive:!0}),xa({framework:t,logger:e.logger,markComplete:o,name:r,overlayBaseFrom:e.overlayBaseFrom,target:a})):{code:1,files:[],target:a}:(e.logger.error(`init: unknown framework "${t}". Supported overlays: ${Object.keys(B).join(", ")}.`),{code:m.USAGE,files:[],target:a}),Oa=async(e,t,r,a,o)=>e.from!==void 0?await wa(e.from,t,a,r,e.logger,o):e.source!==void 0&&e.source.length>0&&!e.allowUnsafeSource&&!da(e.source)?(e.logger.error(`init: refusing --source ${e.source} — only gh:, github:, or https:// sources are allowed (and may not contain ".."). Re-run with --allow-unsafe-source if you really want this.`),{code:m.USAGE,files:[],target:a}):await Be({isLocal:!1,logger:e.logger,source:H(t,e.source,e.ref)})?ya({logger:e.logger,markComplete:o,name:r,ref:e.ref,source:e.source,target:a,templateType:t}):{code:1,files:[],target:a},Ta=(e,t)=>{if(X(t))return;let r;try{r=P(e)}catch{return}r==="pnpm"&&Ue(e)},Pa=async(e,t,r)=>{await kt("realtime backend on Cloudflare Workers + Durable Objects");const a=_a(e);if(a!==void 0)return e.logger.error(a),{code:m.USAGE,files:[],target:""};const o=Hr(),n=e.name??await Ce(x.name,{badge:g.dir,default:o,placeholder:o}),i=await Ra(e),s=n.trim();if(s.length===0)return e.logger.error("init: refusing an empty project name — pass a directory name (e.g. `lunora init my-app`)."),{code:m.USAGE,files:[],target:""};if(s.includes("/")||s.includes("\\")||s===".."||s===".")return e.logger.error(`init: refusing project name "${s}" — must not contain path separators or be "." / "..".`),{code:m.USAGE,files:[],target:""};if(!ea.test(s))return e.logger.error(`init: refusing project name "${s}" — a Cloudflare Worker name must be lowercase letters, digits, "-" or "_" (starting with a letter, digit or "_"), and wrangler rejects anything else. Try \`${aa(s)}\`.`),{code:m.USAGE,files:[],target:""};const l=fe(t,s),c=ue(l,{throwIfNoEntry:!1});if(c?.isSymbolicLink()===!0)return e.logger.error(`init: refusing to scaffold into "${l}" — it is a symlink. Remove it, or scaffold into a different directory name.`),{code:m.CONFLICT,files:[],target:l};const u=c!==void 0;if(u&&de(l).length>0)return e.logger.error(`target directory not empty: ${l}`),{code:m.CONFLICT,files:[],target:l};if(e.dryRun===!0){const d=i.kind==="overlay"?`the ${i.framework} create-vite overlay`:`the ${i.templateType} template`;return A(e.logger,`scaffold ${d} into ${l}`),{code:0,files:[],target:l}}r.record(l,u);const h=i.kind==="overlay"?await $a(e,i.framework,s,l,r.complete):await Oa(e,i.templateType,s,l,r.complete);return h.code===0&&Ta(l,t),h},W=(e,t)=>{const{target:r,targetPreExisted:a}=e;if(!(r===void 0||!v(r))){if(a===!0)for(const o of de(r))$(p(r,o),{force:!0,recursive:!0});else $(r,{force:!0,recursive:!0});t.info(`removed the partially-created project at ${r}`)}},Da=async(e,t,r)=>e.inPlace!==!0?Pa(e,t,r):e.dryRun===!0?(A(e.logger,`configure Lunora into ${t}`),{code:0,files:[],target:t}):Aa(t,e.logger),Ba=async(e,t,r)=>{const a=await Na(e,t.target),o=e.inPlace===!0?void 0:await va(e,t.target);if(e.inPlace!==!0){await ma(e,t.target);const n=o??P(t.target);await fa(N(t.target),o,n,X(r)),await nr(e.logger)}return a},ja=(e,t,r)=>{if(t.code!==0||e.ci===void 0)return;if(e.dryRun===!0){A(e.logger,`scaffold a ${e.ci} CI deploy pipeline`);return}const a=e.inPlace===!0?r:t.target;try{const o=P(a);Ht(a,e.ci,o,e.logger)}catch{e.logger.warn(`--ci ${e.ci}: could not detect a package manager for this project — skipped the CI pipeline.`)}},Ua=async e=>{const t=e.cwd??process.cwd(),r={};let a;try{a=await Da(e,t,{complete:()=>{r.target=void 0},record:(o,n)=>{r.target=o,r.targetPreExisted=n}}),a.code===0&&a.target!==""?(r.target=void 0,await Ba(e,a,t)||(a={...a,code:1})):a.code!==0&&W(r,e.logger)}catch(o){if(o instanceof q)return W(r,e.logger),process.stdout.write("\n ✖ Setup cancelled — run `lunora init` again whenever you're ready. 🌙\n"),{code:130,files:[],target:""};throw W(r,e.logger),o}return ja(e,a,t),a},Va=e=>typeof e=="string"&&Ge.includes(e),Fa=(e,t)=>{if(e!==void 0){if(Ft(e))return e;t.warn(`init: unknown --ci "${e}" — expected github | gitlab; skipping CI scaffold.`)}},Wa=e=>e===void 0?{}:Va(e)?{templateType:e}:j(e)?{vite:e}:{error:`init: unknown --template "${e}" — expected a bespoke template (${Ye}) or an overlay framework (${qe}).`},mo=ft(({argument:e,cwd:t,logger:r,options:a})=>{const o=Wa(a.template);return"error"in o?(r.error(o.error),{code:m.USAGE}):Ua({add:a.add,allowUnsafeSource:a.allowUnsafeSource===!0,cwd:t,ci:Fa(a.ci,r),dryRun:a.dryRun===!0,from:a.from,inPlace:a.here===!0,interactive:a.interactive===!0?!0:void 0,logger:r,name:e[0],ref:a.ref,source:a.source,templateType:o.templateType,vite:a.vite??o.vite,yes:a.yes===!0})});export{Ke as FRAMEWORK_CHOICES,mo as execute,Va as isTemplate,Wa as resolveTemplateFlag,H as resolveTemplateSource,Ua as runInitCommand};
|
|
1260
|
+
`,Qr="gh:anolilab/lunora/templates",Zr=e=>{const t=e.lastIndexOf(".");return t===-1?!1:Gr.has(e.slice(t))},ea=/^[a-z0-9_][a-z0-9\-_]*$/u,ta=/([a-z0-9])([A-Z])/gu,ra=/[^a-z0-9_]/gu,aa=e=>{const t=e.replaceAll(ta,"$1-$2").toLowerCase().replaceAll(ra,"-").split("-").filter(r=>r.length>0);return t.length>0?t.join("-"):"my-app"},oa=(e,t)=>e.replaceAll("{{name}}",t),na=async(e,t)=>{const r=new Set;for(const a of e)if(N(a)==="package.json")for(const o of Object.keys(me(S(a))))U(o)&&r.add(o);return ye(r,t)},sa=(e,t,r)=>{let a;try{a=JSON.parse(e)}catch{return e}let o=e;for(const n of["dependencies","devDependencies"])for(const s of Object.keys(a[n]??{})){if(!U(s))continue;const i=r.get(s)??t,l=lt(o,[n,s],i,{formattingOptions:{insertSpaces:!0,tabSize:4}});o=ct(o,l)}return o},ia=["@parcel/watcher","esbuild","lmdb","msgpackr-extract","rs-module-lexer","sharp","unrs-resolver","vue-demi","workerd"],la=["cpu-features","protobufjs","ssh2"],je="pnpm-workspace.yaml",ca=()=>["# pnpm reads its settings from here (the package.json `pnpm` field is no longer read).","# Pre-approve the toolchain's native build scripts so `pnpm install` runs them","# without the interactive `pnpm approve-builds` step; deny the optional native","# builds a scaffold doesn't need (so no C/C++ toolchain is required).","allowBuilds:",...ia.map(e=>` '${e}': true`),...la.map(e=>` '${e}': false`),""].join(`
|
|
1261
|
+
`),Ue=e=>{const t=p(e,je);v(t)||w(t,ca(),"utf8")},V=e=>{const t=[];for(const r of it(e,{includeDirs:!1,includeFiles:!0}))ue(r.path).isSymbolicLink()||t.push(r.path);return t},ie="vitejs/vite",le=(e,t)=>{for(const r of V(e)){const a=p(t,ge(e,r));M(S(a),{recursive:!0}),Je(r,a)}},Ve=async(e,t,r)=>{const a=V(e),o=[],n=be(),s=await na(a,n);for(const i of a){const l=ge(e,i),c=p(t,l);M(S(c),{recursive:!0});const u=T(i);let h=Zr(i)?oa(u.toString("utf8"),r):void 0;h!==void 0&&N(i)==="package.json"&&(h=sa(h,n,s)),h===void 0?w(c,u):w(c,h,"utf8"),o.push(c)}return o},H=(e,t,r)=>t!==void 0&&t.length>0?t:`${Qr}/${e}#${xe(r)}`,da=e=>e.includes("..")?!1:e.startsWith("gh:")||e.startsWith("github:")||e.startsWith("https://"),A=(e,t)=>{e.info(`[dry-run] would ${t}`)},Fe=(e,t,r)=>(e.error(`init: the template at ${r} contains no files — nothing was scaffolded. Check the template name, \`--source\` layout and \`--ref\`.`),{code:m.NOT_FOUND,files:[],target:t}),We="Template files copied.",J=(e,t,r)=>{y()&&process.stdout.write(`
|
|
1262
|
+
`),e.success(`scaffolded ${String(t.length)} files into ${r}`)},ua=(e,t)=>{const{args:r,command:a}=mt(e,t);return`${a} ${r.join(" ")}`},He=(e,t)=>{let r=fe(e);for(;;){if(t(r))return!0;const a=S(r);if(a===r)return!1;r=a}},pa=e=>v(p(e,je))?!0:nt(e)?.workspaces!==void 0,X=e=>He(e,pa),ha=e=>He(e,t=>v(p(t,".git"))),ma=async(e,t)=>{if(e.yes===!0||!y()||ha(S(t)))return;if(!await Le(x.git,{badge:g.git,defaultYes:!1})){await Me("Sounds good! You can always run git init manually.");return}if(e.dryRun===!0){A(e.logger,"initialize a git repository");return}const r=e.spawner??ke;(await St("Initializing a git repository…",()=>r({args:["init"],command:"git",cwd:t}))).code===0?await O("git","Initialized an empty git repository."):e.logger.warn("`git init` failed — initialize it yourself later with `git init`.")},fa=async(e,t,r,a)=>{const o=[{code:`cd ./${e}`,lead:"Enter your project directory using"}];t===void 0&&o.push({code:`${r} install`,lead:"Install dependencies with",tail:a?" from the workspace root":void 0}),o.push({code:ht(r,"dev"),lead:"Run",tail:" to start the dev server."},{code:"lunora add",lead:"Add features like auth or storage using"});const n=[{code:"https://lunora.sh/docs",lead:"Read the docs at"},{code:"https://lunora.sh/chat",lead:"Stuck? Join the chat at"}];if(y()){await Lt(g.next,x.nextHeader,o,n);return}const s=o.map(i=>`${i.lead} ${i.code}${i.tail??""}`);s.push("",...n.map(i=>`${i.lead} ${i.code}${i.tail??""}`)),await O("next",x.nextHeader,s.join(`
|
|
1263
|
+
`))},ga=e=>e.yes!==!0&&(e.installPrompt!==void 0||y()),va=async(e,t)=>{if(!ga(e)||X(S(t)))return;const r=pt(e.packageManagerProbe),[a]=r;if(a===void 0)return;if(!await(e.installPrompt?.confirmInstall??(async()=>Le(x.install,{badge:g.deps,defaultYes:!0})))()){await Me("No problem! Remember to install dependencies after setup.");return}let n=a;if(r.length>1&&(n=e.installPrompt?await e.installPrompt.selectManager(r):await G(x.packageManager,r.map(u=>({label:u,value:u})),{badge:g.deps,default:a})??a),e.dryRun===!0){A(e.logger,`install dependencies with ${n}`);return}n==="pnpm"&&Ue(t);const s=e.spawner??ke,{args:i,command:l}=we(n);await O("deps",`Installing dependencies with ${n}…`);const c=await s({args:i,command:l,cwd:t});if(c.code!==0){e.logger.warn(`\`${l} install\` exited with code ${String(c.code)} — run it yourself in ${N(t)}/.`);return}return await O("deps",`Dependencies installed with ${n}.`),n},wa=async(e,t,r,a,o,n)=>{const s=p(e,t);if(!v(s))return o.error(`template not found in local source: ${s}`),{code:m.NOT_FOUND,files:[],target:r};const i=await Ve(s,r,a);return i.length===0?Fe(o,r,s):(n(),J(o,i,r),{code:0,files:i,target:r})},ya=async e=>{const{logger:t,markComplete:r,name:a,ref:o,source:n,target:s,templateType:i}=e,l=pe(p(he(),"lunora-init-fetch-")),c=p(l,"template");try{const u=n!==void 0&&n.length>0?o:await yt(o,t),h=H(i,n,u);let d,b=[];if(await Ae([{label:`${i} template fetched`,run:async()=>{d=await ve(h,{cwd:l,dir:c,force:!0,install:!1,silent:!0})}},{label:`files copied into ${a}/`,run:async()=>{b=await Ve(c,s,a)}}],{end:We,start:"Project initializing…"}),b.length===0)return Fe(t,s,d?.source??h);r();const _=V(c);return y()&&process.stdout.write(`
|
|
1264
|
+
`),t.info(d?.commit?`template: ${d.source} @ ${d.commit} (${String(_.length)} files)`:`template: ${d?.source??h} (${String(_.length)} files)`),J(t,b,s),{code:0,files:b,target:s}}catch(u){if(u instanceof q)throw u;const{hints:h,message:d}=or(u,{ref:xe(o),remote:H(i,n,o),templateType:i});t.error(d);for(const b of h)t.warn(b);return{code:1,files:[],target:s}}finally{$(l,{force:!0,recursive:!0})}},ba=e=>{for(const t of["_gitignore","_npmrc","_gitattributes"]){const r=p(e,t);v(r)&&Xe(r,p(e,`.${t.slice(1)}`))}},xa=async e=>{const{framework:t,logger:r,markComplete:a,name:o,overlayBaseFrom:n,target:s}=e,i=B[t],l=pe(p(he(),"lunora-vite-base-"));try{let c;if(n!==void 0&&(c=p(n,`template-${i.createViteTemplate}`),!v(c)))return r.error(`create-vite base not found on disk: ${c}`),{code:m.NOT_FOUND,files:[],target:s};const u=async()=>{if(c!==void 0){le(c,s);return}const d=p(l,"base"),b=await wt(ie,"main",r),_=`github:${ie}/packages/create-vite/template-${i.createViteTemplate}#${b}`;await ve(_,{cwd:l,dir:d,force:!0,install:!1,silent:!0}),ba(d),le(d,s)};let h=[];return await Ae([{label:`create-vite (${i.label}) base ready`,run:u},{label:`Lunora overlay applied (${i.label})`,run:async()=>{h=await Vr({adapter:i,distTag:be(),logger:r,name:o,target:s})}}],{end:We,start:"Project initializing…"}),a(),J(r,h,s),{code:0,files:[...V(s)],target:s}}catch(c){if(c instanceof q)throw c;const u=c instanceof Error?c.message:String(c);return r.error(`failed to scaffold the ${i.label} base: ${u}`),{code:1,files:[],target:s}}finally{$(l,{force:!0,recursive:!0})}},z=(e,t,r,a,o)=>(o.error(`init --in-place: could not ${e} ${t}: ${r instanceof Error?r.message:String(r)}`),{code:1,files:[],target:a}),ka=(e,t)=>{const r=p(e,"vite.config.ts");try{w(r,Yr,"utf8")}catch(a){return z("write",r,a,e,t)}return t.success(`created ${r} with lunora() plugin`),{code:0,files:[r],target:e}},Ca=(e,t,r)=>{let a;try{a=T(e,"utf8")}catch(n){return z("read",e,n,t,r)}const o=$e(a);if(!o.changed)return r.info(`${e}: ${o.reason??"no changes needed"}`),{code:0,files:[],target:t};try{w(e,o.code,"utf8")}catch(n){return z("write",e,n,t,r)}return r.success(`patched ${e} — added lunora() plugin`),{code:0,files:[e],target:t}},Sa=(e,t)=>{const r=p(e,"lunora"),a=p(r,"schema.ts");if(v(a))return t.info(`lunora/ already present — left ${a} untouched`),[];const o=[];try{M(r,{recursive:!0}),w(a,Jr,"utf8"),o.push(a);const n=p(r,"messages.ts");v(n)||(w(n,Xr,"utf8"),o.push(n)),t.success(`scaffolded lunora/ (${String(o.length)} file(s))`)}catch(n){const s=n instanceof Error?n.message:String(n);t.error(`init --here: could not scaffold lunora/: ${s}`)}return o},ze=e=>e==="sveltekit"||e==="nuxt"||e==="astro",La=(e,t,r)=>{const{adapter:a,class:o,framework:n}=e;r.info(""),r.info(`detected framework: ${n} (class ${o})`),r.info("next steps:");const s=[a,"@lunora/client","@lunora/runtime","@lunora/server"];ze(n)||s.push("@lunora/vite"),r.info(` 1. install the adapter: ${ua(t,s)}`),r.info(" 2. run codegen: lunora codegen"),o==="A"?(r.info(" 3. compose one worker: wrap your worker entry with"),r.info(" createWorker({ httpRouter: <your framework SSR handler>, shardDO: ShardDO, ... })"),r.info(` 4. add the provider: mount the ${a} provider in your root layout/route`),r.info(" 5. make a loader live: preloadQuery() in a loader, usePreloadedQuery() in the component"),r.info(" see https://lunora.sh/docs/frameworks/reactive-loaders")):o==="B"?(r.info(" 3. inject Lunora: mount Lunora realtime under /_lunora/* in your server hook"),r.info(` (${n} owns its Cloudflare adapter — Lunora composes into its server entry)`),r.info(` 4. add the provider: mount the ${a} provider in your root layout`),r.info(" 5. read the guide: https://lunora.sh/docs/frameworks/deploy")):(r.info(" 3. add the provider: wrap your app with the LunoraProvider from @lunora/react"),r.info(" 4. read the guide: https://lunora.sh/docs/frameworks/bring-your-framework")),r.info("")},Ma=(e,t,r)=>{if(ze(t))return r.info(`${t} wires Lunora through its server entry, not a lunora() Vite plugin — leaving the Vite config alone (see next steps)`),{code:0,files:[],target:e};const a=Pe(e);return a===void 0?ka(e,r):Ca(a,e,r)},Aa=(e,t)=>{const r=Kt(e),a=Ma(e,r.framework,t);if(a.code!==0)return a;const o=Sa(e,t);return La(r,P(e),t),{code:0,files:[...a.files,...o],target:e}},Ea=e=>e.yes!==!0&&(e.prompt!==void 0||(e.interactive??y())),ce=async(e,t,r)=>{r.dryRun!==!0&&await gr({apply:a=>ot(e,a),detected:at(e),interactive:t,logger:r.logger,multiSelect:r.lintPrompt??((a,o,n)=>Se(a,o,{...n,badge:g.add}))})},Na=async(e,t)=>{const r=Ea(e),a=e.add===void 0?[]:ir(e.add,s=>{e.logger.warn(s)}),n={applyAll:async s=>{if(s.length===0)return!0;if(e.dryRun===!0)return A(e.logger,`add ${s.map(d=>d.label).join(", ")}`),!0;const i=[],l=y()?{error:d=>{i.push({level:"error",message:d})},info:()=>{},success:()=>{},warn:d=>{i.push({level:"warn",message:d})}}:e.logger,c=s.map(d=>({running:`adding ${d.label}…`,task:()=>Tt({allowUnsafeSource:e.allowUnsafeSource,cwd:t,from:e.registryFrom,logger:l,names:[...d.names],ref:e.ref,source:e.registrySource,transformManifest:d.transformManifest,yes:!0})})),u=`added ${s.map(d=>d.label).join(", ")}`,h=await Mt(g.add,c,u);for(const{level:d,message:b}of i)e.logger[d](b);return h.every(d=>d.code===0)},interactive:r,logger:e.logger,multiSelect:e.prompt?.multiSelect??((s,i,l)=>Se(s,i,{...l,badge:g.add})),preselected:a.length>0?a:void 0,projectName:N(t),resolveAuthUiItem:()=>{const s=me(t);if(!$t(s))return Ot(s)??"auth-ui-react"},select:e.prompt?.select??((s,i,l)=>G(s,i,{...l,badge:g.add})),text:e.prompt?.text??((s,i)=>Ce(s,{...i,badge:g.add}))};if(a.length>0){const s=await ae(n);return await ce(t,r,e),s}return y()&&await Ct(x.extras),await ae(n),await ce(t,r,e),!0},F="react",Ke=[{description:"React SPA — official create-vite base + the Lunora layer (the default)",label:"React",value:"react"},{description:"Vue SPA — create-vite base + Lunora",label:"Vue",value:"vue"},{description:"Solid SPA — create-vite base + Lunora",label:"Solid",value:"solid"},{description:"Solid 2.0 SPA — the Solid 2 line (@solidjs/web, vite-plugin-solid 3)",label:"Solid 2",value:"solid-v2"},{description:"Svelte SPA — create-vite base + Lunora",label:"Svelte",value:"svelte"},{description:"React SPA on Rsbuild — the Worker runs under wrangler dev behind the dev server",label:"React · Rsbuild",value:"rspack-react"},{description:"Next.js (App Router) — OpenNext on Cloudflare + a standalone Lunora worker",label:"Next.js",value:"next"},{description:"TanStack Start (React) — SSR with live-loader routes",label:"TanStack Start · React",value:"tanstack-start-react"},{description:"TanStack Start (React) on Rsbuild — SSR composed into the Lunora worker",label:"TanStack Start · React · Rsbuild",value:"tanstack-start-react-rspack"},{description:"TanStack Start (Solid)",label:"TanStack Start · Solid",value:"tanstack-start-solid"},{description:"Next.js App Router on Vite (vinext) — composed into the Lunora worker (experimental)",label:"vinext · App Router",value:"vinext"},{description:"Next.js Pages Router on Vite (vinext) — composed into one worker (experimental)",label:"vinext · Pages Router",value:"vinext-pages"},{description:"Astro (islands) — single-worker, Lunora composed into the adapter worker",label:"Astro",value:"astro"},{description:"AnalogJS (Angular) — single-worker, Lunora mounted in Nitro",label:"Analog",value:"analog"},{description:"Nuxt (Vue) — single-worker, Lunora mounted in Nitro",label:"Nuxt",value:"nuxt"},{description:"SvelteKit — single-worker, Lunora composed into the adapter worker",label:"SvelteKit",value:"sveltekit"},{description:"React Native (Expo) — an iOS/Android/web app + a Lunora worker backend",label:"React Native · Expo",value:"expo"},{description:"Worker only — no frontend",label:"Standalone",value:"standalone"}],qe=Object.keys(B).join("|"),Ge=Ke.filter(e=>!j(e.value)).map(e=>e.value),Ye=Ge.join("|"),Ia=e=>j(e)?{framework:e,kind:"overlay"}:{kind:"template",templateType:e},_a=async e=>e.vite!==void 0?{framework:e.vite,kind:"overlay"}:e.templateType!==void 0?{kind:"template",templateType:e.templateType}:!y()||e.yes===!0?{framework:F,kind:"overlay"}:Ia(await G(x.framework,Ke,{badge:g.tmpl,default:F})??F),Ra=e=>{if(y()||e.yes===!0)return;const t=[];if(e.name===void 0&&t.push("a project name (`lunora init <name>`)"),e.templateType===void 0&&e.vite===void 0&&t.push(`a framework — \`--vite <${qe}>\` for an SPA, or \`-t <${Ye}>\` for a bespoke template`),t.length!==0)return`lunora init can't prompt in a non-interactive terminal — provide ${t.join(" and ")}, or pass --yes to accept the defaults.`},$a=async(e,t,r,a,o)=>j(t)?await Be({isLocal:e.overlayBaseFrom!==void 0,logger:e.logger})?(M(a,{recursive:!0}),xa({framework:t,logger:e.logger,markComplete:o,name:r,overlayBaseFrom:e.overlayBaseFrom,target:a})):{code:1,files:[],target:a}:(e.logger.error(`init: unknown framework "${t}". Supported overlays: ${Object.keys(B).join(", ")}.`),{code:m.USAGE,files:[],target:a}),Oa=async(e,t,r,a,o)=>e.from!==void 0?await wa(e.from,t,a,r,e.logger,o):e.source!==void 0&&e.source.length>0&&!e.allowUnsafeSource&&!da(e.source)?(e.logger.error(`init: refusing --source ${e.source} — only gh:, github:, or https:// sources are allowed (and may not contain ".."). Re-run with --allow-unsafe-source if you really want this.`),{code:m.USAGE,files:[],target:a}):await Be({isLocal:!1,logger:e.logger,source:H(t,e.source,e.ref)})?ya({logger:e.logger,markComplete:o,name:r,ref:e.ref,source:e.source,target:a,templateType:t}):{code:1,files:[],target:a},Ta=(e,t)=>{if(X(t))return;let r;try{r=P(e)}catch{return}r==="pnpm"&&Ue(e)},Pa=async(e,t,r)=>{await kt("realtime backend on Cloudflare Workers + Durable Objects");const a=Ra(e);if(a!==void 0)return e.logger.error(a),{code:m.USAGE,files:[],target:""};const o=Hr(),n=e.name??await Ce(x.name,{badge:g.dir,default:o,placeholder:o}),s=await _a(e),i=n.trim();if(i.length===0)return e.logger.error("init: refusing an empty project name — pass a directory name (e.g. `lunora init my-app`)."),{code:m.USAGE,files:[],target:""};if(i.includes("/")||i.includes("\\")||i===".."||i===".")return e.logger.error(`init: refusing project name "${i}" — must not contain path separators or be "." / "..".`),{code:m.USAGE,files:[],target:""};if(!ea.test(i))return e.logger.error(`init: refusing project name "${i}" — a Cloudflare Worker name must be lowercase letters, digits, "-" or "_" (starting with a letter, digit or "_"), and wrangler rejects anything else. Try \`${aa(i)}\`.`),{code:m.USAGE,files:[],target:""};const l=fe(t,i),c=ue(l,{throwIfNoEntry:!1});if(c?.isSymbolicLink()===!0)return e.logger.error(`init: refusing to scaffold into "${l}" — it is a symlink. Remove it, or scaffold into a different directory name.`),{code:m.CONFLICT,files:[],target:l};const u=c!==void 0;if(u&&de(l).length>0)return e.logger.error(`target directory not empty: ${l}`),{code:m.CONFLICT,files:[],target:l};if(e.dryRun===!0){const d=s.kind==="overlay"?`the ${s.framework} create-vite overlay`:`the ${s.templateType} template`;return A(e.logger,`scaffold ${d} into ${l}`),{code:0,files:[],target:l}}r.record(l,u);const h=s.kind==="overlay"?await $a(e,s.framework,i,l,r.complete):await Oa(e,s.templateType,i,l,r.complete);return h.code===0&&Ta(l,t),h},W=(e,t)=>{const{target:r,targetPreExisted:a}=e;if(!(r===void 0||!v(r))){if(a===!0)for(const o of de(r))$(p(r,o),{force:!0,recursive:!0});else $(r,{force:!0,recursive:!0});t.info(`removed the partially-created project at ${r}`)}},Da=async(e,t,r)=>e.inPlace!==!0?Pa(e,t,r):e.dryRun===!0?(A(e.logger,`configure Lunora into ${t}`),{code:0,files:[],target:t}):Aa(t,e.logger),Ba=async(e,t,r)=>{const a=await Na(e,t.target),o=e.inPlace===!0?void 0:await va(e,t.target);if(e.inPlace!==!0){await ma(e,t.target);const n=o??P(t.target);await fa(N(t.target),o,n,X(r)),await nr(e.logger)}return a},ja=(e,t,r)=>{if(t.code!==0||e.ci===void 0)return;if(e.dryRun===!0){A(e.logger,`scaffold a ${e.ci} CI deploy pipeline`);return}const a=e.inPlace===!0?r:t.target;try{const o=P(a);Ht(a,e.ci,o,e.logger)}catch{e.logger.warn(`--ci ${e.ci}: could not detect a package manager for this project — skipped the CI pipeline.`)}},Ua=async e=>{const t=e.cwd??process.cwd(),r={};let a;try{a=await Da(e,t,{complete:()=>{r.target=void 0},record:(o,n)=>{r.target=o,r.targetPreExisted=n}}),a.code===0&&a.target!==""?(r.target=void 0,await Ba(e,a,t)||(a={...a,code:1})):a.code!==0&&W(r,e.logger)}catch(o){if(o instanceof q)return W(r,e.logger),process.stdout.write("\n ✖ Setup cancelled — run `lunora init` again whenever you're ready. 🌙\n"),{code:130,files:[],target:""};throw W(r,e.logger),o}return ja(e,a,t),a},Va=e=>typeof e=="string"&&Ge.includes(e),Fa=(e,t)=>{if(e!==void 0){if(Ft(e))return e;t.warn(`init: unknown --ci "${e}" — expected github | gitlab; skipping CI scaffold.`)}},Wa=e=>e===void 0?{}:Va(e)?{templateType:e}:j(e)?{vite:e}:{error:`init: unknown --template "${e}" — expected a bespoke template (${Ye}) or an overlay framework (${qe}).`},mo=ft(({argument:e,cwd:t,logger:r,options:a})=>{const o=Wa(a.template);return"error"in o?(r.error(o.error),{code:m.USAGE}):Ua({add:a.add,allowUnsafeSource:a.allowUnsafeSource===!0,cwd:t,ci:Fa(a.ci,r),dryRun:a.dryRun===!0,from:a.from,inPlace:a.here===!0,interactive:a.interactive===!0?!0:void 0,logger:r,name:e[0],ref:a.ref,source:a.source,templateType:o.templateType,vite:a.vite??o.vite,yes:a.yes===!0})});export{Ke as FRAMEWORK_CHOICES,mo as execute,Va as isTemplate,Wa as resolveTemplateFlag,H as resolveTemplateSource,Ua as runInitCommand};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as E,R as M,V as a,r as s}from"./cli-
|
|
1
|
+
import{C as E,R as M,V as a,r as s}from"./cli-BbgDNGew.mjs";import"./cli-manifest-DoQ_3bzs.mjs";import"./EXIT_CODE-D_XCixv8.mjs";import"./createLogger-4TujevyB.mjs";import"./render-lunora-error-B6893vbU.mjs";export{E as COMMANDS,M as REGISTERED_COMMAND_NAMES,a as VERSION,s as runCli};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{isLunoraError as L,findSolutionByMessage as I}from"@lunora/errors";import{createCerebro as j}from"@visulima/cerebro";import _ from"@visulima/cerebro/command/completion";import T from"@visulima/cerebro/command/version";import{O as s}from"./output-format-DWe_tkTR.mjs";import{A as m}from"./api-spec-lYyq4vL6.mjs";import{deployTargetIds as P,DEFAULT_DEPLOY_TARGET as U,addArgsFor as M,detectPackageManager as W}from"@lunora/config/cli";import{SDK_LANGUAGES as z}from"@lunora/codegen/sdk";import{r as $}from"./cli-manifest-DoQ_3bzs.mjs";import{EXIT_CODE as y,exitCodeForError as F}from"./EXIT_CODE-D_XCixv8.mjs";import{setCommandLogger as k,createLogger as v}from"./createLogger-4TujevyB.mjs";import{r as J}from"./render-lunora-error-B6893vbU.mjs";import{mkdirSync as K,readFileSync as G,lstatSync as V,writeFileSync as H}from"node:fs";import{homedir as q}from"node:os";import{join as b}from"node:path";const Y={argument:{description:"Feature or registry item: ai | auth | email | storage | crons | presence | queue | workflow | flags | backup | …",name:"feature",type:String},description:"Add a feature or registry item (ai, auth, email, storage, crons, …) to the current Lunora project",examples:[["lunora add auth","Add authentication (asks which provider)"],["lunora add auth --provider clerk","Add Clerk auth without prompting"],["lunora add auth-ui","Add copy-in auth screens for your framework (auto-detected)"],["lunora add email","Add transactional email (Cloudflare Email Workers + dev mail catcher)"],["lunora add storage","Add the R2 storage registry item (asks for the bucket name)"],["lunora add storage --bucket my-app-uploads","Add storage with a bucket name, no prompt"],["lunora add crons","Add the scheduled-jobs registry item"],["lunora add storage --ref alpha","Add an item from the alpha branch's registry"]],group:"Project",loader:()=>import("../packem_chunks/handler2.mjs").then(e=>({default:e.execute})),name:"add",options:[{description:"auth: provider to use without prompting (auth | clerk | auth0)",name:"provider",type:String},{description:"auth: D1 database name to use without prompting (lowercase alphanumeric + hyphens)",name:"db",type:String},{description:"storage: R2 bucket name to use without prompting (lowercase alphanumeric + hyphens)",name:"bucket",type:String},{description:"email: verified destination address to use without prompting",name:"mail-to",type:String},{description:"Skip prompts (auth provider, DB name, bucket name, mail destination) and use the defaults",name:"yes",type:Boolean},{description:"Local registry root (offline; expects <name>/ subdirs)",name:"from",type:String},{description:"Override the remote registry source base (e.g. gh:owner/repo/registry)",name:"source",type:String},{description:"Fetch items from a git ref (branch, tag, or commit), e.g. --ref alpha. Overrides the version-derived default",name:"ref",type:String},{description:"Permit --source values outside gh:/github:/https://",name:"allow-unsafe-source",type:Boolean},s]},S="lunora.advisor.map.json",Q={description:"Score your app's advisor findings into a health map, and gate CI on it",examples:[["lunora advisor","Score the app and write lunora.advisor.map.json"],["lunora advisor --all","Show every procedure as a check matrix"],["lunora advisor --entry messages#sendMessage","Inspect one procedure"],["lunora advisor --min-score 80","Exit non-zero when the score drops below 80"],["lunora advisor --baseline","Fail on any regression against the committed map"]],group:"Develop",loader:()=>import("../packem_chunks/handler18.mjs").then(e=>({default:e.execute})),name:"advisor",options:[{description:"Show every procedure as a check matrix, not just the ones with findings",name:"all",type:Boolean},{description:`Compare against a committed map and fail on regression (default ${S})`,name:"baseline",type:String},{description:"Inspect a single procedure by `file#exportName`",name:"entry",type:String},s,{description:"Exit non-zero when the global score is below this value (0-100)",name:"min-score",type:String},{description:`Where to write the map (default ${S})`,name:"out",type:String},{description:"Write the map artifact to disk (the default)",name:"write",type:Boolean},{description:"Don't write the map artifact to disk — report only",name:"no-write",type:Boolean}]},X={description:"Run wrangler dry-run and report bundle size, top modules, and _generated files",examples:[["lunora analyze","Report the worker bundle size + heaviest modules"]],group:"Deploy",loader:()=>import("../packem_chunks/handler3.mjs").then(e=>({default:e.execute})),name:"analyze",options:[s]},Z={argument:{description:"create | list | restore <id|file> | retention | prune | pitr",name:"subcommand",type:String},description:"Managed snapshot backups (create | list | restore) to a directory or an R2 bucket, plus native point-in-time recovery (pitr)",examples:[["lunora backup create","Snapshot every table to a backup file"],["lunora backup list","List recorded snapshots"],["lunora backup list --format json","Same, as a single JSON document on stdout"],["lunora backup restore <id>","Restore a snapshot by id"],["lunora backup create --bucket default","Snapshot into an R2 bucket instead of a directory"],["lunora backup restore <id> --bucket default --verify","Restore from R2, checksum first"],["lunora backup retention","Show what the platform's retention would delete next"],["lunora backup prune","Delete the snapshots past the retention window (the only command that deletes backups)"],["lunora backup pitr --at 2026-06-01T00:00:00Z","Point-in-time recovery (≤30 days)"]],group:"Data",loader:()=>import("../packem_chunks/handler22.mjs").then(e=>({default:e.execute})),name:"backup",options:[{description:"Backup directory (default .lunora-backups)",name:"dir",type:String},{description:"Store snapshots in this R2 bucket instead of a directory (use `default` for the app's default bucket)",name:"bucket",type:String},{description:"Key prefix for bucket-backed snapshots (default backups/)",name:"prefix",type:String},{description:"restore: verify the snapshot's checksum before importing anything",name:"verify",type:Boolean},{description:"Comma-separated table allowlist (create)",name:"tables",type:String},s,{description:"pitr: time to read/restore to (ISO or epoch-ms, ≤30 days)",name:"at",type:String},{description:"pitr --restore: explicit bookmark to restore to (wins over --at)",name:"bookmark",type:String},{description:"pitr: perform a restore instead of just reading the bookmark",name:"restore",type:Boolean},{description:"pitr --restore: restart the shard now so recovery applies immediately",name:"restart",type:Boolean},{description:"pitr: target shard key (default: root shard)",name:"shard",type:String},{description:"Target production — requires an explicit --url",name:"prod",type:Boolean},{description:"Confirm a destructive step without prompting: a production pitr --restore, or backup prune",name:"yes",type:Boolean},{description:"Worker URL (default http://localhost:8787)",name:"url",type:String},{description:"Admin bearer token (prefer LUNORA_ADMIN_TOKEN; --token is visible to other local processes via the process table)",name:"token",type:String}]},ee=(()=>{const e=P();return e.length>1?`${e.join(" | ")} (default ${U})`:e.join(" | ")})(),p={description:`Deploy target: ${ee}. Also settable as "target" in lunora.config.*`,name:"target",type:String},te={description:"Codegen + validate + bundle the Worker to disk without deploying",examples:[["lunora build","Bundle to .lunora/build without deploying"],["lunora build --out-dir dist-worker","Bundle to a custom directory"],["lunora build --emit-bindings bindings.json","Also write what the bundle needs provisioned, for an external deployer"]],group:"Deploy",loader:()=>import("../packem_chunks/handler19.mjs").then(e=>({default:e.execute})),name:"build",options:[{description:"Override the schema-drift gate for this run (build even with breaking schema drift and no migration; the committed baseline is not advanced)",name:"allow-schema-drift",type:Boolean},{description:`Which API spec(s) to emit: ${m} (default openapi)`,name:"api-spec",type:String},{description:"Use per-module lazy function imports (opt-in; default eager)",name:"lazy-functions",type:Boolean},{description:"Write a JSON manifest of the bindings + crons the bundle needs to this path, for an IaC program to consume",name:"emit-bindings",type:String},s,{description:"Evaluate every lazy function module in workerd before shipping (default; nothing to check for an eager registry)",name:"smoke-load",type:Boolean},{description:"Skip evaluating lazy function modules before shipping",name:"no-smoke-load",type:Boolean},{description:"Run the project's vite/rsbuild client build before bundling the Worker (default when wrangler reads its output)",name:"framework-build",type:Boolean},{description:"Skip the vite/rsbuild client build; bundle whatever is already on disk",name:"no-framework-build",type:Boolean},{description:"Directory to write the bundled Worker to (default .lunora/build)",name:"out-dir",type:String},{description:"Project directory to build (default the working directory). A Vite or Rspack plugin with an explicit root must name the same directory.",name:"root",type:String},{description:"Fail the build on ERROR-level codegen advisories even locally (the gate already defaults to on in CI)",name:"strict-advisories",type:Boolean},{description:"Don't fail the build on ERROR-level codegen advisories (the gate defaults to on in CI, off locally). Never downgrades platform diagnostics.",name:"no-strict-advisories",type:Boolean},p]},re=[{name:"alerts",summary:"usage alerts that catch a runaway bill",usage:"[status | setup | test]"},{name:"ai-gateway",summary:"create or reuse an AI Gateway for ctx.ai and write its id into wrangler vars",usage:""},{name:"containers",summary:"build and push container images, manage instances (wraps wrangler containers)",usage:"<build|push|images|list|info|delete> [args…]"},{name:"deployments",summary:"deployment history; roll back or promote Worker versions",usage:"list | inspect <version-id> | rollback [version-id] | promote <version-id>"},{name:"profile",summary:"capture an on-demand CPU or heap profile (pprof) from the live Worker or one of its Durable Objects",usage:"[worker]"}],R={argument:{description:`${re.map(e=>e.name).join(" | ")}, then the tool's own arguments`,name:"tool",type:String},description:"Cloudflare-only tools: usage alerts, AI Gateway, containers, deployments, profiling",examples:[["lunora cloudflare","List the tools"],["lunora cloudflare alerts","Show last month's usage and which products have an alert"],["lunora cloudflare alerts setup --email ops@example.com --dry-run","Show the alerts setup would create, without creating them"],["lunora cloudflare alerts setup --email ops@example.com --multiplier 5 --yes","Create or update the alerts at 5x last month"],["lunora cloudflare alerts setup --email ops@example.com --threshold do-duration=500000 --yes","Also alert on Durable Objects duration at a limit you choose"],["lunora cloudflare alerts test","Show what Cloudflare has delivered to your alert destinations"],["lunora cloudflare ai-gateway","Create (or reuse) a gateway named after the worker and wire it into wrangler vars"],["lunora cloudflare ai-gateway --id my-gateway --no-logs","Use an explicit gateway id, with prompt/response log collection off"],["lunora cloudflare ai-gateway --dry-run","Print what would be created and written, without calling Cloudflare"],["lunora cloudflare containers build ./containers/transcoder --tag transcoder:v1 --push","Build an image and push it to the Cloudflare Registry"],["lunora cloudflare containers images list","List images in your Cloudflare Registry"],["lunora cloudflare containers list --format json","List container instances as JSON (also `info`, `images list`)"],["lunora cloudflare containers images delete transcoder:v1","Delete an image to free registry storage"],["lunora cloudflare deployments list","Show the 10 most recent deployments"],["lunora cloudflare deployments inspect <version-id>","View a specific Worker version"],["lunora cloudflare deployments rollback --yes","Roll back to the previous version"],["lunora cloudflare deployments promote <version-id> --yes","Send 100% of traffic to a version"],["lunora cloudflare profile","Capture a 10s CPU profile of the latest version into ./<worker>-cpu-<time>.pprof.gz"],["lunora cloudflare profile --type heap --duration-ms 30000 --out heap.pprof.gz","Capture a 30s heap (allocation) profile"],["lunora cloudflare profile --namespace-id <id> --actor-id <64-hex>","Profile one Durable Object instance"]],group:"Deploy",loader:()=>import("../packem_chunks/handler28.mjs").then(e=>({default:e.execute})),name:"cloudflare",options:[{description:"alerts setup: email address to notify. Repeatable",lazyMultiple:!0,name:"email",type:String},{description:"alerts setup / test: Cloudflare webhook destination id. Repeatable",lazyMultiple:!0,name:"webhook",type:String},{description:"alerts setup: alert at this many times last month's usage (default 3)",name:"multiplier",type:String},{description:"alerts setup: set one metric's limit yourself, in the product's unit: <metric>=<n>. Repeatable",lazyMultiple:!0,name:"threshold",type:String},{description:"alerts setup: accept the floor for a metric whose usage could not be read",name:"allow-floor",type:Boolean},{description:"alerts setup: replace an updated alert's recipients instead of adding to them",name:"replace-recipients",type:Boolean},{description:"alerts setup / ai-gateway: show the plan without creating, updating or writing anything",name:"dry-run",type:Boolean},{description:"alerts setup: apply the plan without asking (required when stdin is not a TTY). deployments rollback / promote: confirm the traffic change (required)",name:"yes",type:Boolean},{description:"ai-gateway: gateway id (default: the worker `name` from wrangler.jsonc)",name:"id",type:String},{description:"ai-gateway: collect request/response logs in the gateway (default)",name:"logs",type:Boolean},{description:"ai-gateway: create the gateway with log collection off (prompts and responses are not stored)",name:"no-logs",type:Boolean},{description:"containers build: name:tag for the image (forwarded to wrangler --tag)",name:"tag",type:String},{description:"containers build: push the image to the Cloudflare Registry after building",name:"push",type:Boolean},{description:"containers / deployments / profile: Cloudflare environment name",name:"env",type:String},{description:"profile: capture window in ms, 1000–50000 (default 10000)",name:"duration-ms",type:String},{description:"profile: cpu (default) or heap",name:"type",type:String},{description:"profile: Worker version id to profile (default latest)",name:"version-id",type:String},{description:"profile: file to write the gzip pprof to (default <worker>-<type>-<time>.pprof.gz)",name:"out",type:String},{description:"profile: Durable Object namespace id (with --actor-id)",name:"namespace-id",type:String},{description:"profile: Durable Object instance id, 64 hex characters (with --namespace-id)",name:"actor-id",type:String},{description:"deployments rollback / promote: reason recorded with the change",name:"message",type:String},{...s,description:"Output format: pretty (default) or json (containers: list | info | images list; deployments: list only)"},p]},oe={description:"Run codegen for lunora/ functions and schema",examples:[["lunora codegen","Generate lunora/_generated/ from your schema + functions"]],group:"Develop",loader:()=>import("../packem_chunks/runCodegenCommand.mjs").then(e=>({default:e.execute})),name:"codegen",options:[{description:`Which API spec(s) to emit: ${m} (default openapi)`,name:"api-spec",type:String},{description:"Use per-module lazy imports for registered functions (opt-in; default eager)",name:"lazy-functions",type:Boolean},s,{description:"Fail on ERROR-level advisories even locally (the gate already defaults to on in CI)",name:"strict-advisories",type:Boolean},{description:"Don't fail on ERROR-level advisories (the gate defaults to on in CI, off locally)",name:"no-strict-advisories",type:Boolean},p]},ne={description:"Codegen, validate wrangler, then wrangler deploy",examples:[["lunora deploy","Deploy to Cloudflare"],["lunora deploy --env production","Deploy to a named environment"],["lunora deploy --dry-run","Validate + bundle without publishing"],["lunora deploy --migrate --migrate-yes --migrate-url <url>","Deploy, then run pending data migrations"]],group:"Deploy",loader:()=>import("./runDeployCommand-D40F3PLQ.mjs").then(e=>({default:e.execute})),name:"deploy",options:[{description:"Deploy even though the app enables the open-shard option (any value but a literal false; any caller may target any shard). Without it, deploy refuses until shards are gated with `authorizeShard`",name:"allow-open-shards",type:Boolean},{description:"Override the schema-drift gate for this run (deploy even with breaking schema drift and no migration; the committed baseline is not advanced — use --update-schema-baseline to accept the new shape)",name:"allow-schema-drift",type:Boolean},{description:`Which API spec(s) to emit: ${m} (default openapi)`,name:"api-spec",type:String},{description:"Use per-module lazy function imports (opt-in; default eager)",name:"lazy-functions",type:Boolean},{description:"Run the project's vite/rsbuild client build before bundling the Worker (default when wrangler reads its output)",name:"framework-build",type:Boolean},{description:"Skip the vite/rsbuild client build; bundle whatever is already on disk",name:"no-framework-build",type:Boolean},{description:"Validate, bundle, and run pre-deploy gates without publishing (wrangler deploy --dry-run)",name:"dry-run",type:Boolean},{description:"Cloudflare environment name",name:"env",type:String},s,{description:"After the deploy, probe the new version's health route (/_lunora/health/ready, falling back to /_lunora/health) and fail if it never answers",name:"health-check",type:Boolean},{description:"After a successful deploy, run pending data migrations against the live worker",name:"migrate",type:Boolean},{description:"Skip codegen + the schema-drift gate (assumes `lunora build`/`prepare` already ran in this CI run). Wrangler still bundles the worker.",name:"prebuilt",type:Boolean},{description:"Project directory to deploy (default the working directory). A Vite or Rspack plugin with an explicit root must name the same directory.",name:"root",type:String},{description:"Admin bearer token for --migrate (falls back to LUNORA_ADMIN_TOKEN)",name:"migrate-token",type:String},{description:"Worker URL for --migrate (REQUIRED with --migrate; the deploy target URL is not captured automatically)",name:"migrate-url",type:String},{description:"Confirm running the production data migration triggered by --migrate (required with --migrate)",name:"migrate-yes",type:Boolean},{description:"Fail the deploy on ERROR-level codegen advisories even locally (the gate already defaults to on in CI)",name:"strict-advisories",type:Boolean},{description:"Don't fail the deploy on ERROR-level codegen advisories (the gate defaults to on in CI, off locally). Never downgrades platform diagnostics.",name:"no-strict-advisories",type:Boolean},{description:"Upload a preview version (wrangler versions upload) instead of going live — prints a preview URL; doesn't shift production traffic",name:"preview",type:Boolean},{description:"Deploy only the app, not the lunora.config services it binds (they deploy first by default)",name:"skip-services",type:Boolean},{description:"Evaluate every lazy function module in workerd before shipping (default; nothing to check for an eager registry)",name:"smoke-load",type:Boolean},{description:"Skip evaluating lazy function modules before shipping",name:"no-smoke-load",type:Boolean},p,{description:"Deploy to a temporary Cloudflare account when unauthenticated (wrangler deploy --temporary; live ~60min, then claim or it's deleted). Wrangler errors if you're already authenticated.",name:"temporary",type:Boolean},{description:"Re-bless the committed schema baseline (lunora/.lunora-schema.json) with the current shape",name:"update-schema-baseline",type:Boolean}]},ae={argument:{description:"Optional subcommand: stop (shut the running dev server down) | status (report it) | logs (print its captured output)",name:"args",type:String},description:"Run the dev stack: wrangler worker + studio + codegen watch",examples:[["lunora dev","Run the worker + studio + codegen watch"],["lunora dev --background","Run detached: blocks until ready, prints URL + PID, then returns"],["lunora dev stop","Stop the background/tracked dev server (idempotent)"],["lunora dev status","Report the running dev server (URL, PID, uptime, ready/starting)"],["lunora dev status --json","Same as JSON — poll `.ready` to gate a dependent step in a task graph"],["lunora dev logs","Print the captured dev-server log (background runs)"],["lunora dev --json","Stream machine-readable JSON log LINES (a stream, not a --format json document)"],["lunora dev --emit-bindings dev-manifest.json","Write what this worker needs + where it serves, for a task runner"],["lunora dev --no-studio","Skip the embedded studio server"],["lunora dev --worker-port 8080","Use a custom wrangler dev port"],["lunora dev --inspector-port 9235","Pin wrangler's devtools inspector port instead of letting it walk up from 9229"],["lunora dev --remote","Proxy D1/KV/R2 to the deployed worker (also LUNORA_REMOTE=1)"],["lunora dev --local","Start no remote proxy session, e.g. in CI where a service's `ai` binding has no credentials"],["lunora dev --tunnel","Share the worker on a public *.trycloudflare.com URL (needs cloudflared ≥ 2026.9.3)"],["lunora dev --tunnel --allow-mail you@example.com","Same, but visitors must confirm an allowed email with a one-time PIN"]],group:"Develop",loader:()=>import("../packem_chunks/runDevCommand.mjs").then(e=>({default:e.execute})),name:"dev",options:[{description:`Which API spec(s) codegen emits: ${m} (default openapi)`,name:"api-spec",type:String},{description:"Use per-module lazy imports for codegen (opt-in; default eager)",name:"lazy-functions",type:Boolean},{description:"Write the binding manifest (plus the dev origin) to <file>, for a supervisor that owns the rest of the graph",name:"emit-bindings",type:String},{description:"wrangler dev inspector port, for `wrangler dev` only (defaults to `dev.inspector_port` in wrangler.jsonc; unset, wrangler probes upward from 9229 and can take a sibling worker's pinned port)",name:"inspector-port",type:Number},{description:"Studio server port (default 6173)",name:"port",type:Number},p,{description:"wrangler dev port (default 8787)",name:"worker-port",type:Number},{description:"Run the dev server as a managed background process (auto-enabled when an AI agent is detected; LUNORA_AGENT_MODE=0 disables)",name:"background",type:Boolean},{description:"Machine-readable JSON log lines while the server runs, and a JSON result for `dev status`/`dev stop` (also LUNORA_LOG_JSON=1; auto-enabled for AI agents)",name:"json",type:Boolean},{description:"How many trailing lines `lunora dev logs` prints (default 100, 0 = all)",name:"lines",type:Number},{description:"Serve the embedded studio at /__lunora (default)",name:"studio",type:Boolean},{description:"Don't start the embedded studio server",name:"no-studio",type:Boolean},{description:"Spawn wrangler dev for the worker (default)",name:"worker",type:Boolean},{description:"Don't spawn wrangler dev — an external task runner owns the worker; codegen watch + studio still run",name:"no-worker",type:Boolean},{description:"Run codegen on startup and watch for changes (default)",name:"codegen",type:Boolean},{description:"Don't run codegen — no watch, no startup generate (or set LUNORA_CODEGEN=0)",name:"no-codegen",type:Boolean},{description:"Proxy D1/KV/R2 bindings to the deployed worker (or set LUNORA_REMOTE=1)",name:"remote",type:Boolean},{description:"Pass --local to wrangler dev: no remote proxy session, so an `ai` binding (in the app or a service) cannot stop dev from starting without Cloudflare credentials — it fails when called instead",name:"local",type:Boolean},{description:"Share the worker through a Cloudflare quick tunnel (*.trycloudflare.com, needs cloudflared ≥ 2026.9.3). PUBLIC unless --allow-mail is given",name:"tunnel",type:Boolean},{description:"With --tunnel: only these emails get in, after a one-time PIN (passed to cloudflared as --allowed-mail). Repeatable; accepts a comma list and '*@domain'",lazyMultiple:!0,name:"allow-mail",type:String}]},ie={argument:{description:"Optional path under the docs site (e.g. packages/studio)",name:"section",type:String},description:"Open the Lunora docs in your browser (optional [section] path)",examples:[["lunora docs","Open the Lunora docs"],["lunora docs packages/studio","Open a specific docs section"]],group:"Project",loader:()=>import("../packem_chunks/handler4.mjs").then(e=>({default:e.execute})),name:"docs"},se={description:"Preflight the current Lunora project (wrangler bindings, placeholders, dev secrets)",examples:[["lunora doctor","Run the project preflight checks"],["lunora doctor --format json","Emit the findings as a machine-readable JSON document"],["lunora doctor --fix","Create the D1 databases the config names and mint the local dev secrets"],["lunora doctor --fix --dry-run","Show what --fix would create or write, without doing it"]],group:"Project",loader:()=>import("../packem_chunks/handler26.mjs").then(e=>({default:e.execute})),name:"doctor",options:[s,{description:"Resolve what can be resolved: create placeholder D1 databases, mint missing .dev.vars secrets",name:"fix",type:Boolean},{description:"With --fix: print the changes without making them",name:"dry-run",type:Boolean}]},le={argument:{description:"list | get <KEY> | set <KEY> <VALUE> | unset <KEY> | generate [KEY] | push | diff | doctor",name:"subcommand",type:String},description:"Manage .dev.vars and sync secrets via wrangler (list | get | set | unset | generate | push | diff | doctor)",examples:[["lunora env list","List .dev.vars keys"],["lunora env set API_KEY secret","Set a local variable"],["lunora env generate","Generate strong values for the project's secrets (print KEY=value)"],["lunora env generate AUTH_SECRET --set","Generate one secret and write it to .dev.vars"],["lunora env push --yes","Upload secrets to Cloudflare"],["lunora env diff","Compare local .dev.vars keys against Cloudflare"],["lunora env diff --format json","Same, as a single JSON document on stdout"]],group:"Data",loader:()=>import("../packem_chunks/handler5.mjs").then(e=>({default:e.execute})),name:"env",options:[{description:"Target this Cloudflare environment for `push`/`diff` (passes --env <name> to wrangler)",name:"env",type:String},{description:"Alias for --env production",name:"prod",type:Boolean},s,{description:"For `generate` — write the generated secrets into .dev.vars instead of printing them",name:"set",type:Boolean},{description:"Push secrets to a temporary-account deployment when unauthenticated (wrangler secret put --temporary). Errors if you're already authenticated.",name:"temporary",type:Boolean},{description:"Required for `push` — confirms uploading secrets to Cloudflare",name:"yes",type:Boolean}]},de={description:"Run every *.eval.ts under evals/ via @lunora/testing's evaluate/agentHarness — no live worker needed",examples:[["lunora eval","Run every eval under evals/, print the aggregate table"],["lunora eval --threshold 0.8","Non-zero exit if any eval's average score falls below 0.8"],["lunora eval --dir evals/support --format json","Run a subset and emit a machine-readable result"]],group:"Develop",loader:()=>import("../packem_chunks/handler23.mjs").then(e=>({default:e.execute})),name:"eval",options:[{description:"Directory to discover *.eval.ts files under (default evals/)",name:"dir",type:String},s,{description:"Score gate every eval's average must meet ([0,1]); a per-eval `threshold` export wins over this for that eval",name:"threshold",type:Number}]},pe={argument:{description:"Optional path (alias for --out)",name:"path",type:String},description:"Stream NDJSON of every shard-local + global table from the worker",examples:[["lunora export --out backup.ndjson","Dump every table to an NDJSON file"],["lunora export --tables messages,users","Export only specific tables"],["lunora export --out backup.ndjson --format json","Write the dump to a file and report rows/bytes as JSON"]],group:"Data",loader:()=>import("../packem_chunks/handler6.mjs").then(e=>({default:e.execute})),name:"export",options:[{description:"Output file path (`-` for stdout, default)",name:"out",type:String},{description:"Comma-separated table allowlist",name:"tables",type:String},{...s,description:"Output format: pretty (default) or json — json needs --out <file>, since stdout carries the NDJSON"},{description:"Target production — requires an explicit --url",name:"prod",type:Boolean},{description:"Worker URL (default http://localhost:8787)",name:"url",type:String},{description:"Admin bearer token (prefer LUNORA_ADMIN_TOKEN; --token is visible to other local processes via the process table)",name:"token",type:String}]},ce={argument:{description:"Source NDJSON file, or a `npx convex export --path <dir>` directory",name:"file",type:String},description:"Bulk-insert rows from an NDJSON file — or a Convex export directory — via the worker's admin endpoint",examples:[["lunora import backup.ndjson","Bulk-insert rows from an NDJSON file"],["lunora import ./convex-export","Import a `npx convex export --path` directory (ids are preserved, so no remapping)"],["lunora import ./convex-export --with-storage","Also migrate blobs (verified sha256 upload) + `{ $storage }` refs"],["lunora import ./convex-export --scan","Write a candidate `lunora/import-convex.json` storage-column mapping (imports nothing)"],["lunora import ./snapshot.zip --with-storage --verify","Import a `npx convex export --path` zip snapshot with blob + row-parity checks"],["lunora import ./supabase-csv --from supabase","Import a directory of `COPY … TO STDOUT WITH CSV HEADER` dumps"],["lunora import ./firestore-json --from firebase --verify","Import Firestore documents (REST/Admin-SDK JSON) with row-parity checks"]],group:"Data",loader:()=>import("../packem_chunks/handler7.mjs").then(e=>({default:e.execute})),name:"import",options:[{description:"Source reader for a dump that cannot be detected: supabase | firebase (Convex and NDJSON are auto-detected)",name:"from",type:String},{description:"Wrap each bare doc as `{table:<name>,doc:...}`",name:"table",type:String},s,{description:"Rows per HTTP request (default 500)",name:"batch-size",type:Number},{description:"Also migrate file storage — Convex `_storage` blobs, or a Supabase/Firebase bucket (verified upload)",name:"with-storage",type:Boolean},{description:"Directory of storage objects to upload alongside the rows (Firebase: after `gcloud storage cp -r`)",name:"storage-dir",type:String},{description:"Write a candidate `lunora/import-convex.json` storage-column mapping and exit",name:"scan",type:Boolean},{description:"Verify row parity + dangling-storage after import (non-zero exit on mismatch)",name:"verify",type:Boolean},{description:"Target production — requires an explicit --url",name:"prod",type:Boolean},{description:"Confirm bulk-writing production (required with --prod)",name:"yes",type:Boolean},{description:"Worker URL (default http://localhost:8787)",name:"url",type:String},{description:"Admin bearer token (prefer LUNORA_ADMIN_TOKEN; --token is visible to other local processes via the process table)",name:"token",type:String}]},ue={description:"Print resolved project config: @lunora/* versions, wrangler summary, schema overview",examples:[["lunora info","Print resolved project config"],["lunora info --format json","Emit a JSON snapshot"],["lunora info --bindings","List what this Worker needs provisioned: bindings, crons, vars"],["lunora info --bindings --format json","Emit the manifest a deployer or task runner consumes"],["lunora info --bindings --out reqs.json","Write that manifest to a file"]],group:"Project",loader:()=>import("../packem_chunks/handler8.mjs").then(e=>({default:e.execute})),name:"info",options:[{description:"Report only what this Worker needs provisioned, as the binding manifest",name:"bindings",type:Boolean},s,{description:"With --bindings: write the manifest to <file> instead of stdout",name:"out",type:String}]},me={argument:{description:"Project name",name:"name",type:String},description:"Scaffold a new Lunora project",examples:[["lunora init my-app","Scaffold with the default (vite) template"],["lunora init my-app -t next","Scaffold a Next.js app"],["lunora init my-app -t tanstack-start-react","Scaffold a TanStack Start (React) app"],["lunora init my-app -t tanstack-start-solid","Scaffold a TanStack Start (Solid) app"],["lunora init my-app -t solid-v2","Scaffold a Solid 2.0 SPA"],["lunora init my-app -t rspack-react","Scaffold a React SPA on Rsbuild"],["lunora init my-app --ref alpha","Scaffold from the alpha branch's templates"],["lunora init --here","Add Lunora to the current project"],["lunora init my-app --ci github","Scaffold + add a GitHub Actions deploy pipeline"],["lunora init my-app --ci gitlab","Scaffold + add a GitLab CI deploy pipeline"]],group:"Project",loader:()=>import("../packem_chunks/runInitCommand.mjs").then(e=>({default:e.execute})),name:"init",options:[{alias:"t",description:"Template: analog | astro | expo | next | nuxt | rspack-react | solid-v2 | standalone | sveltekit | tanstack-start-react | tanstack-start-react-rspack | tanstack-start-solid | vinext | vinext-pages. Also accepts an overlay framework (react | vue | solid | svelte), same as --vite.",name:"template",type:String},{description:"Scaffold via the create-vite overlay for a framework (react | vue | solid | svelte | vanilla) — official create-vite base + Lunora layer",name:"vite",type:String},{description:"Local templates root to copy from (offline-friendly; expects <type>/ subdirs)",name:"from",type:String},{description:"Override the remote template source (e.g. gh:owner/repo/sub#ref)",name:"source",type:String},{description:"Fetch templates from a git ref (branch, tag, or commit), e.g. --ref alpha. Overrides the version-derived default",name:"ref",type:String},{description:"Permit --source values outside gh:/github:/https:// (e.g. local file://)",name:"allow-unsafe-source",type:Boolean},{description:"Add Lunora to the current project: detect the framework, patch the config, scaffold lunora/, print per-framework wiring steps",name:"here",type:Boolean},{alias:"i",description:"After scaffolding, offer to add auth + email (defaults on when stdin is a TTY)",name:"interactive",type:Boolean},{alias:"y",description:"Skip the auth/email offer; scaffold only",name:"yes",type:Boolean},{description:"Also scaffold a CI deploy pipeline: github (.github/workflows/deploy.yml) or gitlab (.gitlab-ci.yml)",name:"ci",type:String},{description:"Add features non-interactively after scaffolding (comma-separated): ai | auth | auth-ui | backup | browser | cloudflare-access | crons | email | flags | hyperdrive | payment | presence | queue | storage | workflow",name:"add",type:String},{description:"Walk through every step (prompts + output) without writing files, installing, or running git",name:"dry-run",type:Boolean}]},he={description:"Report write-conflict hot-spots, error rates, and latency outliers from a running Worker",examples:[["lunora insights","Report against the local dev worker"],["lunora insights --shard channel:demo","Scope the report to one shard"],["lunora insights --format json","Emit the raw report as JSON"],["lunora insights --prod --url https://app.example.com --token $LUNORA_ADMIN_TOKEN","Report against production"]],group:"Develop",loader:()=>import("../packem_chunks/handler9.mjs").then(e=>({default:e.execute})),name:"insights",options:[{description:"Explicit shard key (defaults to the root shard)",name:"shard",type:String},{description:"Max rows per section (default 10)",name:"limit",type:String},s,{description:"Target production — requires an explicit --url",name:"prod",type:Boolean},{description:"Worker URL (default http://localhost:8787)",name:"url",type:String},{description:"Admin bearer token (or LUNORA_ADMIN_TOKEN)",name:"token",type:String}]},ge={description:"Scaffold lunora/schema.ts (and list/get procedures) from an existing Postgres or MySQL database",examples:[["lunora introspect --url postgres://localhost/shop","Scaffold a schema + procedures from every table"],["lunora introspect --tables users,orders","Introspect only these tables (DATABASE_URL is read by default)"],["lunora introspect --dry-run","Print what would be written without touching the filesystem"],["lunora introspect --no-procedures --force","Regenerate just the schema, overwriting the existing file"]],group:"Data",loader:()=>import("../packem_chunks/handler25.mjs").then(e=>({default:e.execute})),name:"introspect",options:[{description:"Database connection string (default: $DATABASE_URL)",name:"url",type:String},{description:"Postgres schema (default `public`) or MySQL database name",name:"schema",type:String},{description:"Comma-separated table allow-list (default: every base table)",name:"tables",type:String},{description:"Also emit list/get procedure modules per table (the default)",name:"procedures",type:Boolean},{description:"Emit only the schema — skip the per-table list/get procedure modules",name:"no-procedures",type:Boolean},{description:"Overwrite files that already exist",name:"force",type:Boolean},{description:"Print what would be written without writing it",name:"dry-run",type:Boolean},s]},fe={description:"Link this checkout to its deployed Worker (writes .lunora/project.json)",examples:[["lunora link --url https://app.acme.workers.dev","Link to a deployed Worker URL"],["lunora link --url https://app.acme.workers.dev --env production","Link a named environment"],["lunora link --remove","Remove the link"]],group:"Deploy",loader:()=>import("../packem_chunks/handler10.mjs").then(e=>({default:e.execute})),name:"link",options:[{description:"Cloudflare environment name to record alongside the link",name:"env",type:String},{description:"Worker name (defaults to the `name` in wrangler config)",name:"name",type:String},{description:"Remove the existing link (.lunora/project.json)",name:"remove",type:Boolean},{description:"Deployed Worker URL to link (e.g. https://app.acme.workers.dev)",name:"url",type:String}]},ye={argument:{description:"Worker name (defaults to the name in wrangler config)",name:"worker",type:String},description:"Stream live logs from a deployed Worker, or read the durable log archive with --durable",group:"Deploy",loader:()=>import("../packem_chunks/handler24.mjs").then(e=>({default:e.execute})),name:"logs",options:[{description:"Cloudflare environment name",name:"env",type:String},s,{description:"Substring filter on log messages",name:"search",type:String},{description:"Filter by invocation status: ok, error, or canceled",name:"status",type:String},p,{description:"Tail a temporary-account deployment when unauthenticated (wrangler tail --temporary). Errors if you're already authenticated.",name:"temporary",type:Boolean},{description:"Read the durable log archive (pipelineLogSink → R2) via R2 SQL instead of tailing live",name:"durable",type:Boolean},{description:"durable: Iceberg table the Pipeline writes to (required with --durable)",name:"table",type:String},{description:"durable: Iceberg namespace (R2 Data Catalog database) the table lives in",name:"namespace",type:String},{description:"durable: lower time bound (epoch-millis or ISO 8601), inclusive",name:"since",type:String},{description:"durable: upper time bound (epoch-millis or ISO 8601), inclusive",name:"until",type:String},{description:"durable: exact severity filter (trace|debug|log|info|warn|error|fatal)",name:"level",type:String},{description:"durable: severity floor — this level and every more-severe one",name:"min-level",type:String},{description:"durable: keep function paths starting with this prefix (LIKE 'prefix%')",name:"function-prefix",type:String},{description:"durable: trace-id filter",name:"trace-id",type:String},{description:"durable: shard-key filter",name:"shard-key",type:String},{description:"durable: user-id filter",name:"user-id",type:String},{description:"durable: max rows (clamped to 1–10000; default 500)",name:"limit",type:String},{description:"durable: resume after a prior page — the opaque cursor token printed by the previous page (bare epoch-millis also accepted for back-compat)",name:"cursor",type:String},{description:"durable: emit one JSON object per line instead of a table",name:"ndjson",type:Boolean}]},ve={argument:{description:"install [client…] | uninstall [client…] | serve",name:"args",type:String},description:"Connect your AI editor to Lunora over MCP (docs search + this project's dev server)",examples:[["lunora mcp install","Install into every MCP client already configured here"],["lunora mcp install claude-code cursor","Install into specific clients"],["lunora mcp install --list","List the supported clients and their config files"],["lunora mcp install --docs-only","Install only the hosted documentation server"],["lunora mcp install --print","Show the config that would be written, without writing it"],["lunora mcp install --global","Force every server into the machine-wide config"],["lunora mcp uninstall","Remove Lunora's MCP servers from every supported client"],["lunora mcp uninstall cursor","Remove them from one client"],["lunora mcp uninstall --print","Show what would be removed, without removing it"],["lunora mcp serve","Run the stdio MCP server (this is what your editor spawns)"],["lunora mcp serve --allow-writes","Also expose the mutation/action tools"],["lunora mcp serve --token $LUNORA_ADMIN_TOKEN","Expose the observability tools (logs, issues, advisories, insights, migrations) too"]],group:"Develop",loader:()=>import("../packem_chunks/handler27.mjs").then(e=>({default:e.execute})),name:"mcp",options:[{description:"install: replace entries that already exist",name:"force",type:Boolean},{description:"install: list the supported clients and their config files",name:"list",type:Boolean},{description:"install/uninstall: print what would change instead of writing it",name:"print",type:Boolean},{description:"install/uninstall: only the hosted documentation server",name:"docs-only",type:Boolean},{description:"install/uninstall: only this project's local server",name:"local-only",type:Boolean},{description:"install/uninstall: the machine-wide config (install default: docs server global, local server per-project)",name:"global",type:Boolean},{description:"install/uninstall: this project's config instead of the machine-wide one",name:"project",type:Boolean},{description:"serve: also expose the mutation/action tools (default: read-only)",name:"allow-writes",type:Boolean},{description:"serve: expose the documentation tools (default)",name:"docs",type:Boolean},{description:"serve: skip the documentation tools",name:"no-docs",type:Boolean},{description:"Docs site origin backing the documentation tools (default https://lunora.sh)",name:"docs-url",type:String},{description:"serve: deployment URL to expose (default: the running dev server)",name:"url",type:String},{description:"serve: bearer token (default: LUNORA_ADMIN_TOKEN from the environment or .dev.vars). Also gates the observability tools (logs, issues, advisories, query insights, migration status) — without a token they are not exposed at all",name:"token",type:String}]},be={argument:{description:"generate | create | up | down | status | d1-to-hyperdrive [name|id]",name:"subcommand",type:String},description:"Schema (generate), online data (create | up | down | status), and backend (d1-to-hyperdrive) migrations",examples:[["lunora migrate generate","Diff lunora/schema.ts and emit a SQL migration"],["lunora migrate create add_users_email","Scaffold a data migration"],["lunora migrate up backfill-names","Run a data migration across shards"],["lunora migrate status backfill-names","Report a migration's per-shard status"],["lunora migrate status backfill-names --format json","Same, as a single JSON document on stdout"],["lunora migrate d1-to-hyperdrive --from-url https://old --to-url https://new","Copy .global() data from D1 to Hyperdrive"]],group:"Data",loader:()=>import("../packem_chunks/dispatch.mjs").then(e=>({default:e.execute})),name:"migrate",options:[{description:"Migration name slug (e.g. add_users_email)",name:"name",type:String},{description:"Target table for `create` (prompted for interactively when omitted)",name:"table",type:String},{description:"Preview a data migration without rewriting rows",name:"dry-run",type:Boolean},s,{description:"Rows per batch for a data migration",name:"batch-size",type:Number},{description:"Cap batches processed this run (maps to the runner's maxBatches)",name:"steps",type:Number},{description:"Target production — requires an explicit --url",name:"prod",type:Boolean},{description:"Worker URL (default http://localhost:8787)",name:"url",type:String},{description:"Admin bearer token (prefer LUNORA_ADMIN_TOKEN; --token is visible to other local processes via the process table)",name:"token",type:String},{description:"Required with --prod for up/down — confirms running against production",name:"yes",type:Boolean},{description:"d1-to-hyperdrive: source (D1) worker URL (defaults to --url)",name:"from-url",type:String},{description:"d1-to-hyperdrive: source admin token (defaults to --token / LUNORA_ADMIN_TOKEN)",name:"from-token",type:String},{description:"d1-to-hyperdrive: target (Hyperdrive) worker URL (defaults to --url)",name:"to-url",type:String},{description:"d1-to-hyperdrive: target admin token (defaults to --token / LUNORA_ADMIN_TOKEN)",name:"to-token",type:String},{description:"d1-to-hyperdrive: comma-separated .global() tables to move (default: all global tables)",name:"tables",type:String},{description:"d1-to-hyperdrive: keep the intermediate NDJSON dump at this path",name:"out",type:String}]},we={description:"Run codegen + binding reconcile + wrangler validation (no Vite) — for CI",examples:[["lunora prepare","Codegen + binding reconcile + validate (CI, before deploy)"]],group:"Deploy",loader:()=>import("../packem_chunks/handler11.mjs").then(e=>({default:e.execute})),name:"prepare",options:[{description:"Override the schema-drift gate for this run (proceed even with breaking schema drift and no migration; the committed baseline is not advanced)",name:"allow-schema-drift",type:Boolean},{description:`Which API spec(s) to emit: ${m} (default openapi)`,name:"api-spec",type:String},{description:"Use per-module lazy function imports (opt-in; default eager)",name:"lazy-functions",type:Boolean},{description:"Evaluate every lazy function module in workerd before passing (default; nothing to check for an eager registry)",name:"smoke-load",type:Boolean},{description:"Skip evaluating lazy function modules before passing",name:"no-smoke-load",type:Boolean},{description:"Fail on ERROR-level codegen advisories even locally (the gate already defaults to on in CI)",name:"strict-advisories",type:Boolean},{description:"Don't fail on ERROR-level codegen advisories (the gate defaults to on in CI, off locally). Never downgrades platform diagnostics.",name:"no-strict-advisories",type:Boolean},p,{description:"Re-bless the committed schema baseline (lunora/.lunora-schema.json) with the current shape",name:"update-schema-baseline",type:Boolean}]},ke={description:"Capture an on-demand CPU or heap profile (pprof) from a running Node-target app",examples:[["lunora profile --target node --url https://app.example.com/__profile","Capture a 10 s CPU profile of the app"],["lunora profile --target node --url http://localhost:3000/__profile --type heap --duration-ms 30000","Capture a 30 s heap profile of a local app"],["lunora profile --target node --url https://app.example.com/__profile --out cpu.pprof.gz","Write the profile to a named file"]],group:"Develop",loader:()=>import("../packem_chunks/handler20.mjs").then(e=>({default:e.execute})),name:"profile",options:[{description:"Capture window in ms, 1000–50000 (default 10000)",name:"duration-ms",type:String},{description:"cpu (default) or heap",name:"type",type:String},{description:"File to write the gzip pprof to (default profile-<type>-<time>.pprof.gz)",name:"out",type:String},{description:"Full URL of the profile route the app mounts createNodeProfileHandler on",name:"url",type:String},{description:"Admin bearer token (or LUNORA_ADMIN_TOKEN)",name:"token",type:String},p]},Se={argument:{description:"<add|list|view|build> [item names…]",name:"args",type:String},description:"Component registry: add/list/view items, or build the catalog",examples:[["lunora registry list","List available registry items"],["lunora registry add presence","Scaffold a registry item into lunora/"],["lunora registry build --from ./registry --check","Verify the committed catalog is current"]],group:"Project",loader:()=>import("../packem_chunks/handler12.mjs").then(e=>({default:e.execute})),name:"registry",options:[{description:"add: print the plan and stop without writing",name:"dry-run",type:Boolean},{description:"add: preview the file changes (content diff) and write nothing",name:"diff",type:Boolean},{description:"add: force-overwrite existing files (take the incoming copy)",name:"overwrite",type:Boolean},{description:"add: skip the package.json mutation confirmation prompt",name:"yes",type:Boolean},{description:"Local registry root (offline; expects <name>/ subdirs)",name:"from",type:String},{description:"Override the remote registry source base (e.g. gh:owner/repo/registry)",name:"source",type:String},{description:"Fetch items from a git ref (branch, tag, or commit), e.g. --ref alpha. Overrides the version-derived default",name:"ref",type:String},{description:"Permit --source values outside gh:/github:/https://",name:"allow-unsafe-source",type:Boolean},{...s,description:"Output format: pretty (default) or json (add plan / list)"},{description:"build: output path for the catalog (default <root>/index.json)",name:"out",type:String},{description:"build: verify the index is current instead of rewriting it",name:"check",type:Boolean}]},xe={description:"Clear local Miniflare state (and .lunora-cache with --all)",examples:[["lunora reset","Clear local Miniflare state"],["lunora reset --all","Also remove .lunora-cache"]],group:"Develop",loader:()=>import("../packem_chunks/runResetCommand.mjs").then(e=>({default:e.execute})),name:"reset",options:[{description:"Also remove .lunora-cache",name:"all",type:Boolean},{description:"Skip the confirmation prompt (required when stdin is not a TTY)",name:"yes",type:Boolean}]},Ce={argument:{description:"install | check",name:"subcommand",type:String},description:"Install the Lunora agent skills (AI rules) into .agents/skills/, or check they're present",examples:[["lunora rules install","Copy the Lunora agent skills into .agents/skills/"],["lunora rules install --overwrite","Reinstall, replacing edited skill files"],["lunora rules check","Report which Lunora skills are installed"],["lunora rules check --strict","Exit non-zero when rules are missing (CI gate)"],["lunora rules install --dir packages/app","Install into a specific root instead of the workspace root"]],group:"Project",loader:()=>import("../packem_chunks/handler13.mjs").then(e=>({default:e.execute})),name:"rules",options:[{description:"Install/check root (default: the detected workspace root, not the current directory)",name:"dir",type:String},{description:"install: overwrite skill files that already exist (default: skip them)",name:"overwrite",type:Boolean},{description:"check: exit non-zero when the rules are missing (for CI gating)",name:"strict",type:Boolean}]},Re={argument:{description:"Function path (e.g. messages:send)",name:"functionPath",type:String},description:"Send a single RPC to a running Lunora Worker",examples:[[`lunora run messages:send --args '{"text":"hi"}'`,"Call a function with JSON args"],["lunora run messages:list --shard channel:demo","Target a specific shard"],["lunora run messages:list --as user_123","Run as an authenticated user (needed when the app gates on identity)"],["lunora run messages:list --format json","Emit the RPC result as a single JSON document on stdout"]],group:"Develop",loader:()=>import("../packem_chunks/runRpcCommand.mjs").then(e=>({default:e.execute})),name:"run",options:[{description:"JSON-encoded args object",name:"args",type:String},{description:"Run as this user id — dispatches through the admin-gated `runAs` op so identity-gated apps accept the call",name:"as",type:String},{description:`JSON-encoded extra identity claims to forge alongside --as (e.g. '{"org":"acme"}')`,name:"claims",type:String},{description:"Explicit shard key",name:"shard",type:String},s,{description:"Worker URL (defaults to the running dev server, else http://localhost:8787)",name:"url",type:String},{description:"Admin bearer for --as (prefer LUNORA_ADMIN_TOKEN or .dev.vars; --token is visible to other local processes via the process table)",name:"token",type:String}]},Oe={argument:{description:"<generate>",name:"args",type:String},description:"Generate a self-contained typed client SDK for another language from the project's OpenRPC surface",examples:[["lunora sdk generate --lang python","Emit a Python SDK, transport included, into ./sdk/python"],["lunora sdk generate --lang go --out ./clients/go","Choose the language and output directory"],["lunora sdk generate --lang dart","A Flutter-ready Dart client — live queries arrive as a Stream"],["lunora sdk generate --lang kotlin","Any of the registered targets; --lang lists them"],["lunora sdk generate --lang rust --from ./sdks","Copy the transport from a local checkout instead of fetching it"]],group:"Project",loader:()=>import("../packem_chunks/handler21.mjs").then(e=>({default:e.execute})),name:"sdk",options:[{description:`Target language: ${z.join(" | ")}`,name:"lang",type:String},{description:"Output directory (default ./sdk/<lang>)",name:"out",type:String},{description:"Path to the OpenRPC document (default ./lunora/_generated/openrpc.json)",name:"spec",type:String},{description:"Copy the transport from a local directory of per-language transports (the repo's `sdks/`) instead of fetching it",name:"from",type:String},{description:"Git ref to fetch the transport from (default: this CLI's own release tag, so the transport matches the generated surface)",name:"ref",type:String},{description:"Override the remote transport source base (default gh:anolilab/lunora/sdks)",name:"source",type:String},{description:"Permit --source values outside gh:/github:/https://",name:"allow-unsafe-source",type:Boolean}]},Ae={description:"Generate deterministic fake data from lunora/schema.ts and bulk-insert it via the worker's admin endpoint",examples:[["lunora seed","Seed every table with the default row count"],["lunora seed --table posts --count 50","Seed 50 posts; FK-parent tables are seeded automatically"],["lunora seed --reset","Wipe local .wrangler/state, then seed from scratch"],["lunora seed --seed 7 --dry-run","Print the NDJSON for seed 7 without inserting"],["lunora seed --format json","Report generated / inserted / conflicts per table as JSON"],["lunora seed --seed 7 --now 1785000000000","Byte-identical rows across runs (pins the clock too)"]],group:"Data",loader:()=>import("../packem_chunks/handler14.mjs").then(e=>({default:e.execute})),name:"seed",options:[{description:"Rows per table (default 10)",name:"count",type:Number},{description:"Seed only this table; its FK-parent tables are seeded automatically",name:"table",type:String},{description:"Deterministic seed — same value yields identical rows (default 0)",name:"seed",type:Number},{description:"Epoch-ms reference for time columns (createdAt, expiresAt, …). Pin it with --seed for byte-identical rows across runs; defaults to now",name:"now",type:Number},{description:"Print the generated NDJSON instead of inserting",name:"dry-run",type:Boolean},s,{description:"Wipe local .wrangler/state before seeding (local dev only)",name:"reset",type:Boolean},{description:"Rows per HTTP request (default 500)",name:"batch-size",type:Number},{description:"Target production — requires an explicit --url",name:"prod",type:Boolean},{description:"Worker URL (default http://localhost:8787)",name:"url",type:String},{description:"Admin bearer token (prefer LUNORA_ADMIN_TOKEN; --token is visible to other local processes via the process table)",name:"token",type:String},{description:"Skip the confirmation prompt when seeding a non-local/production target",name:"yes",type:Boolean}]},Ne={argument:{description:"prune",name:"subcommand",type:String},description:"Maintain the shard registry: prune shards that no longer hold any rows of their .shardBy() table",examples:[["lunora shards prune --dry-run","Show which registered shards are empty, without removing anything"],["lunora shards prune","Remove the empty shards from the registry"],["lunora shards prune --tables messages","Only prune the shards listed for `messages`"],["lunora shards prune --prod --url https://app.example.com","Prune production"]],group:"Data",loader:()=>import("../packem_chunks/handler15.mjs").then(e=>({default:e.execute})),name:"shards",options:[{description:"Comma-separated .shardBy() tables (default: all of them)",name:"tables",type:String},{description:"Report what would be pruned without changing the registry",name:"dry-run",type:Boolean},s,{description:"Target production — requires an explicit --url",name:"prod",type:Boolean},{description:"Worker URL (defaults to the running dev server)",name:"url",type:String},{description:"Admin bearer token (or LUNORA_ADMIN_TOKEN)",name:"token",type:String}]},Be={description:"Validate wrangler.jsonc + codegen dry-run + tsc --noEmit (no files written)",examples:[["lunora verify","Validate wrangler + codegen + tsc"],["lunora verify --no-typecheck","Skip the TypeScript type-check"],["lunora verify --health-url https://my-app.workers.dev","Also probe the deployment's /_lunora/health"],["lunora verify --env production","Validate the env.production view, as `lunora deploy --env production` will"]],group:"Deploy",loader:()=>import("../packem_chunks/handler16.mjs").then(e=>({default:e.execute})),name:"verify",options:[{description:"Treat breaking schema drift as a warning instead of a failure",name:"allow-schema-drift",type:Boolean},{description:`Which API spec(s) to emit: ${m} (default openapi)`,name:"api-spec",type:String},{description:"Use per-module lazy function imports (opt-in; default eager)",name:"lazy-functions",type:Boolean},{description:"Cloudflare environment name — validate the env.<name> view of wrangler.jsonc, as `lunora deploy --env` does",name:"env",type:String},s,{description:"Probe this deployment's /_lunora/health endpoint (off by default; keeps verify offline-safe)",name:"health-url",type:String},{description:"Fail verification on ERROR-level codegen advisories even locally (the gate already defaults to on in CI)",name:"strict-advisories",type:Boolean},{description:"Don't fail verification on ERROR-level codegen advisories (the gate defaults to on in CI, off locally). Never downgrades platform diagnostics.",name:"no-strict-advisories",type:Boolean},{description:"Run the TypeScript type-check step (default)",name:"typecheck",type:Boolean},{description:"Skip the TypeScript type-check step",name:"no-typecheck",type:Boolean},p]},De={description:"Open the Lunora studio in your browser (the running dev server's, or the default local one)",examples:[["lunora view","Open the studio for the running dev server"]],group:"Project",loader:()=>import("../packem_chunks/handler17.mjs").then(e=>({default:e.execute})),name:"view"},Ee=(e,t)=>{const r=Array.from({length:t.length+1},(o,n)=>n);for(let o=1;o<=e.length;o+=1){let n=r[0]??0;r[0]=o;for(let a=1;a<=t.length;a+=1){const i=r[a]??0,l=e[o-1]===t[a-1]?0:1;r[a]=Math.min((r[a-1]??0)+1,i+1,n+l),n=i}}return r[t.length]??0},O=(e,t)=>{let r,o=Number.POSITIVE_INFINITY;for(const a of t){const i=Ee(e,a);i<o&&(o=i,r=a)}const n=Math.max(2,Math.ceil(e.length/3));return r!==void 0&&o<=n?r:void 0},Le=e=>`https://registry.npmjs.org/@lunora/cli/${e}`,Ie=1440*60*1e3,je=1500,_e="0.0.0",Te=/^v/u,Pe=new Set(["alpha","beta","next"]),g=e=>{const t=e.trim().replace(Te,""),r=t.indexOf("-");return r===-1?{core:t,prerelease:""}:{core:t.slice(0,r),prerelease:t.slice(r+1)}},x=e=>{const[t,r,o]=g(e).core.split(".").map(n=>{const a=Number.parseInt(n,10);return Number.isFinite(a)?a:0});return[t??0,r??0,o??0]},Ue=(e,t)=>{const r=Number.parseInt(e,10),o=Number.parseInt(t,10);return String(r)===e&&String(o)===t?r>o?1:-1:e>t?1:-1},Me=(e,t)=>{if(e===t)return 0;if(e===""||t==="")return e===""?1:-1;const r=e.split("."),o=t.split(".");for(let n=0;n<Math.max(r.length,o.length);n+=1){const a=r[n],i=o[n];if(a===void 0||i===void 0)return a===void 0?-1:1;if(a!==i)return Ue(a,i)}return 0},We=(e,t)=>{const r=x(e),o=x(t);for(let n=0;n<3;n+=1)if((r[n]??0)!==(o[n]??0))return(r[n]??0)>(o[n]??0)?1:-1;return Me(g(e).prerelease,g(t).prerelease)},ze=e=>{const t=g(e).prerelease.split(".")[0]??"";return Pe.has(t)?t:"latest"},$e=(e,t)=>We(t,e)>0,Fe=(e,t,r)=>t-e<r,Je=(e,t,r="latest",o)=>{const n=`Update available for @lunora/cli: ${e} → ${t}`;if(o===void 0)return`${n} — add @lunora/cli@${r} as a dev dependency to update`;const{args:a,command:i}=M(o,[`@lunora/cli@${r}`],{dev:!0});return`${n} — run \`${i} ${a.join(" ")}\``},A=e=>b(e,"lunora-cli-update.json"),Ke=e=>{const t=e.XDG_CACHE_HOME&&e.XDG_CACHE_HOME.length>0?e.XDG_CACHE_HOME:b(q(),".cache"),r=b(t,"lunora");try{K(r,{mode:448,recursive:!0})}catch{}return r},Ge=e=>{try{const t=JSON.parse(G(A(e),"utf8"));if(t!==null&&typeof t=="object"){const{checkedAt:r,latest:o}=t;if(typeof o=="string"&&typeof r=="number"){const{tag:n}=t;return{checkedAt:r,latest:o,...typeof n=="string"?{tag:n}:{}}}}}catch{}},C=(e,t)=>{try{const r=A(e);try{if(V(r).isSymbolicLink())return}catch{}H(r,`${JSON.stringify(t)}
|
|
2
|
+
`,"utf8")}catch{}},Ve=async(e,t)=>{try{const r=await e(Le(t),{signal:AbortSignal.timeout(je)});if(!r.ok)return;const o=await r.json(),n=o!==null&&typeof o=="object"?o.version:void 0;return typeof n=="string"?n:void 0}catch{return}},He=(e,t,r)=>e===_e||!r||t.CI!==void 0||t.LUNORA_NO_UPDATE_NOTIFIER!==void 0,qe=async e=>{const t=e.env??process.env,r=e.isTTY??process.stdout.isTTY;if(He(e.current,t,r))return;const o=e.cacheDir??Ke(t),n=(e.now??Date.now)(),a=e.ttlMs??Ie,i=ze(e.current),l=Ge(o),c=l?.tag??"latest",d=l!==void 0&&c===i?l:void 0;let h=d?.latest;if(d===void 0||!Fe(d.checkedAt,n,a)){const f=await Ve(e.fetchImpl??globalThis.fetch,i);f===void 0?C(o,{checkedAt:n,latest:e.current,tag:i}):(h=f,C(o,{checkedAt:n,latest:f,tag:i}))}h!==void 0&&$e(e.current,h)&&e.logger.warn(Je(e.current,h,i,e.manager))},N=["init","add","dev","codegen","build","deploy","prepare","link","cloudflare","logs","run","insights","profile","reset","migrate","export","import","seed","shards","backup","eval","verify","info","doctor","env","analyze","view","docs","registry","rules","mcp"],B=$(),Ye=[me,Y,ae,oe,Q,te,ne,we,fe,R,ye,Re,he,ke,xe,be,pe,ce,Ae,Ne,ge,Z,de,Be,ue,se,le,X,De,ie,Se,Ce,ve,Oe],D=[...Ye,T,_],Ct=D.map(e=>e.name),u=e=>e.replaceAll("{",String.raw`\{`).replaceAll("}",String.raw`\}`),Qe=e=>e.every(t=>typeof t=="string")?e.map(t=>u(t)):e.map(t=>typeof t=="string"?[u(t)]:t.map(r=>u(r))),Xe=e=>({...e,...e.argument===void 0?{}:{argument:{...e.argument,description:u(e.argument.description??"")}},...e.description===void 0?{}:{description:u(e.description)},...e.examples===void 0?{}:{examples:Qe(e.examples)},...e.options===void 0?{}:{options:e.options.map(t=>({...t,description:u(t.description??"")}))}}),Ze=e=>{const t={value:0},r=j("lunora",{argv:e.argv===void 0?void 0:[...e.argv],cwd:e.cwd,exit:o=>{t.value=typeof o=="number"?o:0},logger:e.logger,packageName:"@lunora/cli",packageVersion:B});for(const o of D)r.addCommand(Xe(o));return{cli:r,exitCode:t}},et=/Command "(?<name>[^"]+)" not found/u,w={ai:{absorbs:"gateway",to:"cloudflare ai-gateway"},alerts:{to:"cloudflare alerts"},containers:{to:"cloudflare containers"},deployments:{to:"cloudflare deployments"}},tt=new Set((R.options??[]).filter(e=>e.type!==Boolean).map(e=>`--${e.name}`)),rt=/^[\w@%+=:,./-]+$/u,ot=e=>rt.test(e)?e:`'${e.replaceAll("'",String.raw`'\''`)}'`,nt=(e,t)=>{const r=e.indexOf(t);return r===-1?[...e]:[...e.slice(0,r),...e.slice(r+1)]},at=(e,t)=>e.findIndex((r,o)=>r===t&&(o===0||!tt.has(e[o-1]??""))),it=e=>{const t=O(e,[...N,...Object.keys(w)]);return t!==void 0&&Object.hasOwn(w,t)?t:void 0},E=(e,t,r)=>{const o=it(e),n=o===void 0?void 0:w[o];if(o===void 0||n===void 0)return;const a=e===o?"":`\`lunora ${e}\` is not a command. `;let i=[...t];if(n.absorbs!==void 0){const d=at(i,n.absorbs);if(d===-1&&r===void 0)return`${a}\`lunora ${o}\` had one subcommand, \`${n.absorbs}\`; it moved to \`lunora ${n.to}\`.`;i=d===-1?i:[...i.slice(0,d),...i.slice(d+1)]}const l=n.absorbs===void 0?o:`${o} ${n.absorbs}`,c=r??["lunora",n.to,...i.map(d=>ot(d))].join(" ");return`${a}\`lunora ${l}\` moved to \`lunora ${n.to}\`. Run: ${c}`},st=(e,t)=>{const r=v(),o=e instanceof Error?e.message:String(e),n=et.exec(o);if(!n?.groups)return L(e)||I(o)!==void 0?r.error(J(e)):r.error(o),F(e);const a=n.groups.name??"",i=a.split(" ")[0]??"",l=E(i,nt(t,i));if(l!==void 0)return r.error(l),y.USAGE;const c=O(a,N);return r.error(`Unknown command "${a}".${c===void 0?"":` Did you mean "${c}"?`}`),r.info("Run `lunora --help` to list commands, or `lunora docs` to open the documentation."),y.USAGE},lt=e=>({debug:t=>{e.debug(t)},error:t=>{e.error(t)},info:t=>{e.info(t)},success:t=>{e.info(t)},warn:t=>{e.warn(t)}}),Rt=async(e={})=>{const{cli:t,exitCode:r}=Ze(e);e.logger!==void 0&&k(lt(e.logger));const o=e.argv??process.argv.slice(2);try{const a=o[0]==="help"&&o[1]!==void 0?E(o[1],o.slice(2),"lunora help cloudflare"):void 0;if(a!==void 0)return v().error(a),y.USAGE;await t.run({shouldExitProcess:!1})}catch(a){return st(a,o)}finally{k(void 0)}let n;try{n=W(process.cwd())}catch{}return await qe({current:B,logger:v(),manager:n}),r.value};export{N as C,S as D,Ct as R,B as V,re as a,Rt as r};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./platform-diagnostics-Cn2g6Jh-.mjs";import"./api-spec-lYyq4vL6.mjs";import{e as u,b as y,r as x,a as D,s as L}from"../packem_chunks/handler.mjs";import"./secret-key-8DPOH98z.mjs";import"./binding-manifest-file-CQ1eQYy1.mjs";import"./command-CB4JM-Jl.mjs";import"./deploy-target-resolve-BTCW1Iv4.mjs";import"./EXIT_CODE-D_XCixv8.mjs";import"./resolve-target-C_ZloTvd.mjs";import"./health-probe-Bw9JFfIy.mjs";import"./createRecordingSpawner-Ch7zuQQE.mjs";export{u as execute,y as provisionBindings,x as runDeployCommand,D as runPreDeployPipeline,L as smokeLoadLazyModules};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lunora/cli",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.417",
|
|
4
4
|
"description": "The Lunora CLI: init, dev, deploy, codegen, migrate, seed, doctor, insights, logs, registry, and the rest of the project commands",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agent-skills",
|
|
@@ -52,15 +52,15 @@
|
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"@bomb.sh/tab": "0.0.22",
|
|
55
|
-
"@lunora/advisor": "1.0.0-alpha.
|
|
55
|
+
"@lunora/advisor": "1.0.0-alpha.248",
|
|
56
56
|
"@lunora/bindings": "1.0.0-alpha.130",
|
|
57
|
-
"@lunora/codegen": "1.0.0-alpha.
|
|
58
|
-
"@lunora/config": "1.0.0-alpha.
|
|
57
|
+
"@lunora/codegen": "1.0.0-alpha.342",
|
|
58
|
+
"@lunora/config": "1.0.0-alpha.393",
|
|
59
59
|
"@lunora/container": "1.0.0-alpha.89",
|
|
60
|
-
"@lunora/d1": "1.0.0-alpha.
|
|
60
|
+
"@lunora/d1": "1.0.0-alpha.199",
|
|
61
61
|
"@lunora/errors": ">=1.0.0-alpha.51 <2.0.0-0",
|
|
62
62
|
"@lunora/mcp": "1.0.0-alpha.254",
|
|
63
|
-
"@lunora/runtime": "1.0.0-alpha.
|
|
63
|
+
"@lunora/runtime": "1.0.0-alpha.229",
|
|
64
64
|
"@lunora/seed": "1.0.0-alpha.246",
|
|
65
65
|
"@visulima/cerebro": "3.1.2",
|
|
66
66
|
"@visulima/error": "6.1.0",
|
|
@@ -55,7 +55,6 @@ accepted as an alias for the same overlay.
|
|
|
55
55
|
| `tanstack-start-react-rspack` | TanStack Start (React) on Rsbuild, one worker |
|
|
56
56
|
| `rspack-react` | React SPA on Rsbuild (`@lunora/rspack`) |
|
|
57
57
|
| `solid-v2` | Solid 2.0 SPA (`@solidjs/web`, `vite-plugin-solid` 3) |
|
|
58
|
-
| `react-router` | React Router v7 framework mode, SSR in the Lunora worker |
|
|
59
58
|
| `astro` | Astro, Lunora composed into the adapter worker |
|
|
60
59
|
| `sveltekit` | SvelteKit, Lunora composed into the adapter worker |
|
|
61
60
|
| `nuxt` | Nuxt (Vue), Lunora mounted in Nitro |
|