@lunora/cli
Version:
The Lunora CLI: init, dev, deploy, codegen, migrate, seed, doctor, insights, logs, registry, and the rest of the project commands
2 lines (1 loc) • 1.07 kB
JavaScript
import{LunoraError as a}from"@lunora/errors";import{deployTargetIds as s,DEFAULT_DEPLOY_TARGET as i,resolveTargetOrThrow as g,isRunnableTarget as c,runnableTargetIds as l}from"@lunora/config";const o=["both","none","openapi","openrpc"],p=o.join(" | "),f=r=>{if(!(typeof r!="string"||r.length===0)){if(o.includes(r))return r;throw new a("INTERNAL",`invalid --api-spec "${r}" — expected one of: ${p}`)}},T=(()=>{const r=s();return r.length>1?`${r.join(" | ")} (default ${i})`:r.join(" | ")})(),A={description:`Deploy target: ${T}. Also settable as "target" in lunora.json`,name:"target",type:String},d=(r,t)=>{try{return{target:g(r,t)}}catch(e){return{error:e instanceof Error?e.message:String(e)}}},h=(r,t)=>{const e=d(r,t);if(e.target===void 0)return e;if(!c(e.target)){const n=l();return{error:`deploy target "${e.target}" has no command-line toolchain, so the Lunora CLI cannot deploy or serve it — it can only generate for it (\`lunora codegen --target ${e.target}\`). Deployable targets: ${n.join(", ")}`}}return e};export{p as A,A as T,h as a,f as p,d as r};