yezz-cli 0.0.5 → 0.0.6

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.
@@ -1 +1 @@
1
- {"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/command/update.ts"],"names":[],"mappings":"AAcA,wBAA8B,MAAM,kBAWnC"}
1
+ {"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/command/update.ts"],"names":[],"mappings":"AAcA,wBAA8B,MAAM,kBAsBnC"}
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{Command as t}from"commander";import{input as e,select as i}from"@inquirer/prompts";import r from"axios";import s from"chalk";import n from"fs-extra";import o from"lodash";import a from"node:path";import l from"progress-estimator";import f from"simple-git";import h from"node:child_process";import c from"node:process";import{stripVTControlCharacters as u}from"node:util";var m="0.0.4";const d=t=>String(t??""),_={info(t){console.log(s.cyan(d(t)))},success(t){console.log(s.green(`√ ${d(t)}`))},warn(t){console.log(s.yellow(`! ${d(t)}`))},error(t){console.error(s.red(`× ${d(t)}`))}},p=l({spinner:{interval:300,frames:["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"].map(t=>s.blue(t))}}),g={baseDir:process.cwd(),binary:"git",maxConcurrentProcesses:6},v=new Map([["Vite4-Vue3-Typescript-template",{name:"admin-template",downloadUrl:"git@gitee.com:sohucw/admin-pro.git",description:"Vue3技术栈开发模板",branch:"dev11"}],["Vite-temp",{name:"admin-template",downloadUrl:"git@gitee.com:sohucw/admin-pro.git",description:"Vue3技术栈开发模板",branch:"dev10"}]]),x=async t=>{const{data:e}=await(async t=>{const e="https://registry.npmjs.org/"+t;let i={};try{i=await r.get(e)}catch(t){_.error(t)}return i})(t);return e["dist-tags"].latest};async function y(t){const r=[...v.entries()].map(t=>{const[e,i]=t;return{name:e,value:e,description:i.description}});t||(t=await e({message:"请输入项目名称"}));const l=a.resolve(process.cwd(),t);if(n.existsSync(l)){if(!await(async t=>(_.warn(`${t} 文件已存在 !`),i({message:"是否覆盖原文件: ",choices:[{name:"覆盖",value:!0},{name:"取消",value:!1}]})))(t))return;await n.remove(l)}const h=await i({message:"请选择模板",choices:r});await(async(t,e)=>{const i=await x(t),r=o.gt(i,e);return r?(_.info(`检测到 yezz 最新版:${s.blueBright(i)} 当前版本:${s.blueBright(e)} ~`),_.info(`可使用 ${s.yellow("pnpm")} install yezz-cli@latest 更新 ~`)):_.info(`当前已是最新版本 ${s.blueBright(e)} ~`),r})("yezz-cli",m);const c=v.get(h);c?await(async(t,e,i)=>{const r=f(g);try{await p(r.clone(t,e,i),"代码下载中: ",{estimate:8e3}),console.log(),console.log(s.blueBright("==================================")),console.log(s.blueBright("=== 欢迎使用 yezz-cli 脚手架 ===")),console.log(s.blueBright("==================================")),console.log(),_.success(`项目创建成功 ${s.blueBright(e)}`),_.success("执行以下命令启动项目:"),_.info(`cd ${s.blueBright(e)}`),_.info(`${s.yellow("pnpm")} install`),_.info(`${s.yellow("pnpm")} run dev`)}catch(t){_.error("下载失败"),_.error(String(t))}})(c.downloadUrl,t,["-b",`${c.branch}`]):_.error(`${h} 模板不存在`)}const b=(t,e,i,r)=>{if("length"===i||"prototype"===i)return;if("arguments"===i||"caller"===i)return;const s=Object.getOwnPropertyDescriptor(t,i),n=Object.getOwnPropertyDescriptor(e,i);!w(s,n)&&r||Object.defineProperty(t,i,n)},w=function(t,e){return void 0===t||t.configurable||t.writable===e.writable&&t.enumerable===e.enumerable&&t.configurable===e.configurable&&(t.writable||t.value===e.value)},T=(t,e)=>`/* Wrapped ${t}*/\n${e}`,S=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),E=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name");function I(t,e,{ignoreNonConfigurable:i=!1}={}){const{name:r}=t;for(const r of Reflect.ownKeys(e))b(t,e,r,i);return((t,e)=>{const i=Object.getPrototypeOf(e);i!==Object.getPrototypeOf(t)&&Object.setPrototypeOf(t,i)})(t,e),((t,e,i)=>{const r=""===i?"":`with ${i.trim()}() `,s=T.bind(null,r,e.toString());Object.defineProperty(s,"name",E);const{writable:n,enumerable:o,configurable:a}=S;Object.defineProperty(t,"toString",{value:s,writable:n,enumerable:o,configurable:a})})(t,e,r),t}const P=new WeakMap,R=(t,e={})=>{if("function"!=typeof t)throw new TypeError("Expected a function");let i,r=0;const s=t.displayName||t.name||"<anonymous>",n=function(...o){if(P.set(n,++r),1===r)i=t.apply(this,o),t=void 0;else if(!0===e.throw)throw new Error(`Function \`${s}\` can only be called once`);return i};return I(n,t),P.set(n,r),n};R.callCount=t=>{if(!P.has(t))throw new Error(`The given function \`${t.name}\` is not wrapped by the \`onetime\` package`);return P.get(t)};const C=[];C.push("SIGHUP","SIGINT","SIGTERM"),"win32"!==process.platform&&C.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),"linux"===process.platform&&C.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");const O=t=>!!t&&"object"==typeof t&&"function"==typeof t.removeListener&&"function"==typeof t.emit&&"function"==typeof t.reallyExit&&"function"==typeof t.listeners&&"function"==typeof t.kill&&"number"==typeof t.pid&&"function"==typeof t.on,B=Symbol.for("signal-exit emitter"),L=globalThis,k=Object.defineProperty.bind(Object);class W{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(L[B])return L[B];k(L,B,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(t,e){this.listeners[t].push(e)}removeListener(t,e){const i=this.listeners[t],r=i.indexOf(e);-1!==r&&(0===r&&1===i.length?i.length=0:i.splice(r,1))}emit(t,e,i){if(this.emitted[t])return!1;this.emitted[t]=!0;let r=!1;for(const s of this.listeners[t])r=!0===s(e,i)||r;return"exit"===t&&(r=this.emit("afterExit",e,i)||r),r}}class A{}const M=globalThis.process,{onExit:$}=(j=O(M)?new class extends A{#t="win32"===M.platform?"SIGINT":"SIGHUP";#e=new W;#i;#r;#s;#n={};#o=!1;constructor(t){super(),this.#i=t,this.#n={};for(const e of C)this.#n[e]=()=>{const i=this.#i.listeners(e);let{count:r}=this.#e;const s=t;if("object"==typeof s.__signal_exit_emitter__&&"number"==typeof s.__signal_exit_emitter__.count&&(r+=s.__signal_exit_emitter__.count),i.length===r){this.unload();const i=this.#e.emit("exit",null,e),r="SIGHUP"===e?this.#t:e;i||t.kill(t.pid,r)}};this.#s=t.reallyExit,this.#r=t.emit}onExit(t,e){if(!O(this.#i))return()=>{};!1===this.#o&&this.load();const i=e?.alwaysLast?"afterExit":"exit";return this.#e.on(i,t),()=>{this.#e.removeListener(i,t),0===this.#e.listeners.exit.length&&0===this.#e.listeners.afterExit.length&&this.unload()}}load(){if(!this.#o){this.#o=!0,this.#e.count+=1;for(const t of C)try{const e=this.#n[t];e&&this.#i.on(t,e)}catch(t){}this.#i.emit=(t,...e)=>this.#a(t,...e),this.#i.reallyExit=t=>this.#l(t)}}unload(){this.#o&&(this.#o=!1,C.forEach(t=>{const e=this.#n[t];if(!e)throw new Error("Listener not defined for signal: "+t);try{this.#i.removeListener(t,e)}catch(t){}}),this.#i.emit=this.#r,this.#i.reallyExit=this.#s,this.#e.count-=1)}#l(t){return O(this.#i)?(this.#i.exitCode=t||0,this.#e.emit("exit",this.#i.exitCode,null),this.#s.call(this.#i,this.#i.exitCode)):0}#a(t,...e){const i=this.#r;if("exit"===t&&O(this.#i)){"number"==typeof e[0]&&(this.#i.exitCode=e[0]);const r=i.call(this.#i,t,...e);return this.#e.emit("exit",this.#i.exitCode,null),r}return i.call(this.#i,t,...e)}}(M):new class extends A{onExit(){return()=>{}}load(){}unload(){}},{onExit:(t,e)=>j.onExit(t,e),load:()=>j.load(),unload:()=>j.unload()});var j;const F=c.stderr.isTTY?c.stderr:c.stdout.isTTY?c.stdout:void 0,G=F?R(()=>{$(()=>{F.write("[?25h")},{alwaysLast:!0})}):()=>{};let D=!1;const H={show:(t=c.stderr)=>{t.isTTY&&(D=!1,t.write("[?25h"))},hide:(t=c.stderr)=>{t.isTTY&&(G(),D=!0,t.write("[?25l"))},toggle:(t,e)=>{void 0!==t&&(D=t),D?H.show(e):H.hide(e)}};var z={dots:{interval:80,frames:["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"]},dots2:{interval:80,frames:["⣾","⣽","⣻","⢿","⡿","⣟","⣯","⣷"]},dots3:{interval:80,frames:["⠋","⠙","⠚","⠞","⠖","⠦","⠴","⠲","⠳","⠓"]},dots4:{interval:80,frames:["⠄","⠆","⠇","⠋","⠙","⠸","⠰","⠠","⠰","⠸","⠙","⠋","⠇","⠆"]},dots5:{interval:80,frames:["⠋","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋"]},dots6:{interval:80,frames:["⠁","⠉","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠤","⠄","⠄","⠤","⠴","⠲","⠒","⠂","⠂","⠒","⠚","⠙","⠉","⠁"]},dots7:{interval:80,frames:["⠈","⠉","⠋","⠓","⠒","⠐","⠐","⠒","⠖","⠦","⠤","⠠","⠠","⠤","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋","⠉","⠈"]},dots8:{interval:80,frames:["⠁","⠁","⠉","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠤","⠄","⠄","⠤","⠠","⠠","⠤","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋","⠉","⠈","⠈"]},dots9:{interval:80,frames:["⢹","⢺","⢼","⣸","⣇","⡧","⡗","⡏"]},dots10:{interval:80,frames:["⢄","⢂","⢁","⡁","⡈","⡐","⡠"]},dots11:{interval:100,frames:["⠁","⠂","⠄","⡀","⢀","⠠","⠐","⠈"]},dots12:{interval:80,frames:["⢀⠀","⡀⠀","⠄⠀","⢂⠀","⡂⠀","⠅⠀","⢃⠀","⡃⠀","⠍⠀","⢋⠀","⡋⠀","⠍⠁","⢋⠁","⡋⠁","⠍⠉","⠋⠉","⠋⠉","⠉⠙","⠉⠙","⠉⠩","⠈⢙","⠈⡙","⢈⠩","⡀⢙","⠄⡙","⢂⠩","⡂⢘","⠅⡘","⢃⠨","⡃⢐","⠍⡐","⢋⠠","⡋⢀","⠍⡁","⢋⠁","⡋⠁","⠍⠉","⠋⠉","⠋⠉","⠉⠙","⠉⠙","⠉⠩","⠈⢙","⠈⡙","⠈⠩","⠀⢙","⠀⡙","⠀⠩","⠀⢘","⠀⡘","⠀⠨","⠀⢐","⠀⡐","⠀⠠","⠀⢀","⠀⡀"]},dots13:{interval:80,frames:["⣼","⣹","⢻","⠿","⡟","⣏","⣧","⣶"]},dots14:{interval:80,frames:["⠉⠉","⠈⠙","⠀⠹","⠀⢸","⠀⣰","⢀⣠","⣀⣀","⣄⡀","⣆⠀","⡇⠀","⠏⠀","⠋⠁"]},dots8Bit:{interval:80,frames:["⠀","⠁","⠂","⠃","⠄","⠅","⠆","⠇","⡀","⡁","⡂","⡃","⡄","⡅","⡆","⡇","⠈","⠉","⠊","⠋","⠌","⠍","⠎","⠏","⡈","⡉","⡊","⡋","⡌","⡍","⡎","⡏","⠐","⠑","⠒","⠓","⠔","⠕","⠖","⠗","⡐","⡑","⡒","⡓","⡔","⡕","⡖","⡗","⠘","⠙","⠚","⠛","⠜","⠝","⠞","⠟","⡘","⡙","⡚","⡛","⡜","⡝","⡞","⡟","⠠","⠡","⠢","⠣","⠤","⠥","⠦","⠧","⡠","⡡","⡢","⡣","⡤","⡥","⡦","⡧","⠨","⠩","⠪","⠫","⠬","⠭","⠮","⠯","⡨","⡩","⡪","⡫","⡬","⡭","⡮","⡯","⠰","⠱","⠲","⠳","⠴","⠵","⠶","⠷","⡰","⡱","⡲","⡳","⡴","⡵","⡶","⡷","⠸","⠹","⠺","⠻","⠼","⠽","⠾","⠿","⡸","⡹","⡺","⡻","⡼","⡽","⡾","⡿","⢀","⢁","⢂","⢃","⢄","⢅","⢆","⢇","⣀","⣁","⣂","⣃","⣄","⣅","⣆","⣇","⢈","⢉","⢊","⢋","⢌","⢍","⢎","⢏","⣈","⣉","⣊","⣋","⣌","⣍","⣎","⣏","⢐","⢑","⢒","⢓","⢔","⢕","⢖","⢗","⣐","⣑","⣒","⣓","⣔","⣕","⣖","⣗","⢘","⢙","⢚","⢛","⢜","⢝","⢞","⢟","⣘","⣙","⣚","⣛","⣜","⣝","⣞","⣟","⢠","⢡","⢢","⢣","⢤","⢥","⢦","⢧","⣠","⣡","⣢","⣣","⣤","⣥","⣦","⣧","⢨","⢩","⢪","⢫","⢬","⢭","⢮","⢯","⣨","⣩","⣪","⣫","⣬","⣭","⣮","⣯","⢰","⢱","⢲","⢳","⢴","⢵","⢶","⢷","⣰","⣱","⣲","⣳","⣴","⣵","⣶","⣷","⢸","⢹","⢺","⢻","⢼","⢽","⢾","⢿","⣸","⣹","⣺","⣻","⣼","⣽","⣾","⣿"]},dotsCircle:{interval:80,frames:["⢎ ","⠎⠁","⠊⠑","⠈⠱"," ⡱","⢀⡰","⢄⡠","⢆⡀"]},sand:{interval:80,frames:["⠁","⠂","⠄","⡀","⡈","⡐","⡠","⣀","⣁","⣂","⣄","⣌","⣔","⣤","⣥","⣦","⣮","⣶","⣷","⣿","⡿","⠿","⢟","⠟","⡛","⠛","⠫","⢋","⠋","⠍","⡉","⠉","⠑","⠡","⢁"]},line:{interval:130,frames:["-","\\","|","/"]},line2:{interval:100,frames:["⠂","-","–","—","–","-"]},rollingLine:{interval:80,frames:["/ "," - "," \\ "," |"," |"," \\ "," - ","/ "]},pipe:{interval:100,frames:["┤","┘","┴","└","├","┌","┬","┐"]},simpleDots:{interval:400,frames:[". ",".. ","..."," "]},simpleDotsScrolling:{interval:200,frames:[". ",".. ","..."," .."," ."," "]},star:{interval:70,frames:["✶","✸","✹","✺","✹","✷"]},star2:{interval:80,frames:["+","x","*"]},flip:{interval:70,frames:["_","_","_","-","`","`","'","´","-","_","_","_"]},hamburger:{interval:100,frames:["☱","☲","☴"]},growVertical:{interval:120,frames:["▁","▃","▄","▅","▆","▇","▆","▅","▄","▃"]},growHorizontal:{interval:120,frames:["▏","▎","▍","▌","▋","▊","▉","▊","▋","▌","▍","▎"]},balloon:{interval:140,frames:[" ",".","o","O","@","*"," "]},balloon2:{interval:120,frames:[".","o","O","°","O","o","."]},noise:{interval:100,frames:["▓","▒","░"]},bounce:{interval:120,frames:["⠁","⠂","⠄","⠂"]},boxBounce:{interval:120,frames:["▖","▘","▝","▗"]},boxBounce2:{interval:100,frames:["▌","▀","▐","▄"]},triangle:{interval:50,frames:["◢","◣","◤","◥"]},binary:{interval:80,frames:["010010","001100","100101","111010","111101","010111","101011","111000","110011","110101"]},arc:{interval:100,frames:["◜","◠","◝","◞","◡","◟"]},circle:{interval:120,frames:["◡","⊙","◠"]},squareCorners:{interval:180,frames:["◰","◳","◲","◱"]},circleQuarters:{interval:120,frames:["◴","◷","◶","◵"]},circleHalves:{interval:50,frames:["◐","◓","◑","◒"]},squish:{interval:100,frames:["╫","╪"]},toggle:{interval:250,frames:["⊶","⊷"]},toggle2:{interval:80,frames:["▫","▪"]},toggle3:{interval:120,frames:["□","■"]},toggle4:{interval:100,frames:["■","□","▪","▫"]},toggle5:{interval:100,frames:["▮","▯"]},toggle6:{interval:300,frames:["ဝ","၀"]},toggle7:{interval:80,frames:["⦾","⦿"]},toggle8:{interval:100,frames:["◍","◌"]},toggle9:{interval:100,frames:["◉","◎"]},toggle10:{interval:100,frames:["㊂","㊀","㊁"]},toggle11:{interval:50,frames:["⧇","⧆"]},toggle12:{interval:120,frames:["☗","☖"]},toggle13:{interval:80,frames:["=","*","-"]},arrow:{interval:100,frames:["←","↖","↑","↗","→","↘","↓","↙"]},arrow2:{interval:80,frames:["⬆️ ","↗️ ","➡️ ","↘️ ","⬇️ ","↙️ ","⬅️ ","↖️ "]},arrow3:{interval:120,frames:["▹▹▹▹▹","▸▹▹▹▹","▹▸▹▹▹","▹▹▸▹▹","▹▹▹▸▹","▹▹▹▹▸"]},bouncingBar:{interval:80,frames:["[ ]","[= ]","[== ]","[=== ]","[====]","[ ===]","[ ==]","[ =]","[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"]},bouncingBall:{interval:80,frames:["( ● )","( ● )","( ● )","( ● )","( ●)","( ● )","( ● )","( ● )","( ● )","(● )"]},smiley:{interval:200,frames:["😄 ","😝 "]},monkey:{interval:300,frames:["🙈 ","🙈 ","🙉 ","🙊 "]},hearts:{interval:100,frames:["💛 ","💙 ","💜 ","💚 ","💗 "]},clock:{interval:100,frames:["🕛 ","🕐 ","🕑 ","🕒 ","🕓 ","🕔 ","🕕 ","🕖 ","🕗 ","🕘 ","🕙 ","🕚 "]},earth:{interval:180,frames:["🌍 ","🌎 ","🌏 "]},material:{interval:17,frames:["█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","███▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","████▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁","███████▁▁▁▁▁▁▁▁▁▁▁▁▁","████████▁▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","██████████▁▁▁▁▁▁▁▁▁▁","███████████▁▁▁▁▁▁▁▁▁","█████████████▁▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁▁██████████████▁▁▁▁","▁▁▁██████████████▁▁▁","▁▁▁▁█████████████▁▁▁","▁▁▁▁██████████████▁▁","▁▁▁▁██████████████▁▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁▁██████████████","▁▁▁▁▁▁██████████████","▁▁▁▁▁▁▁█████████████","▁▁▁▁▁▁▁█████████████","▁▁▁▁▁▁▁▁████████████","▁▁▁▁▁▁▁▁████████████","▁▁▁▁▁▁▁▁▁███████████","▁▁▁▁▁▁▁▁▁███████████","▁▁▁▁▁▁▁▁▁▁██████████","▁▁▁▁▁▁▁▁▁▁██████████","▁▁▁▁▁▁▁▁▁▁▁▁████████","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁██████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","███▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","████▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","██████▁▁▁▁▁▁▁▁▁▁▁▁▁█","████████▁▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","███████████▁▁▁▁▁▁▁▁▁","████████████▁▁▁▁▁▁▁▁","████████████▁▁▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁▁▁█████████████▁▁▁▁","▁▁▁▁▁████████████▁▁▁","▁▁▁▁▁████████████▁▁▁","▁▁▁▁▁▁███████████▁▁▁","▁▁▁▁▁▁▁▁█████████▁▁▁","▁▁▁▁▁▁▁▁█████████▁▁▁","▁▁▁▁▁▁▁▁▁█████████▁▁","▁▁▁▁▁▁▁▁▁█████████▁▁","▁▁▁▁▁▁▁▁▁▁█████████▁","▁▁▁▁▁▁▁▁▁▁▁████████▁","▁▁▁▁▁▁▁▁▁▁▁████████▁","▁▁▁▁▁▁▁▁▁▁▁▁███████▁","▁▁▁▁▁▁▁▁▁▁▁▁███████▁","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁"]},moon:{interval:80,frames:["🌑 ","🌒 ","🌓 ","🌔 ","🌕 ","🌖 ","🌗 ","🌘 "]},runner:{interval:140,frames:["🚶 ","🏃 "]},pong:{interval:80,frames:["▐⠂ ▌","▐⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂▌","▐ ⠠▌","▐ ⡀▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐⠠ ▌"]},shark:{interval:120,frames:["▐|\\____________▌","▐_|\\___________▌","▐__|\\__________▌","▐___|\\_________▌","▐____|\\________▌","▐_____|\\_______▌","▐______|\\______▌","▐_______|\\_____▌","▐________|\\____▌","▐_________|\\___▌","▐__________|\\__▌","▐___________|\\_▌","▐____________|\\▌","▐____________/|▌","▐___________/|_▌","▐__________/|__▌","▐_________/|___▌","▐________/|____▌","▐_______/|_____▌","▐______/|______▌","▐_____/|_______▌","▐____/|________▌","▐___/|_________▌","▐__/|__________▌","▐_/|___________▌","▐/|____________▌"]},dqpb:{interval:100,frames:["d","q","p","b"]},weather:{interval:100,frames:["☀️ ","☀️ ","☀️ ","🌤 ","⛅️ ","🌥 ","☁️ ","🌧 ","🌨 ","🌧 ","🌨 ","🌧 ","🌨 ","⛈ ","🌨 ","🌧 ","🌨 ","☁️ ","🌥 ","⛅️ ","🌤 ","☀️ ","☀️ "]},christmas:{interval:400,frames:["🌲","🎄"]},grenade:{interval:80,frames:["، ","′ "," ´ "," ‾ "," ⸌"," ⸊"," |"," ⁎"," ⁕"," ෴ "," ⁓"," "," "," "]},point:{interval:125,frames:["∙∙∙","●∙∙","∙●∙","∙∙●","∙∙∙"]},layer:{interval:150,frames:["-","=","≡"]},betaWave:{interval:80,frames:["ρββββββ","βρβββββ","ββρββββ","βββρβββ","ββββρββ","βββββρβ","ββββββρ"]},fingerDance:{interval:160,frames:["🤘 ","🤟 ","🖖 ","✋ ","🤚 ","👆 "]},fistBump:{interval:80,frames:["🤜    🤛 ","🤜    🤛 ","🤜    🤛 "," 🤜  🤛  ","  🤜🤛   "," 🤜✨🤛   ","🤜 ✨ 🤛  "]},soccerHeader:{interval:80,frames:[" 🧑⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 "]},mindblown:{interval:160,frames:["😐 ","😐 ","😮 ","😮 ","😦 ","😦 ","😧 ","😧 ","🤯 ","💥 ","✨ ","  ","  ","  "]},speaker:{interval:160,frames:["🔈 ","🔉 ","🔊 ","🔉 "]},orangePulse:{interval:100,frames:["🔸 ","🔶 ","🟠 ","🟠 ","🔶 "]},bluePulse:{interval:100,frames:["🔹 ","🔷 ","🔵 ","🔵 ","🔷 "]},orangeBluePulse:{interval:100,frames:["🔸 ","🔶 ","🟠 ","🟠 ","🔶 ","🔹 ","🔷 ","🔵 ","🔵 ","🔷 "]},timeTravel:{interval:100,frames:["🕛 ","🕚 ","🕙 ","🕘 ","🕗 ","🕖 ","🕕 ","🕔 ","🕓 ","🕒 ","🕑 ","🕐 "]},aesthetic:{interval:80,frames:["▰▱▱▱▱▱▱","▰▰▱▱▱▱▱","▰▰▰▱▱▱▱","▰▰▰▰▱▱▱","▰▰▰▰▰▱▱","▰▰▰▰▰▰▱","▰▰▰▰▰▰▰","▰▱▱▱▱▱▱"]},dwarfFortress:{interval:80,frames:[" ██████£££ ","☺██████£££ ","☺██████£££ ","☺▓█████£££ ","☺▓█████£££ ","☺▒█████£££ ","☺▒█████£££ ","☺░█████£££ ","☺░█████£££ ","☺ █████£££ "," ☺█████£££ "," ☺█████£££ "," ☺▓████£££ "," ☺▓████£££ "," ☺▒████£££ "," ☺▒████£££ "," ☺░████£££ "," ☺░████£££ "," ☺ ████£££ "," ☺████£££ "," ☺████£££ "," ☺▓███£££ "," ☺▓███£££ "," ☺▒███£££ "," ☺▒███£££ "," ☺░███£££ "," ☺░███£££ "," ☺ ███£££ "," ☺███£££ "," ☺███£££ "," ☺▓██£££ "," ☺▓██£££ "," ☺▒██£££ "," ☺▒██£££ "," ☺░██£££ "," ☺░██£££ "," ☺ ██£££ "," ☺██£££ "," ☺██£££ "," ☺▓█£££ "," ☺▓█£££ "," ☺▒█£££ "," ☺▒█£££ "," ☺░█£££ "," ☺░█£££ "," ☺ █£££ "," ☺█£££ "," ☺█£££ "," ☺▓£££ "," ☺▓£££ "," ☺▒£££ "," ☺▒£££ "," ☺░£££ "," ☺░£££ "," ☺ £££ "," ☺£££ "," ☺£££ "," ☺▓££ "," ☺▓££ "," ☺▒££ "," ☺▒££ "," ☺░££ "," ☺░££ "," ☺ ££ "," ☺££ "," ☺££ "," ☺▓£ "," ☺▓£ "," ☺▒£ "," ☺▒£ "," ☺░£ "," ☺░£ "," ☺ £ "," ☺£ "," ☺£ "," ☺▓ "," ☺▓ "," ☺▒ "," ☺▒ "," ☺░ "," ☺░ "," ☺ "," ☺ &"," ☺ ☼&"," ☺ ☼ &"," ☺☼ &"," ☺☼ & "," ‼ & "," ☺ & "," ‼ & "," ☺ & "," ‼ & "," ☺ & ","‼ & "," & "," & "," & ░ "," & ▒ "," & ▓ "," & £ "," & ░£ "," & ▒£ "," & ▓£ "," & ££ "," & ░££ "," & ▒££ ","& ▓££ ","& £££ "," ░£££ "," ▒£££ "," ▓£££ "," █£££ "," ░█£££ "," ▒█£££ "," ▓█£££ "," ██£££ "," ░██£££ "," ▒██£££ "," ▓██£££ "," ███£££ "," ░███£££ "," ▒███£££ "," ▓███£££ "," ████£££ "," ░████£££ "," ▒████£££ "," ▓████£££ "," █████£££ "," ░█████£££ "," ▒█████£££ "," ▓█████£££ "," ██████£££ "," ██████£££ "]},fish:{interval:80,frames:["~~~~~~~~~~~~~~~~~~~~","> ~~~~~~~~~~~~~~~~~~","º> ~~~~~~~~~~~~~~~~~","(º> ~~~~~~~~~~~~~~~~","((º> ~~~~~~~~~~~~~~~","<((º> ~~~~~~~~~~~~~~","><((º> ~~~~~~~~~~~~~"," ><((º> ~~~~~~~~~~~~","~ ><((º> ~~~~~~~~~~~","~~ <>((º> ~~~~~~~~~~","~~~ ><((º> ~~~~~~~~~","~~~~ <>((º> ~~~~~~~~","~~~~~ ><((º> ~~~~~~~","~~~~~~ <>((º> ~~~~~~","~~~~~~~ ><((º> ~~~~~","~~~~~~~~ <>((º> ~~~~","~~~~~~~~~ ><((º> ~~~","~~~~~~~~~~ <>((º> ~~","~~~~~~~~~~~ ><((º> ~","~~~~~~~~~~~~ <>((º> ","~~~~~~~~~~~~~ ><((º>","~~~~~~~~~~~~~~ <>((º","~~~~~~~~~~~~~~~ ><((","~~~~~~~~~~~~~~~~ <>(","~~~~~~~~~~~~~~~~~ ><","~~~~~~~~~~~~~~~~~~ <","~~~~~~~~~~~~~~~~~~~~"]}};const N=function({onlyFirst:t=!1}={}){return new RegExp("(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]",t?void 0:"g")}();const U=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],Y=[12288,12288,65281,65376,65504,65510],V=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141],q=(t,e)=>{let i=0,r=Math.floor(t.length/2)-1;for(;i<=r;){const s=Math.floor((i+r)/2),n=2*s;if(e<t[n])r=s-1;else{if(!(e>t[n+1]))return!0;i=s+1}}return!1},[J,K]=Q(V);function Q(t){let e=t[0],i=t[1];for(let r=0;r<t.length;r+=2){const s=t[r],n=t[r+1];if(19968>=s&&19968<=n)return[s,n];n-s>i-e&&(e=s,i=n)}return[e,i]}function X(t,{ambiguousAsWide:e=!1}={}){return function(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}(t),(t=>!(t<12288||t>65510)&&q(Y,t))(t)||(t=>t>=J&&t<=K||!(t<4352||t>262141)&&q(V,t))(t)||e&&(t=>!(t<161||t>1114109)&&q(U,t))(t)?2:1}const Z=new Intl.Segmenter,tt=/^(?:\p{Default_Ignorable_Code_Point}|\p{Control}|\p{Format}|\p{Mark}|\p{Surrogate})+$/v,et=/^[\p{Default_Ignorable_Code_Point}\p{Control}\p{Format}\p{Mark}\p{Surrogate}]+/v,it=/^\p{RGI_Emoji}$/v,rt=/^[\d#*]\u20E3$/,st=/\p{Extended_Pictographic}/gu;function nt(t){if(t.length>50)return!1;if(rt.test(t))return!0;if(t.includes("‍")){const e=t.match(st);return null!==e&&e.length>=2}return!1}function ot(t){return t.replace(et,"")}function at(t){return tt.test(t)}function lt(t){return t>=4352&&t<=4447||t>=43360&&t<=43388}function ft(t){return t>=4448&&t<=4519||t>=55216&&t<=55238}function ht(t){return t>=4520&&t<=4607||t>=55243&&t<=55291}function ct(t){return lt(t)||ft(t)||ht(t)}function ut(t,e){const i=[];for(const e of t)tt.test(e)||i.push(e.codePointAt(0));if(0===i.length)return;let r=0;for(let t=0;t<i.length;t++){const s=i[t];if(!ct(s)){if(0===r)return;for(let s=t;s<i.length;s++)r+=X(i[s],e);return r}lt(s)&&ft(i[t+1])?(r+=2,t+=ht(i[t+2])?2:1):r+=X(s,e)}return r}function mt(t,e){let i=0,r=!0;for(const s of t)r?r=!1:s>="＀"&&s<="￯"&&(i+=X(s.codePointAt(0),e));return i}function dt(t,e={}){if("string"!=typeof t||0===t.length)return 0;const{ambiguousIsNarrow:i=!0,countAnsiEscapeCodes:r=!1}=e;let s=t;if(r||!s.includes("")&&!s.includes("›")||(s=function(t){if("string"!=typeof t)throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.includes("")||t.includes("›")?t.replace(N,""):t}(s)),0===s.length)return 0;if(/^[\u0020-\u007E]*$/.test(s))return s.length;let n=0;const o={ambiguousAsWide:!i};for(const{segment:t}of Z.segment(s)){if(at(t))continue;if(it.test(t)||nt(t)){n+=2;continue}const e=ot(t),i=ut(e,o);if(void 0!==i){n+=i;continue}n+=X(e.codePointAt(0),o),n+=mt(e,o)}return n}const _t=new class{#f=0;#h;#c=!1;#u=!1;#m=t=>{if(!t?.length)return;3===("string"==typeof t?t.codePointAt(0):t[0])&&c.kill(c.pid,"SIGINT")};start(){this.#f++,1===this.#f&&this.#d()}stop(){0!==this.#f&&0===--this.#f&&this.#_()}#d(){const{stdin:t}=c;"win32"!==c.platform&&t?.isTTY&&"function"==typeof t.setRawMode?(this.#h=t,this.#c=t.isPaused(),this.#u=Boolean(t.isRaw),t.setRawMode(!0),t.prependListener("data",this.#m),this.#c&&t.resume()):this.#h=void 0}#_(){if(!this.#h)return;const t=this.#h;t.off("data",this.#m),t.isTTY&&t.setRawMode?.(this.#u),this.#c&&t.pause(),this.#h=void 0,this.#c=!1,this.#u=!1}};var pt=Object.freeze(_t);const gt=new Map,vt=new Set(["black","red","green","yellow","blue","magenta","cyan","white","gray"]);class xt{#p=0;#g=-1;#v=0;#x;#y;#b;#w;#T=new Map;#S=!1;#E;#I;#P=!1;#R;#C(t){this.#S=!0;try{return t()}finally{this.#S=!1}}#O(){this.isSpinning&&this.render()}#B(t,e){if(null==t)return"";if("string"==typeof t)return t;if(Buffer.isBuffer(t)||ArrayBuffer.isView(t)){const i="string"==typeof e&&e&&"buffer"!==e?e:"utf8";return Buffer.from(t).toString(i)}return String(t)}#L(t){if(!t)return!1;const e=t.at(-1);return"\n"===e||"\r"===e}#k(){this.#I||(this.#I=setTimeout(()=>{this.#I=void 0,this.isSpinning&&this.#O()},200),"function"==typeof this.#I?.unref&&this.#I.unref())}#W(){this.#I&&(clearTimeout(this.#I),this.#I=void 0)}#A(t,e,i,r){return this.#M(i," ")+t+("string"==typeof e?(t?" ":"")+e:"")+this.#$(r," ")}constructor(t){if("string"==typeof t&&(t={text:t}),this.#x={color:"cyan",stream:c.stderr,discardStdin:!0,hideCursor:!0,...t},this.color=this.#x.color,this.#b=this.#x.stream,"boolean"!=typeof this.#x.isEnabled&&(this.#x.isEnabled=function({stream:t=process.stdout}={}){return Boolean(t&&t.isTTY&&"dumb"!==process.env.TERM&&!("CI"in process.env))}({stream:this.#b})),"boolean"!=typeof this.#x.isSilent&&(this.#x.isSilent=!1),void 0!==this.#x.interval&&!(Number.isInteger(this.#x.interval)&&this.#x.interval>0))throw new Error("The `interval` option must be a positive integer");const e=this.#x.interval;this.spinner=this.#x.spinner,this.#x.interval=e,this.text=this.#x.text,this.prefixText=this.#x.prefixText,this.suffixText=this.#x.suffixText,this.indent=this.#x.indent,"test"===c.env.NODE_ENV&&(this._stream=this.#b,this._isEnabled=this.#x.isEnabled,Object.defineProperty(this,"_linesToClear",{get(){return this.#p},set(t){this.#p=t}}),Object.defineProperty(this,"_frameIndex",{get(){return this.#g}}),Object.defineProperty(this,"_lineCount",{get(){const t=this.#b.columns??80,e="function"==typeof this.#x.prefixText?"":this.#x.prefixText,i="function"==typeof this.#x.suffixText?"":this.#x.suffixText,r="string"==typeof e&&""!==e?e+" ":"",s="string"==typeof i&&""!==i?" "+i:"",n=" ".repeat(this.#x.indent)+r+"-"+("string"==typeof this.#x.text?" "+this.#x.text:"")+s;return this.#j(n,t)}}))}get indent(){return this.#x.indent}set indent(t=0){if(!(t>=0&&Number.isInteger(t)))throw new Error("The `indent` option must be an integer from 0 and up");this.#x.indent=t}get interval(){return this.#x.interval??this.#y.interval??100}get spinner(){return this.#y}set spinner(t){if(this.#g=-1,this.#x.interval=void 0,"object"==typeof t){if(!Array.isArray(t.frames)||0===t.frames.length||t.frames.some(t=>"string"!=typeof t))throw new Error("The given spinner must have a non-empty `frames` array of strings");if(void 0!==t.interval&&!(Number.isInteger(t.interval)&&t.interval>0))throw new Error("`spinner.interval` must be a positive integer if provided");this.#y=t}else if(function(){const{env:t}=c,{TERM:e,TERM_PROGRAM:i}=t;return"win32"!==c.platform?"linux"!==e:Boolean(t.WT_SESSION)||Boolean(t.TERMINUS_SUBLIME)||"{cmd::Cmder}"===t.ConEmuTask||"Terminus-Sublime"===i||"vscode"===i||"xterm-256color"===e||"alacritty"===e||"rxvt-unicode"===e||"rxvt-unicode-256color"===e||"JetBrains-JediTerm"===t.TERMINAL_EMULATOR}())if(void 0===t)this.#y=z.dots;else{if("default"===t||!z[t])throw new Error(`There is no built-in spinner named '${t}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`);this.#y=z[t]}else this.#y=z.line}get text(){return this.#x.text}set text(t=""){this.#x.text=t}get prefixText(){return this.#x.prefixText}set prefixText(t=""){this.#x.prefixText=t}get suffixText(){return this.#x.suffixText}set suffixText(t=""){this.#x.suffixText=t}get isSpinning(){return void 0!==this.#w}#F(t,e,i=!1){const r="function"==typeof t?t():t;return"string"==typeof r&&""!==r?i?e+r:r+e:""}#M(t=this.#x.prefixText,e=" "){return this.#F(t,e,!1)}#$(t=this.#x.suffixText,e=" "){return this.#F(t,e,!0)}#j(t,e){let i=0;for(const r of u(t).split("\n"))i+=Math.max(1,Math.ceil(dt(r)/e));return i}get color(){return this.#R}set color(t){if(void 0!==t&&!1!==t&&!vt.has(t))throw new Error("The `color` option must be a valid color or `false` to disable");this.#R=t}get isEnabled(){return this.#x.isEnabled&&!this.#x.isSilent}set isEnabled(t){if("boolean"!=typeof t)throw new TypeError("The `isEnabled` option must be a boolean");this.#x.isEnabled=t}get isSilent(){return this.#x.isSilent}set isSilent(t){if("boolean"!=typeof t)throw new TypeError("The `isSilent` option must be a boolean");this.#x.isSilent=t}frame(){const t=Date.now();(-1===this.#g||t-this.#v>=this.interval)&&(this.#g=(this.#g+1)%this.#y.frames.length,this.#v=t);const{frames:e}=this.#y;let i=e[this.#g];this.#R&&(i=s[this.#R](i));return this.#M(this.#x.prefixText," ")+i+("string"==typeof this.text?" "+this.text:"")+this.#$(this.#x.suffixText," ")}clear(){return this.isEnabled&&this.#b.isTTY?(this.#C(()=>{this.#b.cursorTo(0);for(let t=0;t<this.#p;t++)t>0&&this.#b.moveCursor(0,-1),this.#b.clearLine(1);this.#x.indent&&this.#b.cursorTo(this.#x.indent)}),this.#p=0,this):this}#G(t){if(!t||this.#T.has(t)||!t.isTTY||"function"!=typeof t.write)return;gt.has(t)&&console.warn("[ora] Multiple concurrent spinners detected. This may cause visual corruption. Use one spinner at a time.");const e=t.write;this.#T.set(t,e),gt.set(t,this),t.write=(i,r,s)=>this.#D(t,e,i,r,s)}#H(){if(!this.isEnabled||this.#T.size>0)return;const t=new Set([this.#b,c.stdout,c.stderr]);for(const e of t)this.#G(e)}#z(){for(const[t,e]of this.#T)t.write=e,gt.get(t)===this&&gt.delete(t);this.#T.clear()}#D(t,e,i,r,s){if("function"==typeof r&&(s=r,r=void 0),this.#S)return e.call(t,i,r,s);this.clear();const n=this.#B(i,r),o=this.#L(n),a=e.call(t,i,r,s);return o?this.#W():n.length>0&&this.#k(),this.isSpinning&&!this.#I&&this.render(),a}render(){if(!this.isEnabled||this.#E||this.#I)return this;const t=this.#b.isTTY;let e=!1;try{t&&(this.#C(()=>this.#b.write("[?2026h")),e=!0),this.clear();let i=this.frame();const r=this.#b.columns??80,s=this.#j(i,r),n=this.#b.rows;if(n&&n>1&&s>n){const t=i.split("\n"),e=n-1;i=[...t.slice(0,e),"... (content truncated to fit terminal)"].join("\n")}!1===this.#C(()=>this.#b.write(i))&&this.#b.isTTY&&(this.#E=()=>{this.#E=void 0,this.#O()},this.#b.once("drain",this.#E)),this.#p=this.#j(i,r)}finally{e&&this.#C(()=>this.#b.write("[?2026l"))}return this}start(t){if(t&&(this.text=t),this.isSilent)return this;if(!this.isEnabled){const t=this.text?"-":"",e=" ".repeat(this.#x.indent)+this.#A(t,this.text,this.#x.prefixText,this.#x.suffixText);return""!==e.trim()&&this.#C(()=>this.#b.write(e+"\n")),this}return this.isSpinning||(this.#x.hideCursor&&H.hide(this.#b),this.#x.discardStdin&&c.stdin.isTTY&&(pt.start(),this.#P=!0),this.#H(),this.render(),this.#w=setInterval(this.render.bind(this),this.interval)),this}stop(){return clearInterval(this.#w),this.#w=void 0,this.#g=-1,this.#v=0,this.#W(),this.#z(),this.#E&&(this.#b.removeListener("drain",this.#E),this.#E=void 0),this.isEnabled&&(this.clear(),this.#x.hideCursor&&H.show(this.#b)),this.#P&&(this.#P=!1,pt.stop()),this}succeed(t){return this.stopAndPersist({symbol:"✅",text:t})}fail(t){return this.stopAndPersist({symbol:"❌️",text:t})}warn(t){return this.stopAndPersist({symbol:"⚠️",text:t})}info(t){return this.stopAndPersist({symbol:"ℹ️",text:t})}stopAndPersist(t={}){if(this.isSilent)return this;const e=t.symbol??" ",i=t.text??this.text,r=t.prefixText??this.#x.prefixText,s=t.suffixText??this.#x.suffixText,n=this.#A(e,i,r,s)+"\n";return this.stop(),this.#C(()=>this.#b.write(n)),this}}const yt=(bt={text:"yezz-cli 正在更新中...",spinner:{interval:300,frames:["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"].map(t=>s.blue(t))}},new xt(bt));var bt;const wt=new t("yezz");wt.version(m,"-v, --version"),wt.command("update").description("更新 dawei 至最新版本").action(async()=>{await async function(){yt.start(),h.exec("npm update yezz-cli -g",t=>{yt.stop(),t?(console.error(s.red("更新失败,请稍后重试")),yt.fail("更新失败,请稍后重试")):yt.succeed("更新成功!")})}()}),wt.command("create").description("create a new project").argument("[name]","项目名称").action(async t=>{await y(t)}),wt.parse();
2
+ import{Command as e}from"commander";import{input as o,select as r}from"@inquirer/prompts";import t from"axios";import n from"chalk";import a from"fs-extra";import i from"lodash";import s from"node:path";import c from"progress-estimator";import l from"simple-git";import{exec as m}from"node:child_process";import p from"ora";var g="0.0.5";const d=e=>String(e??""),u={info(e){console.log(n.cyan(d(e)))},success(e){console.log(n.green(`√ ${d(e)}`))},warn(e){console.log(n.yellow(`! ${d(e)}`))},error(e){console.error(n.red(`× ${d(e)}`))}},w=c({spinner:{interval:300,frames:["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"].map(e=>n.blue(e))}}),y={baseDir:process.cwd(),binary:"git",maxConcurrentProcesses:6},f=new Map([["Vite4-Vue3-Typescript-template",{name:"admin-template",downloadUrl:"git@gitee.com:sohucw/admin-pro.git",description:"Vue3技术栈开发模板",branch:"dev11"}],["Vite-temp",{name:"admin-template",downloadUrl:"git@gitee.com:sohucw/admin-pro.git",description:"Vue3技术栈开发模板",branch:"dev10"}]]),h=async e=>{const{data:o}=await(async e=>{const o="https://registry.npmjs.org/"+e;let r={};try{r=await t.get(o)}catch(e){u.error(e)}return r})(e);return o["dist-tags"].latest};async function b(e){const t=[...f.entries()].map(e=>{const[o,r]=e;return{name:o,value:o,description:r.description}});e||(e=await o({message:"请输入项目名称"}));const c=s.resolve(process.cwd(),e);if(a.existsSync(c)){if(!await(async e=>(u.warn(`${e} 文件已存在 !`),r({message:"是否覆盖原文件: ",choices:[{name:"覆盖",value:!0},{name:"取消",value:!1}]})))(e))return;await a.remove(c)}const m=await r({message:"请选择模板",choices:t});await(async(e,o)=>{const r=await h(e),t=i.gt(r,o);return t?(u.info(`检测到 yezz 最新版:${n.blueBright(r)} 当前版本:${n.blueBright(o)} ~`),u.info(`可使用 ${n.yellow("pnpm")} install yezz-cli@latest 更新 ~`)):u.info(`当前已是最新版本 ${n.blueBright(o)} ~`),t})("yezz-cli",g);const p=f.get(m);p?await(async(e,o,r)=>{const t=l(y);try{await w(t.clone(e,o,r),"代码下载中: ",{estimate:8e3}),console.log(),console.log(n.blueBright("==================================")),console.log(n.blueBright("=== 欢迎使用 yezz-cli 脚手架 ===")),console.log(n.blueBright("==================================")),console.log(),u.success(`项目创建成功 ${n.blueBright(o)}`),u.success("执行以下命令启动项目:"),u.info(`cd ${n.blueBright(o)}`),u.info(`${n.yellow("pnpm")} install`),u.info(`${n.yellow("pnpm")} run dev`)}catch(e){u.error("下载失败"),u.error(String(e))}})(p.downloadUrl,e,["-b",`${p.branch}`]):u.error(`${m} 模板不存在`)}const z=p({text:"yezz-cli 正在更新中...",spinner:{interval:300,frames:["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"].map(e=>n.blue(e))}});const v=new e("yezz");v.version(g,"-v, --version"),v.command("update").description("更新 yezz 至最新版本").action(async()=>{await async function(){z.start();try{await new Promise((e,o)=>{m("npm install yezz-cli@latest -g",{timeout:12e4},(r,t,n)=>{r?o(new Error(n||r.message)):e()})}),z.succeed("更新成功!")}catch(e){z.fail("更新失败,请稍后重试"),console.error(n.red(String(e)))}}()}),v.command("create").description("create a new project").argument("[name]","项目名称").action(async e=>{await b(e)}),v.parse();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yezz-cli",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "description": "yezz-cli is a command line tool for scaffolding projects.",
5
5
  "main": "./dist/index.js",
6
6
  "type": "module",
@@ -30,7 +30,6 @@
30
30
  "@types/fs-extra": "^11.0.4",
31
31
  "@types/lodash": "^4.17.24",
32
32
  "@types/node": "^25.9.1",
33
- "ora": "^9.4.0",
34
33
  "rollup": "^4.60.4",
35
34
  "rollup-plugin-node-externals": "^9.0.1",
36
35
  "rollup-plugin-typescript2": "^0.37.0",
@@ -43,6 +42,7 @@
43
42
  "commander": "^14.0.3",
44
43
  "fs-extra": "^11.3.5",
45
44
  "lodash": "^4.18.1",
45
+ "ora": "^9.4.0",
46
46
  "progress-estimator": "^0.3.1",
47
47
  "simple-git": "^3.36.0"
48
48
  }