UNPKG

@lunora/cli

Version:

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

5 lines (4 loc) 718 B
import{errorAdvisoryNames as a}from"@lunora/codegen";const i=e=>e.strictAdvisories??(process.env.CI!==void 0&&process.env.CI!==""),v=(e,s)=>{const o=e.filter(t=>t.level==="ERROR");return{errorAdvisories:o,names:a(e),shouldBlock:o.length>0&&s}},p=(e,s)=>{if(e.length===0)return{errors:[],warnings:[]};const o=e.map(r=>` [${r.level.toUpperCase()}] ${r.name}${r.message}${r.remediation}`),t=e.filter(r=>r.level==="error").map(r=>r.message),n=e.filter(r=>r.level!=="error").map(r=>r.message),l=`${String(e.length)} platform ${e.length===1?"diagnostic":"diagnostics"}: ${o.join(` `)}`;return t.length===0?(s.warn(l),{errors:[],warnings:n}):(s.error(l),{errors:t,warnings:n})};export{p as a,v as e,i as r};