UNPKG

@lunora/cli

Version:

The Lunora CLI: init, dev, deploy, codegen, migrate, seed, doctor, insights, logs, registry, and the rest of the project commands

4 lines (3 loc) 677 B
import{findLunoraSolution as i}from"@lunora/codegen";import{VisulimaError as s,renderError as a}from"@visulima/error";const d=n=>n.body.split(` `).filter(e=>!e.startsWith("```")).join(` `).replaceAll(/\*\*(.+?)\*\*/gu,"$1").replaceAll(/`([^`]+)`/gu,"$1"),l={filterStacktrace:()=>!1,hideErrorCodeView:!0},g=(n,e)=>{const r=n instanceof Error?n.message:String(n),o=i(r),t=new s({hint:o?[o.header,"",d(o)]:void 0,message:e===void 0?`codegen failed: ${r}`:`codegen failed (${e}): ${r}`,name:"CodegenError"});return t.stack="",a(t,l)},f=n=>{const e=i(n);if(e===void 0)return;const r=new s({hint:[d(e)],message:e.header,name:"Hint"});return r.stack="",a(r,l)};export{f as a,g as r};