@commercelayer/cli-ux 1.0.14 → 1.1.0

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/lib/index.d.mts CHANGED
@@ -440,6 +440,7 @@ declare class ux {
440
440
  static trace(format: string, ...args: string[]): void;
441
441
  static get tree(): typeof tree$1;
442
442
  static url(text: string, uri: string, params?: {}): void;
443
+ static hyperlink(text: string, uri: string, params?: {}): string;
443
444
  static get wait(): typeof _default$1;
444
445
  }
445
446
  declare const action: ActionBase;
@@ -449,6 +450,7 @@ declare const confirm: typeof confirm$1;
449
450
  declare const debug: typeof ux.debug;
450
451
  declare const done: typeof ux.done;
451
452
  declare const flush: typeof ux.flush;
453
+ declare const hyperlink: typeof ux.hyperlink;
452
454
  declare const info: typeof ux.info;
453
455
  declare const log: typeof ux.log;
454
456
  declare const logToStderr: typeof ux.logToStderr;
@@ -466,4 +468,4 @@ declare const error: typeof Errors.error;
466
468
  declare const exit: typeof Errors.exit;
467
469
  declare const warn: typeof Errors.warn;
468
470
 
469
- export { ActionBase, Config, ExitError, type IPromptOptions, table$2 as Table, action, annotation, anykey, colorize, config, confirm, debug, done, error, exit, flush, info, log, logToStderr, progress, prompt, styledHeader, styledJSON, styledObject, table, trace, tree, url, ux, wait, warn, _default as write };
471
+ export { ActionBase, Config, ExitError, type IPromptOptions, table$2 as Table, action, annotation, anykey, colorize, config, confirm, debug, done, error, exit, flush, hyperlink, info, log, logToStderr, progress, prompt, styledHeader, styledJSON, styledObject, table, trace, tree, url, ux, wait, warn, _default as write };
package/lib/index.d.ts CHANGED
@@ -440,6 +440,7 @@ declare class ux {
440
440
  static trace(format: string, ...args: string[]): void;
441
441
  static get tree(): typeof tree$1;
442
442
  static url(text: string, uri: string, params?: {}): void;
443
+ static hyperlink(text: string, uri: string, params?: {}): string;
443
444
  static get wait(): typeof _default$1;
444
445
  }
445
446
  declare const action: ActionBase;
@@ -449,6 +450,7 @@ declare const confirm: typeof confirm$1;
449
450
  declare const debug: typeof ux.debug;
450
451
  declare const done: typeof ux.done;
451
452
  declare const flush: typeof ux.flush;
453
+ declare const hyperlink: typeof ux.hyperlink;
452
454
  declare const info: typeof ux.info;
453
455
  declare const log: typeof ux.log;
454
456
  declare const logToStderr: typeof ux.logToStderr;
@@ -466,4 +468,4 @@ declare const error: typeof Errors.error;
466
468
  declare const exit: typeof Errors.exit;
467
469
  declare const warn: typeof Errors.warn;
468
470
 
469
- export { ActionBase, Config, ExitError, type IPromptOptions, table$2 as Table, action, annotation, anykey, colorize, config, confirm, debug, done, error, exit, flush, info, log, logToStderr, progress, prompt, styledHeader, styledJSON, styledObject, table, trace, tree, url, ux, wait, warn, _default as write };
471
+ export { ActionBase, Config, ExitError, type IPromptOptions, table$2 as Table, action, annotation, anykey, colorize, config, confirm, debug, done, error, exit, flush, hyperlink, info, log, logToStderr, progress, prompt, styledHeader, styledJSON, styledObject, table, trace, tree, url, ux, wait, warn, _default as write };
package/lib/index.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var It=Object.create;var P=Object.defineProperty;var At=Object.getOwnPropertyDescriptor;var Et=Object.getOwnPropertyNames;var Lt=Object.getPrototypeOf,Ft=Object.prototype.hasOwnProperty;var Rt=(s,e,t)=>e in s?P(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var tt=(s,e)=>{for(var t in e)P(s,t,{get:e[t],enumerable:!0})},et=(s,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Et(e))!Ft.call(s,n)&&n!==t&&P(s,n,{get:()=>e[n],enumerable:!(r=At(e,n))||r.enumerable});return s};var g=(s,e,t)=>(t=s!=null?It(Lt(s)):{},et(e||!s||!s.__esModule?P(t,"default",{value:s,enumerable:!0}):t,s)),qt=s=>et(P({},"__esModule",{value:!0}),s);var c=(s,e,t)=>Rt(s,typeof e!="symbol"?e+"":e,t);var Ce={};tt(Ce,{ActionBase:()=>b,Config:()=>A,ExitError:()=>W,Table:()=>S,action:()=>ee,annotation:()=>re,anykey:()=>se,colorize:()=>Ct,config:()=>y,confirm:()=>ne,debug:()=>ie,done:()=>oe,error:()=>we,exit:()=>ke,flush:()=>ae,info:()=>ce,log:()=>ue,logToStderr:()=>le,progress:()=>de,prompt:()=>pe,styledHeader:()=>fe,styledJSON:()=>me,styledObject:()=>ge,table:()=>he,trace:()=>ye,tree:()=>ve,url:()=>be,ux:()=>O,wait:()=>xe,warn:()=>Te,write:()=>T});module.exports=qt(Ce);var $=g(require("chalk")),E=require("util");var dt=g(require("@oclif/core/lib/cache"));var K=require("util");function N(s){return s===void 0?[]:Array.isArray(s)?s:[s]}function H(s,e){return s.reduce((t,r)=>t+e(r),0)}function rt(s){return s?s.charAt(0).toUpperCase()+s.slice(1).toLowerCase():""}var b=class{constructor(){c(this,"std","stderr");c(this,"stdmocks");c(this,"type");c(this,"stdmockOrigs",{stderr:process.stderr.write,stdout:process.stdout.write})}get output(){return this.globals.output}set output(e){this.globals.output=e}get running(){return!!this.task}get status(){return this.task?this.task.status:void 0}set status(e){let{task:t}=this;t&&t.status!==e&&(this._updateStatus(e,t.status),t.status=e)}get task(){return this.globals.action.task}set task(e){this.globals.action.task=e}async pause(e,t){let{task:r}=this,n=r?.active;r&&n&&(this._pause(t),this._stdout(!1),r.active=!1);let o=e();return r&&n&&this._resume(),o}async pauseAsync(e,t){let{task:r}=this,n=r?.active;r&&n&&(this._pause(t),this._stdout(!1),r.active=!1);let o=await e();return r&&n&&this._resume(),o}start(e,t,r={}){this.std=r.stdout?"stdout":"stderr";let n={action:e,active:!!this.task?.active,status:t};this.task=n,this._start(r),n.active=!0,this._stdout(!0)}stop(e="done"){let{task:t}=this;t&&(this._stop(e),t.active=!1,this.task=void 0,this._stdout(!1))}_flushStdout(){try{let e="",t;for(;this.stdmocks&&this.stdmocks.length>0;){let r=this.stdmocks.shift();t=r[0],this._write(t,r[1]),e+=r[1][0].toString("utf8")}e&&t&&e.at(-1)!==`
1
+ "use strict";var It=Object.create;var P=Object.defineProperty;var At=Object.getOwnPropertyDescriptor;var Et=Object.getOwnPropertyNames;var Lt=Object.getPrototypeOf,Ft=Object.prototype.hasOwnProperty;var Rt=(s,e,t)=>e in s?P(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var tt=(s,e)=>{for(var t in e)P(s,t,{get:e[t],enumerable:!0})},et=(s,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Et(e))!Ft.call(s,n)&&n!==t&&P(s,n,{get:()=>e[n],enumerable:!(r=At(e,n))||r.enumerable});return s};var g=(s,e,t)=>(t=s!=null?It(Lt(s)):{},et(e||!s||!s.__esModule?P(t,"default",{value:s,enumerable:!0}):t,s)),qt=s=>et(P({},"__esModule",{value:!0}),s);var c=(s,e,t)=>Rt(s,typeof e!="symbol"?e+"":e,t);var Se={};tt(Se,{ActionBase:()=>b,Config:()=>A,ExitError:()=>W,Table:()=>S,action:()=>ee,annotation:()=>re,anykey:()=>se,colorize:()=>Ct,config:()=>y,confirm:()=>ne,debug:()=>ie,done:()=>oe,error:()=>ke,exit:()=>Te,flush:()=>ae,hyperlink:()=>ce,info:()=>ue,log:()=>le,logToStderr:()=>de,progress:()=>pe,prompt:()=>fe,styledHeader:()=>me,styledJSON:()=>ge,styledObject:()=>he,table:()=>ye,trace:()=>ve,tree:()=>be,url:()=>xe,ux:()=>O,wait:()=>we,warn:()=>_e,write:()=>T});module.exports=qt(Se);var $=g(require("chalk")),E=require("util");var dt=g(require("@oclif/core/lib/cache"));var K=require("util");function N(s){return s===void 0?[]:Array.isArray(s)?s:[s]}function H(s,e){return s.reduce((t,r)=>t+e(r),0)}function rt(s){return s?s.charAt(0).toUpperCase()+s.slice(1).toLowerCase():""}var b=class{constructor(){c(this,"std","stderr");c(this,"stdmocks");c(this,"type");c(this,"stdmockOrigs",{stderr:process.stderr.write,stdout:process.stdout.write})}get output(){return this.globals.output}set output(e){this.globals.output=e}get running(){return!!this.task}get status(){return this.task?this.task.status:void 0}set status(e){let{task:t}=this;t&&t.status!==e&&(this._updateStatus(e,t.status),t.status=e)}get task(){return this.globals.action.task}set task(e){this.globals.action.task=e}async pause(e,t){let{task:r}=this,n=r?.active;r&&n&&(this._pause(t),this._stdout(!1),r.active=!1);let o=e();return r&&n&&this._resume(),o}async pauseAsync(e,t){let{task:r}=this,n=r?.active;r&&n&&(this._pause(t),this._stdout(!1),r.active=!1);let o=await e();return r&&n&&this._resume(),o}start(e,t,r={}){this.std=r.stdout?"stdout":"stderr";let n={action:e,active:!!this.task?.active,status:t};this.task=n,this._start(r),n.active=!0,this._stdout(!0)}stop(e="done"){let{task:t}=this;t&&(this._stop(e),t.active=!1,this.task=void 0,this._stdout(!1))}_flushStdout(){try{let e="",t;for(;this.stdmocks&&this.stdmocks.length>0;){let r=this.stdmocks.shift();t=r[0],this._write(t,r[1]),e+=r[1][0].toString("utf8")}e&&t&&e.at(-1)!==`
2
2
  `&&this._write(t,`
3
3
  `)}catch(e){this._write("stderr",(0,K.inspect)(e))}}_pause(e){throw new Error("not implemented")}_resume(){this.task&&this.start(this.task.action,this.task.status)}_start(e){throw new Error("not implemented")}_stdout(e){try{if(e){if(this.stdmocks)return;this.stdmockOrigs={stderr:process.stderr.write,stdout:process.stdout.write},this.stdmocks=[],process.stdout.write=(...t)=>(this.stdmocks.push(["stdout",t]),!0),process.stderr.write=(...t)=>(this.stdmocks.push(["stderr",t]),!0)}else{if(!this.stdmocks)return;delete this.stdmocks,process.stdout.write=this.stdmockOrigs.stdout,process.stderr.write=this.stdmockOrigs.stderr}}catch(t){this._write("stderr",(0,K.inspect)(t))}}_stop(e){throw new Error("not implemented")}_updateStatus(e,t){}_write(e,t){switch(e){case"stdout":{this.stdmockOrigs.stdout.apply(process.stdout,N(t));break}case"stderr":{this.stdmockOrigs.stderr.apply(process.stderr,N(t));break}default:throw new Error(`invalid std: ${e}`)}}get globals(){global.ux=global.ux||{};let e=global.ux;return e.action=e.action||{},e}};var B=class extends b{constructor(){super(...arguments);c(this,"type","simple")}_flush(){this._write(this.std,`
4
4
  `),this._flushStdout()}_pause(t){t?this._updateStatus(t):this._flush()}_render(t,r){this.task&&(this.task.active&&this._flush(),this._write(this.std,r?`${t}... ${r}`:`${t}...`))}_resume(){}_start(){this.task&&this._render(this.task.action,this.task.status)}_stop(t){this.task&&this._updateStatus(t,this.task.status,!0)}_updateStatus(t,r,n=!1){this.task&&(this.task.active&&!r?this._write(this.std,` ${t}`):this._write(this.std,`${this.task.action}... ${t}`),(n||!r)&&this._flush())}};var at=g(require("ansi-styles")),ct=g(require("chalk")),ut=g(require("strip-ansi")),F=g(require("supports-color"));function st(s){if(!s.isTTY)return 80;let e=s.getWindowSize()[0];return e<1?80:e<40?40:e}var nt=Number.parseInt(process.env.OCLIF_COLUMNS,10),it=nt||st(process.stdout),ot=nt||st(process.stderr);var Y={arc:{frames:["\u25DC","\u25E0","\u25DD","\u25DE","\u25E1","\u25DF"],interval:100},arrow:{frames:["\u2190","\u2196","\u2191","\u2197","\u2192","\u2198","\u2193","\u2199"],interval:100},arrow2:{frames:["\u2B06\uFE0F ","\u2197\uFE0F ","\u27A1\uFE0F ","\u2198\uFE0F ","\u2B07\uFE0F ","\u2199\uFE0F ","\u2B05\uFE0F ","\u2196\uFE0F "],interval:80},arrow3:{frames:["\u25B9\u25B9\u25B9\u25B9\u25B9","\u25B8\u25B9\u25B9\u25B9\u25B9","\u25B9\u25B8\u25B9\u25B9\u25B9","\u25B9\u25B9\u25B8\u25B9\u25B9","\u25B9\u25B9\u25B9\u25B8\u25B9","\u25B9\u25B9\u25B9\u25B9\u25B8"],interval:120},balloon:{frames:[" ",".","o","O","@","*"," "],interval:140},balloon2:{frames:[".","o","O","\xB0","O","o","."],interval:120},bounce:{frames:["\u2801","\u2802","\u2804","\u2802"],interval:120},bouncingBall:{frames:["( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF)","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","(\u25CF )"],interval:80},bouncingBar:{frames:["[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"],interval:80},boxBounce:{frames:["\u2596","\u2598","\u259D","\u2597"],interval:120},boxBounce2:{frames:["\u258C","\u2580","\u2590","\u2584"],interval:100},circle:{frames:["\u25E1","\u2299","\u25E0"],interval:120},circleHalves:{frames:["\u25D0","\u25D3","\u25D1","\u25D2"],interval:50},circleQuarters:{frames:["\u25F4","\u25F7","\u25F6","\u25F5"],interval:120},clock:{frames:["\u{1F550} ","\u{1F551} ","\u{1F552} ","\u{1F553} ","\u{1F554} ","\u{1F555} ","\u{1F556} ","\u{1F557} ","\u{1F558} ","\u{1F559} ","\u{1F55A} "],interval:100},dots:{frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],interval:80},dots2:{frames:["\u28FE","\u28FD","\u28FB","\u28BF","\u287F","\u28DF","\u28EF","\u28F7"],interval:80},dots3:{frames:["\u280B","\u2819","\u281A","\u281E","\u2816","\u2826","\u2834","\u2832","\u2833","\u2813"],interval:80},dots4:{frames:["\u2804","\u2806","\u2807","\u280B","\u2819","\u2838","\u2830","\u2820","\u2830","\u2838","\u2819","\u280B","\u2807","\u2806"],interval:80},dots5:{frames:["\u280B","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B"],interval:80},dots6:{frames:["\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2834","\u2832","\u2812","\u2802","\u2802","\u2812","\u281A","\u2819","\u2809","\u2801"],interval:80},dots7:{frames:["\u2808","\u2809","\u280B","\u2813","\u2812","\u2810","\u2810","\u2812","\u2816","\u2826","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808"],interval:80},dots8:{frames:["\u2801","\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808","\u2808"],interval:80},dots9:{frames:["\u28B9","\u28BA","\u28BC","\u28F8","\u28C7","\u2867","\u2857","\u284F"],interval:80},dots10:{frames:["\u2884","\u2882","\u2881","\u2841","\u2848","\u2850","\u2860"],interval:80},dots11:{frames:["\u2801","\u2802","\u2804","\u2840","\u2880","\u2820","\u2810","\u2808"],interval:100},earth:{frames:["\u{1F30D} ","\u{1F30E} ","\u{1F30F} "],interval:180},flip:{frames:["_","_","_","-","`","`","'","\xB4","-","_","_","_"],interval:70},growHorizontal:{frames:["\u258F","\u258E","\u258D","\u258C","\u258B","\u258A","\u2589","\u258A","\u258B","\u258C","\u258D","\u258E"],interval:120},growVertical:{frames:["\u2581","\u2583","\u2584","\u2585","\u2586","\u2587","\u2586","\u2585","\u2584","\u2583"],interval:120},hamburger:{frames:["\u2631","\u2632","\u2634"],interval:100},hearts:{frames:["\u{1F49B} ","\u{1F499} ","\u{1F49C} ","\u{1F49A} ","\u2764\uFE0F "],interval:100},hexagon:{frames:["\u2B21","\u2B22"],interval:400},line:{frames:["-","\\","|","/"],interval:130},line2:{frames:["\u2802","-","\u2013","\u2014","\u2013","-"],interval:100},monkey:{frames:["\u{1F648} ","\u{1F648} ","\u{1F649} ","\u{1F64A} "],interval:300},moon:{frames:["\u{1F311} ","\u{1F312} ","\u{1F313} ","\u{1F314} ","\u{1F315} ","\u{1F316} ","\u{1F317} ","\u{1F318} "],interval:80},noise:{frames:["\u2593","\u2592","\u2591"],interval:100},pipe:{frames:["\u2524","\u2518","\u2534","\u2514","\u251C","\u250C","\u252C","\u2510"],interval:100},pong:{frames:["\u2590\u2802 \u258C","\u2590\u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802\u258C","\u2590 \u2820\u258C","\u2590 \u2840\u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590\u2820 \u258C"],interval:80},runner:{frames:["\u{1F6B6} ","\u{1F3C3} "],interval:140},simpleDots:{frames:[". ",".. ","..."," "],interval:400},simpleDotsScrolling:{frames:[". ",".. ","..."," .."," ."," "],interval:200},smiley:{frames:["\u{1F604} ","\u{1F61D} "],interval:200},squareCorners:{frames:["\u25F0","\u25F3","\u25F2","\u25F1"],interval:180},squish:{frames:["\u256B","\u256A"],interval:100},star:{frames:["\u2736","\u2738","\u2739","\u273A","\u2739","\u2737"],interval:70},star2:{frames:["+","x","*"],interval:80},toggle:{frames:["\u22B6","\u22B7"],interval:250},toggle2:{frames:["\u25AB","\u25AA"],interval:80},toggle3:{frames:["\u25A1","\u25A0"],interval:120},toggle4:{frames:["\u25A0","\u25A1","\u25AA","\u25AB"],interval:100},toggle5:{frames:["\u25AE","\u25AF"],interval:100},toggle6:{frames:["\u101D","\u1040"],interval:300},toggle7:{frames:["\u29BE","\u29BF"],interval:80},toggle8:{frames:["\u25CD","\u25CC"],interval:100},toggle9:{frames:["\u25C9","\u25CE"],interval:100},toggle10:{frames:["\u3282","\u3280","\u3281"],interval:100},toggle11:{frames:["\u29C7","\u29C6"],interval:50},toggle12:{frames:["\u2617","\u2616"],interval:120},toggle13:{frames:["=","*","-"],interval:80},triangle:{frames:["\u25E2","\u25E3","\u25E4","\u25E5"],interval:50}};var D=require("ansi-escapes");function jt(s){return F?(F.stdout?F.stdout.has256:(process.env.TERM||"").includes("256"))?`\x1B[38;5;104m${s}${at.default.reset.open}`:ct.default.magenta(s):s}var I=class extends b{constructor(){super();c(this,"frameIndex");c(this,"frames");c(this,"spinner");c(this,"type","spinner");this.frames=this.getFrames(),this.frameIndex=0}_frame(){let t=this.frames[this.frameIndex];return this.frameIndex=++this.frameIndex%this.frames.length,jt(t)}_lines(t){return(0,ut.default)(t).split(`
@@ -16,4 +16,4 @@
16
16
  `)}static log(e,...t){this.info(e||"",...t)}static logToStderr(e,...t){T.stderr((0,E.format)(e,...t)+`
17
17
  `)}static get progress(){return q}static get prompt(){return z}static styledHeader(e){this.info($.default.dim("=== ")+$.default.bold(e)+`
18
18
  `)}static styledJSON(e){let t=JSON.stringify(e,null,2);if(!$.default.level){this.info(t);return}let r=require("cardinal"),n=require("cardinal/themes/jq");this.info(r.highlight(t,{json:!0,theme:n}))}static styledObject(e,t){this.info(R(e,t))}static get table(){return S.table}static trace(e,...t){this.config.outputLevel==="trace"&&this.info((0,E.format)(e,...t)+`
19
- `)}static get tree(){return M}static url(e,t,r={}){require("supports-hyperlinks").stdout?this.log(te(e,t,r)):this.log(t)}static get wait(){return _t}};c(O,"config",y);var{action:ee,annotation:re,anykey:se,confirm:ne,debug:ie,done:oe,flush:ae,info:ce,log:ue,logToStderr:le,progress:de,prompt:pe,styledHeader:fe,styledJSON:me,styledObject:ge,table:he,trace:ye,tree:ve,url:be,wait:xe}=O,{error:we,exit:ke,warn:Te}=St.Errors;var Ot=async()=>{try{await O.done()}catch(s){console.error(s),process.exitCode=1}},_e=process.listeners("exit").find(s=>s.name===Ot.name);_e||process.once("exit",Ot);0&&(module.exports={ActionBase,Config,ExitError,Table,action,annotation,anykey,colorize,config,confirm,debug,done,error,exit,flush,info,log,logToStderr,progress,prompt,styledHeader,styledJSON,styledObject,table,trace,tree,url,ux,wait,warn,write});
19
+ `)}static get tree(){return M}static url(e,t,r={}){this.log(this.hyperlink(e,t,r))}static hyperlink(e,t,r={}){return require("supports-hyperlinks").stdout?te(e,t,r):t}static get wait(){return _t}};c(O,"config",y);var{action:ee,annotation:re,anykey:se,confirm:ne,debug:ie,done:oe,flush:ae,hyperlink:ce,info:ue,log:le,logToStderr:de,progress:pe,prompt:fe,styledHeader:me,styledJSON:ge,styledObject:he,table:ye,trace:ve,tree:be,url:xe,wait:we}=O,{error:ke,exit:Te,warn:_e}=St.Errors;var Ot=async()=>{try{await O.done()}catch(s){console.error(s),process.exitCode=1}},Ce=process.listeners("exit").find(s=>s.name===Ot.name);Ce||process.once("exit",Ot);0&&(module.exports={ActionBase,Config,ExitError,Table,action,annotation,anykey,colorize,config,confirm,debug,done,error,exit,flush,hyperlink,info,log,logToStderr,progress,prompt,styledHeader,styledJSON,styledObject,table,trace,tree,url,ux,wait,warn,write});
package/lib/index.mjs CHANGED
@@ -16,4 +16,4 @@ var U=Object.defineProperty;var ht=(s,e,t)=>e in s?U(s,e,{enumerable:!0,configur
16
16
  `)}static log(e,...t){this.info(e||"",...t)}static logToStderr(e,...t){C.stderr(M(e,...t)+`
17
17
  `)}static get progress(){return R}static get prompt(){return Y}static styledHeader(e){this.info(z.dim("=== ")+z.bold(e)+`
18
18
  `)}static styledJSON(e){let t=JSON.stringify(e,null,2);if(!z.level){this.info(t);return}let r=y("cardinal"),n=y("cardinal/themes/jq");this.info(r.highlight(t,{json:!0,theme:n}))}static styledObject(e,t){this.info(F(e,t))}static get table(){return B.table}static trace(e,...t){this.config.outputLevel==="trace"&&this.info(M(e,...t)+`
19
- `)}static get tree(){return j}static url(e,t,r={}){y("supports-hyperlinks").stdout?this.log(zt(e,t,r)):this.log(t)}static get wait(){return dt}};c(I,"config",b);var{action:Tr,annotation:_r,anykey:Cr,confirm:Sr,debug:Or,done:Pr,flush:Br,info:Ir,log:Ar,logToStderr:Er,progress:Lr,prompt:Fr,styledHeader:Rr,styledJSON:qr,styledObject:jr,table:Mr,trace:Wr,tree:$r,url:Nr,wait:Hr}=I,{error:Kr,exit:Yr,warn:Dr}=Vt;var ft=async()=>{try{await I.done()}catch(s){console.error(s),process.exitCode=1}},Ut=process.listeners("exit").find(s=>s.name===ft.name);Ut||process.once("exit",ft);export{k as ActionBase,L as Config,V as ExitError,B as Table,Tr as action,_r as annotation,Cr as anykey,Jt as colorize,b as config,Sr as confirm,Or as debug,Pr as done,Kr as error,Yr as exit,Br as flush,Ir as info,Ar as log,Er as logToStderr,Lr as progress,Fr as prompt,Rr as styledHeader,qr as styledJSON,jr as styledObject,Mr as table,Wr as trace,$r as tree,Nr as url,I as ux,Hr as wait,Dr as warn,C as write};
19
+ `)}static get tree(){return j}static url(e,t,r={}){this.log(this.hyperlink(e,t,r))}static hyperlink(e,t,r={}){return y("supports-hyperlinks").stdout?zt(e,t,r):t}static get wait(){return dt}};c(I,"config",b);var{action:Tr,annotation:_r,anykey:Cr,confirm:Sr,debug:Or,done:Pr,flush:Br,hyperlink:Ir,info:Ar,log:Er,logToStderr:Lr,progress:Fr,prompt:Rr,styledHeader:qr,styledJSON:jr,styledObject:Mr,table:Wr,trace:$r,tree:Nr,url:Hr,wait:Kr}=I,{error:Yr,exit:Dr,warn:Jr}=Vt;var ft=async()=>{try{await I.done()}catch(s){console.error(s),process.exitCode=1}},Ut=process.listeners("exit").find(s=>s.name===ft.name);Ut||process.once("exit",ft);export{k as ActionBase,L as Config,V as ExitError,B as Table,Tr as action,_r as annotation,Cr as anykey,Jt as colorize,b as config,Sr as confirm,Or as debug,Pr as done,Yr as error,Dr as exit,Br as flush,Ir as hyperlink,Ar as info,Er as log,Lr as logToStderr,Fr as progress,Rr as prompt,qr as styledHeader,jr as styledJSON,Mr as styledObject,Wr as table,$r as trace,Nr as tree,Hr as url,I as ux,Kr as wait,Jr as warn,C as write};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commercelayer/cli-ux",
3
- "version": "1.0.14",
3
+ "version": "1.1.0",
4
4
  "author": "Pierluigi Viti <pierluigi@commercelayer.io>",
5
5
  "license": "MIT",
6
6
  "description": "Commerce Layer Javascript CLI ux lib",
@@ -40,7 +40,7 @@
40
40
  "@semantic-release/changelog": "^6.0.3",
41
41
  "@semantic-release/git": "^10.0.1",
42
42
  "@types/cli-progress": "^3.11.6",
43
- "@types/color": "^3.0.6",
43
+ "@types/color": "^3.0.7",
44
44
  "@types/jest": "^29.5.14",
45
45
  "@types/js-yaml": "^3.12.10",
46
46
  "@types/node": "^22.19.15",