@empjs/cli 3.12.3 → 3.12.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/template/index.html +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var Li=Object.create;var ue=Object.defineProperty;var Ai=Object.getOwnPropertyDescriptor;var Fi=Object.getOwnPropertyNames;var Ni=Object.getPrototypeOf,$i=Object.prototype.hasOwnProperty;var w=(s,e)=>()=>(s&&(e=s(s=0)),e);var K=(s,e)=>{for(var t in e)ue(s,t,{get:e[t],enumerable:!0})},Nt=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Fi(e))!$i.call(s,r)&&r!==t&&ue(s,r,{get:()=>e[r],enumerable:!(i=Ai(e,r))||i.enumerable});return s};var d=(s,e,t)=>(t=s!=null?Li(Ni(s)):{},Nt(e||!s||!s.__esModule?ue(t,"default",{value:s,enumerable:!0}):t,s)),Ii=s=>Nt(ue({},"__esModule",{value:!0}),s);var c=w(()=>{"use strict"});var me,ze=w(()=>{me={name:"@empjs/cli",version:"3.12.3",description:"emp",license:"MIT",type:"module",files:["dist","bin","resource","template","types","tsconfig"],maintainers:["xuhongbin","ckken","doerme"],repository:{type:"git",url:"git+https://github.com/empjs/emp.git",directory:"packages/cli"},publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},keywords:["rspack","rust","typescript"],bin:{emp:"./bin/emp.js"},main:"dist/index.js",types:"dist/index.d.ts",exports:{".":{import:{types:"./dist/index.d.ts",default:"./dist/index.js"},require:{types:"./dist/index.d.cts",default:"./dist/index.cjs"}},"./emp-tsconfig.json":{default:"./tsconfig/react.json"},"./tsconfig/base":{default:"./tsconfig/base.json"},"./tsconfig/react":{default:"./tsconfig/react.json"},"./tsconfig/vue":{default:"./tsconfig/vue.json"},"./client":{types:"./types/react/index.d.ts",default:"./types/react/index.d.ts"},"./types/base":{types:"./types/base/index.d.ts",default:"./types/base/index.d.ts"},"./types/vue":{types:"./types/vue/index.d.ts",default:"./types/vue/index.d.ts"},"./types/react":{types:"./types/react/index.d.ts",default:"./types/react/index.d.ts"}},scripts:{dev:"tsup --watch --env.ENV dev",build:"tsup --env.ENV prod","dev-rs":"rslib build --watch --env-mode development","build-rs":"rslib build --env-mode production",ph:"pnpm publish --no-git-checks"},engines:{node:">=18.0.0"},author:"Ken",devDependencies:{"@types/compression":"^1.7.2","@types/connect":"^3.4.38","@types/cors":"^2.8.12","@types/default-gateway":"^7.2.1","@types/fs-extra":"^11.0.4","@types/react":"^18.3.2","@types/serve-static":"^1.15.8","@types/watchpack":"^2.4.3","@types/webpack":"^5.28.4","@types/webpack-bundle-analyzer":"^4.6.2","@types/webpack-sources":"^3.2.2",chokidar:"^4.0.3",vue:"^3.5.21"},dependencies:{"@empjs/chain":"workspace:*","@rsdoctor/rspack-plugin":"1.5.0","@rspack/core":"1.7.4","@rspack/dev-server":"1.2.1","@swc/helpers":"^0.5.18","@vue/tsconfig":"^0.8.1",address:"^2.0.2",chalk:"^5.3.0",commander:"11.1.0",compression:"1.8.1",connect:"3.7.0","core-js":"^3.41.0",cors:"2.8.5","default-gateway":"7.2.2","fs-extra":"11.3.1",glob:"11.0.3","gzip-size":"7.0.0","html-webpack-plugin":"5.6.4","http-proxy-middleware":"^3.0.5",jiti:"2.6.1","less-loader":"^12.2.0",open:"10.2.0","sass-embedded":"1.93.2","sass-loader":"16.0.5","serve-static":"2.2.0","ts-checker-rspack-plugin":"1.1.6","typescript-plugin-css-modules":"5.2.0","webpack-bundle-analyzer":"4.10.2"}}});function Wt(s,e={}){let t=e.entryType||e.type;if(t==="both"&&(t=D.FILE_DIR_TYPE),t&&(e.type=t),s){if(typeof s!="string")throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");if(t&&!$t.includes(t))throw new Error(`readdirp: Invalid type passed. Use one of ${$t.join(", ")}`)}else throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");return e.root=s,new We(e)}var z,zt,H,D,He,Ht,zi,$t,Hi,Wi,Gi,Ui,It,Mt,We,Gt=w(()=>{"use strict";c();z=require("fs/promises"),zt=require("stream"),H=require("path"),D={FILE_TYPE:"files",DIR_TYPE:"directories",FILE_DIR_TYPE:"files_directories",EVERYTHING_TYPE:"all"},He={root:".",fileFilter:s=>!0,directoryFilter:s=>!0,type:D.FILE_TYPE,lstat:!1,depth:2147483648,alwaysStat:!1,highWaterMark:4096};Object.freeze(He);Ht="READDIRP_RECURSIVE_ERROR",zi=new Set(["ENOENT","EPERM","EACCES","ELOOP",Ht]),$t=[D.DIR_TYPE,D.EVERYTHING_TYPE,D.FILE_DIR_TYPE,D.FILE_TYPE],Hi=new Set([D.DIR_TYPE,D.EVERYTHING_TYPE,D.FILE_DIR_TYPE]),Wi=new Set([D.EVERYTHING_TYPE,D.FILE_DIR_TYPE,D.FILE_TYPE]),Gi=s=>zi.has(s.code),Ui=process.platform==="win32",It=s=>!0,Mt=s=>{if(s===void 0)return It;if(typeof s=="function")return s;if(typeof s=="string"){let e=s.trim();return t=>t.basename===e}if(Array.isArray(s)){let e=s.map(t=>t.trim());return t=>e.some(i=>t.basename===i)}return It},We=class extends zt.Readable{constructor(e={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:e.highWaterMark});let t={...He,...e},{root:i,type:r}=t;this._fileFilter=Mt(t.fileFilter),this._directoryFilter=Mt(t.directoryFilter);let o=t.lstat?z.lstat:z.stat;Ui?this._stat=a=>o(a,{bigint:!0}):this._stat=o,this._maxDepth=t.depth??He.depth,this._wantsDir=r?Hi.has(r):!1,this._wantsFile=r?Wi.has(r):!1,this._wantsEverything=r===D.EVERYTHING_TYPE,this._root=(0,H.resolve)(i),this._isDirent=!t.alwaysStat,this._statsProp=this._isDirent?"dirent":"stats",this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent},this.parents=[this._exploreDir(i,1)],this.reading=!1,this.parent=void 0}async _read(e){if(!this.reading){this.reading=!0;try{for(;!this.destroyed&&e>0;){let t=this.parent,i=t&&t.files;if(i&&i.length>0){let{path:r,depth:o}=t,a=i.splice(0,e).map(l=>this._formatEntry(l,r)),n=await Promise.all(a);for(let l of n){if(!l)continue;if(this.destroyed)return;let f=await this._getEntryType(l);f==="directory"&&this._directoryFilter(l)?(o<=this._maxDepth&&this.parents.push(this._exploreDir(l.fullPath,o+1)),this._wantsDir&&(this.push(l),e--)):(f==="file"||this._includeAsFile(l))&&this._fileFilter(l)&&this._wantsFile&&(this.push(l),e--)}}else{let r=this.parents.pop();if(!r){this.push(null);break}if(this.parent=await r,this.destroyed)return}}}catch(t){this.destroy(t)}finally{this.reading=!1}}}async _exploreDir(e,t){let i;try{i=await(0,z.readdir)(e,this._rdOptions)}catch(r){this._onError(r)}return{files:i,depth:t,path:e}}async _formatEntry(e,t){let i,r=this._isDirent?e.name:e;try{let o=(0,H.resolve)((0,H.join)(t,r));i={path:(0,H.relative)(this._root,o),fullPath:o,basename:r},i[this._statsProp]=this._isDirent?e:await this._stat(o)}catch(o){this._onError(o);return}return i}_onError(e){Gi(e)&&!this.destroyed?this.emit("warn",e):this.destroy(e)}async _getEntryType(e){if(!e&&this._statsProp in e)return"";let t=e[this._statsProp];if(t.isFile())return"file";if(t.isDirectory())return"directory";if(t&&t.isSymbolicLink()){let i=e.fullPath;try{let r=await(0,z.realpath)(i),o=await(0,z.lstat)(r);if(o.isFile())return"file";if(o.isDirectory()){let a=r.length;if(i.startsWith(r)&&i.substr(a,1)===H.sep){let n=new Error(`Circular symlink detected: "${i}" points to "${r}"`);return n.code=Ht,this._onError(n)}return"directory"}}catch(r){return this._onError(r),""}}}_includeAsFile(e){let t=e&&e[this._statsProp];return t&&this._wantsEverything&&!t.isDirectory()}}});function Ut(s,e,t,i,r){let o=(a,n)=>{t(s),r(a,n,{watchedPath:s}),n&&s!==n&&ye(P.resolve(s,n),V,P.join(s,n))};try{return(0,Y.watch)(s,{persistent:e.persistent},o)}catch(a){i(a);return}}var Y,F,P,Bt,Bi,Be,Jt,ve,be,Je,Ji,Vi,Yi,Vt,x,A,qi,Xi,V,de,Q,Ki,Qi,Zi,Ue,ie,er,re,Yt,ge,ye,tr,Ge,sr,we,qt=w(()=>{"use strict";c();Y=require("fs"),F=require("fs/promises"),P=d(require("path"),1),Bt=require("os"),Bi="data",Be="end",Jt="close",ve=()=>{},be=process.platform,Je=be==="win32",Ji=be==="darwin",Vi=be==="linux",Yi=be==="freebsd",Vt=(0,Bt.type)()==="OS400",x={ALL:"all",READY:"ready",ADD:"add",CHANGE:"change",ADD_DIR:"addDir",UNLINK:"unlink",UNLINK_DIR:"unlinkDir",RAW:"raw",ERROR:"error"},A=x,qi="watch",Xi={lstat:F.lstat,stat:F.stat},V="listeners",de="errHandlers",Q="rawEmitters",Ki=[V,de,Q],Qi=new Set(["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]),Zi=s=>Qi.has(P.extname(s).slice(1).toLowerCase()),Ue=(s,e)=>{s instanceof Set?s.forEach(e):e(s)},ie=(s,e,t)=>{let i=s[e];i instanceof Set||(s[e]=i=new Set([i])),i.add(t)},er=s=>e=>{let t=s[e];t instanceof Set?t.clear():delete s[e]},re=(s,e,t)=>{let i=s[e];i instanceof Set?i.delete(t):i===t&&delete s[e]},Yt=s=>s instanceof Set?s.size===0:!s,ge=new Map;ye=(s,e,t,i,r)=>{let o=ge.get(s);o&&Ue(o[e],a=>{a(t,i,r)})},tr=(s,e,t,i)=>{let{listener:r,errHandler:o,rawEmitter:a}=i,n=ge.get(e),l;if(!t.persistent)return l=Ut(s,t,r,o,a),l?l.close.bind(l):void 0;if(n)ie(n,V,r),ie(n,de,o),ie(n,Q,a);else{if(l=Ut(s,t,ye.bind(null,e,V),o,ye.bind(null,e,Q)),!l)return;l.on(A.ERROR,async f=>{let p=ye.bind(null,e,de);if(n&&(n.watcherUnusable=!0),Je&&f.code==="EPERM")try{await(await(0,F.open)(s,"r")).close(),p(f)}catch{}else p(f)}),n={listeners:r,errHandlers:o,rawEmitters:a,watcher:l},ge.set(e,n)}return()=>{re(n,V,r),re(n,de,o),re(n,Q,a),Yt(n.listeners)&&(n.watcher.close(),ge.delete(e),Ki.forEach(er(n)),n.watcher=void 0,Object.freeze(n))}},Ge=new Map,sr=(s,e,t,i)=>{let{listener:r,rawEmitter:o}=i,a=Ge.get(e),n=a&&a.options;return n&&(n.persistent<t.persistent||n.interval>t.interval)&&((0,Y.unwatchFile)(e),a=void 0),a?(ie(a,V,r),ie(a,Q,o)):(a={listeners:r,rawEmitters:o,options:t,watcher:(0,Y.watchFile)(e,t,(l,f)=>{Ue(a.rawEmitters,m=>{m(A.CHANGE,e,{curr:l,prev:f})});let p=l.mtimeMs;(l.size!==f.size||p>f.mtimeMs||p===0)&&Ue(a.listeners,m=>m(s,l))})},Ge.set(e,a)),()=>{re(a,V,r),re(a,Q,o),Yt(a.listeners)&&(Ge.delete(e),(0,Y.unwatchFile)(e),a.options=a.watcher=void 0,Object.freeze(a))}},we=class{constructor(e){this.fsw=e,this._boundHandleError=t=>e._handleError(t)}_watchWithNodeFs(e,t){let i=this.fsw.options,r=P.dirname(e),o=P.basename(e);this.fsw._getWatchedDir(r).add(o);let n=P.resolve(e),l={persistent:i.persistent};t||(t=ve);let f;if(i.usePolling){let p=i.interval!==i.binaryInterval;l.interval=p&&Zi(o)?i.binaryInterval:i.interval,f=sr(e,n,l,{listener:t,rawEmitter:this.fsw._emitRaw})}else f=tr(e,n,l,{listener:t,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw});return f}_handleFile(e,t,i){if(this.fsw.closed)return;let r=P.dirname(e),o=P.basename(e),a=this.fsw._getWatchedDir(r),n=t;if(a.has(o))return;let l=async(p,m)=>{if(this.fsw._throttle(qi,e,5)){if(!m||m.mtimeMs===0)try{let u=await(0,F.stat)(e);if(this.fsw.closed)return;let b=u.atimeMs,C=u.mtimeMs;if((!b||b<=C||C!==n.mtimeMs)&&this.fsw._emit(A.CHANGE,e,u),(Ji||Vi||Yi)&&n.ino!==u.ino){this.fsw._closeFile(p),n=u;let E=this._watchWithNodeFs(e,l);E&&this.fsw._addPathCloser(p,E)}else n=u}catch{this.fsw._remove(r,o)}else if(a.has(o)){let u=m.atimeMs,b=m.mtimeMs;(!u||u<=b||b!==n.mtimeMs)&&this.fsw._emit(A.CHANGE,e,m),n=m}}},f=this._watchWithNodeFs(e,l);if(!(i&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(A.ADD,e,0))return;this.fsw._emit(A.ADD,e,t)}return f}async _handleSymlink(e,t,i,r){if(this.fsw.closed)return;let o=e.fullPath,a=this.fsw._getWatchedDir(t);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let n;try{n=await(0,F.realpath)(i)}catch{return this.fsw._emitReady(),!0}return this.fsw.closed?void 0:(a.has(r)?this.fsw._symlinkPaths.get(o)!==n&&(this.fsw._symlinkPaths.set(o,n),this.fsw._emit(A.CHANGE,i,e.stats)):(a.add(r),this.fsw._symlinkPaths.set(o,n),this.fsw._emit(A.ADD,i,e.stats)),this.fsw._emitReady(),!0)}if(this.fsw._symlinkPaths.has(o))return!0;this.fsw._symlinkPaths.set(o,!0)}_handleRead(e,t,i,r,o,a,n){if(e=P.join(e,""),n=this.fsw._throttle("readdir",e,1e3),!n)return;let l=this.fsw._getWatchedDir(i.path),f=new Set,p=this.fsw._readdirp(e,{fileFilter:m=>i.filterPath(m),directoryFilter:m=>i.filterDir(m)});if(p)return p.on(Bi,async m=>{if(this.fsw.closed){p=void 0;return}let u=m.path,b=P.join(e,u);if(f.add(u),!(m.stats.isSymbolicLink()&&await this._handleSymlink(m,e,b,u))){if(this.fsw.closed){p=void 0;return}(u===r||!r&&!l.has(u))&&(this.fsw._incrReadyCount(),b=P.join(o,P.relative(o,b)),this._addToNodeFs(b,t,i,a+1))}}).on(A.ERROR,this._boundHandleError),new Promise((m,u)=>{if(!p)return u();p.once(Be,()=>{if(this.fsw.closed){p=void 0;return}let b=n?n.clear():!1;m(void 0),l.getChildren().filter(C=>C!==e&&!f.has(C)).forEach(C=>{this.fsw._remove(e,C)}),p=void 0,b&&this._handleRead(e,!1,i,r,o,a,n)})})}async _handleDir(e,t,i,r,o,a,n){let l=this.fsw._getWatchedDir(P.dirname(e)),f=l.has(P.basename(e));!(i&&this.fsw.options.ignoreInitial)&&!o&&!f&&this.fsw._emit(A.ADD_DIR,e,t),l.add(P.basename(e)),this.fsw._getWatchedDir(e);let p,m,u=this.fsw.options.depth;if((u==null||r<=u)&&!this.fsw._symlinkPaths.has(n)){if(!o&&(await this._handleRead(e,i,a,o,e,r,p),this.fsw.closed))return;m=this._watchWithNodeFs(e,(b,C)=>{C&&C.mtimeMs===0||this._handleRead(b,!1,a,o,e,r,p)})}return m}async _addToNodeFs(e,t,i,r,o){let a=this.fsw._emitReady;if(this.fsw._isIgnored(e)||this.fsw.closed)return a(),!1;let n=this.fsw._getWatchHelpers(e);i&&(n.filterPath=l=>i.filterPath(l),n.filterDir=l=>i.filterDir(l));try{let l=await Xi[n.statMethod](n.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(n.watchPath,l))return a(),!1;let f=this.fsw.options.followSymlinks,p;if(l.isDirectory()){let m=P.resolve(e),u=f?await(0,F.realpath)(e):e;if(this.fsw.closed||(p=await this._handleDir(n.watchPath,l,t,r,o,n,u),this.fsw.closed))return;m!==u&&u!==void 0&&this.fsw._symlinkPaths.set(m,u)}else if(l.isSymbolicLink()){let m=f?await(0,F.realpath)(e):e;if(this.fsw.closed)return;let u=P.dirname(n.watchPath);if(this.fsw._getWatchedDir(u).add(n.watchPath),this.fsw._emit(A.ADD,n.watchPath,l),p=await this._handleDir(u,l,t,r,e,n,m),this.fsw.closed)return;m!==void 0&&this.fsw._symlinkPaths.set(P.resolve(e),m)}else p=this._handleFile(n.watchPath,l,t);return a(),p&&this.fsw._addPathCloser(e,p),!1}catch(l){if(this.fsw._handleError(l))return a(),e}}}});function Ce(s){return Array.isArray(s)?s:[s]}function pr(s){return typeof s=="function"?s:typeof s=="string"?e=>s===e:s instanceof RegExp?e=>s.test(e):typeof s=="object"&&s!==null?e=>{if(s.path===e)return!0;if(s.recursive){let t=y.relative(s.path,e);return t?!t.startsWith("..")&&!y.isAbsolute(t):!1}return!1}:()=>!1}function cr(s){if(typeof s!="string")throw new Error("string expected");s=y.normalize(s),s=s.replace(/\\/g,"/");let e=!1;s.startsWith("//")&&(e=!0);let t=/\/\//;for(;s.match(t);)s=s.replace(t,"/");return e&&(s="/"+s),s}function Kt(s,e,t){let i=cr(e);for(let r=0;r<s.length;r++){let o=s[r];if(o(i,t))return!0}return!1}function hr(s,e){if(s==null)throw new TypeError("anymatch: specify first argument");let i=Ce(s).map(r=>pr(r));return e==null?(r,o)=>Kt(i,r,o):Kt(i,e)}function gr(s,e={}){let t=new Ee(e);return t.add(s),t}var ts,Pe,ss,y,Ve,ir,is,rr,or,nr,Xt,ar,lr,Ye,Qt,Zt,rs,es,fr,ur,qe,mr,dr,Xe,Ee,os,ns=w(()=>{"use strict";c();ts=require("fs"),Pe=require("fs/promises"),ss=require("events"),y=d(require("path"),1);Gt();qt();Ve="/",ir="//",is=".",rr="..",or="string",nr=/\\/g,Xt=/\/\//,ar=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/,lr=/^\.[/\\]/;Ye=s=>typeof s=="object"&&s!==null&&!(s instanceof RegExp);Qt=s=>{let e=Ce(s).flat();if(!e.every(t=>typeof t===or))throw new TypeError(`Non-string provided as watch path: ${e}`);return e.map(rs)},Zt=s=>{let e=s.replace(nr,Ve),t=!1;for(e.startsWith(ir)&&(t=!0);e.match(Xt);)e=e.replace(Xt,Ve);return t&&(e=Ve+e),e},rs=s=>Zt(y.normalize(Zt(s))),es=(s="")=>e=>typeof e=="string"?rs(y.isAbsolute(e)?e:y.join(s,e)):e,fr=(s,e)=>y.isAbsolute(s)?s:y.join(e,s),ur=Object.freeze(new Set),qe=class{constructor(e,t){this.path=e,this._removeWatcher=t,this.items=new Set}add(e){let{items:t}=this;t&&e!==is&&e!==rr&&t.add(e)}async remove(e){let{items:t}=this;if(!t||(t.delete(e),t.size>0))return;let i=this.path;try{await(0,Pe.readdir)(i)}catch{this._removeWatcher&&this._removeWatcher(y.dirname(i),y.basename(i))}}has(e){let{items:t}=this;if(t)return t.has(e)}getChildren(){let{items:e}=this;return e?[...e.values()]:[]}dispose(){this.items.clear(),this.path="",this._removeWatcher=ve,this.items=ur,Object.freeze(this)}},mr="stat",dr="lstat",Xe=class{constructor(e,t,i){this.fsw=i;let r=e;this.path=e=e.replace(lr,""),this.watchPath=r,this.fullWatchPath=y.resolve(r),this.dirParts=[],this.dirParts.forEach(o=>{o.length>1&&o.pop()}),this.followSymlinks=t,this.statMethod=t?mr:dr}entryPath(e){return y.join(this.watchPath,y.relative(this.watchPath,e.fullPath))}filterPath(e){let{stats:t}=e;if(t&&t.isSymbolicLink())return this.filterDir(e);let i=this.entryPath(e);return this.fsw._isntIgnored(i,t)&&this.fsw._hasReadPermissions(t)}filterDir(e){return this.fsw._isntIgnored(this.entryPath(e),e.stats)}},Ee=class extends ss.EventEmitter{constructor(e={}){super(),this.closed=!1,this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._streams=new Set,this._symlinkPaths=new Map,this._watched=new Map,this._pendingWrites=new Map,this._pendingUnlinks=new Map,this._readyCount=0,this._readyEmitted=!1;let t=e.awaitWriteFinish,i={stabilityThreshold:2e3,pollInterval:100},r={persistent:!0,ignoreInitial:!1,ignorePermissionErrors:!1,interval:100,binaryInterval:300,followSymlinks:!0,usePolling:!1,atomic:!0,...e,ignored:e.ignored?Ce(e.ignored):Ce([]),awaitWriteFinish:t===!0?i:typeof t=="object"?{...i,...t}:!1};Vt&&(r.usePolling=!0),r.atomic===void 0&&(r.atomic=!r.usePolling);let o=process.env.CHOKIDAR_USEPOLLING;if(o!==void 0){let l=o.toLowerCase();l==="false"||l==="0"?r.usePolling=!1:l==="true"||l==="1"?r.usePolling=!0:r.usePolling=!!l}let a=process.env.CHOKIDAR_INTERVAL;a&&(r.interval=Number.parseInt(a,10));let n=0;this._emitReady=()=>{n++,n>=this._readyCount&&(this._emitReady=ve,this._readyEmitted=!0,process.nextTick(()=>this.emit(x.READY)))},this._emitRaw=(...l)=>this.emit(x.RAW,...l),this._boundRemove=this._remove.bind(this),this.options=r,this._nodeFsHandler=new we(this),Object.freeze(r)}_addIgnoredPath(e){if(Ye(e)){for(let t of this._ignoredPaths)if(Ye(t)&&t.path===e.path&&t.recursive===e.recursive)return}this._ignoredPaths.add(e)}_removeIgnoredPath(e){if(this._ignoredPaths.delete(e),typeof e=="string")for(let t of this._ignoredPaths)Ye(t)&&t.path===e&&this._ignoredPaths.delete(t)}add(e,t,i){let{cwd:r}=this.options;this.closed=!1,this._closePromise=void 0;let o=Qt(e);return r&&(o=o.map(a=>fr(a,r))),o.forEach(a=>{this._removeIgnoredPath(a)}),this._userIgnored=void 0,this._readyCount||(this._readyCount=0),this._readyCount+=o.length,Promise.all(o.map(async a=>{let n=await this._nodeFsHandler._addToNodeFs(a,!i,void 0,0,t);return n&&this._emitReady(),n})).then(a=>{this.closed||a.forEach(n=>{n&&this.add(y.dirname(n),y.basename(t||n))})}),this}unwatch(e){if(this.closed)return this;let t=Qt(e),{cwd:i}=this.options;return t.forEach(r=>{!y.isAbsolute(r)&&!this._closers.has(r)&&(i&&(r=y.join(i,r)),r=y.resolve(r)),this._closePath(r),this._addIgnoredPath(r),this._watched.has(r)&&this._addIgnoredPath({path:r,recursive:!0}),this._userIgnored=void 0}),this}close(){if(this._closePromise)return this._closePromise;this.closed=!0,this.removeAllListeners();let e=[];return this._closers.forEach(t=>t.forEach(i=>{let r=i();r instanceof Promise&&e.push(r)})),this._streams.forEach(t=>t.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach(t=>t.dispose()),this._closers.clear(),this._watched.clear(),this._streams.clear(),this._symlinkPaths.clear(),this._throttled.clear(),this._closePromise=e.length?Promise.all(e).then(()=>{}):Promise.resolve(),this._closePromise}getWatched(){let e={};return this._watched.forEach((t,i)=>{let o=(this.options.cwd?y.relative(this.options.cwd,i):i)||is;e[o]=t.getChildren().sort()}),e}emitWithAll(e,t){this.emit(e,...t),e!==x.ERROR&&this.emit(x.ALL,e,...t)}async _emit(e,t,i){if(this.closed)return;let r=this.options;Je&&(t=y.normalize(t)),r.cwd&&(t=y.relative(r.cwd,t));let o=[t];i!=null&&o.push(i);let a=r.awaitWriteFinish,n;if(a&&(n=this._pendingWrites.get(t)))return n.lastChange=new Date,this;if(r.atomic){if(e===x.UNLINK)return this._pendingUnlinks.set(t,[e,...o]),setTimeout(()=>{this._pendingUnlinks.forEach((l,f)=>{this.emit(...l),this.emit(x.ALL,...l),this._pendingUnlinks.delete(f)})},typeof r.atomic=="number"?r.atomic:100),this;e===x.ADD&&this._pendingUnlinks.has(t)&&(e=x.CHANGE,this._pendingUnlinks.delete(t))}if(a&&(e===x.ADD||e===x.CHANGE)&&this._readyEmitted){let l=(f,p)=>{f?(e=x.ERROR,o[0]=f,this.emitWithAll(e,o)):p&&(o.length>1?o[1]=p:o.push(p),this.emitWithAll(e,o))};return this._awaitWriteFinish(t,a.stabilityThreshold,e,l),this}if(e===x.CHANGE&&!this._throttle(x.CHANGE,t,50))return this;if(r.alwaysStat&&i===void 0&&(e===x.ADD||e===x.ADD_DIR||e===x.CHANGE)){let l=r.cwd?y.join(r.cwd,t):t,f;try{f=await(0,Pe.stat)(l)}catch{}if(!f||this.closed)return;o.push(f)}return this.emitWithAll(e,o),this}_handleError(e){let t=e&&e.code;return e&&t!=="ENOENT"&&t!=="ENOTDIR"&&(!this.options.ignorePermissionErrors||t!=="EPERM"&&t!=="EACCES")&&this.emit(x.ERROR,e),e||this.closed}_throttle(e,t,i){this._throttled.has(e)||this._throttled.set(e,new Map);let r=this._throttled.get(e);if(!r)throw new Error("invalid throttle");let o=r.get(t);if(o)return o.count++,!1;let a,n=()=>{let f=r.get(t),p=f?f.count:0;return r.delete(t),clearTimeout(a),f&&clearTimeout(f.timeoutObject),p};a=setTimeout(n,i);let l={timeoutObject:a,clear:n,count:0};return r.set(t,l),l}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(e,t,i,r){let o=this.options.awaitWriteFinish;if(typeof o!="object")return;let a=o.pollInterval,n,l=e;this.options.cwd&&!y.isAbsolute(e)&&(l=y.join(this.options.cwd,e));let f=new Date,p=this._pendingWrites;function m(u){(0,ts.stat)(l,(b,C)=>{if(b||!p.has(e)){b&&b.code!=="ENOENT"&&r(b);return}let E=Number(new Date);u&&C.size!==u.size&&(p.get(e).lastChange=E);let O=p.get(e);E-O.lastChange>=t?(p.delete(e),r(void 0,C)):n=setTimeout(m,a,C)})}p.has(e)||(p.set(e,{lastChange:f,cancelWait:()=>(p.delete(e),clearTimeout(n),i)}),n=setTimeout(m,a))}_isIgnored(e,t){if(this.options.atomic&&ar.test(e))return!0;if(!this._userIgnored){let{cwd:i}=this.options,o=(this.options.ignored||[]).map(es(i)),n=[...[...this._ignoredPaths].map(es(i)),...o];this._userIgnored=hr(n,void 0)}return this._userIgnored(e,t)}_isntIgnored(e,t){return!this._isIgnored(e,t)}_getWatchHelpers(e){return new Xe(e,this.options.followSymlinks,this)}_getWatchedDir(e){let t=y.resolve(e);return this._watched.has(t)||this._watched.set(t,new qe(t,this._boundRemove)),this._watched.get(t)}_hasReadPermissions(e){return this.options.ignorePermissionErrors?!0:!!(Number(e.mode)&256)}_remove(e,t,i){let r=y.join(e,t),o=y.resolve(r);if(i=i??(this._watched.has(r)||this._watched.has(o)),!this._throttle("remove",r,100))return;!i&&this._watched.size===1&&this.add(e,t,!0),this._getWatchedDir(r).getChildren().forEach(u=>this._remove(r,u));let l=this._getWatchedDir(e),f=l.has(t);l.remove(t),this._symlinkPaths.has(o)&&this._symlinkPaths.delete(o);let p=r;if(this.options.cwd&&(p=y.relative(this.options.cwd,r)),this.options.awaitWriteFinish&&this._pendingWrites.has(p)&&this._pendingWrites.get(p).cancelWait()===x.ADD)return;this._watched.delete(r),this._watched.delete(o);let m=i?x.UNLINK_DIR:x.UNLINK;f&&!this._isIgnored(r)&&this._emit(m,r),this._closePath(r)}_closePath(e){this._closeFile(e);let t=y.dirname(e);this._getWatchedDir(t).remove(y.basename(e))}_closeFile(e){let t=this._closers.get(e);t&&(t.forEach(i=>i()),this._closers.delete(e))}_addPathCloser(e,t){if(!t)return;let i=this._closers.get(e);i||(i=[],this._closers.set(e,i)),i.push(t)}_readdirp(e,t){if(this.closed)return;let i={type:x.ALL,alwaysStat:!0,lstat:!0,...t,depth:0},r=Wt(e,i);return this._streams.add(r),r.once(Jt,()=>{r=void 0}),r.once(Be,()=>{r&&(this._streams.delete(r),r=void 0)}),r}};os={watch:gr,FSWatcher:Ee}});var k,yr,G,wr,vr,br,Ke,xe,Cr,Er,Z,Qe,Pr,Ze,ee,_,te=w(()=>{"use strict";c();k=d(require("chalk"),1),yr=k.default.hex("#1abc9c"),G=k.default.hex("#16a085"),wr=k.default.hex("#2ecc71"),vr=k.default.hex("#27ae60"),br=k.default.hex("#e74c3c"),Ke=k.default.hex("#c0392b"),xe=k.default.hex("#f1c40f"),Cr=k.default.hex("#f39c12"),Er=k.default.hex("#3498db"),Z=k.default.hex("#2980b9"),Qe=k.default.hex("#ecf0f1"),Pr=k.default.hex("#fd79a8"),Ze=k.default.hex("#e84393"),ee=k.default.hex("#7f8c8d"),_={lightGreen:yr,green:G,lightCyan:wr,cyan:vr,lightRed:br,red:Ke,yellow:xe,orange:Cr,lightBlue:Er,blue:Z,white:Qe,lightMagenta:Pr,magenta:Ze,gray:ee}});var as,oe,h,N=w(()=>{"use strict";c();te();as=!1,oe=class{brandName="";fullName="";logLevel=as?"debug":"info";isLogTime=as;setup({brandName:e,logLevel:t,fullName:i}){this.brandName=` [${e}] `,this.fullName=` ${i} `,this.fullName=_.green.bold(this.fullName),t&&(this.logLevel=t)}time=(...e)=>this.isLogTime&&console.time(...e);timeEnd=(...e)=>this.isLogTime&&console.timeEnd(...e);debug=(...e)=>["debug"].includes(this.logLevel)&&console.log(...e);info=(...e)=>["debug","info"].includes(this.logLevel)&&console.log(...e);warn=(...e)=>["debug","info","warn"].includes(this.logLevel)&&console.warn(...e);error=(...e)=>["debug","info","warn","error"].includes(this.logLevel)&&console.error(...e);blue=e=>{console.log(`${_.lightBlue(this.brandName)}${_.blue(` ${e} `)}
|
|
1
|
+
"use strict";var Li=Object.create;var ue=Object.defineProperty;var Ai=Object.getOwnPropertyDescriptor;var Fi=Object.getOwnPropertyNames;var Ni=Object.getPrototypeOf,$i=Object.prototype.hasOwnProperty;var w=(s,e)=>()=>(s&&(e=s(s=0)),e);var K=(s,e)=>{for(var t in e)ue(s,t,{get:e[t],enumerable:!0})},Nt=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Fi(e))!$i.call(s,r)&&r!==t&&ue(s,r,{get:()=>e[r],enumerable:!(i=Ai(e,r))||i.enumerable});return s};var d=(s,e,t)=>(t=s!=null?Li(Ni(s)):{},Nt(e||!s||!s.__esModule?ue(t,"default",{value:s,enumerable:!0}):t,s)),Ii=s=>Nt(ue({},"__esModule",{value:!0}),s);var c=w(()=>{"use strict"});var me,ze=w(()=>{me={name:"@empjs/cli",version:"3.12.4",description:"emp",license:"MIT",type:"module",files:["dist","bin","resource","template","types","tsconfig"],maintainers:["xuhongbin","ckken","doerme"],repository:{type:"git",url:"git+https://github.com/empjs/emp.git",directory:"packages/cli"},publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},keywords:["rspack","rust","typescript"],bin:{emp:"./bin/emp.js"},main:"dist/index.js",types:"dist/index.d.ts",exports:{".":{import:{types:"./dist/index.d.ts",default:"./dist/index.js"},require:{types:"./dist/index.d.cts",default:"./dist/index.cjs"}},"./emp-tsconfig.json":{default:"./tsconfig/react.json"},"./tsconfig/base":{default:"./tsconfig/base.json"},"./tsconfig/react":{default:"./tsconfig/react.json"},"./tsconfig/vue":{default:"./tsconfig/vue.json"},"./client":{types:"./types/react/index.d.ts",default:"./types/react/index.d.ts"},"./types/base":{types:"./types/base/index.d.ts",default:"./types/base/index.d.ts"},"./types/vue":{types:"./types/vue/index.d.ts",default:"./types/vue/index.d.ts"},"./types/react":{types:"./types/react/index.d.ts",default:"./types/react/index.d.ts"}},scripts:{dev:"tsup --watch --env.ENV dev",build:"tsup --env.ENV prod","dev-rs":"rslib build --watch --env-mode development","build-rs":"rslib build --env-mode production",ph:"pnpm publish --no-git-checks"},engines:{node:">=18.0.0"},author:"Ken",devDependencies:{"@types/compression":"^1.7.2","@types/connect":"^3.4.38","@types/cors":"^2.8.12","@types/default-gateway":"^7.2.1","@types/fs-extra":"^11.0.4","@types/react":"^18.3.2","@types/serve-static":"^1.15.8","@types/watchpack":"^2.4.3","@types/webpack":"^5.28.4","@types/webpack-bundle-analyzer":"^4.6.2","@types/webpack-sources":"^3.2.2",chokidar:"^4.0.3",vue:"^3.5.21"},dependencies:{"@empjs/chain":"workspace:*","@rsdoctor/rspack-plugin":"1.5.0","@rspack/core":"1.7.4","@rspack/dev-server":"1.2.1","@swc/helpers":"^0.5.18","@vue/tsconfig":"^0.8.1",address:"^2.0.2",chalk:"^5.3.0",commander:"11.1.0",compression:"1.8.1",connect:"3.7.0","core-js":"^3.41.0",cors:"2.8.5","default-gateway":"7.2.2","fs-extra":"11.3.1",glob:"11.0.3","gzip-size":"7.0.0","html-webpack-plugin":"5.6.4","http-proxy-middleware":"^3.0.5",jiti:"2.6.1","less-loader":"^12.2.0",open:"10.2.0","sass-embedded":"1.93.2","sass-loader":"16.0.5","serve-static":"2.2.0","ts-checker-rspack-plugin":"1.1.6","typescript-plugin-css-modules":"5.2.0","webpack-bundle-analyzer":"4.10.2"}}});function Wt(s,e={}){let t=e.entryType||e.type;if(t==="both"&&(t=D.FILE_DIR_TYPE),t&&(e.type=t),s){if(typeof s!="string")throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");if(t&&!$t.includes(t))throw new Error(`readdirp: Invalid type passed. Use one of ${$t.join(", ")}`)}else throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");return e.root=s,new We(e)}var z,zt,H,D,He,Ht,zi,$t,Hi,Wi,Gi,Ui,It,Mt,We,Gt=w(()=>{"use strict";c();z=require("fs/promises"),zt=require("stream"),H=require("path"),D={FILE_TYPE:"files",DIR_TYPE:"directories",FILE_DIR_TYPE:"files_directories",EVERYTHING_TYPE:"all"},He={root:".",fileFilter:s=>!0,directoryFilter:s=>!0,type:D.FILE_TYPE,lstat:!1,depth:2147483648,alwaysStat:!1,highWaterMark:4096};Object.freeze(He);Ht="READDIRP_RECURSIVE_ERROR",zi=new Set(["ENOENT","EPERM","EACCES","ELOOP",Ht]),$t=[D.DIR_TYPE,D.EVERYTHING_TYPE,D.FILE_DIR_TYPE,D.FILE_TYPE],Hi=new Set([D.DIR_TYPE,D.EVERYTHING_TYPE,D.FILE_DIR_TYPE]),Wi=new Set([D.EVERYTHING_TYPE,D.FILE_DIR_TYPE,D.FILE_TYPE]),Gi=s=>zi.has(s.code),Ui=process.platform==="win32",It=s=>!0,Mt=s=>{if(s===void 0)return It;if(typeof s=="function")return s;if(typeof s=="string"){let e=s.trim();return t=>t.basename===e}if(Array.isArray(s)){let e=s.map(t=>t.trim());return t=>e.some(i=>t.basename===i)}return It},We=class extends zt.Readable{constructor(e={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:e.highWaterMark});let t={...He,...e},{root:i,type:r}=t;this._fileFilter=Mt(t.fileFilter),this._directoryFilter=Mt(t.directoryFilter);let o=t.lstat?z.lstat:z.stat;Ui?this._stat=a=>o(a,{bigint:!0}):this._stat=o,this._maxDepth=t.depth??He.depth,this._wantsDir=r?Hi.has(r):!1,this._wantsFile=r?Wi.has(r):!1,this._wantsEverything=r===D.EVERYTHING_TYPE,this._root=(0,H.resolve)(i),this._isDirent=!t.alwaysStat,this._statsProp=this._isDirent?"dirent":"stats",this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent},this.parents=[this._exploreDir(i,1)],this.reading=!1,this.parent=void 0}async _read(e){if(!this.reading){this.reading=!0;try{for(;!this.destroyed&&e>0;){let t=this.parent,i=t&&t.files;if(i&&i.length>0){let{path:r,depth:o}=t,a=i.splice(0,e).map(l=>this._formatEntry(l,r)),n=await Promise.all(a);for(let l of n){if(!l)continue;if(this.destroyed)return;let f=await this._getEntryType(l);f==="directory"&&this._directoryFilter(l)?(o<=this._maxDepth&&this.parents.push(this._exploreDir(l.fullPath,o+1)),this._wantsDir&&(this.push(l),e--)):(f==="file"||this._includeAsFile(l))&&this._fileFilter(l)&&this._wantsFile&&(this.push(l),e--)}}else{let r=this.parents.pop();if(!r){this.push(null);break}if(this.parent=await r,this.destroyed)return}}}catch(t){this.destroy(t)}finally{this.reading=!1}}}async _exploreDir(e,t){let i;try{i=await(0,z.readdir)(e,this._rdOptions)}catch(r){this._onError(r)}return{files:i,depth:t,path:e}}async _formatEntry(e,t){let i,r=this._isDirent?e.name:e;try{let o=(0,H.resolve)((0,H.join)(t,r));i={path:(0,H.relative)(this._root,o),fullPath:o,basename:r},i[this._statsProp]=this._isDirent?e:await this._stat(o)}catch(o){this._onError(o);return}return i}_onError(e){Gi(e)&&!this.destroyed?this.emit("warn",e):this.destroy(e)}async _getEntryType(e){if(!e&&this._statsProp in e)return"";let t=e[this._statsProp];if(t.isFile())return"file";if(t.isDirectory())return"directory";if(t&&t.isSymbolicLink()){let i=e.fullPath;try{let r=await(0,z.realpath)(i),o=await(0,z.lstat)(r);if(o.isFile())return"file";if(o.isDirectory()){let a=r.length;if(i.startsWith(r)&&i.substr(a,1)===H.sep){let n=new Error(`Circular symlink detected: "${i}" points to "${r}"`);return n.code=Ht,this._onError(n)}return"directory"}}catch(r){return this._onError(r),""}}}_includeAsFile(e){let t=e&&e[this._statsProp];return t&&this._wantsEverything&&!t.isDirectory()}}});function Ut(s,e,t,i,r){let o=(a,n)=>{t(s),r(a,n,{watchedPath:s}),n&&s!==n&&ye(P.resolve(s,n),V,P.join(s,n))};try{return(0,Y.watch)(s,{persistent:e.persistent},o)}catch(a){i(a);return}}var Y,F,P,Bt,Bi,Be,Jt,ve,be,Je,Ji,Vi,Yi,Vt,x,A,qi,Xi,V,de,Q,Ki,Qi,Zi,Ue,ie,er,re,Yt,ge,ye,tr,Ge,sr,we,qt=w(()=>{"use strict";c();Y=require("fs"),F=require("fs/promises"),P=d(require("path"),1),Bt=require("os"),Bi="data",Be="end",Jt="close",ve=()=>{},be=process.platform,Je=be==="win32",Ji=be==="darwin",Vi=be==="linux",Yi=be==="freebsd",Vt=(0,Bt.type)()==="OS400",x={ALL:"all",READY:"ready",ADD:"add",CHANGE:"change",ADD_DIR:"addDir",UNLINK:"unlink",UNLINK_DIR:"unlinkDir",RAW:"raw",ERROR:"error"},A=x,qi="watch",Xi={lstat:F.lstat,stat:F.stat},V="listeners",de="errHandlers",Q="rawEmitters",Ki=[V,de,Q],Qi=new Set(["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]),Zi=s=>Qi.has(P.extname(s).slice(1).toLowerCase()),Ue=(s,e)=>{s instanceof Set?s.forEach(e):e(s)},ie=(s,e,t)=>{let i=s[e];i instanceof Set||(s[e]=i=new Set([i])),i.add(t)},er=s=>e=>{let t=s[e];t instanceof Set?t.clear():delete s[e]},re=(s,e,t)=>{let i=s[e];i instanceof Set?i.delete(t):i===t&&delete s[e]},Yt=s=>s instanceof Set?s.size===0:!s,ge=new Map;ye=(s,e,t,i,r)=>{let o=ge.get(s);o&&Ue(o[e],a=>{a(t,i,r)})},tr=(s,e,t,i)=>{let{listener:r,errHandler:o,rawEmitter:a}=i,n=ge.get(e),l;if(!t.persistent)return l=Ut(s,t,r,o,a),l?l.close.bind(l):void 0;if(n)ie(n,V,r),ie(n,de,o),ie(n,Q,a);else{if(l=Ut(s,t,ye.bind(null,e,V),o,ye.bind(null,e,Q)),!l)return;l.on(A.ERROR,async f=>{let p=ye.bind(null,e,de);if(n&&(n.watcherUnusable=!0),Je&&f.code==="EPERM")try{await(await(0,F.open)(s,"r")).close(),p(f)}catch{}else p(f)}),n={listeners:r,errHandlers:o,rawEmitters:a,watcher:l},ge.set(e,n)}return()=>{re(n,V,r),re(n,de,o),re(n,Q,a),Yt(n.listeners)&&(n.watcher.close(),ge.delete(e),Ki.forEach(er(n)),n.watcher=void 0,Object.freeze(n))}},Ge=new Map,sr=(s,e,t,i)=>{let{listener:r,rawEmitter:o}=i,a=Ge.get(e),n=a&&a.options;return n&&(n.persistent<t.persistent||n.interval>t.interval)&&((0,Y.unwatchFile)(e),a=void 0),a?(ie(a,V,r),ie(a,Q,o)):(a={listeners:r,rawEmitters:o,options:t,watcher:(0,Y.watchFile)(e,t,(l,f)=>{Ue(a.rawEmitters,m=>{m(A.CHANGE,e,{curr:l,prev:f})});let p=l.mtimeMs;(l.size!==f.size||p>f.mtimeMs||p===0)&&Ue(a.listeners,m=>m(s,l))})},Ge.set(e,a)),()=>{re(a,V,r),re(a,Q,o),Yt(a.listeners)&&(Ge.delete(e),(0,Y.unwatchFile)(e),a.options=a.watcher=void 0,Object.freeze(a))}},we=class{constructor(e){this.fsw=e,this._boundHandleError=t=>e._handleError(t)}_watchWithNodeFs(e,t){let i=this.fsw.options,r=P.dirname(e),o=P.basename(e);this.fsw._getWatchedDir(r).add(o);let n=P.resolve(e),l={persistent:i.persistent};t||(t=ve);let f;if(i.usePolling){let p=i.interval!==i.binaryInterval;l.interval=p&&Zi(o)?i.binaryInterval:i.interval,f=sr(e,n,l,{listener:t,rawEmitter:this.fsw._emitRaw})}else f=tr(e,n,l,{listener:t,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw});return f}_handleFile(e,t,i){if(this.fsw.closed)return;let r=P.dirname(e),o=P.basename(e),a=this.fsw._getWatchedDir(r),n=t;if(a.has(o))return;let l=async(p,m)=>{if(this.fsw._throttle(qi,e,5)){if(!m||m.mtimeMs===0)try{let u=await(0,F.stat)(e);if(this.fsw.closed)return;let b=u.atimeMs,C=u.mtimeMs;if((!b||b<=C||C!==n.mtimeMs)&&this.fsw._emit(A.CHANGE,e,u),(Ji||Vi||Yi)&&n.ino!==u.ino){this.fsw._closeFile(p),n=u;let E=this._watchWithNodeFs(e,l);E&&this.fsw._addPathCloser(p,E)}else n=u}catch{this.fsw._remove(r,o)}else if(a.has(o)){let u=m.atimeMs,b=m.mtimeMs;(!u||u<=b||b!==n.mtimeMs)&&this.fsw._emit(A.CHANGE,e,m),n=m}}},f=this._watchWithNodeFs(e,l);if(!(i&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(A.ADD,e,0))return;this.fsw._emit(A.ADD,e,t)}return f}async _handleSymlink(e,t,i,r){if(this.fsw.closed)return;let o=e.fullPath,a=this.fsw._getWatchedDir(t);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let n;try{n=await(0,F.realpath)(i)}catch{return this.fsw._emitReady(),!0}return this.fsw.closed?void 0:(a.has(r)?this.fsw._symlinkPaths.get(o)!==n&&(this.fsw._symlinkPaths.set(o,n),this.fsw._emit(A.CHANGE,i,e.stats)):(a.add(r),this.fsw._symlinkPaths.set(o,n),this.fsw._emit(A.ADD,i,e.stats)),this.fsw._emitReady(),!0)}if(this.fsw._symlinkPaths.has(o))return!0;this.fsw._symlinkPaths.set(o,!0)}_handleRead(e,t,i,r,o,a,n){if(e=P.join(e,""),n=this.fsw._throttle("readdir",e,1e3),!n)return;let l=this.fsw._getWatchedDir(i.path),f=new Set,p=this.fsw._readdirp(e,{fileFilter:m=>i.filterPath(m),directoryFilter:m=>i.filterDir(m)});if(p)return p.on(Bi,async m=>{if(this.fsw.closed){p=void 0;return}let u=m.path,b=P.join(e,u);if(f.add(u),!(m.stats.isSymbolicLink()&&await this._handleSymlink(m,e,b,u))){if(this.fsw.closed){p=void 0;return}(u===r||!r&&!l.has(u))&&(this.fsw._incrReadyCount(),b=P.join(o,P.relative(o,b)),this._addToNodeFs(b,t,i,a+1))}}).on(A.ERROR,this._boundHandleError),new Promise((m,u)=>{if(!p)return u();p.once(Be,()=>{if(this.fsw.closed){p=void 0;return}let b=n?n.clear():!1;m(void 0),l.getChildren().filter(C=>C!==e&&!f.has(C)).forEach(C=>{this.fsw._remove(e,C)}),p=void 0,b&&this._handleRead(e,!1,i,r,o,a,n)})})}async _handleDir(e,t,i,r,o,a,n){let l=this.fsw._getWatchedDir(P.dirname(e)),f=l.has(P.basename(e));!(i&&this.fsw.options.ignoreInitial)&&!o&&!f&&this.fsw._emit(A.ADD_DIR,e,t),l.add(P.basename(e)),this.fsw._getWatchedDir(e);let p,m,u=this.fsw.options.depth;if((u==null||r<=u)&&!this.fsw._symlinkPaths.has(n)){if(!o&&(await this._handleRead(e,i,a,o,e,r,p),this.fsw.closed))return;m=this._watchWithNodeFs(e,(b,C)=>{C&&C.mtimeMs===0||this._handleRead(b,!1,a,o,e,r,p)})}return m}async _addToNodeFs(e,t,i,r,o){let a=this.fsw._emitReady;if(this.fsw._isIgnored(e)||this.fsw.closed)return a(),!1;let n=this.fsw._getWatchHelpers(e);i&&(n.filterPath=l=>i.filterPath(l),n.filterDir=l=>i.filterDir(l));try{let l=await Xi[n.statMethod](n.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(n.watchPath,l))return a(),!1;let f=this.fsw.options.followSymlinks,p;if(l.isDirectory()){let m=P.resolve(e),u=f?await(0,F.realpath)(e):e;if(this.fsw.closed||(p=await this._handleDir(n.watchPath,l,t,r,o,n,u),this.fsw.closed))return;m!==u&&u!==void 0&&this.fsw._symlinkPaths.set(m,u)}else if(l.isSymbolicLink()){let m=f?await(0,F.realpath)(e):e;if(this.fsw.closed)return;let u=P.dirname(n.watchPath);if(this.fsw._getWatchedDir(u).add(n.watchPath),this.fsw._emit(A.ADD,n.watchPath,l),p=await this._handleDir(u,l,t,r,e,n,m),this.fsw.closed)return;m!==void 0&&this.fsw._symlinkPaths.set(P.resolve(e),m)}else p=this._handleFile(n.watchPath,l,t);return a(),p&&this.fsw._addPathCloser(e,p),!1}catch(l){if(this.fsw._handleError(l))return a(),e}}}});function Ce(s){return Array.isArray(s)?s:[s]}function pr(s){return typeof s=="function"?s:typeof s=="string"?e=>s===e:s instanceof RegExp?e=>s.test(e):typeof s=="object"&&s!==null?e=>{if(s.path===e)return!0;if(s.recursive){let t=y.relative(s.path,e);return t?!t.startsWith("..")&&!y.isAbsolute(t):!1}return!1}:()=>!1}function cr(s){if(typeof s!="string")throw new Error("string expected");s=y.normalize(s),s=s.replace(/\\/g,"/");let e=!1;s.startsWith("//")&&(e=!0);let t=/\/\//;for(;s.match(t);)s=s.replace(t,"/");return e&&(s="/"+s),s}function Kt(s,e,t){let i=cr(e);for(let r=0;r<s.length;r++){let o=s[r];if(o(i,t))return!0}return!1}function hr(s,e){if(s==null)throw new TypeError("anymatch: specify first argument");let i=Ce(s).map(r=>pr(r));return e==null?(r,o)=>Kt(i,r,o):Kt(i,e)}function gr(s,e={}){let t=new Ee(e);return t.add(s),t}var ts,Pe,ss,y,Ve,ir,is,rr,or,nr,Xt,ar,lr,Ye,Qt,Zt,rs,es,fr,ur,qe,mr,dr,Xe,Ee,os,ns=w(()=>{"use strict";c();ts=require("fs"),Pe=require("fs/promises"),ss=require("events"),y=d(require("path"),1);Gt();qt();Ve="/",ir="//",is=".",rr="..",or="string",nr=/\\/g,Xt=/\/\//,ar=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/,lr=/^\.[/\\]/;Ye=s=>typeof s=="object"&&s!==null&&!(s instanceof RegExp);Qt=s=>{let e=Ce(s).flat();if(!e.every(t=>typeof t===or))throw new TypeError(`Non-string provided as watch path: ${e}`);return e.map(rs)},Zt=s=>{let e=s.replace(nr,Ve),t=!1;for(e.startsWith(ir)&&(t=!0);e.match(Xt);)e=e.replace(Xt,Ve);return t&&(e=Ve+e),e},rs=s=>Zt(y.normalize(Zt(s))),es=(s="")=>e=>typeof e=="string"?rs(y.isAbsolute(e)?e:y.join(s,e)):e,fr=(s,e)=>y.isAbsolute(s)?s:y.join(e,s),ur=Object.freeze(new Set),qe=class{constructor(e,t){this.path=e,this._removeWatcher=t,this.items=new Set}add(e){let{items:t}=this;t&&e!==is&&e!==rr&&t.add(e)}async remove(e){let{items:t}=this;if(!t||(t.delete(e),t.size>0))return;let i=this.path;try{await(0,Pe.readdir)(i)}catch{this._removeWatcher&&this._removeWatcher(y.dirname(i),y.basename(i))}}has(e){let{items:t}=this;if(t)return t.has(e)}getChildren(){let{items:e}=this;return e?[...e.values()]:[]}dispose(){this.items.clear(),this.path="",this._removeWatcher=ve,this.items=ur,Object.freeze(this)}},mr="stat",dr="lstat",Xe=class{constructor(e,t,i){this.fsw=i;let r=e;this.path=e=e.replace(lr,""),this.watchPath=r,this.fullWatchPath=y.resolve(r),this.dirParts=[],this.dirParts.forEach(o=>{o.length>1&&o.pop()}),this.followSymlinks=t,this.statMethod=t?mr:dr}entryPath(e){return y.join(this.watchPath,y.relative(this.watchPath,e.fullPath))}filterPath(e){let{stats:t}=e;if(t&&t.isSymbolicLink())return this.filterDir(e);let i=this.entryPath(e);return this.fsw._isntIgnored(i,t)&&this.fsw._hasReadPermissions(t)}filterDir(e){return this.fsw._isntIgnored(this.entryPath(e),e.stats)}},Ee=class extends ss.EventEmitter{constructor(e={}){super(),this.closed=!1,this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._streams=new Set,this._symlinkPaths=new Map,this._watched=new Map,this._pendingWrites=new Map,this._pendingUnlinks=new Map,this._readyCount=0,this._readyEmitted=!1;let t=e.awaitWriteFinish,i={stabilityThreshold:2e3,pollInterval:100},r={persistent:!0,ignoreInitial:!1,ignorePermissionErrors:!1,interval:100,binaryInterval:300,followSymlinks:!0,usePolling:!1,atomic:!0,...e,ignored:e.ignored?Ce(e.ignored):Ce([]),awaitWriteFinish:t===!0?i:typeof t=="object"?{...i,...t}:!1};Vt&&(r.usePolling=!0),r.atomic===void 0&&(r.atomic=!r.usePolling);let o=process.env.CHOKIDAR_USEPOLLING;if(o!==void 0){let l=o.toLowerCase();l==="false"||l==="0"?r.usePolling=!1:l==="true"||l==="1"?r.usePolling=!0:r.usePolling=!!l}let a=process.env.CHOKIDAR_INTERVAL;a&&(r.interval=Number.parseInt(a,10));let n=0;this._emitReady=()=>{n++,n>=this._readyCount&&(this._emitReady=ve,this._readyEmitted=!0,process.nextTick(()=>this.emit(x.READY)))},this._emitRaw=(...l)=>this.emit(x.RAW,...l),this._boundRemove=this._remove.bind(this),this.options=r,this._nodeFsHandler=new we(this),Object.freeze(r)}_addIgnoredPath(e){if(Ye(e)){for(let t of this._ignoredPaths)if(Ye(t)&&t.path===e.path&&t.recursive===e.recursive)return}this._ignoredPaths.add(e)}_removeIgnoredPath(e){if(this._ignoredPaths.delete(e),typeof e=="string")for(let t of this._ignoredPaths)Ye(t)&&t.path===e&&this._ignoredPaths.delete(t)}add(e,t,i){let{cwd:r}=this.options;this.closed=!1,this._closePromise=void 0;let o=Qt(e);return r&&(o=o.map(a=>fr(a,r))),o.forEach(a=>{this._removeIgnoredPath(a)}),this._userIgnored=void 0,this._readyCount||(this._readyCount=0),this._readyCount+=o.length,Promise.all(o.map(async a=>{let n=await this._nodeFsHandler._addToNodeFs(a,!i,void 0,0,t);return n&&this._emitReady(),n})).then(a=>{this.closed||a.forEach(n=>{n&&this.add(y.dirname(n),y.basename(t||n))})}),this}unwatch(e){if(this.closed)return this;let t=Qt(e),{cwd:i}=this.options;return t.forEach(r=>{!y.isAbsolute(r)&&!this._closers.has(r)&&(i&&(r=y.join(i,r)),r=y.resolve(r)),this._closePath(r),this._addIgnoredPath(r),this._watched.has(r)&&this._addIgnoredPath({path:r,recursive:!0}),this._userIgnored=void 0}),this}close(){if(this._closePromise)return this._closePromise;this.closed=!0,this.removeAllListeners();let e=[];return this._closers.forEach(t=>t.forEach(i=>{let r=i();r instanceof Promise&&e.push(r)})),this._streams.forEach(t=>t.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach(t=>t.dispose()),this._closers.clear(),this._watched.clear(),this._streams.clear(),this._symlinkPaths.clear(),this._throttled.clear(),this._closePromise=e.length?Promise.all(e).then(()=>{}):Promise.resolve(),this._closePromise}getWatched(){let e={};return this._watched.forEach((t,i)=>{let o=(this.options.cwd?y.relative(this.options.cwd,i):i)||is;e[o]=t.getChildren().sort()}),e}emitWithAll(e,t){this.emit(e,...t),e!==x.ERROR&&this.emit(x.ALL,e,...t)}async _emit(e,t,i){if(this.closed)return;let r=this.options;Je&&(t=y.normalize(t)),r.cwd&&(t=y.relative(r.cwd,t));let o=[t];i!=null&&o.push(i);let a=r.awaitWriteFinish,n;if(a&&(n=this._pendingWrites.get(t)))return n.lastChange=new Date,this;if(r.atomic){if(e===x.UNLINK)return this._pendingUnlinks.set(t,[e,...o]),setTimeout(()=>{this._pendingUnlinks.forEach((l,f)=>{this.emit(...l),this.emit(x.ALL,...l),this._pendingUnlinks.delete(f)})},typeof r.atomic=="number"?r.atomic:100),this;e===x.ADD&&this._pendingUnlinks.has(t)&&(e=x.CHANGE,this._pendingUnlinks.delete(t))}if(a&&(e===x.ADD||e===x.CHANGE)&&this._readyEmitted){let l=(f,p)=>{f?(e=x.ERROR,o[0]=f,this.emitWithAll(e,o)):p&&(o.length>1?o[1]=p:o.push(p),this.emitWithAll(e,o))};return this._awaitWriteFinish(t,a.stabilityThreshold,e,l),this}if(e===x.CHANGE&&!this._throttle(x.CHANGE,t,50))return this;if(r.alwaysStat&&i===void 0&&(e===x.ADD||e===x.ADD_DIR||e===x.CHANGE)){let l=r.cwd?y.join(r.cwd,t):t,f;try{f=await(0,Pe.stat)(l)}catch{}if(!f||this.closed)return;o.push(f)}return this.emitWithAll(e,o),this}_handleError(e){let t=e&&e.code;return e&&t!=="ENOENT"&&t!=="ENOTDIR"&&(!this.options.ignorePermissionErrors||t!=="EPERM"&&t!=="EACCES")&&this.emit(x.ERROR,e),e||this.closed}_throttle(e,t,i){this._throttled.has(e)||this._throttled.set(e,new Map);let r=this._throttled.get(e);if(!r)throw new Error("invalid throttle");let o=r.get(t);if(o)return o.count++,!1;let a,n=()=>{let f=r.get(t),p=f?f.count:0;return r.delete(t),clearTimeout(a),f&&clearTimeout(f.timeoutObject),p};a=setTimeout(n,i);let l={timeoutObject:a,clear:n,count:0};return r.set(t,l),l}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(e,t,i,r){let o=this.options.awaitWriteFinish;if(typeof o!="object")return;let a=o.pollInterval,n,l=e;this.options.cwd&&!y.isAbsolute(e)&&(l=y.join(this.options.cwd,e));let f=new Date,p=this._pendingWrites;function m(u){(0,ts.stat)(l,(b,C)=>{if(b||!p.has(e)){b&&b.code!=="ENOENT"&&r(b);return}let E=Number(new Date);u&&C.size!==u.size&&(p.get(e).lastChange=E);let O=p.get(e);E-O.lastChange>=t?(p.delete(e),r(void 0,C)):n=setTimeout(m,a,C)})}p.has(e)||(p.set(e,{lastChange:f,cancelWait:()=>(p.delete(e),clearTimeout(n),i)}),n=setTimeout(m,a))}_isIgnored(e,t){if(this.options.atomic&&ar.test(e))return!0;if(!this._userIgnored){let{cwd:i}=this.options,o=(this.options.ignored||[]).map(es(i)),n=[...[...this._ignoredPaths].map(es(i)),...o];this._userIgnored=hr(n,void 0)}return this._userIgnored(e,t)}_isntIgnored(e,t){return!this._isIgnored(e,t)}_getWatchHelpers(e){return new Xe(e,this.options.followSymlinks,this)}_getWatchedDir(e){let t=y.resolve(e);return this._watched.has(t)||this._watched.set(t,new qe(t,this._boundRemove)),this._watched.get(t)}_hasReadPermissions(e){return this.options.ignorePermissionErrors?!0:!!(Number(e.mode)&256)}_remove(e,t,i){let r=y.join(e,t),o=y.resolve(r);if(i=i??(this._watched.has(r)||this._watched.has(o)),!this._throttle("remove",r,100))return;!i&&this._watched.size===1&&this.add(e,t,!0),this._getWatchedDir(r).getChildren().forEach(u=>this._remove(r,u));let l=this._getWatchedDir(e),f=l.has(t);l.remove(t),this._symlinkPaths.has(o)&&this._symlinkPaths.delete(o);let p=r;if(this.options.cwd&&(p=y.relative(this.options.cwd,r)),this.options.awaitWriteFinish&&this._pendingWrites.has(p)&&this._pendingWrites.get(p).cancelWait()===x.ADD)return;this._watched.delete(r),this._watched.delete(o);let m=i?x.UNLINK_DIR:x.UNLINK;f&&!this._isIgnored(r)&&this._emit(m,r),this._closePath(r)}_closePath(e){this._closeFile(e);let t=y.dirname(e);this._getWatchedDir(t).remove(y.basename(e))}_closeFile(e){let t=this._closers.get(e);t&&(t.forEach(i=>i()),this._closers.delete(e))}_addPathCloser(e,t){if(!t)return;let i=this._closers.get(e);i||(i=[],this._closers.set(e,i)),i.push(t)}_readdirp(e,t){if(this.closed)return;let i={type:x.ALL,alwaysStat:!0,lstat:!0,...t,depth:0},r=Wt(e,i);return this._streams.add(r),r.once(Jt,()=>{r=void 0}),r.once(Be,()=>{r&&(this._streams.delete(r),r=void 0)}),r}};os={watch:gr,FSWatcher:Ee}});var k,yr,G,wr,vr,br,Ke,xe,Cr,Er,Z,Qe,Pr,Ze,ee,_,te=w(()=>{"use strict";c();k=d(require("chalk"),1),yr=k.default.hex("#1abc9c"),G=k.default.hex("#16a085"),wr=k.default.hex("#2ecc71"),vr=k.default.hex("#27ae60"),br=k.default.hex("#e74c3c"),Ke=k.default.hex("#c0392b"),xe=k.default.hex("#f1c40f"),Cr=k.default.hex("#f39c12"),Er=k.default.hex("#3498db"),Z=k.default.hex("#2980b9"),Qe=k.default.hex("#ecf0f1"),Pr=k.default.hex("#fd79a8"),Ze=k.default.hex("#e84393"),ee=k.default.hex("#7f8c8d"),_={lightGreen:yr,green:G,lightCyan:wr,cyan:vr,lightRed:br,red:Ke,yellow:xe,orange:Cr,lightBlue:Er,blue:Z,white:Qe,lightMagenta:Pr,magenta:Ze,gray:ee}});var as,oe,h,N=w(()=>{"use strict";c();te();as=!1,oe=class{brandName="";fullName="";logLevel=as?"debug":"info";isLogTime=as;setup({brandName:e,logLevel:t,fullName:i}){this.brandName=` [${e}] `,this.fullName=` ${i} `,this.fullName=_.green.bold(this.fullName),t&&(this.logLevel=t)}time=(...e)=>this.isLogTime&&console.time(...e);timeEnd=(...e)=>this.isLogTime&&console.timeEnd(...e);debug=(...e)=>["debug"].includes(this.logLevel)&&console.log(...e);info=(...e)=>["debug","info"].includes(this.logLevel)&&console.log(...e);warn=(...e)=>["debug","info","warn"].includes(this.logLevel)&&console.warn(...e);error=(...e)=>["debug","info","warn","error"].includes(this.logLevel)&&console.error(...e);blue=e=>{console.log(`${_.lightBlue(this.brandName)}${_.blue(` ${e} `)}
|
|
2
2
|
`)};cyan=e=>{console.log(`${_.lightCyan(this.brandName)}${_.cyan(` ${e} `)}
|
|
3
3
|
`)};magenta=e=>{console.log(`${_.lightMagenta(this.brandName)}${_.magenta(` ${e} `)}
|
|
4
4
|
`)};green=e=>{console.log(`${_.lightGreen(this.brandName)}${_.green(` ${e} `)}
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {createRequire as __createRequire} from 'module';var require=__createRequire(import.meta.url);
|
|
2
|
-
var Vs=Object.defineProperty;var k=(i=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(i,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):i)(function(i){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+i+'" is not supported')});var v=(i,e)=>()=>(i&&(e=i(i=0)),e);var Z=(i,e)=>{for(var t in e)Vs(i,t,{get:e[t],enumerable:!0})};import Ys from"path";import{fileURLToPath as qs}from"url";var vt,Xs,w,g,c=v(()=>{"use strict";vt=()=>qs(import.meta.url),Xs=()=>Ys.dirname(vt()),w=Xs(),g=vt()});var ae,Ae=v(()=>{ae={name:"@empjs/cli",version:"3.12.3",description:"emp",license:"MIT",type:"module",files:["dist","bin","resource","template","types","tsconfig"],maintainers:["xuhongbin","ckken","doerme"],repository:{type:"git",url:"git+https://github.com/empjs/emp.git",directory:"packages/cli"},publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},keywords:["rspack","rust","typescript"],bin:{emp:"./bin/emp.js"},main:"dist/index.js",types:"dist/index.d.ts",exports:{".":{import:{types:"./dist/index.d.ts",default:"./dist/index.js"},require:{types:"./dist/index.d.cts",default:"./dist/index.cjs"}},"./emp-tsconfig.json":{default:"./tsconfig/react.json"},"./tsconfig/base":{default:"./tsconfig/base.json"},"./tsconfig/react":{default:"./tsconfig/react.json"},"./tsconfig/vue":{default:"./tsconfig/vue.json"},"./client":{types:"./types/react/index.d.ts",default:"./types/react/index.d.ts"},"./types/base":{types:"./types/base/index.d.ts",default:"./types/base/index.d.ts"},"./types/vue":{types:"./types/vue/index.d.ts",default:"./types/vue/index.d.ts"},"./types/react":{types:"./types/react/index.d.ts",default:"./types/react/index.d.ts"}},scripts:{dev:"tsup --watch --env.ENV dev",build:"tsup --env.ENV prod","dev-rs":"rslib build --watch --env-mode development","build-rs":"rslib build --env-mode production",ph:"pnpm publish --no-git-checks"},engines:{node:">=18.0.0"},author:"Ken",devDependencies:{"@types/compression":"^1.7.2","@types/connect":"^3.4.38","@types/cors":"^2.8.12","@types/default-gateway":"^7.2.1","@types/fs-extra":"^11.0.4","@types/react":"^18.3.2","@types/serve-static":"^1.15.8","@types/watchpack":"^2.4.3","@types/webpack":"^5.28.4","@types/webpack-bundle-analyzer":"^4.6.2","@types/webpack-sources":"^3.2.2",chokidar:"^4.0.3",vue:"^3.5.21"},dependencies:{"@empjs/chain":"workspace:*","@rsdoctor/rspack-plugin":"1.5.0","@rspack/core":"1.7.4","@rspack/dev-server":"1.2.1","@swc/helpers":"^0.5.18","@vue/tsconfig":"^0.8.1",address:"^2.0.2",chalk:"^5.3.0",commander:"11.1.0",compression:"1.8.1",connect:"3.7.0","core-js":"^3.41.0",cors:"2.8.5","default-gateway":"7.2.2","fs-extra":"11.3.1",glob:"11.0.3","gzip-size":"7.0.0","html-webpack-plugin":"5.6.4","http-proxy-middleware":"^3.0.5",jiti:"2.6.1","less-loader":"^12.2.0",open:"10.2.0","sass-embedded":"1.93.2","sass-loader":"16.0.5","serve-static":"2.2.0","ts-checker-rspack-plugin":"1.1.6","typescript-plugin-css-modules":"5.2.0","webpack-bundle-analyzer":"4.10.2"}}});import{stat as Qs,lstat as bt,readdir as Zs,realpath as ei}from"fs/promises";import{Readable as ti}from"stream";import{resolve as Ct,relative as si,join as ii,sep as ri}from"path";function St(i,e={}){let t=e.entryType||e.type;if(t==="both"&&(t=T.FILE_DIR_TYPE),t&&(e.type=t),i){if(typeof i!="string")throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");if(t&&!Et.includes(t))throw new Error(`readdirp: Invalid type passed. Use one of ${Et.join(", ")}`)}else throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");return e.root=i,new Fe(e)}var T,Le,_t,oi,Et,ni,ai,li,pi,Pt,xt,Fe,kt=v(()=>{"use strict";c();T={FILE_TYPE:"files",DIR_TYPE:"directories",FILE_DIR_TYPE:"files_directories",EVERYTHING_TYPE:"all"},Le={root:".",fileFilter:i=>!0,directoryFilter:i=>!0,type:T.FILE_TYPE,lstat:!1,depth:2147483648,alwaysStat:!1,highWaterMark:4096};Object.freeze(Le);_t="READDIRP_RECURSIVE_ERROR",oi=new Set(["ENOENT","EPERM","EACCES","ELOOP",_t]),Et=[T.DIR_TYPE,T.EVERYTHING_TYPE,T.FILE_DIR_TYPE,T.FILE_TYPE],ni=new Set([T.DIR_TYPE,T.EVERYTHING_TYPE,T.FILE_DIR_TYPE]),ai=new Set([T.EVERYTHING_TYPE,T.FILE_DIR_TYPE,T.FILE_TYPE]),li=i=>oi.has(i.code),pi=process.platform==="win32",Pt=i=>!0,xt=i=>{if(i===void 0)return Pt;if(typeof i=="function")return i;if(typeof i=="string"){let e=i.trim();return t=>t.basename===e}if(Array.isArray(i)){let e=i.map(t=>t.trim());return t=>e.some(s=>t.basename===s)}return Pt},Fe=class extends ti{constructor(e={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:e.highWaterMark});let t={...Le,...e},{root:s,type:r}=t;this._fileFilter=xt(t.fileFilter),this._directoryFilter=xt(t.directoryFilter);let o=t.lstat?bt:Qs;pi?this._stat=a=>o(a,{bigint:!0}):this._stat=o,this._maxDepth=t.depth??Le.depth,this._wantsDir=r?ni.has(r):!1,this._wantsFile=r?ai.has(r):!1,this._wantsEverything=r===T.EVERYTHING_TYPE,this._root=Ct(s),this._isDirent=!t.alwaysStat,this._statsProp=this._isDirent?"dirent":"stats",this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent},this.parents=[this._exploreDir(s,1)],this.reading=!1,this.parent=void 0}async _read(e){if(!this.reading){this.reading=!0;try{for(;!this.destroyed&&e>0;){let t=this.parent,s=t&&t.files;if(s&&s.length>0){let{path:r,depth:o}=t,a=s.splice(0,e).map(l=>this._formatEntry(l,r)),n=await Promise.all(a);for(let l of n){if(!l)continue;if(this.destroyed)return;let f=await this._getEntryType(l);f==="directory"&&this._directoryFilter(l)?(o<=this._maxDepth&&this.parents.push(this._exploreDir(l.fullPath,o+1)),this._wantsDir&&(this.push(l),e--)):(f==="file"||this._includeAsFile(l))&&this._fileFilter(l)&&this._wantsFile&&(this.push(l),e--)}}else{let r=this.parents.pop();if(!r){this.push(null);break}if(this.parent=await r,this.destroyed)return}}}catch(t){this.destroy(t)}finally{this.reading=!1}}}async _exploreDir(e,t){let s;try{s=await Zs(e,this._rdOptions)}catch(r){this._onError(r)}return{files:s,depth:t,path:e}}async _formatEntry(e,t){let s,r=this._isDirent?e.name:e;try{let o=Ct(ii(t,r));s={path:si(this._root,o),fullPath:o,basename:r},s[this._statsProp]=this._isDirent?e:await this._stat(o)}catch(o){this._onError(o);return}return s}_onError(e){li(e)&&!this.destroyed?this.emit("warn",e):this.destroy(e)}async _getEntryType(e){if(!e&&this._statsProp in e)return"";let t=e[this._statsProp];if(t.isFile())return"file";if(t.isDirectory())return"directory";if(t&&t.isSymbolicLink()){let s=e.fullPath;try{let r=await ei(s),o=await bt(r);if(o.isFile())return"file";if(o.isDirectory()){let a=r.length;if(s.startsWith(r)&&s.substr(a,1)===ri){let n=new Error(`Circular symlink detected: "${s}" points to "${r}"`);return n.code=_t,this._onError(n)}return"directory"}}catch(r){return this._onError(r),""}}}_includeAsFile(e){let t=e&&e[this._statsProp];return t&&this._wantsEverything&&!t.isDirectory()}}});import{watchFile as ci,unwatchFile as Ot,watch as hi}from"fs";import{open as fi,stat as Tt,lstat as mi,realpath as Ne}from"fs/promises";import*as P from"path";import{type as ui}from"os";function Dt(i,e,t,s,r){let o=(a,n)=>{t(i),r(a,n,{watchedPath:i}),n&&i!==n&&ce(P.resolve(i,n),G,P.join(i,n))};try{return hi(i,{persistent:e.persistent},o)}catch(a){s(a);return}}var di,Me,Rt,fe,me,ze,gi,yi,wi,jt,x,A,vi,bi,G,le,Y,Ci,Ei,Pi,Ie,ee,xi,te,At,pe,ce,_i,$e,Si,he,Lt=v(()=>{"use strict";c();di="data",Me="end",Rt="close",fe=()=>{},me=process.platform,ze=me==="win32",gi=me==="darwin",yi=me==="linux",wi=me==="freebsd",jt=ui()==="OS400",x={ALL:"all",READY:"ready",ADD:"add",CHANGE:"change",ADD_DIR:"addDir",UNLINK:"unlink",UNLINK_DIR:"unlinkDir",RAW:"raw",ERROR:"error"},A=x,vi="watch",bi={lstat:mi,stat:Tt},G="listeners",le="errHandlers",Y="rawEmitters",Ci=[G,le,Y],Ei=new Set(["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]),Pi=i=>Ei.has(P.extname(i).slice(1).toLowerCase()),Ie=(i,e)=>{i instanceof Set?i.forEach(e):e(i)},ee=(i,e,t)=>{let s=i[e];s instanceof Set||(i[e]=s=new Set([s])),s.add(t)},xi=i=>e=>{let t=i[e];t instanceof Set?t.clear():delete i[e]},te=(i,e,t)=>{let s=i[e];s instanceof Set?s.delete(t):s===t&&delete i[e]},At=i=>i instanceof Set?i.size===0:!i,pe=new Map;ce=(i,e,t,s,r)=>{let o=pe.get(i);o&&Ie(o[e],a=>{a(t,s,r)})},_i=(i,e,t,s)=>{let{listener:r,errHandler:o,rawEmitter:a}=s,n=pe.get(e),l;if(!t.persistent)return l=Dt(i,t,r,o,a),l?l.close.bind(l):void 0;if(n)ee(n,G,r),ee(n,le,o),ee(n,Y,a);else{if(l=Dt(i,t,ce.bind(null,e,G),o,ce.bind(null,e,Y)),!l)return;l.on(A.ERROR,async f=>{let p=ce.bind(null,e,le);if(n&&(n.watcherUnusable=!0),ze&&f.code==="EPERM")try{await(await fi(i,"r")).close(),p(f)}catch{}else p(f)}),n={listeners:r,errHandlers:o,rawEmitters:a,watcher:l},pe.set(e,n)}return()=>{te(n,G,r),te(n,le,o),te(n,Y,a),At(n.listeners)&&(n.watcher.close(),pe.delete(e),Ci.forEach(xi(n)),n.watcher=void 0,Object.freeze(n))}},$e=new Map,Si=(i,e,t,s)=>{let{listener:r,rawEmitter:o}=s,a=$e.get(e),n=a&&a.options;return n&&(n.persistent<t.persistent||n.interval>t.interval)&&(Ot(e),a=void 0),a?(ee(a,G,r),ee(a,Y,o)):(a={listeners:r,rawEmitters:o,options:t,watcher:ci(e,t,(l,f)=>{Ie(a.rawEmitters,u=>{u(A.CHANGE,e,{curr:l,prev:f})});let p=l.mtimeMs;(l.size!==f.size||p>f.mtimeMs||p===0)&&Ie(a.listeners,u=>u(i,l))})},$e.set(e,a)),()=>{te(a,G,r),te(a,Y,o),At(a.listeners)&&($e.delete(e),Ot(e),a.options=a.watcher=void 0,Object.freeze(a))}},he=class{constructor(e){this.fsw=e,this._boundHandleError=t=>e._handleError(t)}_watchWithNodeFs(e,t){let s=this.fsw.options,r=P.dirname(e),o=P.basename(e);this.fsw._getWatchedDir(r).add(o);let n=P.resolve(e),l={persistent:s.persistent};t||(t=fe);let f;if(s.usePolling){let p=s.interval!==s.binaryInterval;l.interval=p&&Pi(o)?s.binaryInterval:s.interval,f=Si(e,n,l,{listener:t,rawEmitter:this.fsw._emitRaw})}else f=_i(e,n,l,{listener:t,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw});return f}_handleFile(e,t,s){if(this.fsw.closed)return;let r=P.dirname(e),o=P.basename(e),a=this.fsw._getWatchedDir(r),n=t;if(a.has(o))return;let l=async(p,u)=>{if(this.fsw._throttle(vi,e,5)){if(!u||u.mtimeMs===0)try{let m=await Tt(e);if(this.fsw.closed)return;let b=m.atimeMs,C=m.mtimeMs;if((!b||b<=C||C!==n.mtimeMs)&&this.fsw._emit(A.CHANGE,e,m),(gi||yi||wi)&&n.ino!==m.ino){this.fsw._closeFile(p),n=m;let E=this._watchWithNodeFs(e,l);E&&this.fsw._addPathCloser(p,E)}else n=m}catch{this.fsw._remove(r,o)}else if(a.has(o)){let m=u.atimeMs,b=u.mtimeMs;(!m||m<=b||b!==n.mtimeMs)&&this.fsw._emit(A.CHANGE,e,u),n=u}}},f=this._watchWithNodeFs(e,l);if(!(s&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(A.ADD,e,0))return;this.fsw._emit(A.ADD,e,t)}return f}async _handleSymlink(e,t,s,r){if(this.fsw.closed)return;let o=e.fullPath,a=this.fsw._getWatchedDir(t);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let n;try{n=await Ne(s)}catch{return this.fsw._emitReady(),!0}return this.fsw.closed?void 0:(a.has(r)?this.fsw._symlinkPaths.get(o)!==n&&(this.fsw._symlinkPaths.set(o,n),this.fsw._emit(A.CHANGE,s,e.stats)):(a.add(r),this.fsw._symlinkPaths.set(o,n),this.fsw._emit(A.ADD,s,e.stats)),this.fsw._emitReady(),!0)}if(this.fsw._symlinkPaths.has(o))return!0;this.fsw._symlinkPaths.set(o,!0)}_handleRead(e,t,s,r,o,a,n){if(e=P.join(e,""),n=this.fsw._throttle("readdir",e,1e3),!n)return;let l=this.fsw._getWatchedDir(s.path),f=new Set,p=this.fsw._readdirp(e,{fileFilter:u=>s.filterPath(u),directoryFilter:u=>s.filterDir(u)});if(p)return p.on(di,async u=>{if(this.fsw.closed){p=void 0;return}let m=u.path,b=P.join(e,m);if(f.add(m),!(u.stats.isSymbolicLink()&&await this._handleSymlink(u,e,b,m))){if(this.fsw.closed){p=void 0;return}(m===r||!r&&!l.has(m))&&(this.fsw._incrReadyCount(),b=P.join(o,P.relative(o,b)),this._addToNodeFs(b,t,s,a+1))}}).on(A.ERROR,this._boundHandleError),new Promise((u,m)=>{if(!p)return m();p.once(Me,()=>{if(this.fsw.closed){p=void 0;return}let b=n?n.clear():!1;u(void 0),l.getChildren().filter(C=>C!==e&&!f.has(C)).forEach(C=>{this.fsw._remove(e,C)}),p=void 0,b&&this._handleRead(e,!1,s,r,o,a,n)})})}async _handleDir(e,t,s,r,o,a,n){let l=this.fsw._getWatchedDir(P.dirname(e)),f=l.has(P.basename(e));!(s&&this.fsw.options.ignoreInitial)&&!o&&!f&&this.fsw._emit(A.ADD_DIR,e,t),l.add(P.basename(e)),this.fsw._getWatchedDir(e);let p,u,m=this.fsw.options.depth;if((m==null||r<=m)&&!this.fsw._symlinkPaths.has(n)){if(!o&&(await this._handleRead(e,s,a,o,e,r,p),this.fsw.closed))return;u=this._watchWithNodeFs(e,(b,C)=>{C&&C.mtimeMs===0||this._handleRead(b,!1,a,o,e,r,p)})}return u}async _addToNodeFs(e,t,s,r,o){let a=this.fsw._emitReady;if(this.fsw._isIgnored(e)||this.fsw.closed)return a(),!1;let n=this.fsw._getWatchHelpers(e);s&&(n.filterPath=l=>s.filterPath(l),n.filterDir=l=>s.filterDir(l));try{let l=await bi[n.statMethod](n.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(n.watchPath,l))return a(),!1;let f=this.fsw.options.followSymlinks,p;if(l.isDirectory()){let u=P.resolve(e),m=f?await Ne(e):e;if(this.fsw.closed||(p=await this._handleDir(n.watchPath,l,t,r,o,n,m),this.fsw.closed))return;u!==m&&m!==void 0&&this.fsw._symlinkPaths.set(u,m)}else if(l.isSymbolicLink()){let u=f?await Ne(e):e;if(this.fsw.closed)return;let m=P.dirname(n.watchPath);if(this.fsw._getWatchedDir(m).add(n.watchPath),this.fsw._emit(A.ADD,n.watchPath,l),p=await this._handleDir(m,l,t,r,e,n,u),this.fsw.closed)return;u!==void 0&&this.fsw._symlinkPaths.set(P.resolve(e),u)}else p=this._handleFile(n.watchPath,l,t);return a(),p&&this.fsw._addPathCloser(e,p),!1}catch(l){if(this.fsw._handleError(l))return a(),e}}}});import{stat as ki}from"fs";import{stat as Oi,readdir as Di}from"fs/promises";import{EventEmitter as Ti}from"events";import*as y from"path";function ue(i){return Array.isArray(i)?i:[i]}function $i(i){return typeof i=="function"?i:typeof i=="string"?e=>i===e:i instanceof RegExp?e=>i.test(e):typeof i=="object"&&i!==null?e=>{if(i.path===e)return!0;if(i.recursive){let t=y.relative(i.path,e);return t?!t.startsWith("..")&&!y.isAbsolute(t):!1}return!1}:()=>!1}function Ii(i){if(typeof i!="string")throw new Error("string expected");i=y.normalize(i),i=i.replace(/\\/g,"/");let e=!1;i.startsWith("//")&&(e=!0);let t=/\/\//;for(;i.match(t);)i=i.replace(t,"/");return e&&(i="/"+i),i}function Nt(i,e,t){let s=Ii(e);for(let r=0;r<i.length;r++){let o=i[r];if(o(s,t))return!0}return!1}function Mi(i,e){if(i==null)throw new TypeError("anymatch: specify first argument");let s=ue(i).map(r=>$i(r));return e==null?(r,o)=>Nt(s,r,o):Nt(s,e)}function Ui(i,e={}){let t=new de(e);return t.add(i),t}var He,Ri,zt,ji,Ai,Li,Ft,Fi,Ni,We,$t,It,Ht,Mt,zi,Hi,Ge,Wi,Gi,Ue,de,Wt,Gt=v(()=>{"use strict";c();kt();Lt();He="/",Ri="//",zt=".",ji="..",Ai="string",Li=/\\/g,Ft=/\/\//,Fi=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/,Ni=/^\.[/\\]/;We=i=>typeof i=="object"&&i!==null&&!(i instanceof RegExp);$t=i=>{let e=ue(i).flat();if(!e.every(t=>typeof t===Ai))throw new TypeError(`Non-string provided as watch path: ${e}`);return e.map(Ht)},It=i=>{let e=i.replace(Li,He),t=!1;for(e.startsWith(Ri)&&(t=!0);e.match(Ft);)e=e.replace(Ft,He);return t&&(e=He+e),e},Ht=i=>It(y.normalize(It(i))),Mt=(i="")=>e=>typeof e=="string"?Ht(y.isAbsolute(e)?e:y.join(i,e)):e,zi=(i,e)=>y.isAbsolute(i)?i:y.join(e,i),Hi=Object.freeze(new Set),Ge=class{constructor(e,t){this.path=e,this._removeWatcher=t,this.items=new Set}add(e){let{items:t}=this;t&&e!==zt&&e!==ji&&t.add(e)}async remove(e){let{items:t}=this;if(!t||(t.delete(e),t.size>0))return;let s=this.path;try{await Di(s)}catch{this._removeWatcher&&this._removeWatcher(y.dirname(s),y.basename(s))}}has(e){let{items:t}=this;if(t)return t.has(e)}getChildren(){let{items:e}=this;return e?[...e.values()]:[]}dispose(){this.items.clear(),this.path="",this._removeWatcher=fe,this.items=Hi,Object.freeze(this)}},Wi="stat",Gi="lstat",Ue=class{constructor(e,t,s){this.fsw=s;let r=e;this.path=e=e.replace(Ni,""),this.watchPath=r,this.fullWatchPath=y.resolve(r),this.dirParts=[],this.dirParts.forEach(o=>{o.length>1&&o.pop()}),this.followSymlinks=t,this.statMethod=t?Wi:Gi}entryPath(e){return y.join(this.watchPath,y.relative(this.watchPath,e.fullPath))}filterPath(e){let{stats:t}=e;if(t&&t.isSymbolicLink())return this.filterDir(e);let s=this.entryPath(e);return this.fsw._isntIgnored(s,t)&&this.fsw._hasReadPermissions(t)}filterDir(e){return this.fsw._isntIgnored(this.entryPath(e),e.stats)}},de=class extends Ti{constructor(e={}){super(),this.closed=!1,this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._streams=new Set,this._symlinkPaths=new Map,this._watched=new Map,this._pendingWrites=new Map,this._pendingUnlinks=new Map,this._readyCount=0,this._readyEmitted=!1;let t=e.awaitWriteFinish,s={stabilityThreshold:2e3,pollInterval:100},r={persistent:!0,ignoreInitial:!1,ignorePermissionErrors:!1,interval:100,binaryInterval:300,followSymlinks:!0,usePolling:!1,atomic:!0,...e,ignored:e.ignored?ue(e.ignored):ue([]),awaitWriteFinish:t===!0?s:typeof t=="object"?{...s,...t}:!1};jt&&(r.usePolling=!0),r.atomic===void 0&&(r.atomic=!r.usePolling);let o=process.env.CHOKIDAR_USEPOLLING;if(o!==void 0){let l=o.toLowerCase();l==="false"||l==="0"?r.usePolling=!1:l==="true"||l==="1"?r.usePolling=!0:r.usePolling=!!l}let a=process.env.CHOKIDAR_INTERVAL;a&&(r.interval=Number.parseInt(a,10));let n=0;this._emitReady=()=>{n++,n>=this._readyCount&&(this._emitReady=fe,this._readyEmitted=!0,process.nextTick(()=>this.emit(x.READY)))},this._emitRaw=(...l)=>this.emit(x.RAW,...l),this._boundRemove=this._remove.bind(this),this.options=r,this._nodeFsHandler=new he(this),Object.freeze(r)}_addIgnoredPath(e){if(We(e)){for(let t of this._ignoredPaths)if(We(t)&&t.path===e.path&&t.recursive===e.recursive)return}this._ignoredPaths.add(e)}_removeIgnoredPath(e){if(this._ignoredPaths.delete(e),typeof e=="string")for(let t of this._ignoredPaths)We(t)&&t.path===e&&this._ignoredPaths.delete(t)}add(e,t,s){let{cwd:r}=this.options;this.closed=!1,this._closePromise=void 0;let o=$t(e);return r&&(o=o.map(a=>zi(a,r))),o.forEach(a=>{this._removeIgnoredPath(a)}),this._userIgnored=void 0,this._readyCount||(this._readyCount=0),this._readyCount+=o.length,Promise.all(o.map(async a=>{let n=await this._nodeFsHandler._addToNodeFs(a,!s,void 0,0,t);return n&&this._emitReady(),n})).then(a=>{this.closed||a.forEach(n=>{n&&this.add(y.dirname(n),y.basename(t||n))})}),this}unwatch(e){if(this.closed)return this;let t=$t(e),{cwd:s}=this.options;return t.forEach(r=>{!y.isAbsolute(r)&&!this._closers.has(r)&&(s&&(r=y.join(s,r)),r=y.resolve(r)),this._closePath(r),this._addIgnoredPath(r),this._watched.has(r)&&this._addIgnoredPath({path:r,recursive:!0}),this._userIgnored=void 0}),this}close(){if(this._closePromise)return this._closePromise;this.closed=!0,this.removeAllListeners();let e=[];return this._closers.forEach(t=>t.forEach(s=>{let r=s();r instanceof Promise&&e.push(r)})),this._streams.forEach(t=>t.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach(t=>t.dispose()),this._closers.clear(),this._watched.clear(),this._streams.clear(),this._symlinkPaths.clear(),this._throttled.clear(),this._closePromise=e.length?Promise.all(e).then(()=>{}):Promise.resolve(),this._closePromise}getWatched(){let e={};return this._watched.forEach((t,s)=>{let o=(this.options.cwd?y.relative(this.options.cwd,s):s)||zt;e[o]=t.getChildren().sort()}),e}emitWithAll(e,t){this.emit(e,...t),e!==x.ERROR&&this.emit(x.ALL,e,...t)}async _emit(e,t,s){if(this.closed)return;let r=this.options;ze&&(t=y.normalize(t)),r.cwd&&(t=y.relative(r.cwd,t));let o=[t];s!=null&&o.push(s);let a=r.awaitWriteFinish,n;if(a&&(n=this._pendingWrites.get(t)))return n.lastChange=new Date,this;if(r.atomic){if(e===x.UNLINK)return this._pendingUnlinks.set(t,[e,...o]),setTimeout(()=>{this._pendingUnlinks.forEach((l,f)=>{this.emit(...l),this.emit(x.ALL,...l),this._pendingUnlinks.delete(f)})},typeof r.atomic=="number"?r.atomic:100),this;e===x.ADD&&this._pendingUnlinks.has(t)&&(e=x.CHANGE,this._pendingUnlinks.delete(t))}if(a&&(e===x.ADD||e===x.CHANGE)&&this._readyEmitted){let l=(f,p)=>{f?(e=x.ERROR,o[0]=f,this.emitWithAll(e,o)):p&&(o.length>1?o[1]=p:o.push(p),this.emitWithAll(e,o))};return this._awaitWriteFinish(t,a.stabilityThreshold,e,l),this}if(e===x.CHANGE&&!this._throttle(x.CHANGE,t,50))return this;if(r.alwaysStat&&s===void 0&&(e===x.ADD||e===x.ADD_DIR||e===x.CHANGE)){let l=r.cwd?y.join(r.cwd,t):t,f;try{f=await Oi(l)}catch{}if(!f||this.closed)return;o.push(f)}return this.emitWithAll(e,o),this}_handleError(e){let t=e&&e.code;return e&&t!=="ENOENT"&&t!=="ENOTDIR"&&(!this.options.ignorePermissionErrors||t!=="EPERM"&&t!=="EACCES")&&this.emit(x.ERROR,e),e||this.closed}_throttle(e,t,s){this._throttled.has(e)||this._throttled.set(e,new Map);let r=this._throttled.get(e);if(!r)throw new Error("invalid throttle");let o=r.get(t);if(o)return o.count++,!1;let a,n=()=>{let f=r.get(t),p=f?f.count:0;return r.delete(t),clearTimeout(a),f&&clearTimeout(f.timeoutObject),p};a=setTimeout(n,s);let l={timeoutObject:a,clear:n,count:0};return r.set(t,l),l}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(e,t,s,r){let o=this.options.awaitWriteFinish;if(typeof o!="object")return;let a=o.pollInterval,n,l=e;this.options.cwd&&!y.isAbsolute(e)&&(l=y.join(this.options.cwd,e));let f=new Date,p=this._pendingWrites;function u(m){ki(l,(b,C)=>{if(b||!p.has(e)){b&&b.code!=="ENOENT"&&r(b);return}let E=Number(new Date);m&&C.size!==m.size&&(p.get(e).lastChange=E);let D=p.get(e);E-D.lastChange>=t?(p.delete(e),r(void 0,C)):n=setTimeout(u,a,C)})}p.has(e)||(p.set(e,{lastChange:f,cancelWait:()=>(p.delete(e),clearTimeout(n),s)}),n=setTimeout(u,a))}_isIgnored(e,t){if(this.options.atomic&&Fi.test(e))return!0;if(!this._userIgnored){let{cwd:s}=this.options,o=(this.options.ignored||[]).map(Mt(s)),n=[...[...this._ignoredPaths].map(Mt(s)),...o];this._userIgnored=Mi(n,void 0)}return this._userIgnored(e,t)}_isntIgnored(e,t){return!this._isIgnored(e,t)}_getWatchHelpers(e){return new Ue(e,this.options.followSymlinks,this)}_getWatchedDir(e){let t=y.resolve(e);return this._watched.has(t)||this._watched.set(t,new Ge(t,this._boundRemove)),this._watched.get(t)}_hasReadPermissions(e){return this.options.ignorePermissionErrors?!0:!!(Number(e.mode)&256)}_remove(e,t,s){let r=y.join(e,t),o=y.resolve(r);if(s=s??(this._watched.has(r)||this._watched.has(o)),!this._throttle("remove",r,100))return;!s&&this._watched.size===1&&this.add(e,t,!0),this._getWatchedDir(r).getChildren().forEach(m=>this._remove(r,m));let l=this._getWatchedDir(e),f=l.has(t);l.remove(t),this._symlinkPaths.has(o)&&this._symlinkPaths.delete(o);let p=r;if(this.options.cwd&&(p=y.relative(this.options.cwd,r)),this.options.awaitWriteFinish&&this._pendingWrites.has(p)&&this._pendingWrites.get(p).cancelWait()===x.ADD)return;this._watched.delete(r),this._watched.delete(o);let u=s?x.UNLINK_DIR:x.UNLINK;f&&!this._isIgnored(r)&&this._emit(u,r),this._closePath(r)}_closePath(e){this._closeFile(e);let t=y.dirname(e);this._getWatchedDir(t).remove(y.basename(e))}_closeFile(e){let t=this._closers.get(e);t&&(t.forEach(s=>s()),this._closers.delete(e))}_addPathCloser(e,t){if(!t)return;let s=this._closers.get(e);s||(s=[],this._closers.set(e,s)),s.push(t)}_readdirp(e,t){if(this.closed)return;let s={type:x.ALL,alwaysStat:!0,lstat:!0,...t,depth:0},r=St(e,s);return this._streams.add(r),r.once(Rt,()=>{r=void 0}),r.once(Me,()=>{r&&(this._streams.delete(r),r=void 0)}),r}};Wt={watch:Ui,FSWatcher:de}});import O from"chalk";var Bi,z,Ji,Vi,Yi,Be,ge,qi,Xi,q,Je,Ki,Ve,X,_,K=v(()=>{"use strict";c();Bi=O.hex("#1abc9c"),z=O.hex("#16a085"),Ji=O.hex("#2ecc71"),Vi=O.hex("#27ae60"),Yi=O.hex("#e74c3c"),Be=O.hex("#c0392b"),ge=O.hex("#f1c40f"),qi=O.hex("#f39c12"),Xi=O.hex("#3498db"),q=O.hex("#2980b9"),Je=O.hex("#ecf0f1"),Ki=O.hex("#fd79a8"),Ve=O.hex("#e84393"),X=O.hex("#7f8c8d"),_={lightGreen:Bi,green:z,lightCyan:Ji,cyan:Vi,lightRed:Yi,red:Be,yellow:ge,orange:qi,lightBlue:Xi,blue:q,white:Je,lightMagenta:Ki,magenta:Ve,gray:X}});var Ut,ye,h,N=v(()=>{"use strict";c();K();Ut=!1,ye=class{brandName="";fullName="";logLevel=Ut?"debug":"info";isLogTime=Ut;setup({brandName:e,logLevel:t,fullName:s}){this.brandName=` [${e}] `,this.fullName=` ${s} `,this.fullName=_.green.bold(this.fullName),t&&(this.logLevel=t)}time=(...e)=>this.isLogTime&&console.time(...e);timeEnd=(...e)=>this.isLogTime&&console.timeEnd(...e);debug=(...e)=>["debug"].includes(this.logLevel)&&console.log(...e);info=(...e)=>["debug","info"].includes(this.logLevel)&&console.log(...e);warn=(...e)=>["debug","info","warn"].includes(this.logLevel)&&console.warn(...e);error=(...e)=>["debug","info","warn","error"].includes(this.logLevel)&&console.error(...e);blue=e=>{console.log(`${_.lightBlue(this.brandName)}${_.blue(` ${e} `)}
|
|
2
|
+
var Vs=Object.defineProperty;var k=(i=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(i,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):i)(function(i){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+i+'" is not supported')});var v=(i,e)=>()=>(i&&(e=i(i=0)),e);var Z=(i,e)=>{for(var t in e)Vs(i,t,{get:e[t],enumerable:!0})};import Ys from"path";import{fileURLToPath as qs}from"url";var vt,Xs,w,g,c=v(()=>{"use strict";vt=()=>qs(import.meta.url),Xs=()=>Ys.dirname(vt()),w=Xs(),g=vt()});var ae,Ae=v(()=>{ae={name:"@empjs/cli",version:"3.12.4",description:"emp",license:"MIT",type:"module",files:["dist","bin","resource","template","types","tsconfig"],maintainers:["xuhongbin","ckken","doerme"],repository:{type:"git",url:"git+https://github.com/empjs/emp.git",directory:"packages/cli"},publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},keywords:["rspack","rust","typescript"],bin:{emp:"./bin/emp.js"},main:"dist/index.js",types:"dist/index.d.ts",exports:{".":{import:{types:"./dist/index.d.ts",default:"./dist/index.js"},require:{types:"./dist/index.d.cts",default:"./dist/index.cjs"}},"./emp-tsconfig.json":{default:"./tsconfig/react.json"},"./tsconfig/base":{default:"./tsconfig/base.json"},"./tsconfig/react":{default:"./tsconfig/react.json"},"./tsconfig/vue":{default:"./tsconfig/vue.json"},"./client":{types:"./types/react/index.d.ts",default:"./types/react/index.d.ts"},"./types/base":{types:"./types/base/index.d.ts",default:"./types/base/index.d.ts"},"./types/vue":{types:"./types/vue/index.d.ts",default:"./types/vue/index.d.ts"},"./types/react":{types:"./types/react/index.d.ts",default:"./types/react/index.d.ts"}},scripts:{dev:"tsup --watch --env.ENV dev",build:"tsup --env.ENV prod","dev-rs":"rslib build --watch --env-mode development","build-rs":"rslib build --env-mode production",ph:"pnpm publish --no-git-checks"},engines:{node:">=18.0.0"},author:"Ken",devDependencies:{"@types/compression":"^1.7.2","@types/connect":"^3.4.38","@types/cors":"^2.8.12","@types/default-gateway":"^7.2.1","@types/fs-extra":"^11.0.4","@types/react":"^18.3.2","@types/serve-static":"^1.15.8","@types/watchpack":"^2.4.3","@types/webpack":"^5.28.4","@types/webpack-bundle-analyzer":"^4.6.2","@types/webpack-sources":"^3.2.2",chokidar:"^4.0.3",vue:"^3.5.21"},dependencies:{"@empjs/chain":"workspace:*","@rsdoctor/rspack-plugin":"1.5.0","@rspack/core":"1.7.4","@rspack/dev-server":"1.2.1","@swc/helpers":"^0.5.18","@vue/tsconfig":"^0.8.1",address:"^2.0.2",chalk:"^5.3.0",commander:"11.1.0",compression:"1.8.1",connect:"3.7.0","core-js":"^3.41.0",cors:"2.8.5","default-gateway":"7.2.2","fs-extra":"11.3.1",glob:"11.0.3","gzip-size":"7.0.0","html-webpack-plugin":"5.6.4","http-proxy-middleware":"^3.0.5",jiti:"2.6.1","less-loader":"^12.2.0",open:"10.2.0","sass-embedded":"1.93.2","sass-loader":"16.0.5","serve-static":"2.2.0","ts-checker-rspack-plugin":"1.1.6","typescript-plugin-css-modules":"5.2.0","webpack-bundle-analyzer":"4.10.2"}}});import{stat as Qs,lstat as bt,readdir as Zs,realpath as ei}from"fs/promises";import{Readable as ti}from"stream";import{resolve as Ct,relative as si,join as ii,sep as ri}from"path";function St(i,e={}){let t=e.entryType||e.type;if(t==="both"&&(t=T.FILE_DIR_TYPE),t&&(e.type=t),i){if(typeof i!="string")throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");if(t&&!Et.includes(t))throw new Error(`readdirp: Invalid type passed. Use one of ${Et.join(", ")}`)}else throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");return e.root=i,new Fe(e)}var T,Le,_t,oi,Et,ni,ai,li,pi,Pt,xt,Fe,kt=v(()=>{"use strict";c();T={FILE_TYPE:"files",DIR_TYPE:"directories",FILE_DIR_TYPE:"files_directories",EVERYTHING_TYPE:"all"},Le={root:".",fileFilter:i=>!0,directoryFilter:i=>!0,type:T.FILE_TYPE,lstat:!1,depth:2147483648,alwaysStat:!1,highWaterMark:4096};Object.freeze(Le);_t="READDIRP_RECURSIVE_ERROR",oi=new Set(["ENOENT","EPERM","EACCES","ELOOP",_t]),Et=[T.DIR_TYPE,T.EVERYTHING_TYPE,T.FILE_DIR_TYPE,T.FILE_TYPE],ni=new Set([T.DIR_TYPE,T.EVERYTHING_TYPE,T.FILE_DIR_TYPE]),ai=new Set([T.EVERYTHING_TYPE,T.FILE_DIR_TYPE,T.FILE_TYPE]),li=i=>oi.has(i.code),pi=process.platform==="win32",Pt=i=>!0,xt=i=>{if(i===void 0)return Pt;if(typeof i=="function")return i;if(typeof i=="string"){let e=i.trim();return t=>t.basename===e}if(Array.isArray(i)){let e=i.map(t=>t.trim());return t=>e.some(s=>t.basename===s)}return Pt},Fe=class extends ti{constructor(e={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:e.highWaterMark});let t={...Le,...e},{root:s,type:r}=t;this._fileFilter=xt(t.fileFilter),this._directoryFilter=xt(t.directoryFilter);let o=t.lstat?bt:Qs;pi?this._stat=a=>o(a,{bigint:!0}):this._stat=o,this._maxDepth=t.depth??Le.depth,this._wantsDir=r?ni.has(r):!1,this._wantsFile=r?ai.has(r):!1,this._wantsEverything=r===T.EVERYTHING_TYPE,this._root=Ct(s),this._isDirent=!t.alwaysStat,this._statsProp=this._isDirent?"dirent":"stats",this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent},this.parents=[this._exploreDir(s,1)],this.reading=!1,this.parent=void 0}async _read(e){if(!this.reading){this.reading=!0;try{for(;!this.destroyed&&e>0;){let t=this.parent,s=t&&t.files;if(s&&s.length>0){let{path:r,depth:o}=t,a=s.splice(0,e).map(l=>this._formatEntry(l,r)),n=await Promise.all(a);for(let l of n){if(!l)continue;if(this.destroyed)return;let f=await this._getEntryType(l);f==="directory"&&this._directoryFilter(l)?(o<=this._maxDepth&&this.parents.push(this._exploreDir(l.fullPath,o+1)),this._wantsDir&&(this.push(l),e--)):(f==="file"||this._includeAsFile(l))&&this._fileFilter(l)&&this._wantsFile&&(this.push(l),e--)}}else{let r=this.parents.pop();if(!r){this.push(null);break}if(this.parent=await r,this.destroyed)return}}}catch(t){this.destroy(t)}finally{this.reading=!1}}}async _exploreDir(e,t){let s;try{s=await Zs(e,this._rdOptions)}catch(r){this._onError(r)}return{files:s,depth:t,path:e}}async _formatEntry(e,t){let s,r=this._isDirent?e.name:e;try{let o=Ct(ii(t,r));s={path:si(this._root,o),fullPath:o,basename:r},s[this._statsProp]=this._isDirent?e:await this._stat(o)}catch(o){this._onError(o);return}return s}_onError(e){li(e)&&!this.destroyed?this.emit("warn",e):this.destroy(e)}async _getEntryType(e){if(!e&&this._statsProp in e)return"";let t=e[this._statsProp];if(t.isFile())return"file";if(t.isDirectory())return"directory";if(t&&t.isSymbolicLink()){let s=e.fullPath;try{let r=await ei(s),o=await bt(r);if(o.isFile())return"file";if(o.isDirectory()){let a=r.length;if(s.startsWith(r)&&s.substr(a,1)===ri){let n=new Error(`Circular symlink detected: "${s}" points to "${r}"`);return n.code=_t,this._onError(n)}return"directory"}}catch(r){return this._onError(r),""}}}_includeAsFile(e){let t=e&&e[this._statsProp];return t&&this._wantsEverything&&!t.isDirectory()}}});import{watchFile as ci,unwatchFile as Ot,watch as hi}from"fs";import{open as fi,stat as Tt,lstat as mi,realpath as Ne}from"fs/promises";import*as P from"path";import{type as ui}from"os";function Dt(i,e,t,s,r){let o=(a,n)=>{t(i),r(a,n,{watchedPath:i}),n&&i!==n&&ce(P.resolve(i,n),G,P.join(i,n))};try{return hi(i,{persistent:e.persistent},o)}catch(a){s(a);return}}var di,Me,Rt,fe,me,ze,gi,yi,wi,jt,x,A,vi,bi,G,le,Y,Ci,Ei,Pi,Ie,ee,xi,te,At,pe,ce,_i,$e,Si,he,Lt=v(()=>{"use strict";c();di="data",Me="end",Rt="close",fe=()=>{},me=process.platform,ze=me==="win32",gi=me==="darwin",yi=me==="linux",wi=me==="freebsd",jt=ui()==="OS400",x={ALL:"all",READY:"ready",ADD:"add",CHANGE:"change",ADD_DIR:"addDir",UNLINK:"unlink",UNLINK_DIR:"unlinkDir",RAW:"raw",ERROR:"error"},A=x,vi="watch",bi={lstat:mi,stat:Tt},G="listeners",le="errHandlers",Y="rawEmitters",Ci=[G,le,Y],Ei=new Set(["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]),Pi=i=>Ei.has(P.extname(i).slice(1).toLowerCase()),Ie=(i,e)=>{i instanceof Set?i.forEach(e):e(i)},ee=(i,e,t)=>{let s=i[e];s instanceof Set||(i[e]=s=new Set([s])),s.add(t)},xi=i=>e=>{let t=i[e];t instanceof Set?t.clear():delete i[e]},te=(i,e,t)=>{let s=i[e];s instanceof Set?s.delete(t):s===t&&delete i[e]},At=i=>i instanceof Set?i.size===0:!i,pe=new Map;ce=(i,e,t,s,r)=>{let o=pe.get(i);o&&Ie(o[e],a=>{a(t,s,r)})},_i=(i,e,t,s)=>{let{listener:r,errHandler:o,rawEmitter:a}=s,n=pe.get(e),l;if(!t.persistent)return l=Dt(i,t,r,o,a),l?l.close.bind(l):void 0;if(n)ee(n,G,r),ee(n,le,o),ee(n,Y,a);else{if(l=Dt(i,t,ce.bind(null,e,G),o,ce.bind(null,e,Y)),!l)return;l.on(A.ERROR,async f=>{let p=ce.bind(null,e,le);if(n&&(n.watcherUnusable=!0),ze&&f.code==="EPERM")try{await(await fi(i,"r")).close(),p(f)}catch{}else p(f)}),n={listeners:r,errHandlers:o,rawEmitters:a,watcher:l},pe.set(e,n)}return()=>{te(n,G,r),te(n,le,o),te(n,Y,a),At(n.listeners)&&(n.watcher.close(),pe.delete(e),Ci.forEach(xi(n)),n.watcher=void 0,Object.freeze(n))}},$e=new Map,Si=(i,e,t,s)=>{let{listener:r,rawEmitter:o}=s,a=$e.get(e),n=a&&a.options;return n&&(n.persistent<t.persistent||n.interval>t.interval)&&(Ot(e),a=void 0),a?(ee(a,G,r),ee(a,Y,o)):(a={listeners:r,rawEmitters:o,options:t,watcher:ci(e,t,(l,f)=>{Ie(a.rawEmitters,u=>{u(A.CHANGE,e,{curr:l,prev:f})});let p=l.mtimeMs;(l.size!==f.size||p>f.mtimeMs||p===0)&&Ie(a.listeners,u=>u(i,l))})},$e.set(e,a)),()=>{te(a,G,r),te(a,Y,o),At(a.listeners)&&($e.delete(e),Ot(e),a.options=a.watcher=void 0,Object.freeze(a))}},he=class{constructor(e){this.fsw=e,this._boundHandleError=t=>e._handleError(t)}_watchWithNodeFs(e,t){let s=this.fsw.options,r=P.dirname(e),o=P.basename(e);this.fsw._getWatchedDir(r).add(o);let n=P.resolve(e),l={persistent:s.persistent};t||(t=fe);let f;if(s.usePolling){let p=s.interval!==s.binaryInterval;l.interval=p&&Pi(o)?s.binaryInterval:s.interval,f=Si(e,n,l,{listener:t,rawEmitter:this.fsw._emitRaw})}else f=_i(e,n,l,{listener:t,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw});return f}_handleFile(e,t,s){if(this.fsw.closed)return;let r=P.dirname(e),o=P.basename(e),a=this.fsw._getWatchedDir(r),n=t;if(a.has(o))return;let l=async(p,u)=>{if(this.fsw._throttle(vi,e,5)){if(!u||u.mtimeMs===0)try{let m=await Tt(e);if(this.fsw.closed)return;let b=m.atimeMs,C=m.mtimeMs;if((!b||b<=C||C!==n.mtimeMs)&&this.fsw._emit(A.CHANGE,e,m),(gi||yi||wi)&&n.ino!==m.ino){this.fsw._closeFile(p),n=m;let E=this._watchWithNodeFs(e,l);E&&this.fsw._addPathCloser(p,E)}else n=m}catch{this.fsw._remove(r,o)}else if(a.has(o)){let m=u.atimeMs,b=u.mtimeMs;(!m||m<=b||b!==n.mtimeMs)&&this.fsw._emit(A.CHANGE,e,u),n=u}}},f=this._watchWithNodeFs(e,l);if(!(s&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(A.ADD,e,0))return;this.fsw._emit(A.ADD,e,t)}return f}async _handleSymlink(e,t,s,r){if(this.fsw.closed)return;let o=e.fullPath,a=this.fsw._getWatchedDir(t);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let n;try{n=await Ne(s)}catch{return this.fsw._emitReady(),!0}return this.fsw.closed?void 0:(a.has(r)?this.fsw._symlinkPaths.get(o)!==n&&(this.fsw._symlinkPaths.set(o,n),this.fsw._emit(A.CHANGE,s,e.stats)):(a.add(r),this.fsw._symlinkPaths.set(o,n),this.fsw._emit(A.ADD,s,e.stats)),this.fsw._emitReady(),!0)}if(this.fsw._symlinkPaths.has(o))return!0;this.fsw._symlinkPaths.set(o,!0)}_handleRead(e,t,s,r,o,a,n){if(e=P.join(e,""),n=this.fsw._throttle("readdir",e,1e3),!n)return;let l=this.fsw._getWatchedDir(s.path),f=new Set,p=this.fsw._readdirp(e,{fileFilter:u=>s.filterPath(u),directoryFilter:u=>s.filterDir(u)});if(p)return p.on(di,async u=>{if(this.fsw.closed){p=void 0;return}let m=u.path,b=P.join(e,m);if(f.add(m),!(u.stats.isSymbolicLink()&&await this._handleSymlink(u,e,b,m))){if(this.fsw.closed){p=void 0;return}(m===r||!r&&!l.has(m))&&(this.fsw._incrReadyCount(),b=P.join(o,P.relative(o,b)),this._addToNodeFs(b,t,s,a+1))}}).on(A.ERROR,this._boundHandleError),new Promise((u,m)=>{if(!p)return m();p.once(Me,()=>{if(this.fsw.closed){p=void 0;return}let b=n?n.clear():!1;u(void 0),l.getChildren().filter(C=>C!==e&&!f.has(C)).forEach(C=>{this.fsw._remove(e,C)}),p=void 0,b&&this._handleRead(e,!1,s,r,o,a,n)})})}async _handleDir(e,t,s,r,o,a,n){let l=this.fsw._getWatchedDir(P.dirname(e)),f=l.has(P.basename(e));!(s&&this.fsw.options.ignoreInitial)&&!o&&!f&&this.fsw._emit(A.ADD_DIR,e,t),l.add(P.basename(e)),this.fsw._getWatchedDir(e);let p,u,m=this.fsw.options.depth;if((m==null||r<=m)&&!this.fsw._symlinkPaths.has(n)){if(!o&&(await this._handleRead(e,s,a,o,e,r,p),this.fsw.closed))return;u=this._watchWithNodeFs(e,(b,C)=>{C&&C.mtimeMs===0||this._handleRead(b,!1,a,o,e,r,p)})}return u}async _addToNodeFs(e,t,s,r,o){let a=this.fsw._emitReady;if(this.fsw._isIgnored(e)||this.fsw.closed)return a(),!1;let n=this.fsw._getWatchHelpers(e);s&&(n.filterPath=l=>s.filterPath(l),n.filterDir=l=>s.filterDir(l));try{let l=await bi[n.statMethod](n.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(n.watchPath,l))return a(),!1;let f=this.fsw.options.followSymlinks,p;if(l.isDirectory()){let u=P.resolve(e),m=f?await Ne(e):e;if(this.fsw.closed||(p=await this._handleDir(n.watchPath,l,t,r,o,n,m),this.fsw.closed))return;u!==m&&m!==void 0&&this.fsw._symlinkPaths.set(u,m)}else if(l.isSymbolicLink()){let u=f?await Ne(e):e;if(this.fsw.closed)return;let m=P.dirname(n.watchPath);if(this.fsw._getWatchedDir(m).add(n.watchPath),this.fsw._emit(A.ADD,n.watchPath,l),p=await this._handleDir(m,l,t,r,e,n,u),this.fsw.closed)return;u!==void 0&&this.fsw._symlinkPaths.set(P.resolve(e),u)}else p=this._handleFile(n.watchPath,l,t);return a(),p&&this.fsw._addPathCloser(e,p),!1}catch(l){if(this.fsw._handleError(l))return a(),e}}}});import{stat as ki}from"fs";import{stat as Oi,readdir as Di}from"fs/promises";import{EventEmitter as Ti}from"events";import*as y from"path";function ue(i){return Array.isArray(i)?i:[i]}function $i(i){return typeof i=="function"?i:typeof i=="string"?e=>i===e:i instanceof RegExp?e=>i.test(e):typeof i=="object"&&i!==null?e=>{if(i.path===e)return!0;if(i.recursive){let t=y.relative(i.path,e);return t?!t.startsWith("..")&&!y.isAbsolute(t):!1}return!1}:()=>!1}function Ii(i){if(typeof i!="string")throw new Error("string expected");i=y.normalize(i),i=i.replace(/\\/g,"/");let e=!1;i.startsWith("//")&&(e=!0);let t=/\/\//;for(;i.match(t);)i=i.replace(t,"/");return e&&(i="/"+i),i}function Nt(i,e,t){let s=Ii(e);for(let r=0;r<i.length;r++){let o=i[r];if(o(s,t))return!0}return!1}function Mi(i,e){if(i==null)throw new TypeError("anymatch: specify first argument");let s=ue(i).map(r=>$i(r));return e==null?(r,o)=>Nt(s,r,o):Nt(s,e)}function Ui(i,e={}){let t=new de(e);return t.add(i),t}var He,Ri,zt,ji,Ai,Li,Ft,Fi,Ni,We,$t,It,Ht,Mt,zi,Hi,Ge,Wi,Gi,Ue,de,Wt,Gt=v(()=>{"use strict";c();kt();Lt();He="/",Ri="//",zt=".",ji="..",Ai="string",Li=/\\/g,Ft=/\/\//,Fi=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/,Ni=/^\.[/\\]/;We=i=>typeof i=="object"&&i!==null&&!(i instanceof RegExp);$t=i=>{let e=ue(i).flat();if(!e.every(t=>typeof t===Ai))throw new TypeError(`Non-string provided as watch path: ${e}`);return e.map(Ht)},It=i=>{let e=i.replace(Li,He),t=!1;for(e.startsWith(Ri)&&(t=!0);e.match(Ft);)e=e.replace(Ft,He);return t&&(e=He+e),e},Ht=i=>It(y.normalize(It(i))),Mt=(i="")=>e=>typeof e=="string"?Ht(y.isAbsolute(e)?e:y.join(i,e)):e,zi=(i,e)=>y.isAbsolute(i)?i:y.join(e,i),Hi=Object.freeze(new Set),Ge=class{constructor(e,t){this.path=e,this._removeWatcher=t,this.items=new Set}add(e){let{items:t}=this;t&&e!==zt&&e!==ji&&t.add(e)}async remove(e){let{items:t}=this;if(!t||(t.delete(e),t.size>0))return;let s=this.path;try{await Di(s)}catch{this._removeWatcher&&this._removeWatcher(y.dirname(s),y.basename(s))}}has(e){let{items:t}=this;if(t)return t.has(e)}getChildren(){let{items:e}=this;return e?[...e.values()]:[]}dispose(){this.items.clear(),this.path="",this._removeWatcher=fe,this.items=Hi,Object.freeze(this)}},Wi="stat",Gi="lstat",Ue=class{constructor(e,t,s){this.fsw=s;let r=e;this.path=e=e.replace(Ni,""),this.watchPath=r,this.fullWatchPath=y.resolve(r),this.dirParts=[],this.dirParts.forEach(o=>{o.length>1&&o.pop()}),this.followSymlinks=t,this.statMethod=t?Wi:Gi}entryPath(e){return y.join(this.watchPath,y.relative(this.watchPath,e.fullPath))}filterPath(e){let{stats:t}=e;if(t&&t.isSymbolicLink())return this.filterDir(e);let s=this.entryPath(e);return this.fsw._isntIgnored(s,t)&&this.fsw._hasReadPermissions(t)}filterDir(e){return this.fsw._isntIgnored(this.entryPath(e),e.stats)}},de=class extends Ti{constructor(e={}){super(),this.closed=!1,this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._streams=new Set,this._symlinkPaths=new Map,this._watched=new Map,this._pendingWrites=new Map,this._pendingUnlinks=new Map,this._readyCount=0,this._readyEmitted=!1;let t=e.awaitWriteFinish,s={stabilityThreshold:2e3,pollInterval:100},r={persistent:!0,ignoreInitial:!1,ignorePermissionErrors:!1,interval:100,binaryInterval:300,followSymlinks:!0,usePolling:!1,atomic:!0,...e,ignored:e.ignored?ue(e.ignored):ue([]),awaitWriteFinish:t===!0?s:typeof t=="object"?{...s,...t}:!1};jt&&(r.usePolling=!0),r.atomic===void 0&&(r.atomic=!r.usePolling);let o=process.env.CHOKIDAR_USEPOLLING;if(o!==void 0){let l=o.toLowerCase();l==="false"||l==="0"?r.usePolling=!1:l==="true"||l==="1"?r.usePolling=!0:r.usePolling=!!l}let a=process.env.CHOKIDAR_INTERVAL;a&&(r.interval=Number.parseInt(a,10));let n=0;this._emitReady=()=>{n++,n>=this._readyCount&&(this._emitReady=fe,this._readyEmitted=!0,process.nextTick(()=>this.emit(x.READY)))},this._emitRaw=(...l)=>this.emit(x.RAW,...l),this._boundRemove=this._remove.bind(this),this.options=r,this._nodeFsHandler=new he(this),Object.freeze(r)}_addIgnoredPath(e){if(We(e)){for(let t of this._ignoredPaths)if(We(t)&&t.path===e.path&&t.recursive===e.recursive)return}this._ignoredPaths.add(e)}_removeIgnoredPath(e){if(this._ignoredPaths.delete(e),typeof e=="string")for(let t of this._ignoredPaths)We(t)&&t.path===e&&this._ignoredPaths.delete(t)}add(e,t,s){let{cwd:r}=this.options;this.closed=!1,this._closePromise=void 0;let o=$t(e);return r&&(o=o.map(a=>zi(a,r))),o.forEach(a=>{this._removeIgnoredPath(a)}),this._userIgnored=void 0,this._readyCount||(this._readyCount=0),this._readyCount+=o.length,Promise.all(o.map(async a=>{let n=await this._nodeFsHandler._addToNodeFs(a,!s,void 0,0,t);return n&&this._emitReady(),n})).then(a=>{this.closed||a.forEach(n=>{n&&this.add(y.dirname(n),y.basename(t||n))})}),this}unwatch(e){if(this.closed)return this;let t=$t(e),{cwd:s}=this.options;return t.forEach(r=>{!y.isAbsolute(r)&&!this._closers.has(r)&&(s&&(r=y.join(s,r)),r=y.resolve(r)),this._closePath(r),this._addIgnoredPath(r),this._watched.has(r)&&this._addIgnoredPath({path:r,recursive:!0}),this._userIgnored=void 0}),this}close(){if(this._closePromise)return this._closePromise;this.closed=!0,this.removeAllListeners();let e=[];return this._closers.forEach(t=>t.forEach(s=>{let r=s();r instanceof Promise&&e.push(r)})),this._streams.forEach(t=>t.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach(t=>t.dispose()),this._closers.clear(),this._watched.clear(),this._streams.clear(),this._symlinkPaths.clear(),this._throttled.clear(),this._closePromise=e.length?Promise.all(e).then(()=>{}):Promise.resolve(),this._closePromise}getWatched(){let e={};return this._watched.forEach((t,s)=>{let o=(this.options.cwd?y.relative(this.options.cwd,s):s)||zt;e[o]=t.getChildren().sort()}),e}emitWithAll(e,t){this.emit(e,...t),e!==x.ERROR&&this.emit(x.ALL,e,...t)}async _emit(e,t,s){if(this.closed)return;let r=this.options;ze&&(t=y.normalize(t)),r.cwd&&(t=y.relative(r.cwd,t));let o=[t];s!=null&&o.push(s);let a=r.awaitWriteFinish,n;if(a&&(n=this._pendingWrites.get(t)))return n.lastChange=new Date,this;if(r.atomic){if(e===x.UNLINK)return this._pendingUnlinks.set(t,[e,...o]),setTimeout(()=>{this._pendingUnlinks.forEach((l,f)=>{this.emit(...l),this.emit(x.ALL,...l),this._pendingUnlinks.delete(f)})},typeof r.atomic=="number"?r.atomic:100),this;e===x.ADD&&this._pendingUnlinks.has(t)&&(e=x.CHANGE,this._pendingUnlinks.delete(t))}if(a&&(e===x.ADD||e===x.CHANGE)&&this._readyEmitted){let l=(f,p)=>{f?(e=x.ERROR,o[0]=f,this.emitWithAll(e,o)):p&&(o.length>1?o[1]=p:o.push(p),this.emitWithAll(e,o))};return this._awaitWriteFinish(t,a.stabilityThreshold,e,l),this}if(e===x.CHANGE&&!this._throttle(x.CHANGE,t,50))return this;if(r.alwaysStat&&s===void 0&&(e===x.ADD||e===x.ADD_DIR||e===x.CHANGE)){let l=r.cwd?y.join(r.cwd,t):t,f;try{f=await Oi(l)}catch{}if(!f||this.closed)return;o.push(f)}return this.emitWithAll(e,o),this}_handleError(e){let t=e&&e.code;return e&&t!=="ENOENT"&&t!=="ENOTDIR"&&(!this.options.ignorePermissionErrors||t!=="EPERM"&&t!=="EACCES")&&this.emit(x.ERROR,e),e||this.closed}_throttle(e,t,s){this._throttled.has(e)||this._throttled.set(e,new Map);let r=this._throttled.get(e);if(!r)throw new Error("invalid throttle");let o=r.get(t);if(o)return o.count++,!1;let a,n=()=>{let f=r.get(t),p=f?f.count:0;return r.delete(t),clearTimeout(a),f&&clearTimeout(f.timeoutObject),p};a=setTimeout(n,s);let l={timeoutObject:a,clear:n,count:0};return r.set(t,l),l}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(e,t,s,r){let o=this.options.awaitWriteFinish;if(typeof o!="object")return;let a=o.pollInterval,n,l=e;this.options.cwd&&!y.isAbsolute(e)&&(l=y.join(this.options.cwd,e));let f=new Date,p=this._pendingWrites;function u(m){ki(l,(b,C)=>{if(b||!p.has(e)){b&&b.code!=="ENOENT"&&r(b);return}let E=Number(new Date);m&&C.size!==m.size&&(p.get(e).lastChange=E);let D=p.get(e);E-D.lastChange>=t?(p.delete(e),r(void 0,C)):n=setTimeout(u,a,C)})}p.has(e)||(p.set(e,{lastChange:f,cancelWait:()=>(p.delete(e),clearTimeout(n),s)}),n=setTimeout(u,a))}_isIgnored(e,t){if(this.options.atomic&&Fi.test(e))return!0;if(!this._userIgnored){let{cwd:s}=this.options,o=(this.options.ignored||[]).map(Mt(s)),n=[...[...this._ignoredPaths].map(Mt(s)),...o];this._userIgnored=Mi(n,void 0)}return this._userIgnored(e,t)}_isntIgnored(e,t){return!this._isIgnored(e,t)}_getWatchHelpers(e){return new Ue(e,this.options.followSymlinks,this)}_getWatchedDir(e){let t=y.resolve(e);return this._watched.has(t)||this._watched.set(t,new Ge(t,this._boundRemove)),this._watched.get(t)}_hasReadPermissions(e){return this.options.ignorePermissionErrors?!0:!!(Number(e.mode)&256)}_remove(e,t,s){let r=y.join(e,t),o=y.resolve(r);if(s=s??(this._watched.has(r)||this._watched.has(o)),!this._throttle("remove",r,100))return;!s&&this._watched.size===1&&this.add(e,t,!0),this._getWatchedDir(r).getChildren().forEach(m=>this._remove(r,m));let l=this._getWatchedDir(e),f=l.has(t);l.remove(t),this._symlinkPaths.has(o)&&this._symlinkPaths.delete(o);let p=r;if(this.options.cwd&&(p=y.relative(this.options.cwd,r)),this.options.awaitWriteFinish&&this._pendingWrites.has(p)&&this._pendingWrites.get(p).cancelWait()===x.ADD)return;this._watched.delete(r),this._watched.delete(o);let u=s?x.UNLINK_DIR:x.UNLINK;f&&!this._isIgnored(r)&&this._emit(u,r),this._closePath(r)}_closePath(e){this._closeFile(e);let t=y.dirname(e);this._getWatchedDir(t).remove(y.basename(e))}_closeFile(e){let t=this._closers.get(e);t&&(t.forEach(s=>s()),this._closers.delete(e))}_addPathCloser(e,t){if(!t)return;let s=this._closers.get(e);s||(s=[],this._closers.set(e,s)),s.push(t)}_readdirp(e,t){if(this.closed)return;let s={type:x.ALL,alwaysStat:!0,lstat:!0,...t,depth:0},r=St(e,s);return this._streams.add(r),r.once(Rt,()=>{r=void 0}),r.once(Me,()=>{r&&(this._streams.delete(r),r=void 0)}),r}};Wt={watch:Ui,FSWatcher:de}});import O from"chalk";var Bi,z,Ji,Vi,Yi,Be,ge,qi,Xi,q,Je,Ki,Ve,X,_,K=v(()=>{"use strict";c();Bi=O.hex("#1abc9c"),z=O.hex("#16a085"),Ji=O.hex("#2ecc71"),Vi=O.hex("#27ae60"),Yi=O.hex("#e74c3c"),Be=O.hex("#c0392b"),ge=O.hex("#f1c40f"),qi=O.hex("#f39c12"),Xi=O.hex("#3498db"),q=O.hex("#2980b9"),Je=O.hex("#ecf0f1"),Ki=O.hex("#fd79a8"),Ve=O.hex("#e84393"),X=O.hex("#7f8c8d"),_={lightGreen:Bi,green:z,lightCyan:Ji,cyan:Vi,lightRed:Yi,red:Be,yellow:ge,orange:qi,lightBlue:Xi,blue:q,white:Je,lightMagenta:Ki,magenta:Ve,gray:X}});var Ut,ye,h,N=v(()=>{"use strict";c();K();Ut=!1,ye=class{brandName="";fullName="";logLevel=Ut?"debug":"info";isLogTime=Ut;setup({brandName:e,logLevel:t,fullName:s}){this.brandName=` [${e}] `,this.fullName=` ${s} `,this.fullName=_.green.bold(this.fullName),t&&(this.logLevel=t)}time=(...e)=>this.isLogTime&&console.time(...e);timeEnd=(...e)=>this.isLogTime&&console.timeEnd(...e);debug=(...e)=>["debug"].includes(this.logLevel)&&console.log(...e);info=(...e)=>["debug","info"].includes(this.logLevel)&&console.log(...e);warn=(...e)=>["debug","info","warn"].includes(this.logLevel)&&console.warn(...e);error=(...e)=>["debug","info","warn","error"].includes(this.logLevel)&&console.error(...e);blue=e=>{console.log(`${_.lightBlue(this.brandName)}${_.blue(` ${e} `)}
|
|
3
3
|
`)};cyan=e=>{console.log(`${_.lightCyan(this.brandName)}${_.cyan(` ${e} `)}
|
|
4
4
|
`)};magenta=e=>{console.log(`${_.lightMagenta(this.brandName)}${_.magenta(` ${e} `)}
|
|
5
5
|
`)};green=e=>{console.log(`${_.lightGreen(this.brandName)}${_.green(` ${e} `)}
|
package/package.json
CHANGED