mejora 3.1.1 → 3.1.2
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/run.mjs +1 -1
- package/package.json +1 -1
package/dist/run.mjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import{n as e}from"./config-C0qrgNuO.mjs";import{n as t,o as n,r,t as i}from"./hash-BaLFZO2A.mjs";import{t as a}from"./check-registry-mjn8FfPF.mjs";import{fileURLToPath as o}from"node:url";import{mkdir as s,readFile as c,writeFile as l}from"node:fs/promises";import{inspect as u,parseArgs as d,styleText as f}from"node:util";import{Worker as p}from"node:worker_threads";import{env as m}from"node:process";const h=e=>t=>f(e,typeof t==`number`?t.toString():t),g=h(`blue`),_=h(`bold`),ee=h(`cyan`),v=h(`dim`),y=h(`green`),b=h(`red`),x=h(`gray`),S=h(`underline`),te=h(`yellow`);function ne(e){let t=[e.message];if(e.stack){let n=e.stack.split(`
|
|
3
3
|
`).slice(1).map(e=>v(e.trim())).join(`
|
|
4
4
|
`);t.push(n)}return t.join(`
|
|
5
|
-
`)}function C(...e){return e.map(e=>typeof e==`string`?e:e instanceof Error?ne(e):u(e,{colors:!1,depth:10})).join(` `)}const w={error:(...e)=>{console.error(b(`✖`),C(...e))},log:(...e)=>{console.log(C(...e))},start:(...e)=>{console.
|
|
5
|
+
`)}function C(...e){return e.map(e=>typeof e==`string`?e:e instanceof Error?ne(e):u(e,{colors:!1,depth:10})).join(` `)}const w={error:(...e)=>{console.error(b(`✖`),C(...e))},log:(...e)=>{console.log(C(...e))},start:(...e)=>{console.error(ee(`◐`),C(...e))},success:(...e)=>{console.error(y(`✔`),C(...e))}};function T(e,t){return e.file===t.file?e.line===t.line?e.column-t.column:e.line-t.line:e.file<t.file?-1:1}function re(e){return`${e.file} - ${e.rule}: ${e.message}`}function ie(e){let t=Map.groupBy(e,re),n=[];for(let[e,r]of t){r.sort(T);for(let[t,a]of r.entries())n.push({...a,id:i(`${e}:${t}`)})}return n}function E(e){return{items:ie(e.items).toSorted(T),type:`items`}}function D(e,t){return e===1?t:`${t}s`}const O=`__unparsable__`,k={"<":`<`,">":`>`,"[":`[`,"]":`]`},A=/[<>[\]]/g;function j(e){return e.replaceAll(A,e=>k[e])}function M(e,t,r){let i=n(t,e);return r?`${i}#L${r}`:i}function N(e,t){return`[${e}](${t})`}function ae(e,t){let n=M(e.file,t,e.line);return`- ${N(e.line?`Line ${e.line}`:e.file,n)} - ${`${e.rule}: ${j(e.message)}`}`}function oe(e){let t=Object.groupBy(e,e=>e.file||O);return Object.entries(t).map(([e,t=[]])=>({filePath:e,items:t})).toSorted((e,t)=>e.filePath===O?1:t.filePath===O||e.filePath<t.filePath?-1:e.filePath>t.filePath?1:0)}function se(e,t){let n=e.length,r=D(n,`issue`),i=[`\n### Other Issues · ${t}\n`];for(let t of e)i.push(`- ${t.rule}: ${j(t.message)}`);return i.push(`\n${n} ${r} in Other Issues`,``),i.join(`
|
|
6
6
|
`)}function ce(e,t,n){if(e.filePath===O)return se(e.items,n);let r=M(e.filePath,t),i=N(e.filePath,r),a=e.items.length,o=D(a,`issue`),s=[`\n### ${i} · ${n}\n`];for(let n of e.items)s.push(ae(n,t));return s.push(`\n${a} ${o} in ${e.filePath}`,``),s.join(`
|
|
7
7
|
`)}function le(e,t,n){let r=t.length,i=D(r,`issue`),a=[`\n## ${e}\n`];if(t.length===0)return a.push(`No issues`),a.join(`
|
|
8
8
|
`);let o=oe(t);for(let t of o)a.push(ce(t,n,e));return a.push(`---\n${r} total ${i} for ${e}`),a.join(`
|