create-young-proj 0.3.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. package/README.md +6 -1
  2. package/dist/index.mjs +8 -8
  3. package/package.json +1 -1
  4. package/template-uni-app/.vscode/css.code-snippets +398 -0
  5. package/template-uni-app/.vscode/extensions.json +9 -0
  6. package/template-uni-app/.vscode/js.code-snippets +1669 -0
  7. package/template-uni-app/.vscode/settings.json +7 -0
  8. package/template-uni-app/.vscode/vue-html.code-snippets +668 -0
  9. package/template-uni-app/README.md +46 -0
  10. package/template-uni-app/_env +1 -0
  11. package/template-uni-app/_env.development +11 -0
  12. package/template-uni-app/_env.production +11 -0
  13. package/template-uni-app/_env.test +14 -0
  14. package/template-uni-app/_gitignore +3 -0
  15. package/template-uni-app/auto-imports.d.ts +404 -0
  16. package/template-uni-app/components.d.ts +20 -0
  17. package/template-uni-app/custom-plugins/index.ts +8 -0
  18. package/template-uni-app/custom-plugins/multiconf.ts +77 -0
  19. package/template-uni-app/custom-plugins/polyfill.ts +32 -0
  20. package/template-uni-app/index.html +23 -0
  21. package/template-uni-app/package.json +84 -0
  22. package/template-uni-app/pnpm-lock.yaml +7530 -0
  23. package/template-uni-app/rome.json +26 -0
  24. package/template-uni-app/src/App.vue +76 -0
  25. package/template-uni-app/src/apis/index.ts +36 -0
  26. package/template-uni-app/src/apis/lib/index.ts +236 -0
  27. package/template-uni-app/src/apis/requests/get.ts +52 -0
  28. package/template-uni-app/src/apis/requests/index.ts +8 -0
  29. package/template-uni-app/src/apis/requests/post.ts +23 -0
  30. package/template-uni-app/src/components/young-loading/young-loading.vue +38 -0
  31. package/template-uni-app/src/components/young-navbar/young-navbar.vue +253 -0
  32. package/template-uni-app/src/components/young-tabbar/young-tabbar.vue +137 -0
  33. package/template-uni-app/src/components/young-tabbar-layout/young-tabbar-layout.vue +27 -0
  34. package/template-uni-app/src/config/enum.ts +46 -0
  35. package/template-uni-app/src/config/index.ts +8 -0
  36. package/template-uni-app/src/config/map.ts +15 -0
  37. package/template-uni-app/src/env.d.ts +35 -0
  38. package/template-uni-app/src/main.ts +20 -0
  39. package/template-uni-app/src/manifest.json +83 -0
  40. package/template-uni-app/src/pages/index.vue +52 -0
  41. package/template-uni-app/src/pages/my.vue +29 -0
  42. package/template-uni-app/src/pages.json +63 -0
  43. package/template-uni-app/src/store/index.ts +16 -0
  44. package/template-uni-app/src/store/local/index.ts +40 -0
  45. package/template-uni-app/src/store/system.ts +12 -0
  46. package/template-uni-app/src/uni.scss +76 -0
  47. package/template-uni-app/src/utils/auth.ts +125 -0
  48. package/template-uni-app/src/utils/index.ts +11 -0
  49. package/template-uni-app/src/utils/map.ts +97 -0
  50. package/template-uni-app/src/utils/modal.ts +98 -0
  51. package/template-uni-app/src/utils/route.ts +149 -0
  52. package/template-uni-app/src/utils/system.ts +66 -0
  53. package/template-uni-app/tsconfig.json +13 -0
  54. package/template-uni-app/unocss.config.ts +30 -0
  55. package/template-uni-app/vite.config.ts +68 -0
package/README.md CHANGED
@@ -6,6 +6,7 @@
6
6
  - [x] template-vue-admin
7
7
  - [x] template-admin-server
8
8
  - [x] template-vue-mobile
9
+ - [x] template-uni-app
9
10
  - [ ] template-nuxt3
10
11
  - [ ] template-ssr
11
12
  - [ ] template-solidjs-ssr
@@ -38,4 +39,8 @@
38
39
 
39
40
  在 `template-vue-thin` 的基础上加入 `vant4` 开发的移动端模板
40
41
 
41
- 目前测试过的最低兼容为 支付宝/钉钉 内置浏览器(`Chrome69`)
42
+ 目前测试过的最低兼容为 支付宝/钉钉 内置浏览器(`Chrome69`)
43
+
44
+ ## template-uni-app
45
+
46
+ 基于 `Vue3` + `uni-app` 开发的通用小程序模板,[详见](./template-uni-app/README.md)
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import T from"node:fs";import C from"node:path";import{fileURLToPath as Ne}from"node:url";import je from"child_process";import lt from"path";import at from"fs";import Fe from"readline";import Le from"events";var Ve=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},B={exports:{}},ht,jt;function Ye(){if(jt)return ht;jt=1,ht=i,i.sync=o;var s=at;function t(n,r){var l=r.pathExt!==void 0?r.pathExt:process.env.PATHEXT;if(!l||(l=l.split(";"),l.indexOf("")!==-1))return!0;for(var c=0;c<l.length;c++){var h=l[c].toLowerCase();if(h&&n.substr(-h.length).toLowerCase()===h)return!0}return!1}function e(n,r,l){return!n.isSymbolicLink()&&!n.isFile()?!1:t(r,l)}function i(n,r,l){s.stat(n,function(c,h){l(c,c?!1:e(h,n,r))})}function o(n,r){return e(s.statSync(n),n,r)}return ht}var ut,Ft;function He(){if(Ft)return ut;Ft=1,ut=t,t.sync=e;var s=at;function t(n,r,l){s.stat(n,function(c,h){l(c,c?!1:i(h,r))})}function e(n,r){return i(s.statSync(n),r)}function i(n,r){return n.isFile()&&o(n,r)}function o(n,r){var l=n.mode,c=n.uid,h=n.gid,$=r.uid!==void 0?r.uid:process.getuid&&process.getuid(),f=r.gid!==void 0?r.gid:process.getgid&&process.getgid(),a=parseInt("100",8),b=parseInt("010",8),p=parseInt("001",8),S=a|b,E=l&p||l&b&&h===f||l&a&&c===$||l&S&&$===0;return E}return ut}var tt;process.platform==="win32"||Ve.TESTING_WINDOWS?tt=Ye():tt=He();var Be=ct;ct.sync=Ue;function ct(s,t,e){if(typeof t=="function"&&(e=t,t={}),!e){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(i,o){ct(s,t||{},function(n,r){n?o(n):i(r)})})}tt(s,t||{},function(i,o){i&&(i.code==="EACCES"||t&&t.ignoreErrors)&&(i=null,o=!1),e(i,o)})}function Ue(s,t){try{return tt.sync(s,t||{})}catch(e){if(t&&t.ignoreErrors||e.code==="EACCES")return!1;throw e}}const U=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Lt=lt,ze=U?";":":",Vt=Be,Yt=s=>Object.assign(new Error(`not found: ${s}`),{code:"ENOENT"}),Ht=(s,t)=>{const e=t.colon||ze,i=s.match(/\//)||U&&s.match(/\\/)?[""]:[...U?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(e)],o=U?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",n=U?o.split(e):[""];return U&&s.indexOf(".")!==-1&&n[0]!==""&&n.unshift(""),{pathEnv:i,pathExt:n,pathExtExe:o}},Bt=(s,t,e)=>{typeof t=="function"&&(e=t,t={}),t||(t={});const{pathEnv:i,pathExt:o,pathExtExe:n}=Ht(s,t),r=[],l=h=>new Promise(($,f)=>{if(h===i.length)return t.all&&r.length?$(r):f(Yt(s));const a=i[h],b=/^".*"$/.test(a)?a.slice(1,-1):a,p=Lt.join(b,s),S=!b&&/^\.[\\\/]/.test(s)?s.slice(0,2)+p:p;$(c(S,h,0))}),c=(h,$,f)=>new Promise((a,b)=>{if(f===o.length)return a(l($+1));const p=o[f];Vt(h+p,{pathExt:n},(S,E)=>{if(!S&&E)if(t.all)r.push(h+p);else return a(h+p);return a(c(h,$,f+1))})});return e?l(0).then(h=>e(null,h),e):l(0)},We=(s,t)=>{t=t||{};const{pathEnv:e,pathExt:i,pathExtExe:o}=Ht(s,t),n=[];for(let r=0;r<e.length;r++){const l=e[r],c=/^".*"$/.test(l)?l.slice(1,-1):l,h=Lt.join(c,s),$=!c&&/^\.[\\\/]/.test(s)?s.slice(0,2)+h:h;for(let f=0;f<i.length;f++){const a=$+i[f];try{if(Vt.sync(a,{pathExt:o}))if(t.all)n.push(a);else return a}catch{}}}if(t.all&&n.length)return n;if(t.nothrow)return null;throw Yt(s)};var Ge=Bt;Bt.sync=We;var dt={exports:{}};const Ut=(s={})=>{const t=s.env||process.env;return(s.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(i=>i.toUpperCase()==="PATH")||"Path"};dt.exports=Ut,dt.exports.default=Ut;const zt=lt,Je=Ge,Ke=dt.exports;function Wt(s,t){const e=s.options.env||process.env,i=process.cwd(),o=s.options.cwd!=null,n=o&&process.chdir!==void 0&&!process.chdir.disabled;if(n)try{process.chdir(s.options.cwd)}catch{}let r;try{r=Je.sync(s.command,{path:e[Ke({env:e})],pathExt:t?zt.delimiter:void 0})}catch{}finally{n&&process.chdir(i)}return r&&(r=zt.resolve(o?s.options.cwd:"",r)),r}function qe(s){return Wt(s)||Wt(s,!0)}var Ze=qe,ft={};const pt=/([()\][%!^"`<>&|;, *?])/g;function Xe(s){return s=s.replace(pt,"^$1"),s}function Qe(s,t){return s=`${s}`,s=s.replace(/(\\*)"/g,'$1$1\\"'),s=s.replace(/(\\*)$/,"$1$1"),s=`"${s}"`,s=s.replace(pt,"^$1"),t&&(s=s.replace(pt,"^$1")),s}ft.command=Xe,ft.argument=Qe;var ts=/^#!(.*)/;const es=ts;var ss=(s="")=>{const t=s.match(es);if(!t)return null;const[e,i]=t[0].replace(/#! ?/,"").split(" "),o=e.split("/").pop();return o==="env"?i:i?`${o} ${i}`:o};const mt=at,is=ss;function rs(s){const e=Buffer.alloc(150);let i;try{i=mt.openSync(s,"r"),mt.readSync(i,e,0,150,0),mt.closeSync(i)}catch{}return is(e.toString())}var ns=rs;const os=lt,Gt=Ze,Jt=ft,ls=ns,as=process.platform==="win32",hs=/\.(?:com|exe)$/i,us=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function cs(s){s.file=Gt(s);const t=s.file&&ls(s.file);return t?(s.args.unshift(s.file),s.command=t,Gt(s)):s.file}function ds(s){if(!as)return s;const t=cs(s),e=!hs.test(t);if(s.options.forceShell||e){const i=us.test(t);s.command=os.normalize(s.command),s.command=Jt.command(s.command),s.args=s.args.map(n=>Jt.argument(n,i));const o=[s.command].concat(s.args).join(" ");s.args=["/d","/s","/c",`"${o}"`],s.command=process.env.comspec||"cmd.exe",s.options.windowsVerbatimArguments=!0}return s}function fs(s,t,e){t&&!Array.isArray(t)&&(e=t,t=null),t=t?t.slice(0):[],e=Object.assign({},e);const i={command:s,args:t,options:e,file:void 0,original:{command:s,args:t}};return e.shell?i:ds(i)}var ps=fs;const gt=process.platform==="win32";function vt(s,t){return Object.assign(new Error(`${t} ${s.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${s.command}`,path:s.command,spawnargs:s.args})}function ms(s,t){if(!gt)return;const e=s.emit;s.emit=function(i,o){if(i==="exit"){const n=Kt(o,t);if(n)return e.call(s,"error",n)}return e.apply(s,arguments)}}function Kt(s,t){return gt&&s===1&&!t.file?vt(t.original,"spawn"):null}function gs(s,t){return gt&&s===1&&!t.file?vt(t.original,"spawnSync"):null}var vs={hookChildProcess:ms,verifyENOENT:Kt,verifyENOENTSync:gs,notFoundError:vt};const qt=je,bt=ps,wt=vs;function Zt(s,t,e){const i=bt(s,t,e),o=qt.spawn(i.command,i.args,i.options);return wt.hookChildProcess(o,i),o}function bs(s,t,e){const i=bt(s,t,e),o=qt.spawnSync(i.command,i.args,i.options);return o.error=o.error||wt.verifyENOENTSync(o.status,i),o}B.exports=Zt,B.exports.spawn=Zt,B.exports.sync=bs,B.exports._parse=bt,B.exports._enoent=wt;var ws=function(s,t){t||(t={});var e={bools:{},strings:{},unknownFn:null};typeof t.unknown=="function"&&(e.unknownFn=t.unknown),typeof t.boolean=="boolean"&&t.boolean?e.allBools=!0:[].concat(t.boolean).filter(Boolean).forEach(function(u){e.bools[u]=!0});var i={};Object.keys(t.alias||{}).forEach(function(u){i[u]=[].concat(t.alias[u]),i[u].forEach(function(w){i[w]=[u].concat(i[u].filter(function(P){return w!==P}))})}),[].concat(t.string).filter(Boolean).forEach(function(u){e.strings[u]=!0,i[u]&&(e.strings[i[u]]=!0)});var o=t.default||{},n={_:[]};Object.keys(e.bools).forEach(function(u){c(u,o[u]===void 0?!1:o[u])});var r=[];s.indexOf("--")!==-1&&(r=s.slice(s.indexOf("--")+1),s=s.slice(0,s.indexOf("--")));function l(u,w){return e.allBools&&/^--[^=]+$/.test(w)||e.strings[u]||e.bools[u]||i[u]}function c(u,w,P){if(!(P&&e.unknownFn&&!l(u,P)&&e.unknownFn(P)===!1)){var g=!e.strings[u]&&Xt(w)?Number(w):w;h(n,u.split("."),g),(i[u]||[]).forEach(function(K){h(n,K.split("."),g)})}}function h(u,w,P){for(var g=u,K=0;K<w.length-1;K++){var x=w[K];if(Qt(g,x))return;g[x]===void 0&&(g[x]={}),(g[x]===Object.prototype||g[x]===Number.prototype||g[x]===String.prototype)&&(g[x]={}),g[x]===Array.prototype&&(g[x]=[]),g=g[x]}var x=w[w.length-1];Qt(g,x)||((g===Object.prototype||g===Number.prototype||g===String.prototype)&&(g={}),g===Array.prototype&&(g=[]),g[x]===void 0||e.bools[x]||typeof g[x]=="boolean"?g[x]=P:Array.isArray(g[x])?g[x].push(P):g[x]=[g[x],P])}function $(u){return i[u].some(function(w){return e.bools[w]})}for(var f=0;f<s.length;f++){var a=s[f];if(/^--.+=/.test(a)){var b=a.match(/^--([^=]+)=([\s\S]*)$/),p=b[1],S=b[2];e.bools[p]&&(S=S!=="false"),c(p,S,a)}else if(/^--no-.+/.test(a)){var p=a.match(/^--no-(.+)/)[1];c(p,!1,a)}else if(/^--.+/.test(a)){var p=a.match(/^--(.+)/)[1],E=s[f+1];E!==void 0&&!/^-/.test(E)&&!e.bools[p]&&!e.allBools&&(i[p]?!$(p):!0)?(c(p,E,a),f++):/^(true|false)$/.test(E)?(c(p,E==="true",a),f++):c(p,e.strings[p]?"":!0,a)}else if(/^-[^-]+/.test(a)){for(var O=a.slice(1,-1).split(""),V=!1,d=0;d<O.length;d++){var E=a.slice(d+2);if(E==="-"){c(O[d],E,a);continue}if(/[A-Za-z]/.test(O[d])&&/=/.test(E)){c(O[d],E.split("=")[1],a),V=!0;break}if(/[A-Za-z]/.test(O[d])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(E)){c(O[d],E,a),V=!0;break}if(O[d+1]&&O[d+1].match(/\W/)){c(O[d],a.slice(d+2),a),V=!0;break}else c(O[d],e.strings[O[d]]?"":!0,a)}var p=a.slice(-1)[0];!V&&p!=="-"&&(s[f+1]&&!/^(-|--)[^-]/.test(s[f+1])&&!e.bools[p]&&(i[p]?!$(p):!0)?(c(p,s[f+1],a),f++):s[f+1]&&/^(true|false)$/.test(s[f+1])?(c(p,s[f+1]==="true",a),f++):c(p,e.strings[p]?"":!0,a))}else if((!e.unknownFn||e.unknownFn(a)!==!1)&&n._.push(e.strings._||!Xt(a)?a:Number(a)),t.stopEarly){n._.push.apply(n._,s.slice(f+1));break}}return Object.keys(o).forEach(function(u){ys(n,u.split("."))||(h(n,u.split("."),o[u]),(i[u]||[]).forEach(function(w){h(n,w.split("."),o[u])}))}),t["--"]?(n["--"]=new Array,r.forEach(function(u){n["--"].push(u)})):r.forEach(function(u){n._.push(u)}),n};function ys(s,t){var e=s;t.slice(0,-1).forEach(function(o){e=e[o]||{}});var i=t[t.length-1];return i in e}function Xt(s){return typeof s=="number"||/^0x[0-9a-f]+$/i.test(s)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(s)}function Qt(s,t){return t==="constructor"&&typeof s[t]=="function"||t==="__proto__"}var te={};const{FORCE_COLOR:$s,NODE_DISABLE_COLORS:xs,TERM:Ss}=process.env,m={enabled:!xs&&Ss!=="dumb"&&$s!=="0",reset:v(0,0),bold:v(1,22),dim:v(2,22),italic:v(3,23),underline:v(4,24),inverse:v(7,27),hidden:v(8,28),strikethrough:v(9,29),black:v(30,39),red:v(31,39),green:v(32,39),yellow:v(33,39),blue:v(34,39),magenta:v(35,39),cyan:v(36,39),white:v(37,39),gray:v(90,39),grey:v(90,39),bgBlack:v(40,49),bgRed:v(41,49),bgGreen:v(42,49),bgYellow:v(43,49),bgBlue:v(44,49),bgMagenta:v(45,49),bgCyan:v(46,49),bgWhite:v(47,49)};function ee(s,t){let e=0,i,o="",n="";for(;e<s.length;e++)i=s[e],o+=i.open,n+=i.close,t.includes(i.close)&&(t=t.replace(i.rgx,i.close+i.open));return o+t+n}function Es(s,t){let e={has:s,keys:t};return e.reset=m.reset.bind(e),e.bold=m.bold.bind(e),e.dim=m.dim.bind(e),e.italic=m.italic.bind(e),e.underline=m.underline.bind(e),e.inverse=m.inverse.bind(e),e.hidden=m.hidden.bind(e),e.strikethrough=m.strikethrough.bind(e),e.black=m.black.bind(e),e.red=m.red.bind(e),e.green=m.green.bind(e),e.yellow=m.yellow.bind(e),e.blue=m.blue.bind(e),e.magenta=m.magenta.bind(e),e.cyan=m.cyan.bind(e),e.white=m.white.bind(e),e.gray=m.gray.bind(e),e.grey=m.grey.bind(e),e.bgBlack=m.bgBlack.bind(e),e.bgRed=m.bgRed.bind(e),e.bgGreen=m.bgGreen.bind(e),e.bgYellow=m.bgYellow.bind(e),e.bgBlue=m.bgBlue.bind(e),e.bgMagenta=m.bgMagenta.bind(e),e.bgCyan=m.bgCyan.bind(e),e.bgWhite=m.bgWhite.bind(e),e}function v(s,t){let e={open:`\x1B[${s}m`,close:`\x1B[${t}m`,rgx:new RegExp(`\\x1b\\[${t}m`,"g")};return function(i){return this!==void 0&&this.has!==void 0?(this.has.includes(s)||(this.has.push(s),this.keys.push(e)),i===void 0?this:m.enabled?ee(this.keys,i+""):i+""):i===void 0?Es([s],[e]):m.enabled?ee([e],i+""):i+""}}var M=m,Ts=(s,t)=>{if(!(s.meta&&s.name!=="escape")){if(s.ctrl){if(s.name==="a")return"first";if(s.name==="c"||s.name==="d")return"abort";if(s.name==="e")return"last";if(s.name==="g")return"reset"}if(t){if(s.name==="j")return"down";if(s.name==="k")return"up"}return s.name==="return"||s.name==="enter"?"submit":s.name==="backspace"?"delete":s.name==="delete"?"deleteForward":s.name==="abort"?"abort":s.name==="escape"?"exit":s.name==="tab"?"next":s.name==="pagedown"?"nextPage":s.name==="pageup"?"prevPage":s.name==="home"?"home":s.name==="end"?"end":s.name==="up"?"up":s.name==="down"?"down":s.name==="right"?"right":s.name==="left"?"left":!1}},yt=s=>{const t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),e=new RegExp(t,"g");return typeof s=="string"?s.replace(e,""):s};const $t="\x1B",y=`${$t}[`,Os="\x07",xt={to(s,t){return t?`${y}${t+1};${s+1}H`:`${y}${s+1}G`},move(s,t){let e="";return s<0?e+=`${y}${-s}D`:s>0&&(e+=`${y}${s}C`),t<0?e+=`${y}${-t}A`:t>0&&(e+=`${y}${t}B`),e},up:(s=1)=>`${y}${s}A`,down:(s=1)=>`${y}${s}B`,forward:(s=1)=>`${y}${s}C`,backward:(s=1)=>`${y}${s}D`,nextLine:(s=1)=>`${y}E`.repeat(s),prevLine:(s=1)=>`${y}F`.repeat(s),left:`${y}G`,hide:`${y}?25l`,show:`${y}?25h`,save:`${$t}7`,restore:`${$t}8`},Ps={up:(s=1)=>`${y}S`.repeat(s),down:(s=1)=>`${y}T`.repeat(s)},Cs={screen:`${y}2J`,up:(s=1)=>`${y}1J`.repeat(s),down:(s=1)=>`${y}J`.repeat(s),line:`${y}2K`,lineEnd:`${y}K`,lineStart:`${y}1K`,lines(s){let t="";for(let e=0;e<s;e++)t+=this.line+(e<s-1?xt.up():"");return s&&(t+=xt.left),t}};var D={cursor:xt,scroll:Ps,erase:Cs,beep:Os};const Ms=yt,{erase:se,cursor:Ds}=D,_s=s=>[...Ms(s)].length;var Is=function(s,t){if(!t)return se.line+Ds.to(0);let e=0;const i=s.split(/\r?\n/);for(let o of i)e+=1+Math.floor(Math.max(_s(o)-1,0)/t);return se.lines(e)};const q={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},As={arrowUp:q.arrowUp,arrowDown:q.arrowDown,arrowLeft:q.arrowLeft,arrowRight:q.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},Rs=process.platform==="win32"?As:q;var ie=Rs;const z=M,Y=ie,St=Object.freeze({password:{scale:1,render:s=>"*".repeat(s.length)},emoji:{scale:2,render:s=>"\u{1F603}".repeat(s.length)},invisible:{scale:0,render:s=>""},default:{scale:1,render:s=>`${s}`}}),ks=s=>St[s]||St.default,Z=Object.freeze({aborted:z.red(Y.cross),done:z.green(Y.tick),exited:z.yellow(Y.cross),default:z.cyan("?")}),Ns=(s,t,e)=>t?Z.aborted:e?Z.exited:s?Z.done:Z.default,js=s=>z.gray(s?Y.ellipsis:Y.pointerSmall),Fs=(s,t)=>z.gray(s?t?Y.pointerSmall:"+":Y.line);var Ls={styles:St,render:ks,symbols:Z,symbol:Ns,delimiter:js,item:Fs};const Vs=yt;var Ys=function(s,t){let e=String(Vs(s)||"").split(/\r?\n/);return t?e.map(i=>Math.ceil(i.length/t)).reduce((i,o)=>i+o):e.length},Hs=(s,t={})=>{const e=Number.isSafeInteger(parseInt(t.margin))?new Array(parseInt(t.margin)).fill(" ").join(""):t.margin||"",i=t.width;return(s||"").split(/\r?\n/g).map(o=>o.split(/\s+/g).reduce((n,r)=>(r.length+e.length>=i||n[n.length-1].length+r.length+1<i?n[n.length-1]+=` ${r}`:n.push(`${e}${r}`),n),[e]).join(`
1
+ import T from"node:fs";import C from"node:path";import{fileURLToPath as Ne}from"node:url";import je from"child_process";import lt from"path";import at from"fs";import Fe from"readline";import Le from"events";var Ve=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},U={exports:{}},ht,jt;function Ye(){if(jt)return ht;jt=1,ht=i,i.sync=o;var s=at;function t(n,r){var l=r.pathExt!==void 0?r.pathExt:process.env.PATHEXT;if(!l||(l=l.split(";"),l.indexOf("")!==-1))return!0;for(var c=0;c<l.length;c++){var h=l[c].toLowerCase();if(h&&n.substr(-h.length).toLowerCase()===h)return!0}return!1}function e(n,r,l){return!n.isSymbolicLink()&&!n.isFile()?!1:t(r,l)}function i(n,r,l){s.stat(n,function(c,h){l(c,c?!1:e(h,n,r))})}function o(n,r){return e(s.statSync(n),n,r)}return ht}var ut,Ft;function He(){if(Ft)return ut;Ft=1,ut=t,t.sync=e;var s=at;function t(n,r,l){s.stat(n,function(c,h){l(c,c?!1:i(h,r))})}function e(n,r){return i(s.statSync(n),r)}function i(n,r){return n.isFile()&&o(n,r)}function o(n,r){var l=n.mode,c=n.uid,h=n.gid,$=r.uid!==void 0?r.uid:process.getuid&&process.getuid(),f=r.gid!==void 0?r.gid:process.getgid&&process.getgid(),a=parseInt("100",8),b=parseInt("010",8),p=parseInt("001",8),S=a|b,E=l&p||l&b&&h===f||l&a&&c===$||l&S&&$===0;return E}return ut}var tt;process.platform==="win32"||Ve.TESTING_WINDOWS?tt=Ye():tt=He();var Be=ct;ct.sync=Ue;function ct(s,t,e){if(typeof t=="function"&&(e=t,t={}),!e){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(i,o){ct(s,t||{},function(n,r){n?o(n):i(r)})})}tt(s,t||{},function(i,o){i&&(i.code==="EACCES"||t&&t.ignoreErrors)&&(i=null,o=!1),e(i,o)})}function Ue(s,t){try{return tt.sync(s,t||{})}catch(e){if(t&&t.ignoreErrors||e.code==="EACCES")return!1;throw e}}const z=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Lt=lt,ze=z?";":":",Vt=Be,Yt=s=>Object.assign(new Error(`not found: ${s}`),{code:"ENOENT"}),Ht=(s,t)=>{const e=t.colon||ze,i=s.match(/\//)||z&&s.match(/\\/)?[""]:[...z?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(e)],o=z?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",n=z?o.split(e):[""];return z&&s.indexOf(".")!==-1&&n[0]!==""&&n.unshift(""),{pathEnv:i,pathExt:n,pathExtExe:o}},Bt=(s,t,e)=>{typeof t=="function"&&(e=t,t={}),t||(t={});const{pathEnv:i,pathExt:o,pathExtExe:n}=Ht(s,t),r=[],l=h=>new Promise(($,f)=>{if(h===i.length)return t.all&&r.length?$(r):f(Yt(s));const a=i[h],b=/^".*"$/.test(a)?a.slice(1,-1):a,p=Lt.join(b,s),S=!b&&/^\.[\\\/]/.test(s)?s.slice(0,2)+p:p;$(c(S,h,0))}),c=(h,$,f)=>new Promise((a,b)=>{if(f===o.length)return a(l($+1));const p=o[f];Vt(h+p,{pathExt:n},(S,E)=>{if(!S&&E)if(t.all)r.push(h+p);else return a(h+p);return a(c(h,$,f+1))})});return e?l(0).then(h=>e(null,h),e):l(0)},We=(s,t)=>{t=t||{};const{pathEnv:e,pathExt:i,pathExtExe:o}=Ht(s,t),n=[];for(let r=0;r<e.length;r++){const l=e[r],c=/^".*"$/.test(l)?l.slice(1,-1):l,h=Lt.join(c,s),$=!c&&/^\.[\\\/]/.test(s)?s.slice(0,2)+h:h;for(let f=0;f<i.length;f++){const a=$+i[f];try{if(Vt.sync(a,{pathExt:o}))if(t.all)n.push(a);else return a}catch{}}}if(t.all&&n.length)return n;if(t.nothrow)return null;throw Yt(s)};var Ge=Bt;Bt.sync=We;var dt={exports:{}};const Ut=(s={})=>{const t=s.env||process.env;return(s.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(i=>i.toUpperCase()==="PATH")||"Path"};dt.exports=Ut,dt.exports.default=Ut;const zt=lt,Je=Ge,Ke=dt.exports;function Wt(s,t){const e=s.options.env||process.env,i=process.cwd(),o=s.options.cwd!=null,n=o&&process.chdir!==void 0&&!process.chdir.disabled;if(n)try{process.chdir(s.options.cwd)}catch{}let r;try{r=Je.sync(s.command,{path:e[Ke({env:e})],pathExt:t?zt.delimiter:void 0})}catch{}finally{n&&process.chdir(i)}return r&&(r=zt.resolve(o?s.options.cwd:"",r)),r}function qe(s){return Wt(s)||Wt(s,!0)}var Ze=qe,ft={};const pt=/([()\][%!^"`<>&|;, *?])/g;function Xe(s){return s=s.replace(pt,"^$1"),s}function Qe(s,t){return s=`${s}`,s=s.replace(/(\\*)"/g,'$1$1\\"'),s=s.replace(/(\\*)$/,"$1$1"),s=`"${s}"`,s=s.replace(pt,"^$1"),t&&(s=s.replace(pt,"^$1")),s}ft.command=Xe,ft.argument=Qe;var ts=/^#!(.*)/;const es=ts;var ss=(s="")=>{const t=s.match(es);if(!t)return null;const[e,i]=t[0].replace(/#! ?/,"").split(" "),o=e.split("/").pop();return o==="env"?i:i?`${o} ${i}`:o};const mt=at,is=ss;function rs(s){const e=Buffer.alloc(150);let i;try{i=mt.openSync(s,"r"),mt.readSync(i,e,0,150,0),mt.closeSync(i)}catch{}return is(e.toString())}var ns=rs;const os=lt,Gt=Ze,Jt=ft,ls=ns,as=process.platform==="win32",hs=/\.(?:com|exe)$/i,us=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function cs(s){s.file=Gt(s);const t=s.file&&ls(s.file);return t?(s.args.unshift(s.file),s.command=t,Gt(s)):s.file}function ds(s){if(!as)return s;const t=cs(s),e=!hs.test(t);if(s.options.forceShell||e){const i=us.test(t);s.command=os.normalize(s.command),s.command=Jt.command(s.command),s.args=s.args.map(n=>Jt.argument(n,i));const o=[s.command].concat(s.args).join(" ");s.args=["/d","/s","/c",`"${o}"`],s.command=process.env.comspec||"cmd.exe",s.options.windowsVerbatimArguments=!0}return s}function fs(s,t,e){t&&!Array.isArray(t)&&(e=t,t=null),t=t?t.slice(0):[],e=Object.assign({},e);const i={command:s,args:t,options:e,file:void 0,original:{command:s,args:t}};return e.shell?i:ds(i)}var ps=fs;const gt=process.platform==="win32";function vt(s,t){return Object.assign(new Error(`${t} ${s.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${s.command}`,path:s.command,spawnargs:s.args})}function ms(s,t){if(!gt)return;const e=s.emit;s.emit=function(i,o){if(i==="exit"){const n=Kt(o,t);if(n)return e.call(s,"error",n)}return e.apply(s,arguments)}}function Kt(s,t){return gt&&s===1&&!t.file?vt(t.original,"spawn"):null}function gs(s,t){return gt&&s===1&&!t.file?vt(t.original,"spawnSync"):null}var vs={hookChildProcess:ms,verifyENOENT:Kt,verifyENOENTSync:gs,notFoundError:vt};const qt=je,bt=ps,wt=vs;function Zt(s,t,e){const i=bt(s,t,e),o=qt.spawn(i.command,i.args,i.options);return wt.hookChildProcess(o,i),o}function bs(s,t,e){const i=bt(s,t,e),o=qt.spawnSync(i.command,i.args,i.options);return o.error=o.error||wt.verifyENOENTSync(o.status,i),o}U.exports=Zt,U.exports.spawn=Zt,U.exports.sync=bs,U.exports._parse=bt,U.exports._enoent=wt;var ws=function(s,t){t||(t={});var e={bools:{},strings:{},unknownFn:null};typeof t.unknown=="function"&&(e.unknownFn=t.unknown),typeof t.boolean=="boolean"&&t.boolean?e.allBools=!0:[].concat(t.boolean).filter(Boolean).forEach(function(u){e.bools[u]=!0});var i={};Object.keys(t.alias||{}).forEach(function(u){i[u]=[].concat(t.alias[u]),i[u].forEach(function(w){i[w]=[u].concat(i[u].filter(function(P){return w!==P}))})}),[].concat(t.string).filter(Boolean).forEach(function(u){e.strings[u]=!0,i[u]&&(e.strings[i[u]]=!0)});var o=t.default||{},n={_:[]};Object.keys(e.bools).forEach(function(u){c(u,o[u]===void 0?!1:o[u])});var r=[];s.indexOf("--")!==-1&&(r=s.slice(s.indexOf("--")+1),s=s.slice(0,s.indexOf("--")));function l(u,w){return e.allBools&&/^--[^=]+$/.test(w)||e.strings[u]||e.bools[u]||i[u]}function c(u,w,P){if(!(P&&e.unknownFn&&!l(u,P)&&e.unknownFn(P)===!1)){var g=!e.strings[u]&&Xt(w)?Number(w):w;h(n,u.split("."),g),(i[u]||[]).forEach(function(K){h(n,K.split("."),g)})}}function h(u,w,P){for(var g=u,K=0;K<w.length-1;K++){var x=w[K];if(Qt(g,x))return;g[x]===void 0&&(g[x]={}),(g[x]===Object.prototype||g[x]===Number.prototype||g[x]===String.prototype)&&(g[x]={}),g[x]===Array.prototype&&(g[x]=[]),g=g[x]}var x=w[w.length-1];Qt(g,x)||((g===Object.prototype||g===Number.prototype||g===String.prototype)&&(g={}),g===Array.prototype&&(g=[]),g[x]===void 0||e.bools[x]||typeof g[x]=="boolean"?g[x]=P:Array.isArray(g[x])?g[x].push(P):g[x]=[g[x],P])}function $(u){return i[u].some(function(w){return e.bools[w]})}for(var f=0;f<s.length;f++){var a=s[f];if(/^--.+=/.test(a)){var b=a.match(/^--([^=]+)=([\s\S]*)$/),p=b[1],S=b[2];e.bools[p]&&(S=S!=="false"),c(p,S,a)}else if(/^--no-.+/.test(a)){var p=a.match(/^--no-(.+)/)[1];c(p,!1,a)}else if(/^--.+/.test(a)){var p=a.match(/^--(.+)/)[1],E=s[f+1];E!==void 0&&!/^-/.test(E)&&!e.bools[p]&&!e.allBools&&(i[p]?!$(p):!0)?(c(p,E,a),f++):/^(true|false)$/.test(E)?(c(p,E==="true",a),f++):c(p,e.strings[p]?"":!0,a)}else if(/^-[^-]+/.test(a)){for(var O=a.slice(1,-1).split(""),V=!1,d=0;d<O.length;d++){var E=a.slice(d+2);if(E==="-"){c(O[d],E,a);continue}if(/[A-Za-z]/.test(O[d])&&/=/.test(E)){c(O[d],E.split("=")[1],a),V=!0;break}if(/[A-Za-z]/.test(O[d])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(E)){c(O[d],E,a),V=!0;break}if(O[d+1]&&O[d+1].match(/\W/)){c(O[d],a.slice(d+2),a),V=!0;break}else c(O[d],e.strings[O[d]]?"":!0,a)}var p=a.slice(-1)[0];!V&&p!=="-"&&(s[f+1]&&!/^(-|--)[^-]/.test(s[f+1])&&!e.bools[p]&&(i[p]?!$(p):!0)?(c(p,s[f+1],a),f++):s[f+1]&&/^(true|false)$/.test(s[f+1])?(c(p,s[f+1]==="true",a),f++):c(p,e.strings[p]?"":!0,a))}else if((!e.unknownFn||e.unknownFn(a)!==!1)&&n._.push(e.strings._||!Xt(a)?a:Number(a)),t.stopEarly){n._.push.apply(n._,s.slice(f+1));break}}return Object.keys(o).forEach(function(u){ys(n,u.split("."))||(h(n,u.split("."),o[u]),(i[u]||[]).forEach(function(w){h(n,w.split("."),o[u])}))}),t["--"]?(n["--"]=new Array,r.forEach(function(u){n["--"].push(u)})):r.forEach(function(u){n._.push(u)}),n};function ys(s,t){var e=s;t.slice(0,-1).forEach(function(o){e=e[o]||{}});var i=t[t.length-1];return i in e}function Xt(s){return typeof s=="number"||/^0x[0-9a-f]+$/i.test(s)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(s)}function Qt(s,t){return t==="constructor"&&typeof s[t]=="function"||t==="__proto__"}var te={};const{FORCE_COLOR:$s,NODE_DISABLE_COLORS:xs,TERM:Ss}=process.env,m={enabled:!xs&&Ss!=="dumb"&&$s!=="0",reset:v(0,0),bold:v(1,22),dim:v(2,22),italic:v(3,23),underline:v(4,24),inverse:v(7,27),hidden:v(8,28),strikethrough:v(9,29),black:v(30,39),red:v(31,39),green:v(32,39),yellow:v(33,39),blue:v(34,39),magenta:v(35,39),cyan:v(36,39),white:v(37,39),gray:v(90,39),grey:v(90,39),bgBlack:v(40,49),bgRed:v(41,49),bgGreen:v(42,49),bgYellow:v(43,49),bgBlue:v(44,49),bgMagenta:v(45,49),bgCyan:v(46,49),bgWhite:v(47,49)};function ee(s,t){let e=0,i,o="",n="";for(;e<s.length;e++)i=s[e],o+=i.open,n+=i.close,t.includes(i.close)&&(t=t.replace(i.rgx,i.close+i.open));return o+t+n}function Es(s,t){let e={has:s,keys:t};return e.reset=m.reset.bind(e),e.bold=m.bold.bind(e),e.dim=m.dim.bind(e),e.italic=m.italic.bind(e),e.underline=m.underline.bind(e),e.inverse=m.inverse.bind(e),e.hidden=m.hidden.bind(e),e.strikethrough=m.strikethrough.bind(e),e.black=m.black.bind(e),e.red=m.red.bind(e),e.green=m.green.bind(e),e.yellow=m.yellow.bind(e),e.blue=m.blue.bind(e),e.magenta=m.magenta.bind(e),e.cyan=m.cyan.bind(e),e.white=m.white.bind(e),e.gray=m.gray.bind(e),e.grey=m.grey.bind(e),e.bgBlack=m.bgBlack.bind(e),e.bgRed=m.bgRed.bind(e),e.bgGreen=m.bgGreen.bind(e),e.bgYellow=m.bgYellow.bind(e),e.bgBlue=m.bgBlue.bind(e),e.bgMagenta=m.bgMagenta.bind(e),e.bgCyan=m.bgCyan.bind(e),e.bgWhite=m.bgWhite.bind(e),e}function v(s,t){let e={open:`\x1B[${s}m`,close:`\x1B[${t}m`,rgx:new RegExp(`\\x1b\\[${t}m`,"g")};return function(i){return this!==void 0&&this.has!==void 0?(this.has.includes(s)||(this.has.push(s),this.keys.push(e)),i===void 0?this:m.enabled?ee(this.keys,i+""):i+""):i===void 0?Es([s],[e]):m.enabled?ee([e],i+""):i+""}}var M=m,Ts=(s,t)=>{if(!(s.meta&&s.name!=="escape")){if(s.ctrl){if(s.name==="a")return"first";if(s.name==="c"||s.name==="d")return"abort";if(s.name==="e")return"last";if(s.name==="g")return"reset"}if(t){if(s.name==="j")return"down";if(s.name==="k")return"up"}return s.name==="return"||s.name==="enter"?"submit":s.name==="backspace"?"delete":s.name==="delete"?"deleteForward":s.name==="abort"?"abort":s.name==="escape"?"exit":s.name==="tab"?"next":s.name==="pagedown"?"nextPage":s.name==="pageup"?"prevPage":s.name==="home"?"home":s.name==="end"?"end":s.name==="up"?"up":s.name==="down"?"down":s.name==="right"?"right":s.name==="left"?"left":!1}},yt=s=>{const t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),e=new RegExp(t,"g");return typeof s=="string"?s.replace(e,""):s};const $t="\x1B",y=`${$t}[`,Os="\x07",xt={to(s,t){return t?`${y}${t+1};${s+1}H`:`${y}${s+1}G`},move(s,t){let e="";return s<0?e+=`${y}${-s}D`:s>0&&(e+=`${y}${s}C`),t<0?e+=`${y}${-t}A`:t>0&&(e+=`${y}${t}B`),e},up:(s=1)=>`${y}${s}A`,down:(s=1)=>`${y}${s}B`,forward:(s=1)=>`${y}${s}C`,backward:(s=1)=>`${y}${s}D`,nextLine:(s=1)=>`${y}E`.repeat(s),prevLine:(s=1)=>`${y}F`.repeat(s),left:`${y}G`,hide:`${y}?25l`,show:`${y}?25h`,save:`${$t}7`,restore:`${$t}8`},Ps={up:(s=1)=>`${y}S`.repeat(s),down:(s=1)=>`${y}T`.repeat(s)},Cs={screen:`${y}2J`,up:(s=1)=>`${y}1J`.repeat(s),down:(s=1)=>`${y}J`.repeat(s),line:`${y}2K`,lineEnd:`${y}K`,lineStart:`${y}1K`,lines(s){let t="";for(let e=0;e<s;e++)t+=this.line+(e<s-1?xt.up():"");return s&&(t+=xt.left),t}};var D={cursor:xt,scroll:Ps,erase:Cs,beep:Os};const Ms=yt,{erase:se,cursor:Ds}=D,_s=s=>[...Ms(s)].length;var Is=function(s,t){if(!t)return se.line+Ds.to(0);let e=0;const i=s.split(/\r?\n/);for(let o of i)e+=1+Math.floor(Math.max(_s(o)-1,0)/t);return se.lines(e)};const q={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},As={arrowUp:q.arrowUp,arrowDown:q.arrowDown,arrowLeft:q.arrowLeft,arrowRight:q.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},Rs=process.platform==="win32"?As:q;var ie=Rs;const W=M,Y=ie,St=Object.freeze({password:{scale:1,render:s=>"*".repeat(s.length)},emoji:{scale:2,render:s=>"\u{1F603}".repeat(s.length)},invisible:{scale:0,render:s=>""},default:{scale:1,render:s=>`${s}`}}),ks=s=>St[s]||St.default,Z=Object.freeze({aborted:W.red(Y.cross),done:W.green(Y.tick),exited:W.yellow(Y.cross),default:W.cyan("?")}),Ns=(s,t,e)=>t?Z.aborted:e?Z.exited:s?Z.done:Z.default,js=s=>W.gray(s?Y.ellipsis:Y.pointerSmall),Fs=(s,t)=>W.gray(s?t?Y.pointerSmall:"+":Y.line);var Ls={styles:St,render:ks,symbols:Z,symbol:Ns,delimiter:js,item:Fs};const Vs=yt;var Ys=function(s,t){let e=String(Vs(s)||"").split(/\r?\n/);return t?e.map(i=>Math.ceil(i.length/t)).reduce((i,o)=>i+o):e.length},Hs=(s,t={})=>{const e=Number.isSafeInteger(parseInt(t.margin))?new Array(parseInt(t.margin)).fill(" ").join(""):t.margin||"",i=t.width;return(s||"").split(/\r?\n/g).map(o=>o.split(/\s+/g).reduce((n,r)=>(r.length+e.length>=i||n[n.length-1].length+r.length+1<i?n[n.length-1]+=` ${r}`:n.push(`${e}${r}`),n),[e]).join(`
2
2
  `)).join(`
3
3
  `)},Bs=(s,t,e)=>{e=e||t;let i=Math.min(t-e,s-Math.floor(e/2));i<0&&(i=0);let o=Math.min(i+e,t);return{startIndex:i,endIndex:o}},_={action:Ts,clear:Is,style:Ls,strip:yt,figures:ie,lines:Ys,wrap:Hs,entriesToDisplay:Bs};const re=Fe,{action:Us}=_,zs=Le,{beep:Ws,cursor:Gs}=D,Js=M;let Ks=class extends zs{constructor(t={}){super(),this.firstRender=!0,this.in=t.stdin||process.stdin,this.out=t.stdout||process.stdout,this.onRender=(t.onRender||(()=>{})).bind(this);const e=re.createInterface({input:this.in,escapeCodeTimeout:50});re.emitKeypressEvents(this.in,e),this.in.isTTY&&this.in.setRawMode(!0);const i=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,o=(n,r)=>{let l=Us(r,i);l===!1?this._&&this._(n,r):typeof this[l]=="function"?this[l](r):this.bell()};this.close=()=>{this.out.write(Gs.show),this.in.removeListener("keypress",o),this.in.isTTY&&this.in.setRawMode(!1),e.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",o)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(Ws)}render(){this.onRender(Js),this.firstRender&&(this.firstRender=!1)}};var j=Ks;const et=M,qs=j,{erase:Zs,cursor:X}=D,{style:Et,clear:Tt,lines:Xs,figures:Qs}=_;class ti extends qs{constructor(t={}){super(t),this.transform=Et.render(t.style),this.scale=this.transform.scale,this.msg=t.message,this.initial=t.initial||"",this.validator=t.validate||(()=>!0),this.value="",this.errorMsg=t.error||"Please Enter A Valid Value",this.cursor=Number(!!this.initial),this.cursorOffset=0,this.clear=Tt("",this.out.columns),this.render()}set value(t){!t&&this.initial?(this.placeholder=!0,this.rendered=et.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(t)),this._value=t,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=Number(!!this.initial),this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
4
4
  `),this.close()}async validate(){let t=await this.validator(this.value);typeof t=="string"&&(this.errorMsg=t,t=!1),this.error=!t}async submit(){if(this.value=this.value||this.initial,this.cursorOffset=0,this.cursor=this.rendered.length,await this.validate(),this.error){this.red=!0,this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
@@ -35,17 +35,17 @@ Instructions:
35
35
  `),this.close()}_(t,e){let i=this.input.slice(0,this.cursor),o=this.input.slice(this.cursor);this.input=`${i}${t}${o}`,this.cursor=i.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let t=this.input.slice(0,this.cursor-1),e=this.input.slice(this.cursor);this.input=`${t}${e}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let t=this.input.slice(0,this.cursor),e=this.input.slice(this.cursor+1);this.input=`${t}${e}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render()}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render()}renderOption(t,e,i,o){let n,r=i?_t.arrowUp:o?_t.arrowDown:" ",l=e?Q.cyan().underline(t.title):t.title;return r=(e?Q.cyan(_t.pointer)+" ":" ")+r,t.description&&(n=` - ${t.description}`,(r.length+l.length+n.length>=this.out.columns||t.description.split(/\r?\n/).length>1)&&(n=`
36
36
  `+pr(t.description,{margin:3,width:this.out.columns}))),r+" "+l+Q.gray(n||"")}render(){if(this.closed)return;this.firstRender?this.out.write(we.hide):this.out.write(ye(this.outputText,this.out.columns)),super.render();let{startIndex:t,endIndex:e}=mr(this.select,this.choices.length,this.limit);if(this.outputText=[Dt.symbol(this.done,this.aborted,this.exited),Q.bold(this.msg),Dt.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){const i=this.suggestions.slice(t,e).map((o,n)=>this.renderOption(o,this.select===n+t,n===0&&t>0,n+t===e-1&&e<this.choices.length)).join(`
37
37
  `);this.outputText+=`
38
- `+(i||Q.gray(this.fallback.title))}this.out.write(fr.line+we.to(0)+this.outputText)}}var wr=br;const k=M,{cursor:yr}=D,$r=be,{clear:xe,style:Se,figures:W}=_;class xr extends $r{constructor(t={}){t.overrideRender=!0,super(t),this.inputValue="",this.clear=xe("",this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(t=>t.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){const t=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(i=>this.inputValue?!!(typeof i.title=="string"&&i.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof i.value=="string"&&i.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);const e=this.filteredOptions.findIndex(i=>i===t);this.cursor=e<0?0:e,this.render()}handleSpaceToggle(){const t=this.filteredOptions[this.cursor];if(t.selected)t.selected=!1,this.render();else{if(t.disabled||this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();t.selected=!0,this.render()}}handleInputChange(t){this.inputValue=this.inputValue+t,this.updateFilteredOptions()}_(t,e){t===" "?this.handleSpaceToggle():this.handleInputChange(t)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
38
+ `+(i||Q.gray(this.fallback.title))}this.out.write(fr.line+we.to(0)+this.outputText)}}var wr=br;const k=M,{cursor:yr}=D,$r=be,{clear:xe,style:Se,figures:G}=_;class xr extends $r{constructor(t={}){t.overrideRender=!0,super(t),this.inputValue="",this.clear=xe("",this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(t=>t.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){const t=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(i=>this.inputValue?!!(typeof i.title=="string"&&i.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof i.value=="string"&&i.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);const e=this.filteredOptions.findIndex(i=>i===t);this.cursor=e<0?0:e,this.render()}handleSpaceToggle(){const t=this.filteredOptions[this.cursor];if(t.selected)t.selected=!1,this.render();else{if(t.disabled||this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();t.selected=!0,this.render()}}handleInputChange(t){this.inputValue=this.inputValue+t,this.updateFilteredOptions()}_(t,e){t===" "?this.handleSpaceToggle():this.handleInputChange(t)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
39
39
  Instructions:
40
- ${W.arrowUp}/${W.arrowDown}: Highlight option
41
- ${W.arrowLeft}/${W.arrowRight}/[space]: Toggle selection
40
+ ${G.arrowUp}/${G.arrowDown}: Highlight option
41
+ ${G.arrowLeft}/${G.arrowRight}/[space]: Toggle selection
42
42
  [a,b,c]/delete: Filter choices
43
43
  enter/return: Complete answer
44
44
  `:""}renderCurrentInput(){return`
45
45
  Filtered results for: ${this.inputValue?this.inputValue:k.gray("Enter something to filter")}
46
- `}renderOption(t,e,i){let o;return e.disabled?o=t===i?k.gray().underline(e.title):k.strikethrough().gray(e.title):o=t===i?k.cyan().underline(e.title):e.title,(e.selected?k.green(W.radioOn):W.radioOff)+" "+o}renderDoneOrInstructions(){if(this.done)return this.value.filter(e=>e.selected).map(e=>e.title).join(", ");const t=[k.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&t.push(k.yellow(this.warn)),t.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(yr.hide),super.render();let t=[Se.symbol(this.done,this.aborted),k.bold(this.msg),Se.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(t+=k.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),t+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+t),this.clear=xe(t,this.out.columns)}}var Sr=xr;const Ee=M,Er=j,{style:Te,clear:Tr}=_,{erase:Or,cursor:Oe}=D;class Pr extends Er{constructor(t={}){super(t),this.msg=t.message,this.value=t.initial,this.initialValue=!!t.initial,this.yesMsg=t.yes||"yes",this.yesOption=t.yesOption||"(Y/n)",this.noMsg=t.no||"no",this.noOption=t.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
46
+ `}renderOption(t,e,i){let o;return e.disabled?o=t===i?k.gray().underline(e.title):k.strikethrough().gray(e.title):o=t===i?k.cyan().underline(e.title):e.title,(e.selected?k.green(G.radioOn):G.radioOff)+" "+o}renderDoneOrInstructions(){if(this.done)return this.value.filter(e=>e.selected).map(e=>e.title).join(", ");const t=[k.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&t.push(k.yellow(this.warn)),t.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(yr.hide),super.render();let t=[Se.symbol(this.done,this.aborted),k.bold(this.msg),Se.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(t+=k.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),t+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+t),this.clear=xe(t,this.out.columns)}}var Sr=xr;const Ee=M,Er=j,{style:Te,clear:Tr}=_,{erase:Or,cursor:Oe}=D;class Pr extends Er{constructor(t={}){super(t),this.msg=t.message,this.value=t.initial,this.initialValue=!!t.initial,this.yesMsg=t.yes||"yes",this.yesOption=t.yesOption||"(Y/n)",this.noMsg=t.no||"no",this.noOption=t.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
47
47
  `),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
48
- `),this.close()}_(t,e){return t.toLowerCase()==="y"?(this.value=!0,this.submit()):t.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(Oe.hide):this.out.write(Tr(this.outputText,this.out.columns)),super.render(),this.outputText=[Te.symbol(this.done,this.aborted),Ee.bold(this.msg),Te.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:Ee.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(Or.line+Oe.to(0)+this.outputText))}}var Cr=Pr,Mr={TextPrompt:ei,SelectPrompt:li,TogglePrompt:di,DatePrompt:Qi,NumberPrompt:or,MultiselectPrompt:be,AutocompletePrompt:wr,AutocompleteMultiselectPrompt:Sr,ConfirmPrompt:Cr};(function(s){const t=s,e=Mr,i=r=>r;function o(r,l,c={}){return new Promise((h,$)=>{const f=new e[r](l),a=c.onAbort||i,b=c.onSubmit||i,p=c.onExit||i;f.on("state",l.onState||i),f.on("submit",S=>h(b(S))),f.on("exit",S=>h(p(S))),f.on("abort",S=>$(a(S)))})}t.text=r=>o("TextPrompt",r),t.password=r=>(r.style="password",t.text(r)),t.invisible=r=>(r.style="invisible",t.text(r)),t.number=r=>o("NumberPrompt",r),t.date=r=>o("DatePrompt",r),t.confirm=r=>o("ConfirmPrompt",r),t.list=r=>{const l=r.separator||",";return o("TextPrompt",r,{onSubmit:c=>c.split(l).map(h=>h.trim())})},t.toggle=r=>o("TogglePrompt",r),t.select=r=>o("SelectPrompt",r),t.multiselect=r=>{r.choices=[].concat(r.choices||[]);const l=c=>c.filter(h=>h.selected).map(h=>h.value);return o("MultiselectPrompt",r,{onAbort:l,onSubmit:l})},t.autocompleteMultiselect=r=>{r.choices=[].concat(r.choices||[]);const l=c=>c.filter(h=>h.selected).map(h=>h.value);return o("AutocompleteMultiselectPrompt",r,{onAbort:l,onSubmit:l})};const n=(r,l)=>Promise.resolve(l.filter(c=>c.title.slice(0,r.length).toLowerCase()===r.toLowerCase()));t.autocomplete=r=>(r.suggest=r.suggest||n,r.choices=[].concat(r.choices||[]),o("AutocompletePrompt",r))})(te);const It=te,Dr=["suggest","format","onState","validate","onRender","type"],Pe=()=>{};async function L(s=[],{onSubmit:t=Pe,onCancel:e=Pe}={}){const i={},o=L._override||{};s=[].concat(s);let n,r,l,c,h,$;const f=async(a,b,p=!1)=>{if(!(!p&&a.validate&&a.validate(b)!==!0))return a.format?await a.format(b,i):b};for(r of s)if({name:c,type:h}=r,typeof h=="function"&&(h=await h(n,{...i},r),r.type=h),!!h){for(let a in r){if(Dr.includes(a))continue;let b=r[a];r[a]=typeof b=="function"?await b(n,{...i},$):b}if($=r,typeof r.message!="string")throw new Error("prompt message is required");if({name:c,type:h}=r,It[h]===void 0)throw new Error(`prompt type (${h}) is not defined`);if(o[r.name]!==void 0&&(n=await f(r,o[r.name]),n!==void 0)){i[c]=n;continue}try{n=L._injected?_r(L._injected,r.initial):await It[h](r),i[c]=n=await f(r,n,!0),l=await t(r,n,i)}catch{l=!await e(r,i)}if(l)return i}return i}function _r(s,t){const e=s.shift();if(e instanceof Error)throw e;return e===void 0?t:e}function Ir(s){L._injected=(L._injected||[]).concat(s)}function Ar(s){L._override=Object.assign({},s)}var Rr=Object.assign(L,{prompt:L,prompts:It,inject:Ir,override:Ar});let H=!0;const G=typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{};let Ce=0;if(G.process&&G.process.env&&G.process.stdout){const{FORCE_COLOR:s,NODE_DISABLE_COLORS:t,TERM:e}=G.process.env;t||s==="0"?H=!1:s==="1"?H=!0:e==="dumb"?H=!1:"CI"in G.process.env&&["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(i=>i in G.process.env)?H=!0:H=process.stdout.isTTY,H&&(Ce=e&&e.endsWith("-256color")?2:1)}let Me={enabled:H,supportLevel:Ce};function ot(s,t,e=1){const i=`\x1B[${s}m`,o=`\x1B[${t}m`,n=new RegExp(`\\x1b\\[${t}m`,"g");return r=>Me.enabled&&Me.supportLevel>=e?i+(""+r).replace(n,i)+o:""+r}const N=ot(0,0),De=ot(31,39),_e=ot(32,39),J=ot(34,39),At=ws(process.argv.slice(2),{string:["_"]}),Rt=process.cwd(),kt=[{name:"vue",display:"Young Designed Vue Template",color:_e,variants:[{name:"vue-thin",display:"Vue3 + TS + Pinia + Unocss",color:_e},{name:"vue-admin",display:"Vue3 + ElementPlus + TS + Pinia + Unocss",color:J},{name:"admin-server",display:"Node Server Based on Midwayjs",color:J},{name:"vue-mobile",display:"Vue3 + Vant4 + TS + Pinia + Unocss",color:J},{name:"nuxt3",display:"Nuxt3 + TS + Pinia + Unocss",color:J,wip:!0},{name:"ssr",display:"NestJS + TS + Pinia + Tailwindcss",color:J,wip:!0},{name:"solidjs-ssr",display:"SolidJS + TS + Pinia + Unocss",color:J,wip:!0}]},{name:"vite",display:"Vite Formal",color:N,variants:[{name:"create-vite",display:"create-vite",color:N,customCommand:"npm create vite@latest TARGET_DIR"}]},{name:"others",display:"Others",color:N,variants:[{name:"create-vite-extra",display:"create-vite-extra \u2197",color:N,customCommand:"npm create vite-extra@latest TARGET_DIR"}]}],Ie=kt.map(s=>s.variants&&s.variants.map(t=>t.name)||[s.name]).reduce((s,t)=>s.concat(t),[]),kr={_gitignore:".gitignore",_env:".env"},Nt="vite-project";async function Nr(){const s=Ae(At._[0]),t=At.template||At.t;let e=s||Nt;const i=()=>e==="."?C.basename(C.resolve()):e;let o;try{o=await Rr([{type:s?null:"text",name:"projectName",message:N("Project name:"),initial:Nt,onState:d=>{e=Ae(d.value)||Nt}},{type:()=>!T.existsSync(e)||Lr(e)?null:"confirm",name:"overwrite",message:()=>(e==="."?"Current directory":`Target directory "${e}"`)+" is not empty. Remove existing files and continue?"},{type:(d,{overwrite:u})=>{if(u===!1)throw new Error(De("\u2716")+" Operation cancelled");return null},name:"overwriteChecker"},{type:()=>ke(i())?null:"text",name:"packageName",message:N("Package name:"),initial:()=>jr(i()),validate:d=>ke(d)||"Invalid package.json name"},{type:t&&Ie.includes(t)?null:"select",name:"framework",message:typeof t=="string"&&!Ie.includes(t)?N(`"${t}" isn't a valid template. Please choose from below: `):N("Select a framework:"),initial:0,choices:kt.map(d=>{const u=d.color;return{title:u(d.display||d.name),value:d}})},{type:d=>d&&d.variants?"select":null,name:"variant",message:N("Select a variant:"),choices:d=>d.variants.map(u=>{const w=u.color;return{title:w(u.display||u.name),value:u.name,disabled:u.wip}})}],{onCancel:()=>{throw new Error(De("\u2716")+" Operation cancelled")}})}catch(d){console.log(d.message);return}const{framework:n,overwrite:r,packageName:l,variant:c}=o,h=C.join(Rt,e);r?Vr(h):T.existsSync(h)||T.mkdirSync(h,{recursive:!0});const $=c||n?.name||t,f=Yr(process.env.npm_config_user_agent),a=f?f.name:"npm",b=a==="yarn"&&f?.version.startsWith("1."),{customCommand:p}=kt.flatMap(d=>d.variants).find(d=>d.name===$)??{};if(p){const d=p.replace("TARGET_DIR",e).replace(/^npm create/,`${a} create`).replace("@latest",()=>b?"":"@latest").replace(/^npm exec/,()=>a==="pnpm"?"pnpm dlx":a==="yarn"&&!b?"yarn dlx":"npm exec"),[u,...w]=d.split(" "),{status:P}=B.exports.sync(u,w,{stdio:"inherit"});process.exit(P??0)}console.log(`
49
- Scaffolding project in ${h}...`);const S=C.resolve(Ne(import.meta.url),"../..",`template-${$}`),E=(d,u)=>{const w=C.join(h,kr[d]??d);u?T.writeFileSync(w,u):Re(C.join(S,d),w)},O=T.readdirSync(S);for(const d of O.filter(u=>u!=="package.json"))E(d);const V=JSON.parse(T.readFileSync(C.join(S,"package.json"),"utf-8"));switch(V.name=l||i(),E("package.json",JSON.stringify(V,null,2)),console.log(`
48
+ `),this.close()}_(t,e){return t.toLowerCase()==="y"?(this.value=!0,this.submit()):t.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(Oe.hide):this.out.write(Tr(this.outputText,this.out.columns)),super.render(),this.outputText=[Te.symbol(this.done,this.aborted),Ee.bold(this.msg),Te.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:Ee.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(Or.line+Oe.to(0)+this.outputText))}}var Cr=Pr,Mr={TextPrompt:ei,SelectPrompt:li,TogglePrompt:di,DatePrompt:Qi,NumberPrompt:or,MultiselectPrompt:be,AutocompletePrompt:wr,AutocompleteMultiselectPrompt:Sr,ConfirmPrompt:Cr};(function(s){const t=s,e=Mr,i=r=>r;function o(r,l,c={}){return new Promise((h,$)=>{const f=new e[r](l),a=c.onAbort||i,b=c.onSubmit||i,p=c.onExit||i;f.on("state",l.onState||i),f.on("submit",S=>h(b(S))),f.on("exit",S=>h(p(S))),f.on("abort",S=>$(a(S)))})}t.text=r=>o("TextPrompt",r),t.password=r=>(r.style="password",t.text(r)),t.invisible=r=>(r.style="invisible",t.text(r)),t.number=r=>o("NumberPrompt",r),t.date=r=>o("DatePrompt",r),t.confirm=r=>o("ConfirmPrompt",r),t.list=r=>{const l=r.separator||",";return o("TextPrompt",r,{onSubmit:c=>c.split(l).map(h=>h.trim())})},t.toggle=r=>o("TogglePrompt",r),t.select=r=>o("SelectPrompt",r),t.multiselect=r=>{r.choices=[].concat(r.choices||[]);const l=c=>c.filter(h=>h.selected).map(h=>h.value);return o("MultiselectPrompt",r,{onAbort:l,onSubmit:l})},t.autocompleteMultiselect=r=>{r.choices=[].concat(r.choices||[]);const l=c=>c.filter(h=>h.selected).map(h=>h.value);return o("AutocompleteMultiselectPrompt",r,{onAbort:l,onSubmit:l})};const n=(r,l)=>Promise.resolve(l.filter(c=>c.title.slice(0,r.length).toLowerCase()===r.toLowerCase()));t.autocomplete=r=>(r.suggest=r.suggest||n,r.choices=[].concat(r.choices||[]),o("AutocompletePrompt",r))})(te);const It=te,Dr=["suggest","format","onState","validate","onRender","type"],Pe=()=>{};async function L(s=[],{onSubmit:t=Pe,onCancel:e=Pe}={}){const i={},o=L._override||{};s=[].concat(s);let n,r,l,c,h,$;const f=async(a,b,p=!1)=>{if(!(!p&&a.validate&&a.validate(b)!==!0))return a.format?await a.format(b,i):b};for(r of s)if({name:c,type:h}=r,typeof h=="function"&&(h=await h(n,{...i},r),r.type=h),!!h){for(let a in r){if(Dr.includes(a))continue;let b=r[a];r[a]=typeof b=="function"?await b(n,{...i},$):b}if($=r,typeof r.message!="string")throw new Error("prompt message is required");if({name:c,type:h}=r,It[h]===void 0)throw new Error(`prompt type (${h}) is not defined`);if(o[r.name]!==void 0&&(n=await f(r,o[r.name]),n!==void 0)){i[c]=n;continue}try{n=L._injected?_r(L._injected,r.initial):await It[h](r),i[c]=n=await f(r,n,!0),l=await t(r,n,i)}catch{l=!await e(r,i)}if(l)return i}return i}function _r(s,t){const e=s.shift();if(e instanceof Error)throw e;return e===void 0?t:e}function Ir(s){L._injected=(L._injected||[]).concat(s)}function Ar(s){L._override=Object.assign({},s)}var Rr=Object.assign(L,{prompt:L,prompts:It,inject:Ir,override:Ar});let H=!0;const J=typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{};let Ce=0;if(J.process&&J.process.env&&J.process.stdout){const{FORCE_COLOR:s,NODE_DISABLE_COLORS:t,TERM:e}=J.process.env;t||s==="0"?H=!1:s==="1"?H=!0:e==="dumb"?H=!1:"CI"in J.process.env&&["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(i=>i in J.process.env)?H=!0:H=process.stdout.isTTY,H&&(Ce=e&&e.endsWith("-256color")?2:1)}let Me={enabled:H,supportLevel:Ce};function ot(s,t,e=1){const i=`\x1B[${s}m`,o=`\x1B[${t}m`,n=new RegExp(`\\x1b\\[${t}m`,"g");return r=>Me.enabled&&Me.supportLevel>=e?i+(""+r).replace(n,i)+o:""+r}const N=ot(0,0),De=ot(31,39),_e=ot(32,39),B=ot(34,39),At=ws(process.argv.slice(2),{string:["_"]}),Rt=process.cwd(),kt=[{name:"vue",display:"Young Designed Vue Template",color:_e,variants:[{name:"vue-thin",display:"Vue3 + TS + Pinia + Unocss",color:_e},{name:"vue-admin",display:"Vue3 + ElementPlus + TS + Pinia + Unocss",color:B},{name:"admin-server",display:"Node Server Based on Midwayjs",color:B},{name:"vue-mobile",display:"Vue3 + Vant4 + TS + Pinia + Unocss",color:B},{name:"uni-app",display:"Vue3 + uni-app + TS + Pinia + Unocss",color:B},{name:"nuxt3",display:"Nuxt3 + TS + Pinia + Unocss",color:B,wip:!0},{name:"ssr",display:"NestJS + TS + Pinia + Tailwindcss",color:B,wip:!0},{name:"solidjs-ssr",display:"SolidJS + TS + Pinia + Unocss",color:B,wip:!0}]},{name:"vite",display:"Vite Formal",color:N,variants:[{name:"create-vite",display:"create-vite",color:N,customCommand:"npm create vite@latest TARGET_DIR"}]},{name:"others",display:"Others",color:N,variants:[{name:"create-vite-extra",display:"create-vite-extra \u2197",color:N,customCommand:"npm create vite-extra@latest TARGET_DIR"}]}],Ie=kt.map(s=>s.variants&&s.variants.map(t=>t.name)||[s.name]).reduce((s,t)=>s.concat(t),[]),kr={_gitignore:".gitignore"},Nr=/_env.*/,Nt="vite-project";async function jr(){const s=Ae(At._[0]),t=At.template||At.t;let e=s||Nt;const i=()=>e==="."?C.basename(C.resolve()):e;let o;try{o=await Rr([{type:s?null:"text",name:"projectName",message:N("Project name:"),initial:Nt,onState:d=>{e=Ae(d.value)||Nt}},{type:()=>!T.existsSync(e)||Vr(e)?null:"confirm",name:"overwrite",message:()=>(e==="."?"Current directory":`Target directory "${e}"`)+" is not empty. Remove existing files and continue?"},{type:(d,{overwrite:u})=>{if(u===!1)throw new Error(De("\u2716")+" Operation cancelled");return null},name:"overwriteChecker"},{type:()=>ke(i())?null:"text",name:"packageName",message:N("Package name:"),initial:()=>Fr(i()),validate:d=>ke(d)||"Invalid package.json name"},{type:t&&Ie.includes(t)?null:"select",name:"framework",message:typeof t=="string"&&!Ie.includes(t)?N(`"${t}" isn't a valid template. Please choose from below: `):N("Select a framework:"),initial:0,choices:kt.map(d=>{const u=d.color;return{title:u(d.display||d.name),value:d}})},{type:d=>d&&d.variants?"select":null,name:"variant",message:N("Select a variant:"),choices:d=>d.variants.map(u=>{const w=u.color;return{title:w(u.display||u.name),value:u.name,disabled:u.wip}})}],{onCancel:()=>{throw new Error(De("\u2716")+" Operation cancelled")}})}catch(d){console.log(d.message);return}const{framework:n,overwrite:r,packageName:l,variant:c}=o,h=C.join(Rt,e);r?Yr(h):T.existsSync(h)||T.mkdirSync(h,{recursive:!0});const $=c||n?.name||t,f=Hr(process.env.npm_config_user_agent),a=f?f.name:"npm",b=a==="yarn"&&f?.version.startsWith("1."),{customCommand:p}=kt.flatMap(d=>d.variants).find(d=>d.name===$)??{};if(p){const d=p.replace("TARGET_DIR",e).replace(/^npm create/,`${a} create`).replace("@latest",()=>b?"":"@latest").replace(/^npm exec/,()=>a==="pnpm"?"pnpm dlx":a==="yarn"&&!b?"yarn dlx":"npm exec"),[u,...w]=d.split(" "),{status:P}=U.exports.sync(u,w,{stdio:"inherit"});process.exit(P??0)}console.log(`
49
+ Scaffolding project in ${h}...`);const S=C.resolve(Ne(import.meta.url),"../..",`template-${$}`),E=(d,u)=>{const w=C.join(h,kr[d]??Nr.test(d)?d.replace("_","."):d);u?T.writeFileSync(w,u):Re(C.join(S,d),w)},O=T.readdirSync(S);for(const d of O.filter(u=>u!=="package.json"))E(d);const V=JSON.parse(T.readFileSync(C.join(S,"package.json"),"utf-8"));switch(V.name=l||i(),E("package.json",JSON.stringify(V,null,2)),console.log(`
50
50
  Done. Now run:
51
- `),h!==Rt&&console.log(` cd ${C.relative(Rt,h)}`),a){case"yarn":console.log(" yarn"),console.log(" yarn dev");break;default:console.log(` ${a} install`),console.log(` ${a} run dev`);break}console.log()}function Ae(s){return s?.trim().replace(/\/+$/g,"")}function Re(s,t){T.statSync(s).isDirectory()?Fr(s,t):T.copyFileSync(s,t)}function ke(s){return/^(?:@[a-z\d\-*~][a-z\d\-*._~]*\/)?[a-z\d\-~][a-z\d\-._~]*$/.test(s)}function jr(s){return s.trim().toLowerCase().replace(/\s+/g,"-").replace(/^[._]/,"").replace(/[^a-z\d\-~]+/g,"-")}function Fr(s,t){T.mkdirSync(t,{recursive:!0});for(const e of T.readdirSync(s)){const i=C.resolve(s,e),o=C.resolve(t,e);Re(i,o)}}function Lr(s){const t=T.readdirSync(s);return t.length===0||t.length===1&&t[0]===".git"}function Vr(s){if(!!T.existsSync(s))for(const t of T.readdirSync(s))t!==".git"&&T.rmSync(C.resolve(s,t),{recursive:!0,force:!0})}function Yr(s){if(!s)return;const e=s.split(" ")[0].split("/");return{name:e[0],version:e[1]}}Nr().catch(s=>{console.error(s)});
51
+ `),h!==Rt&&console.log(` cd ${C.relative(Rt,h)}`),a){case"yarn":console.log(" yarn"),console.log(" yarn dev");break;default:console.log(` ${a} install`),console.log(` ${a} run dev`);break}console.log()}function Ae(s){return s?.trim().replace(/\/+$/g,"")}function Re(s,t){T.statSync(s).isDirectory()?Lr(s,t):T.copyFileSync(s,t)}function ke(s){return/^(?:@[a-z\d\-*~][a-z\d\-*._~]*\/)?[a-z\d\-~][a-z\d\-._~]*$/.test(s)}function Fr(s){return s.trim().toLowerCase().replace(/\s+/g,"-").replace(/^[._]/,"").replace(/[^a-z\d\-~]+/g,"-")}function Lr(s,t){T.mkdirSync(t,{recursive:!0});for(const e of T.readdirSync(s)){const i=C.resolve(s,e),o=C.resolve(t,e);Re(i,o)}}function Vr(s){const t=T.readdirSync(s);return t.length===0||t.length===1&&t[0]===".git"}function Yr(s){if(!!T.existsSync(s))for(const t of T.readdirSync(s))t!==".git"&&T.rmSync(C.resolve(s,t),{recursive:!0,force:!0})}function Hr(s){if(!s)return;const e=s.split(" ")[0].split("/");return{name:e[0],version:e[1]}}jr().catch(s=>{console.error(s)});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-young-proj",
3
- "version": "0.3.0",
3
+ "version": "0.5.0",
4
4
  "description": "create project from template",
5
5
  "main": "index.mjs",
6
6
  "bin": {
@@ -0,0 +1,398 @@
1
+ {
2
+ "#ifdef": {
3
+ "body": [
4
+ "/* #ifdef ${1|APP-PLUS,MP,MP-ALIPAY,MP-BAIDU,MP-WEIXIN,MP-QQ,H5|} */",
5
+ "$0",
6
+ "/* #endif */"
7
+ ],
8
+ "prefix": "ifdef",
9
+ "project": "uni-app",
10
+ "scope": "css"
11
+ },
12
+ "#ifndef": {
13
+ "body": [
14
+ "/* #ifndef ${1|APP-PLUS,MP,MP-ALIPAY,MP-BAIDU,MP-WEIXIN,MP-QQ,H5|} */",
15
+ "$0",
16
+ "/* #endif */"
17
+ ],
18
+ "prefix": "ifndef",
19
+ "project": "uni-app",
20
+ "scope": "css"
21
+ },
22
+ "-moz-": {
23
+ "body": [
24
+ "-moz-"
25
+ ],
26
+ "prefix": "moz",
27
+ "scope": "css",
28
+ "triggerAssist": true
29
+ },
30
+ "-ms-": {
31
+ "body": [
32
+ "-ms-"
33
+ ],
34
+ "prefix": "ms",
35
+ "scope": "css",
36
+ "triggerAssist": true
37
+ },
38
+ "-webkit-": {
39
+ "body": [
40
+ "-webkit-"
41
+ ],
42
+ "prefix": "webkit",
43
+ "scope": "css",
44
+ "triggerAssist": true
45
+ },
46
+ "@-moz-keyframes": {
47
+ "body": [
48
+ "@-moz-keyframes ${1:name}{",
49
+ "\tfrom{$2}",
50
+ "\tto{$3}",
51
+ "}"
52
+ ],
53
+ "prefix": "@keyframes",
54
+ "scope": "CSS_OUTRULE"
55
+ },
56
+ "@-ms-keyframes": {
57
+ "body": [
58
+ "@-ms-keyframes ${1:name}{",
59
+ "\tfrom{$2}",
60
+ "\tto{$3}",
61
+ "}"
62
+ ],
63
+ "prefix": "@keyframes",
64
+ "scope": "CSS_OUTRULE"
65
+ },
66
+ "@-webkit-keyframes": {
67
+ "body": [
68
+ "@-webkit-keyframes ${1:name}{",
69
+ "\tfrom{$2}",
70
+ "\tto{$3}",
71
+ "}"
72
+ ],
73
+ "prefix": "@keyframes",
74
+ "scope": "CSS_OUTRULE"
75
+ },
76
+ "@charset": {
77
+ "body": [
78
+ "@charset \"${1:utf-8}\";"
79
+ ],
80
+ "prefix": "@charset",
81
+ "scope": "CSS_OUTRULE"
82
+ },
83
+ "@document": {
84
+ "body": [
85
+ "@document ${1:url}(\"$2\") {",
86
+ "\t$3",
87
+ "}"
88
+ ],
89
+ "prefix": "@document",
90
+ "scope": "CSS_OUTRULE"
91
+ },
92
+ "@font-face": {
93
+ "body": [
94
+ "@font-face {",
95
+ "\tfont-family:$1;",
96
+ "\tsrc: url($2);",
97
+ "}"
98
+ ],
99
+ "prefix": "@fontface",
100
+ "scope": "CSS_OUTRULE"
101
+ },
102
+ "@import": {
103
+ "body": [
104
+ "@import url(\"$1\");"
105
+ ],
106
+ "prefix": "@import",
107
+ "scope": "CSS_OUTRULE",
108
+ "triggerAssist": true
109
+ },
110
+ "@keyframes": {
111
+ "body": [
112
+ "@keyframes ${1:name}{",
113
+ "\tfrom{$2}",
114
+ "\tto{$3}",
115
+ "}"
116
+ ],
117
+ "prefix": "@keyframes",
118
+ "scope": "CSS_OUTRULE"
119
+ },
120
+ "@media": {
121
+ "body": [
122
+ "@media $1 {",
123
+ "\t$2",
124
+ "}"
125
+ ],
126
+ "prefix": "@media",
127
+ "scope": "CSS_OUTRULE"
128
+ },
129
+ "@namespace": {
130
+ "body": [
131
+ "@namespace ${1:prefix} \"$2\";"
132
+ ],
133
+ "prefix": "@namespace",
134
+ "scope": "CSS_OUTRULE"
135
+ },
136
+ "@page": {
137
+ "body": [
138
+ "@page:${1:first}{",
139
+ "\t",
140
+ "}"
141
+ ],
142
+ "prefix": "@page",
143
+ "scope": "CSS_OUTRULE"
144
+ },
145
+ "@supports": {
146
+ "body": [
147
+ "@supports(${1:prop}:${2:value}) {",
148
+ "\t$3",
149
+ "}"
150
+ ],
151
+ "prefix": "@supports",
152
+ "scope": "CSS_OUTRULE"
153
+ },
154
+ "background-color": {
155
+ "body": [
156
+ "background-color: $1"
157
+ ],
158
+ "prefix": "bc",
159
+ "scope": "css",
160
+ "triggerAssist": true
161
+ },
162
+ "background-color: #": {
163
+ "body": [
164
+ "background-color: #$1"
165
+ ],
166
+ "prefix": "bch",
167
+ "scope": "css",
168
+ "triggerAssist": true
169
+ },
170
+ "background-color: rgb": {
171
+ "body": [
172
+ "background-color: rgb(${1:255},${2:255},${3:255})"
173
+ ],
174
+ "prefix": "bcr",
175
+ "scope": "css"
176
+ },
177
+ "background-image": {
178
+ "body": [
179
+ "background-image: $1"
180
+ ],
181
+ "prefix": "bi",
182
+ "scope": "css",
183
+ "triggerAssist": true
184
+ },
185
+ "background-image: url": {
186
+ "body": [
187
+ "background-image: url($1)"
188
+ ],
189
+ "prefix": "biu",
190
+ "scope": "css",
191
+ "triggerAssist": true
192
+ },
193
+ "background-position": {
194
+ "body": [
195
+ "background-position: $1"
196
+ ],
197
+ "prefix": "bp",
198
+ "scope": "css",
199
+ "triggerAssist": true
200
+ },
201
+ "background: image repeat attachment position": {
202
+ "body": [
203
+ "background: url($1) ${2:repeat} ${3:fixed} ${4:center};$0"
204
+ ],
205
+ "prefix": "bg",
206
+ "scope": "css",
207
+ "triggerAssist": true
208
+ },
209
+ "border-color": {
210
+ "body": [
211
+ "border-color: $1"
212
+ ],
213
+ "prefix": "boc",
214
+ "scope": "css",
215
+ "triggerAssist": true
216
+ },
217
+ "border-style": {
218
+ "body": [
219
+ "border-style: $1"
220
+ ],
221
+ "prefix": "bs",
222
+ "scope": "css",
223
+ "triggerAssist": true
224
+ },
225
+ "border-width": {
226
+ "body": [
227
+ "border-width: $1"
228
+ ],
229
+ "prefix": "bw",
230
+ "scope": "css",
231
+ "triggerAssist": true
232
+ },
233
+ "display: block": {
234
+ "body": [
235
+ "display: block;"
236
+ ],
237
+ "prefix": "db",
238
+ "scope": "css"
239
+ },
240
+ "display: flex": {
241
+ "body": [
242
+ "display: flex;"
243
+ ],
244
+ "prefix": "df",
245
+ "scope": "css"
246
+ },
247
+ "display: none": {
248
+ "body": [
249
+ "display: none;"
250
+ ],
251
+ "prefix": "dn",
252
+ "scope": "css"
253
+ },
254
+ "flex-direction: row": {
255
+ "body": [
256
+ "flex-direction: row;"
257
+ ],
258
+ "prefix": "fdr",
259
+ "scope": "css"
260
+ },
261
+ "font-family: family": {
262
+ "body": [
263
+ "font-family: $1"
264
+ ],
265
+ "prefix": "ff",
266
+ "scope": "css",
267
+ "triggerAssist": true
268
+ },
269
+ "font-size: size": {
270
+ "body": [
271
+ "font-size: $1"
272
+ ],
273
+ "prefix": "fsize",
274
+ "scope": "css",
275
+ "triggerAssist": true
276
+ },
277
+ "height --status-bar-height": {
278
+ "body": [
279
+ "height: var(--status-bar-height);"
280
+ ],
281
+ "prefix": "heightstatusbar",
282
+ "project": "uni-app",
283
+ "scope": "css"
284
+ },
285
+ "height --window-bottom": {
286
+ "body": [
287
+ "height: var(--window-bottom);"
288
+ ],
289
+ "prefix": "heightwindowbottom",
290
+ "project": "uni-app",
291
+ "scope": "css"
292
+ },
293
+ "height --window-top": {
294
+ "body": [
295
+ "height: var(--window-top);"
296
+ ],
297
+ "prefix": "heightwindowtop",
298
+ "project": "uni-app",
299
+ "scope": "css"
300
+ },
301
+ "height px": {
302
+ "body": [
303
+ "height: ${1}px;$0"
304
+ ],
305
+ "prefix": "hpx",
306
+ "scope": "css"
307
+ },
308
+ "justify-content: center": {
309
+ "body": [
310
+ "justify-content: center;"
311
+ ],
312
+ "prefix": "jcc",
313
+ "scope": "css"
314
+ },
315
+ "list-style-image: url": {
316
+ "body": [
317
+ "list-style-image: url($1);"
318
+ ],
319
+ "prefix": "lsi",
320
+ "scope": "css",
321
+ "triggerAssist": true
322
+ },
323
+ "scrollbar": {
324
+ "body": [
325
+ "scrollbar-base-color: ${1:#CCCCCC};",
326
+ "scrollbar-arrow-color: ${2:#000000};",
327
+ "scrollbar-track-color: ${3:#999999};",
328
+ "scrollbar-3dlight-color: ${4:#EEEEEE};",
329
+ "scrollbar-highlight-color: ${5:#FFFFFF};",
330
+ "scrollbar-face-color: ${6:#CCCCCC};",
331
+ "scrollbar-shadow-color: ${7:#999999};",
332
+ "scrollbar-darkshadow-color: ${8:#666666};"
333
+ ],
334
+ "prefix": "scrollbarr",
335
+ "scope": "css"
336
+ },
337
+ "text-align: center": {
338
+ "body": [
339
+ "text-align: center;"
340
+ ],
341
+ "prefix": "tac",
342
+ "scope": "css"
343
+ },
344
+ "text-align: left": {
345
+ "body": [
346
+ "text-align: left;"
347
+ ],
348
+ "prefix": "tal",
349
+ "scope": "css"
350
+ },
351
+ "text-align: right": {
352
+ "body": [
353
+ "text-align: right;"
354
+ ],
355
+ "prefix": "tar",
356
+ "scope": "css"
357
+ },
358
+ "text-transform": {
359
+ "body": [
360
+ "text-transform: $1"
361
+ ],
362
+ "prefix": "tt",
363
+ "scope": "css",
364
+ "triggerAssist": true
365
+ },
366
+ "userselect:none": {
367
+ "body": [
368
+ "-webkit-user-select: none;",
369
+ "-moz-user-select: none;",
370
+ "-ms-user-select: none;",
371
+ "user-select: none;"
372
+ ],
373
+ "prefix": "usn",
374
+ "scope": "css"
375
+ },
376
+ "width length": {
377
+ "body": [
378
+ "width: ${1}px;$0"
379
+ ],
380
+ "prefix": "widthlength",
381
+ "scope": "css"
382
+ },
383
+ "width upx": {
384
+ "body": [
385
+ "width: ${1}upx;$0"
386
+ ],
387
+ "prefix": "wupx",
388
+ "project": "uni-app",
389
+ "scope": "css"
390
+ },
391
+ "width_length": {
392
+ "body": [
393
+ "width: ${1}px;$0"
394
+ ],
395
+ "prefix": "wlength",
396
+ "scope": "css"
397
+ }
398
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "recommendations": [
3
+ "dbaeumer.vscode-eslint",
4
+ "antfu.unocss",
5
+ "vue.volar",
6
+ "Vue.vscode-typescript-vue-plugin",
7
+ "uni-helper.uni-helper-vscode"
8
+ ]
9
+ }