@stacksjs/cli 0.75.276 → 0.75.279
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/index.js +1 -1
- package/package.json +9 -9
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import We from"process";async function Ye(e,t={silent:!0}){let n=t.packageManage
|
|
|
4
4
|
`);throw Error(`Command failed with exit code ${r.exitCode}: ${n.join(" ")}
|
|
5
5
|
${l}`)}return o}function _e(e,t,n,r,o){if(p.debug(`exitHandler: ${e}, exitCode: ${n}, signalCode: ${r}`),o)p.debug("Process error:",o.message)}import{handleError as Rt}from"@stacksjs/error-handling";import{log as p}from"@stacksjs/logging";import{ExitCode as Ae}from"@stacksjs/types";import{collect as wt}from"@stacksjs/collections";var g=!process.env.NO_COLOR&&(process.env.FORCE_COLOR?process.env.FORCE_COLOR!=="0":!!process.stdout?.isTTY),d={reset:g?"\x1B[0m":"",black:g?"\x1B[30m":"",red:g?"\x1B[31m":"",green:g?"\x1B[32m":"",yellow:g?"\x1B[33m":"",blue:g?"\x1B[34m":"",magenta:g?"\x1B[35m":"",cyan:g?"\x1B[36m":"",white:g?"\x1B[37m":"",gray:g?"\x1B[90m":"",lightRed:g?"\x1B[91m":"",lightGreen:g?"\x1B[92m":"",lightYellow:g?"\x1B[93m":"",lightBlue:g?"\x1B[94m":"",lightMagenta:g?"\x1B[95m":"",lightCyan:g?"\x1B[96m":"",lightGray:g?"\x1B[37m":"",bgBlack:g?"\x1B[40m":"",bgRed:g?"\x1B[41m":"",bgGreen:g?"\x1B[42m":"",bgYellow:g?"\x1B[43m":"",bgBlue:g?"\x1B[44m":"",bgMagenta:g?"\x1B[45m":"",bgCyan:g?"\x1B[46m":"",bgWhite:g?"\x1B[47m":"",bgGray:g?"\x1B[100m":"",bgLightRed:g?"\x1B[101m":"",bgLightGreen:g?"\x1B[102m":"",bgLightYellow:g?"\x1B[103m":"",bgLightBlue:g?"\x1B[104m":"",bgLightMagenta:g?"\x1B[105m":"",bgLightCyan:g?"\x1B[106m":"",bgLightGray:g?"\x1B[47m":"",bold:g?"\x1B[1m":"",dim:g?"\x1B[2m":"",italic:g?"\x1B[3m":"",underline:g?"\x1B[4m":"",inverse:g?"\x1B[7m":"",hidden:g?"\x1B[8m":"",strikethrough:g?"\x1B[9m":""},U="\x1B[",kt="\x1B]8;;",$t="\x1B]8;;\x07",qe=(e)=>String(e);function B(e,t,n){return Math.min(Math.max(Math.floor(e),t),n)}function u(e,t=d.reset){return(n)=>{if(!g)return String(n);return`${e}${String(n)}${t}`}}function Ft(e){return e.replace(/\x1B\]8;;[^\x07]*(?:\x07|\x1B\\)/g,"").replace(/\x1B\]8;;(?:\x07|\x1B\\)/g,"")}function I(e){return Ft(e).replace(/\x1B\[[0-?]*[ -/]*[@-~]/g,"")}var Ke=I;function He(e){return Array.from(I(e)).length}var ie=u(d.black),se=u(d.red),T=u(d.green),ae=u(d.yellow),le=u(d.blue),ce=u(d.magenta),P=u(d.cyan),ue=u(d.white),S=u(d.gray),ge=u(d.lightRed),de=u(d.lightGreen),me=u(d.lightYellow),fe=u(d.lightBlue),pe=u(d.lightMagenta),he=u(d.lightCyan),K=u(d.lightGray),be=u(d.bgBlack),ye=u(d.bgRed),Ce=u(d.bgGreen),xe=u(d.bgYellow),we=u(d.bgBlue),ke=u(d.bgMagenta),j=u(d.bgCyan),$e=u(d.bgWhite),Fe=u(d.bgGray),ve=u(d.bgLightRed),Be=u(d.bgLightGreen),Se=u(d.bgLightYellow),Oe=u(d.bgLightBlue),Le=u(d.bgLightMagenta),Re=u(d.bgLightCyan),H=u(d.bgLightGray),F=u(d.bold),O=u(d.dim),x=u(d.italic),Ie=u(d.underline),Me=u(d.inverse),Ee=u(d.hidden),Te=u(d.strikethrough),Pe=u(d.reset,"");function Ue(e){return u(`${U}38;5;${B(e,0,255)}m`)}function Ve(e){return u(`${U}48;5;${B(e,0,255)}m`)}function Je(e,t,n){return u(`${U}38;2;${B(e,0,255)};${B(t,0,255)};${B(n,0,255)}m`)}function Qe(e,t,n){return u(`${U}48;2;${B(e,0,255)};${B(t,0,255)};${B(n,0,255)}m`)}function Xe(e,t){let n=(o,i)=>{let l=String(o);if(!g)return l;return`${kt}${i}\x07${l}${$t}`};if(typeof t==="string")return n(e,t);let r=String(e);return(o)=>n(o,r)}var vt={black:ie,red:se,green:T,yellow:ae,blue:le,magenta:ce,cyan:P,white:ue,gray:S,lightRed:ge,lightGreen:de,lightYellow:me,lightBlue:fe,lightMagenta:pe,lightCyan:he,lightGray:K,bgBlack:be,bgRed:ye,bgGreen:Ce,bgYellow:xe,bgBlue:we,bgMagenta:ke,bgCyan:j,bgWhite:$e,bgGray:Fe,bgLightRed:ve,bgLightGreen:Be,bgLightYellow:Se,bgLightBlue:Oe,bgLightMagenta:Le,bgLightCyan:Re,bgLightGray:H,bold:F,dim:O,italic:x,underline:Ie,inverse:Me,hidden:Ee,strikethrough:Te,reset:Pe};function Ze(e){return vt[e]??qe}function xr(e,t){if(typeof t==="function")return t(e);return Ze(t)(e)}function Bt(){return g}var wr={black:ie,red:se,green:T,yellow:ae,blue:le,magenta:ce,cyan:P,white:ue,gray:S,lightRed:ge,lightGreen:de,lightYellow:me,lightBlue:fe,lightMagenta:pe,lightCyan:he,lightGray:K,bgBlack:be,bgRed:ye,bgGreen:Ce,bgYellow:xe,bgBlue:we,bgMagenta:ke,bgCyan:j,bgWhite:$e,bgGray:Fe,bgLightRed:ve,bgLightGreen:Be,bgLightYellow:Se,bgLightBlue:Oe,bgLightMagenta:Le,bgLightCyan:Re,bgLightGray:H,bold:F,dim:O,italic:x,underline:Ie,inverse:Me,hidden:Ee,strikethrough:Te,reset:Pe,ansi256:Ue,ansi256Bg:Ve,trueColor:Je,trueColorBg:Qe,link:Xe,stripColors:Ke},kr={black:ie,red:se,green:T,yellow:ae,blue:le,magenta:ce,cyan:P,white:ue,gray:S,lightRed:ge,lightGreen:de,lightYellow:me,lightBlue:fe,lightMagenta:pe,lightCyan:he,lightGray:K,bgBlack:be,bgRed:ye,bgGreen:Ce,bgYellow:xe,bgBlue:we,bgMagenta:ke,bgCyan:j,bgWhite:$e,bgGray:Fe,bgLightRed:ve,bgLightGreen:Be,bgLightYellow:Se,bgLightBlue:Oe,bgLightMagenta:Le,bgLightCyan:Re,bgLightGray:H,bold:F,dim:O,italic:x,underline:Ie,inverse:Me,hidden:Ee,strikethrough:Te,reset:Pe,ansi256:Ue,ansi256Bg:Ve,trueColor:Je,trueColorBg:Qe,link:Xe,stripColors:Ke,grey:S,lightGrey:K,bgLightGrey:H,supportsColor:Bt};function St(e,t,n,r){let o=He(e);if(o>=t)return e;let i=r[0]||" ",l=t-o;if(n==="right")return`${i.repeat(l)}${e}`;if(n==="center"){let s=Math.floor(l/2),a=l-s;return`${i.repeat(s)}${e}${i.repeat(a)}`}return`${e}${i.repeat(l)}`}function V(e){return Math.max(0,...e.map(He))}function J(e,t,n="left"){let r=String(e).split(/\r?\n/),o=typeof t==="object"?t:void 0,i=typeof t==="number"?t:o?.width??V(r),l=o?.align??n,s=o?.padChar??" ";return r.map((a)=>St(a,Math.max(0,i),l,s)).join(`
|
|
6
6
|
`)}function $r(e,t){return J(e,t,"left")}function Fr(e,t){let n=String(e).split(/\r?\n/);return J(e,t??process.stdout?.columns??V(n),"right")}function vr(e,t){let n=String(e).split(/\r?\n/);return J(e,t??process.stdout?.columns??V(n),"center")}var Ot={single:{topLeft:"\u250C",topRight:"\u2510",bottomLeft:"\u2514",bottomRight:"\u2518",horizontal:"\u2500",vertical:"\u2502"},double:{topLeft:"\u2554",topRight:"\u2557",bottomLeft:"\u255A",bottomRight:"\u255D",horizontal:"\u2550",vertical:"\u2551"},round:{topLeft:"\u256D",topRight:"\u256E",bottomLeft:"\u2570",bottomRight:"\u256F",horizontal:"\u2500",vertical:"\u2502"}};function et(e,t={}){let n=String(e).split(/\r?\n/),r=Ot[t.borderStyle??"single"],o=Math.max(0,t.padding??1),i=Math.max(0,t.margin??0),l=t.align??"left",s=V(n),a=s+o*2,c=typeof t.borderColor==="function"?t.borderColor:t.borderColor?Ze(t.borderColor):qe,y=c((()=>{if(!t.title)return`${r.topLeft}${r.horizontal.repeat(a)}${r.topRight}`;let k=` ${I(String(t.title))} `.slice(0,a),E=r.horizontal.repeat(Math.max(0,a-k.length));return`${r.topLeft}${k}${E}${r.topRight}`})()),C=c(`${r.bottomLeft}${r.horizontal.repeat(a)}${r.bottomRight}`),h=n.map((w)=>{let k=J(w,{align:l,width:s}),E=`${" ".repeat(o)}${k}${" ".repeat(o)}`;return`${c(r.vertical)}${E}${c(r.vertical)}`}),v=" ".repeat(i);return[y,...h,C].map((w)=>`${v}${w}`).join(`
|
|
7
|
-
`)}var Br=wt(["The best way to get started is to quit talking and begin doing.","The pessimist sees difficulty in every opportunity. The optimist sees opportunity in every difficulty.","Don\u2019t let yesterday take up too much of today.","You learn more from failure than from success. Don\u2019t let it stop you. Failure builds character.","It\u2019s not whether you get knocked down, it\u2019s whether you get up.","If you are working on something that you really care about, you don\u2019t have to be pushed. The vision pulls you.","People who are crazy enough to think they can change the world, are the ones who do.","Failure will never overtake me if my determination to succeed is strong enough.","Entrepreneurs are great at dealing with uncertainty and also very good at minimizing risk. That\u2019s the classic entrepreneur.","We may encounter many defeats but we must not be defeated.","Knowing is not enough; we must apply. Wishing is not enough; we must do.","Imagine your life is perfect in every respect; what would it look like?","We generate fears while we sit. We overcome them by action.","Whether you think you can or think you can\u2019t, you\u2019re right.","Security is mostly a superstition. Life is either a daring adventure or nothing."]);var tt="0.75.
|
|
7
|
+
`)}var Br=wt(["The best way to get started is to quit talking and begin doing.","The pessimist sees difficulty in every opportunity. The optimist sees opportunity in every difficulty.","Don\u2019t let yesterday take up too much of today.","You learn more from failure than from success. Don\u2019t let it stop you. Failure builds character.","It\u2019s not whether you get knocked down, it\u2019s whether you get up.","If you are working on something that you really care about, you don\u2019t have to be pushed. The vision pulls you.","People who are crazy enough to think they can change the world, are the ones who do.","Failure will never overtake me if my determination to succeed is strong enough.","Entrepreneurs are great at dealing with uncertainty and also very good at minimizing risk. That\u2019s the classic entrepreneur.","We may encounter many defeats but we must not be defeated.","Knowing is not enough; we must apply. Wishing is not enough; we must do.","Imagine your life is perfect in every respect; what would it look like?","We generate fears while we sit. We overcome them by action.","Whether you think you can or think you can\u2019t, you\u2019re right.","Security is mostly a superstition. Life is either a daring adventure or nothing."]);var tt="0.75.279";async function Tr(e,t){return new Promise((n)=>{if(t?.quiet===!1)console.log(),console.log(P(F("Stacks CLI"))+O(` v${tt}`)),console.log();if(p.info(`Running ${j(x(F(` ${e} `)))}`),t?.showPerformance===!1||t?.quiet)return n(0);return n(performance.now())})}function Pr(e,t,n){let r={type:"success",useSeconds:!0,...t};return r.message=t?.message||e,new Promise((o)=>{if(n)return Rt(n),o(Ae.FatalError);if(r?.startTime){let i=performance.now()-r.startTime;if(r.useSeconds)i=i/1000,i=Math.round(i*100)/100;if(r.quiet===!0)return o(Ae.Success);if(n)p.error(`[${i.toFixed(2)}${r.useSeconds?"s":"ms"}] Failed`);else if(r.type==="error")p.error(`[${i.toFixed(2)}${r.useSeconds?"s":"ms"}] ${r.message??"Failed"}`);else if(r.type==="warning")p.warn(`[${i.toFixed(2)}${r.useSeconds?"s":"ms"}] ${r.message??"Complete"}`);else if(r.type==="info")p.info(`${O(S(`[${i.toFixed(2)}${r.useSeconds?"s":"ms"}]`))} ${r.message??"Complete"}`);else p.success(`${O(S(F(`[${i.toFixed(2)}${r.useSeconds?"s":"ms"}]`)))} ${F(T(r.message??"Complete"))}`)}else if(r?.type==="info")p.info(e);else if(r?.type==="error")p.error(e);else if(r?.type==="warning")p.warn(e);else if(r?.type==="success"&&r?.quiet!==!0)p.success(e);p.flush().catch(()=>{}).then(()=>o(Ae.Success))})}import Q from"process";function rt(e){if(!e)return!1;return e.startsWith("--")}function It(e){return e.startsWith("-")&&!rt(e)}function Ge(e){if(e==="true")return!0;if(e==="false")return!1;let t=Number.parseFloat(e);if(!Number.isNaN(t))return t;return e.replace(/"/g,"")}function Mt(e,t,n,r){let[o,i]=e.slice(2).split("=");if(i!==void 0)r[o]=Ge(i);else if(n+1<t.length&&!t[n+1]?.startsWith("-"))r[o]=t[n+1],n++;else r[o]=!0;return n}function Et(e,t,n,r){let[o,i]=e.slice(1).split("=");if(o===void 0)return n;if(i!==void 0&&o!==void 0)for(let l=0;l<o.length;l++)r[o[l]]=Ge(i);else for(let l=0;l<o.length;l++)if(n+1<t.length&&l===o.length-1&&!t[n+1]?.startsWith("-"))r[o[l]]=Ge(t[n+1]),n++;else r[o[l]]=!0;return n}function Tt(e){if(e===void 0)e=Q.argv.slice(2);let t=[],n={};for(let r=0;r<e.length;r++){let o=e[r];if(!o)continue;if(rt(o))r=Mt(o,e,r,n);else if(It(o))r=Et(o,e,r,n);else t.push(o)}return{args:t,options:n}}function Wr(e){if(e===void 0)e=Q.argv.slice(2);return Tt(e).args}function Yr(e){e=e||{};let t={dryRun:!1,quiet:!1,verbose:!1},n=Q.argv.slice(2);for(let r=0;r<n.length;r++){let o=n[r];if(o?.startsWith("--")){let l=o.substring(2).replace(/-([a-z])/gi,(s)=>s[1]?s[1].toUpperCase():"");if(r+1<n.length&&!n?.[r+1]?.startsWith("--"))if(n?.[r+1]==="true"||n?.[r+1]==="false")e[l]=n[r+1]==="true",r++;else e[l]=n[r+1],r++;else e[l]=!0}}if(Object.keys(e).length===0)return{};return{...t,...e}}function Pt(e){let t=[];for(let[n,r]of Object.entries(e)){if(n==="--"||n==="_"||r===!1||r===void 0||r===null)continue;if(typeof r==="object"&&!Array.isArray(r))continue;if(typeof r==="function"||typeof r==="symbol")continue;if(r===!0)t.push(`--${n}`);else t.push(`--${n}`,String(r))}return t}function At(e){if(Array.isArray(e)){if(e=Array.from(new Set(e)),Array.isArray(e)&&e[0]&&!e[0].startsWith("-"))e.shift();return e.join(" ")}if(typeof e==="object"&&e!==null)return Pt(e).join(" ");return At(Q.argv.slice(2))}async function Dr(e,t){if(!Number.isSafeInteger(t.timeoutMs)||t.timeoutMs<1||t.timeoutMs>120000)throw Error("Invalid bounded process timeout");for(let f of[t.stdoutBytes,t.stderrBytes])if(!Number.isSafeInteger(f)||f<1||f>2000000)throw Error("Invalid bounded process output limit");let n=process.platform!=="win32",r=Bun.spawn(e,{cwd:t.cwd,env:t.env??process.env,stdin:"ignore",stdout:"pipe",stderr:"pipe",detached:n}),o=[r.stdout.getReader(),r.stderr.getReader()],i=[],l,s=!1,a=!1,c="failed",m=[];function y(f){if(f?.code!=="ESRCH")m.push(f)}function C(){if(n)try{process.kill(-r.pid,"SIGKILL")}catch(f){y(f)}if(r.exitCode===null)try{r.kill("SIGKILL")}catch(f){y(f)}}function h(f,L="failed"){if(!s)l=f,s=!0,c=L;if(a)return;a=!0,C();for(let R of o)i.push(R.cancel().catch((N)=>{m.push(N)}))}async function v(f,L,R){let N=[],ee=0;try{while(!0){let{done:D,value:te}=await f.read();if(D)return Buffer.concat(N,ee).toString("utf8");if(te.byteLength>L-ee){let je=Error(`${t.label} ${R} exceeds byte limit`);throw h(je,`${R} exceeds byte limit`),je}ee+=te.byteLength,N.push(te)}}catch(D){throw h(D,`${R} read failed`),D}}let w=setTimeout(()=>h(Error(`${t.label} timed out`),"timed out"),t.timeoutMs),k=v(o[0],t.stdoutBytes,"stdout"),E=v(o[1],t.stderrBytes,"stderr");try{let[f,L,R]=await Promise.all([r.exited,k,E]);if(s)throw l;return{exitCode:f,stdout:L,stderr:R}}catch(f){throw h(f),f}finally{if(clearTimeout(w),C(),r.exitCode===null)h(Error(`${t.label} interrupted`));await Promise.allSettled([r.exited,k,E,...i]);for(let f of o)try{f.releaseLock()}catch(L){m.push(L)}if(m.length)throw AggregateError(s?[l,...m]:m,`${t.label} ${s?`${c}; `:""}process cleanup failed`)}}import{writeSync as Gt}from"fs";import{format as X}from"util";function Kr(...e){ot(1,X(...e))}function Hr(...e){ot(2,X(...e))}async function Ur(...e){await nt(process.stdout,X(...e))}async function Vr(...e){await nt(process.stderr,X(...e))}function nt(e,t){return new Promise((n,r)=>{let o=(i)=>{e.off("error",o),r(i)};e.once("error",o);try{e.write(`${t}
|
|
8
8
|
`,"utf8",(i)=>{if(i)setImmediate(()=>e.off("error",o)),r(i);else e.off("error",o),n()})}catch(i){e.off("error",o),r(i)}})}function ot(e,t){let n=Buffer.from(`${t}
|
|
9
9
|
`),r=0;while(r<n.length)r+=Gt(e,n,r,n.length-r)}import b from"process";import{createInterface as jt}from"readline";var Zr=b.stdin.destroy;b.stdin.destroy=function(e){if(e)this.emit("error",e);return this};b.on("SIGINT",()=>{console.log(`
|
|
10
10
|
`),b.exit(130)});var A=null;function Wt(){if(!A){let e=b.stdin.isTTY&&b.stdout.isTTY;if(A=jt({input:b.stdin,output:b.stdout,terminal:e}),e&&typeof b.stdin.setRawMode==="function")A.on("SIGINT",()=>{b.emit("SIGINT")});A.once("close",()=>{A=null})}return A}var Z=Symbol("stdin-eof");function it(e){return new Promise((t)=>{let n=Wt(),r=!1,o=(l)=>{if(r)return;r=!0,n.off("close",i),t(l)},i=()=>o(Z);n.once("close",i);try{n.question(e,o)}catch{o(Z)}})}function st(){if(b.argv.includes("--no-interaction"))return!1;if(b.env.CI)return!1;return Boolean(b.stdin.isTTY&&b.stdout.isTTY)}async function W(e){if(!st())return"";let t=await it(e);return t===Z?"":t}function at(e,t){let n=e.toLowerCase().trim();if(!n)return t;if(n==="y"||n==="yes")return!0;if(n==="n"||n==="no")return!1;return t}async function en(e){let t=typeof e==="string"?{message:e}:e,n=t.initial??!1,r=n?" (Y/n) ":" (y/N) ";if(!st())return null;let o=await it(`${t.message}${r}`);if(o===Z)return null;return at(o,n)}async function Yt(e){let t=typeof e==="string"?{message:e}:e,n=t.initial??!1,r=n?" (Y/n) ":" (y/N) ",o=await W(`${t.message}${r}`);return at(o,n)}async function Nt(e){let t=typeof e==="string"?{message:e}:e,n=t.placeholder||t.initial||"",r=n?` (${n}) `:" ";return(await W(`${t.message}${r}`)).trim()||t.initial||""}async function Dt(e){console.log(e.message),e.choices.forEach((o,i)=>{let l=i===(e.initial??0)?">":" ";console.log(`${l} ${i+1}. ${o.label}`)});let t=await W("Select (number): "),n=Number.parseInt(t.trim(),10)-1,r=e.choices[n]??e.choices[e.initial??0];if(!r)throw Error("select prompt: no choices available");return r.value}async function zt(e){console.log(e.message),console.log("(Enter numbers separated by commas)"),e.choices.forEach((o,i)=>{console.log(` ${i+1}. ${o.label}`)});let n=(await W("Select (e.g., 1,3,4): ")).split(",").map((o)=>Number.parseInt(o.trim(),10)-1),r=[];for(let o of n){let i=e.choices[o];if(i)r.push(i.value)}return r}async function _t(e){return(await W(`${(typeof e==="string"?{message:e}:e).message} `)).trim()}var tn={text:Nt,confirm:Yt,select:Dt,multiselect:zt,password:_t};import{handleError as qt}from"@stacksjs/error-handling";async function Kt(e,t){let n={...t,stdin:t?.stdin??"inherit",verbose:t?.verbose??!1};return await oe(e,n)}async function sn(e,t){let n={...t,stdio:[t?.stdin??"inherit","pipe","pipe"],verbose:t?.verbose??!1};return await oe(e,n)}async function an(e,t){let n={...t,stdio:[t?.stdin??"inherit","pipe","pipe"],verbose:t?.verbose??!1};return await ze(e,n)}async function ln(e,t){let n=[];for(let r of e){let o=await Kt(r,t);if(o.isErr)throw qt("Error during runCommands",o.error),o.error;n.push(o)}return n}import Ht from"process";var Ut=["SIGINT","SIGTERM","SIGHUP"],G=new Map,lt=!1;function Vt(){if(lt)return;lt=!0;for(let e of Ut)Ht.on(e,async()=>{for(let[t,n]of G)try{await n()}catch(r){console.error(`[signals] cleanup '${t}' threw:`,r)}})}function gn(e,t){return Vt(),G.set(e,t),()=>{if(G.get(e)===t)G.delete(e)}}function dn(e){G.delete(e)}function mn(){return[...G.keys()]}var ct=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],Y=process.stdout.isTTY&&!process.env.CI;function Jt(e){let t=e||"",n=0,r=null,o=!1,i=()=>{if(Y)process.stdout.write("\r\x1B[K")},l=()=>{if(!Y)return;i();let s=ct[n];process.stdout.write(`${s} ${t}`),n=(n+1)%ct.length};return{start(s){if(s)t=s;if(o)return;if(o=!0,Y)l(),r=setInterval(l,80);else if(t)console.log(` ${t}`)},stop(s){if(o=!1,r)clearInterval(r),r=null;if(i(),s)console.log(s)},update(s){if(t=s,!Y&&o)console.log(` ${s}`)},succeed(s){let a=s||t;if(o=!1,r)clearInterval(r),r=null;i(),console.log(`\u2713 ${a}`)},fail(s){let a=s||t;if(o=!1,r)clearInterval(r),r=null;i(),console.error(`\u2717 ${a}`)},get text(){return t},set text(s){if(t=s,Y&&o)l()},get isSpinning(){return o}}}async function pn(e,t,n){let r=Jt(e);r.start();try{let o=await t();return r.succeed(n?.successMessage||e),o}catch(o){throw r.fail(n?.failMessage||`Failed: ${e}`),o}}import M from"process";var ut="\r\x1B[2K";function Qt(){return{columns:M.stdout.columns??80,rows:M.stdout.rows??24}}function Xt(){return Boolean(M.stdout.isTTY)&&!M.env.CI}function Cn(e,t){console.log(et(e,t===void 0?{}:{title:t}))}function xn(e,t={}){let r=(t.columns??[...new Set(e.flatMap((a)=>Object.keys(a)))]).map((a)=>typeof a==="string"?{key:a}:a);if(r.length===0)return"";let o=(a,c)=>{let m=a[c.key];return m===void 0||m===null?"":String(m)},i=r.map((a)=>{let c=t.header===!1?"":a.header??a.key;return Math.max(I(c).length,...e.map((m)=>I(o(m,a)).length))}),l=(a,c,m)=>{let y=Math.max(0,c-I(a).length);return m==="right"?" ".repeat(y)+a:a+" ".repeat(y)},s=[];if(t.header!==!1)s.push(r.map((a,c)=>l(a.header??a.key,i[c],a.align)).join(" ").trimEnd()),s.push(r.map((a,c)=>"-".repeat(i[c])).join(" "));for(let a of e)s.push(r.map((c,m)=>l(o(a,c),i[m],c.align)).join(" ").trimEnd());return s.join(`
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@stacksjs/cli",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"sideEffects": false,
|
|
5
|
-
"version": "0.75.
|
|
5
|
+
"version": "0.75.279",
|
|
6
6
|
"description": "TypeScript framework for CLI artisans. Build beautiful console apps with ease.",
|
|
7
7
|
"author": "Chris Breuer",
|
|
8
8
|
"contributors": [
|
|
@@ -70,16 +70,16 @@
|
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
72
|
"@stacksjs/clapp": "^0.2.12",
|
|
73
|
-
"@stacksjs/collections": "0.75.
|
|
74
|
-
"@stacksjs/error-handling": "0.75.
|
|
75
|
-
"@stacksjs/logging": "0.75.
|
|
76
|
-
"@stacksjs/types": "0.75.
|
|
73
|
+
"@stacksjs/collections": "0.75.279",
|
|
74
|
+
"@stacksjs/error-handling": "0.75.279",
|
|
75
|
+
"@stacksjs/logging": "0.75.279",
|
|
76
|
+
"@stacksjs/types": "0.75.279"
|
|
77
77
|
},
|
|
78
78
|
"devDependencies": {
|
|
79
|
-
"@stacksjs/config": "0.75.
|
|
80
|
-
"@stacksjs/path": "0.75.
|
|
81
|
-
"@stacksjs/utils": "0.75.
|
|
82
|
-
"@stacksjs/validation": "0.75.
|
|
79
|
+
"@stacksjs/config": "0.75.279",
|
|
80
|
+
"@stacksjs/path": "0.75.279",
|
|
81
|
+
"@stacksjs/utils": "0.75.279",
|
|
82
|
+
"@stacksjs/validation": "0.75.279",
|
|
83
83
|
"better-dx": "^0.2.24"
|
|
84
84
|
}
|
|
85
85
|
}
|