@umijs/utils 4.0.0-beta.9 → 4.0.0-rc.3
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/compiled/axios/index.d.ts +29 -14
- package/compiled/axios/index.js +1 -1
- package/compiled/chalk/LICENSE +1 -1
- package/compiled/chalk/index.js +1 -1
- package/compiled/chalk/package.json +1 -1
- package/compiled/chalk/source/index.d.ts +318 -0
- package/compiled/chalk/source/vendor/supports-color/index.d.ts +55 -0
- package/compiled/color/color-convert/conversions.d.ts +87 -87
- package/compiled/color/color-convert/index.d.ts +75 -60
- package/compiled/color/color-convert/route.d.ts +271 -271
- package/compiled/color/index.d.ts +118 -121
- package/compiled/color/index.js +1 -1
- package/compiled/color/package.json +1 -4
- package/compiled/debug/LICENSE +10 -9
- package/compiled/debug/index.js +1 -1
- package/compiled/debug/package.json +1 -1
- package/compiled/execa/index.d.ts +467 -445
- package/compiled/execa/index.js +1 -1
- package/compiled/globby/@nodelib/fs.scandir/out/adapters/fs.d.ts +20 -0
- package/compiled/globby/@nodelib/fs.scandir/out/index.d.ts +12 -0
- package/compiled/globby/@nodelib/fs.scandir/out/providers/async.d.ts +7 -0
- package/compiled/globby/@nodelib/fs.scandir/out/settings.d.ts +20 -0
- package/compiled/globby/@nodelib/fs.scandir/out/types/index.d.ts +20 -0
- package/compiled/globby/@nodelib/fs.stat/out/adapters/fs.d.ts +13 -0
- package/compiled/globby/@nodelib/fs.stat/out/index.d.ts +12 -0
- package/compiled/globby/@nodelib/fs.stat/out/providers/async.d.ts +4 -0
- package/compiled/globby/@nodelib/fs.stat/out/settings.d.ts +16 -0
- package/compiled/globby/@nodelib/fs.stat/out/types/index.d.ts +4 -0
- package/compiled/globby/@nodelib/fs.walk/out/index.d.ts +14 -0
- package/compiled/globby/@nodelib/fs.walk/out/providers/async.d.ts +12 -0
- package/compiled/globby/@nodelib/fs.walk/out/readers/async.d.ts +30 -0
- package/compiled/globby/@nodelib/fs.walk/out/readers/reader.d.ts +6 -0
- package/compiled/globby/@nodelib/fs.walk/out/settings.d.ts +30 -0
- package/compiled/globby/@nodelib/fs.walk/out/types/index.d.ts +8 -0
- package/compiled/globby/LICENSE +9 -0
- package/compiled/globby/fast-glob/out/index.d.ts +27 -0
- package/compiled/globby/fast-glob/out/managers/tasks.d.ts +22 -0
- package/compiled/globby/fast-glob/out/settings.d.ts +164 -0
- package/compiled/globby/fast-glob/out/types/index.d.ts +31 -0
- package/compiled/globby/index.d.ts +206 -0
- package/compiled/globby/index.js +37 -0
- package/compiled/globby/package.json +1 -0
- package/compiled/pirates/LICENSE +21 -0
- package/compiled/pirates/index.d.ts +82 -0
- package/compiled/pirates/index.js +1 -0
- package/compiled/pirates/package.json +1 -0
- package/compiled/pkg-up/LICENSE +1 -1
- package/compiled/pkg-up/index.d.ts +55 -44
- package/compiled/pkg-up/index.js +1 -1
- package/compiled/pkg-up/package.json +1 -1
- package/compiled/resolve/index.js +1 -1
- package/compiled/strip-ansi/LICENSE +1 -1
- package/compiled/strip-ansi/index.d.ts +2 -4
- package/compiled/strip-ansi/index.js +1 -1
- package/compiled/strip-ansi/package.json +1 -1
- package/compiled/yargs-parser/index.js +1 -1
- package/dist/getCorejsVersion.d.ts +1 -0
- package/dist/getCorejsVersion.js +11 -0
- package/dist/index.d.ts +5 -3
- package/dist/index.js +6 -5
- package/dist/installDeps.js +20 -4
- package/dist/isStyleFile.d.ts +5 -0
- package/dist/isStyleFile.js +16 -0
- package/dist/logger.d.ts +8 -6
- package/dist/logger.js +8 -1
- package/dist/register.js +21 -22
- package/dist/tryPaths.d.ts +1 -0
- package/dist/tryPaths.js +11 -0
- package/package.json +19 -18
package/compiled/execa/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){var e={184:function(e,t,n){"use strict";const r=n(622);const o=n(129);const i=n(178);const s=n(614);const a=n(799);const c=n(390);const d=n(362);const u=n(442);const{spawnedKill:l,spawnedCancel:f,setupTimeout:p,validateTimeout:m,setExitHandler:g}=n(485);const{handleInput:x,getSpawnedResult:b,makeAllStream:h,validateInputSync:S}=n(717);const{mergePromise:y,getSpawnedPromise:I}=n(740);const{joinCommand:w,parseCommand:v,getEscapedCommand:G}=n(453);const T=1e3*1e3*100;const getEnv=({env:e,extendEnv:t,preferLocal:n,localDir:r,execPath:o})=>{const i=t?{...process.env,...e}:e;if(n){return a.env({env:i,cwd:r,execPath:o})}return i};const handleArguments=(e,t,n={})=>{const o=i._parse(e,t,n);e=o.command;t=o.args;n=o.options;n={maxBuffer:T,buffer:true,stripFinalNewline:true,extendEnv:true,preferLocal:false,localDir:n.cwd||process.cwd(),execPath:process.execPath,encoding:"utf8",reject:true,cleanup:true,all:false,windowsHide:true,...n};n.env=getEnv(n);n.stdio=u(n);if(process.platform==="win32"&&r.basename(e,".exe")==="cmd"){t.unshift("/q")}return{file:e,args:t,options:n,parsed:o}};const handleOutput=(e,t,n)=>{if(typeof t!=="string"&&!Buffer.isBuffer(t)){return n===undefined?undefined:""}if(e.stripFinalNewline){return s(t)}return t};const execa=(e,t,n)=>{const r=handleArguments(e,t,n);const i=w(e,t);const s=G(e,t);m(r.options);let a;try{a=o.spawn(r.file,r.args,r.options)}catch(e){const t=new o.ChildProcess;const n=Promise.reject(d({error:e,stdout:"",stderr:"",all:"",command:i,escapedCommand:s,parsed:r,timedOut:false,isCanceled:false,killed:false}));return y(t,n)}const u=I(a);const S=p(a,r.options,u);const v=g(a,r.options,S);const T={isCanceled:false};a.kill=l.bind(null,a.kill.bind(a));a.cancel=f.bind(null,a,T);const handlePromise=async()=>{const[{error:e,exitCode:t,signal:n,timedOut:o},c,u,l]=await b(a,r.options,v);const f=handleOutput(r.options,c);const p=handleOutput(r.options,u);const m=handleOutput(r.options,l);if(e||t!==0||n!==null){const c=d({error:e,exitCode:t,signal:n,stdout:f,stderr:p,all:m,command:i,escapedCommand:s,parsed:r,timedOut:o,isCanceled:T.isCanceled,killed:a.killed});if(!r.options.reject){return c}throw c}return{command:i,escapedCommand:s,exitCode:0,stdout:f,stderr:p,all:m,failed:false,timedOut:false,isCanceled:false,killed:false}};const C=c(handlePromise);x(a,r.options.input);a.all=h(a,r.options);return y(a,C)};e.exports=execa;e.exports.sync=(e,t,n)=>{const r=handleArguments(e,t,n);const i=w(e,t);const s=G(e,t);S(r.options);let a;try{a=o.spawnSync(r.file,r.args,r.options)}catch(e){throw d({error:e,stdout:"",stderr:"",all:"",command:i,escapedCommand:s,parsed:r,timedOut:false,isCanceled:false,killed:false})}const c=handleOutput(r.options,a.stdout,a.error);const u=handleOutput(r.options,a.stderr,a.error);if(a.error||a.status!==0||a.signal!==null){const e=d({stdout:c,stderr:u,error:a.error,signal:a.signal,exitCode:a.status,command:i,escapedCommand:s,parsed:r,timedOut:a.error&&a.error.code==="ETIMEDOUT",isCanceled:false,killed:a.signal!==null});if(!r.options.reject){return e}throw e}return{command:i,escapedCommand:s,exitCode:0,stdout:c,stderr:u,failed:false,timedOut:false,isCanceled:false,killed:false}};e.exports.command=(e,t)=>{const[n,...r]=v(e);return execa(n,r,t)};e.exports.commandSync=(e,t)=>{const[n,...r]=v(e);return execa.sync(n,r,t)};e.exports.node=(e,t,n={})=>{if(t&&!Array.isArray(t)&&typeof t==="object"){n=t;t=[]}const r=u.node(n);const o=process.execArgv.filter((e=>!e.startsWith("--inspect")));const{nodePath:i=process.execPath,nodeOptions:s=o}=n;return execa(i,[...s,e,...Array.isArray(t)?t:[]],{...n,stdin:undefined,stdout:undefined,stderr:undefined,stdio:r,shell:false})}},453:function(e){"use strict";const normalizeArgs=(e,t=[])=>{if(!Array.isArray(t)){return[e]}return[e,...t]};const t=/^[\w.-]+$/;const n=/"/g;const escapeArg=e=>{if(typeof e!=="string"||t.test(e)){return e}return`"${e.replace(n,'\\"')}"`};const joinCommand=(e,t)=>normalizeArgs(e,t).join(" ");const getEscapedCommand=(e,t)=>normalizeArgs(e,t).map((e=>escapeArg(e))).join(" ");const r=/ +/g;const parseCommand=e=>{const t=[];for(const n of e.trim().split(r)){const e=t[t.length-1];if(e&&e.endsWith("\\")){t[t.length-1]=`${e.slice(0,-1)} ${n}`}else{t.push(n)}}return t};e.exports={joinCommand:joinCommand,getEscapedCommand:getEscapedCommand,parseCommand:parseCommand}},362:function(e,t,n){"use strict";const{signalsByName:r}=n(410);const getErrorPrefix=({timedOut:e,timeout:t,errorCode:n,signal:r,signalDescription:o,exitCode:i,isCanceled:s})=>{if(e){return`timed out after ${t} milliseconds`}if(s){return"was canceled"}if(n!==undefined){return`failed with ${n}`}if(r!==undefined){return`was killed with ${r} (${o})`}if(i!==undefined){return`failed with exit code ${i}`}return"failed"};const makeError=({stdout:e,stderr:t,all:n,error:o,signal:i,exitCode:s,command:a,escapedCommand:c,timedOut:d,isCanceled:u,killed:l,parsed:{options:{timeout:f}}})=>{s=s===null?undefined:s;i=i===null?undefined:i;const p=i===undefined?undefined:r[i].description;const m=o&&o.code;const g=getErrorPrefix({timedOut:d,timeout:f,errorCode:m,signal:i,signalDescription:p,exitCode:s,isCanceled:u});const x=`Command ${g}: ${a}`;const b=Object.prototype.toString.call(o)==="[object Error]";const h=b?`${x}\n${o.message}`:x;const S=[h,t,e].filter(Boolean).join("\n");if(b){o.originalMessage=o.message;o.message=S}else{o=new Error(S)}o.shortMessage=h;o.command=a;o.escapedCommand=c;o.exitCode=s;o.signal=i;o.signalDescription=p;o.stdout=e;o.stderr=t;if(n!==undefined){o.all=n}if("bufferedData"in o){delete o.bufferedData}o.failed=true;o.timedOut=Boolean(d);o.isCanceled=u;o.killed=l&&!d;return o};e.exports=makeError},485:function(e,t,n){"use strict";const r=n(87);const o=n(370);const i=1e3*5;const spawnedKill=(e,t="SIGTERM",n={})=>{const r=e(t);setKillTimeout(e,t,n,r);return r};const setKillTimeout=(e,t,n,r)=>{if(!shouldForceKill(t,n,r)){return}const o=getForceKillAfterTimeout(n);const i=setTimeout((()=>{e("SIGKILL")}),o);if(i.unref){i.unref()}};const shouldForceKill=(e,{forceKillAfterTimeout:t},n)=>isSigterm(e)&&t!==false&&n;const isSigterm=e=>e===r.constants.signals.SIGTERM||typeof e==="string"&&e.toUpperCase()==="SIGTERM";const getForceKillAfterTimeout=({forceKillAfterTimeout:e=true})=>{if(e===true){return i}if(!Number.isFinite(e)||e<0){throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)}return e};const spawnedCancel=(e,t)=>{const n=e.kill();if(n){t.isCanceled=true}};const timeoutKill=(e,t,n)=>{e.kill(t);n(Object.assign(new Error("Timed out"),{timedOut:true,signal:t}))};const setupTimeout=(e,{timeout:t,killSignal:n="SIGTERM"},r)=>{if(t===0||t===undefined){return r}let o;const i=new Promise(((r,i)=>{o=setTimeout((()=>{timeoutKill(e,n,i)}),t)}));const s=r.finally((()=>{clearTimeout(o)}));return Promise.race([i,s])};const validateTimeout=({timeout:e})=>{if(e!==undefined&&(!Number.isFinite(e)||e<0)){throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)}};const setExitHandler=async(e,{cleanup:t,detached:n},r)=>{if(!t||n){return r}const i=o((()=>{e.kill()}));return r.finally((()=>{i()}))};e.exports={spawnedKill:spawnedKill,spawnedCancel:spawnedCancel,setupTimeout:setupTimeout,validateTimeout:validateTimeout,setExitHandler:setExitHandler}},740:function(e){"use strict";const t=(async()=>{})().constructor.prototype;const n=["then","catch","finally"].map((e=>[e,Reflect.getOwnPropertyDescriptor(t,e)]));const mergePromise=(e,t)=>{for(const[r,o]of n){const n=typeof t==="function"?(...e)=>Reflect.apply(o.value,t(),e):o.value.bind(t);Reflect.defineProperty(e,r,{...o,value:n})}return e};const getSpawnedPromise=e=>new Promise(((t,n)=>{e.on("exit",((e,n)=>{t({exitCode:e,signal:n})}));e.on("error",(e=>{n(e)}));if(e.stdin){e.stdin.on("error",(e=>{n(e)}))}}));e.exports={mergePromise:mergePromise,getSpawnedPromise:getSpawnedPromise}},442:function(e){"use strict";const t=["stdin","stdout","stderr"];const hasAlias=e=>t.some((t=>e[t]!==undefined));const normalizeStdio=e=>{if(!e){return}const{stdio:n}=e;if(n===undefined){return t.map((t=>e[t]))}if(hasAlias(e)){throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${t.map((e=>`\`${e}\``)).join(", ")}`)}if(typeof n==="string"){return n}if(!Array.isArray(n)){throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof n}\``)}const r=Math.max(n.length,t.length);return Array.from({length:r},((e,t)=>n[t]))};e.exports=normalizeStdio;e.exports.node=e=>{const t=normalizeStdio(e);if(t==="ipc"){return"ipc"}if(t===undefined||typeof t==="string"){return[t,t,t,"ipc"]}if(t.includes("ipc")){return t}return[...t,"ipc"]}},717:function(e,t,n){"use strict";const r=n(8);const o=n(122);const i=n(450);const handleInput=(e,t)=>{if(t===undefined||e.stdin===undefined){return}if(r(t)){t.pipe(e.stdin)}else{e.stdin.end(t)}};const makeAllStream=(e,{all:t})=>{if(!t||!e.stdout&&!e.stderr){return}const n=i();if(e.stdout){n.add(e.stdout)}if(e.stderr){n.add(e.stderr)}return n};const getBufferedData=async(e,t)=>{if(!e){return}e.destroy();try{return await t}catch(e){return e.bufferedData}};const getStreamPromise=(e,{encoding:t,buffer:n,maxBuffer:r})=>{if(!e||!n){return}if(t){return o(e,{encoding:t,maxBuffer:r})}return o.buffer(e,{maxBuffer:r})};const getSpawnedResult=async({stdout:e,stderr:t,all:n},{encoding:r,buffer:o,maxBuffer:i},s)=>{const a=getStreamPromise(e,{encoding:r,buffer:o,maxBuffer:i});const c=getStreamPromise(t,{encoding:r,buffer:o,maxBuffer:i});const d=getStreamPromise(n,{encoding:r,buffer:o,maxBuffer:i*2});try{return await Promise.all([s,a,c,d])}catch(r){return Promise.all([{error:r,signal:r.signal,timedOut:r.timedOut},getBufferedData(e,a),getBufferedData(t,c),getBufferedData(n,d)])}};const validateInputSync=({input:e})=>{if(r(e)){throw new TypeError("The `input` option cannot be a stream in sync mode")}};e.exports={handleInput:handleInput,makeAllStream:makeAllStream,getSpawnedResult:getSpawnedResult,validateInputSync:validateInputSync}},57:function(e,t,n){"use strict";const{PassThrough:r}=n(413);e.exports=e=>{e={...e};const{array:t}=e;let{encoding:n}=e;const o=n==="buffer";let i=false;if(t){i=!(n||o)}else{n=n||"utf8"}if(o){n=null}const s=new r({objectMode:i});if(n){s.setEncoding(n)}let a=0;const c=[];s.on("data",(e=>{c.push(e);if(i){a=c.length}else{a+=e.length}}));s.getBufferedValue=()=>{if(t){return c}return o?Buffer.concat(c,a):c.join("")};s.getBufferedLength=()=>a;return s}},122:function(e,t,n){"use strict";const{constants:r}=n(293);const o=n(413);const{promisify:i}=n(669);const s=n(57);const a=i(o.pipeline);class MaxBufferError extends Error{constructor(){super("maxBuffer exceeded");this.name="MaxBufferError"}}async function getStream(e,t){if(!e){throw new Error("Expected a stream")}t={maxBuffer:Infinity,...t};const{maxBuffer:n}=t;const o=s(t);await new Promise(((t,i)=>{const rejectPromise=e=>{if(e&&o.getBufferedLength()<=r.MAX_LENGTH){e.bufferedData=o.getBufferedValue()}i(e)};(async()=>{try{await a(e,o);t()}catch(e){rejectPromise(e)}})();o.on("data",(()=>{if(o.getBufferedLength()>n){rejectPromise(new MaxBufferError)}}))}));return o.getBufferedValue()}e.exports=getStream;e.exports.buffer=(e,t)=>getStream(e,{...t,encoding:"buffer"});e.exports.array=(e,t)=>getStream(e,{...t,array:true});e.exports.MaxBufferError=MaxBufferError},570:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.SIGNALS=void 0;const n=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:true},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:true},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:true},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];t.SIGNALS=n},410:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.signalsByNumber=t.signalsByName=void 0;var r=n(87);var o=n(67);var i=n(934);const getSignalsByName=function(){const e=(0,o.getSignals)();return e.reduce(getSignalByName,{})};const getSignalByName=function(e,{name:t,number:n,description:r,supported:o,action:i,forced:s,standard:a}){return{...e,[t]:{name:t,number:n,description:r,supported:o,action:i,forced:s,standard:a}}};const s=getSignalsByName();t.signalsByName=s;const getSignalsByNumber=function(){const e=(0,o.getSignals)();const t=i.SIGRTMAX+1;const n=Array.from({length:t},((t,n)=>getSignalByNumber(n,e)));return Object.assign({},...n)};const getSignalByNumber=function(e,t){const n=findSignalByNumber(e,t);if(n===undefined){return{}}const{name:r,description:o,supported:i,action:s,forced:a,standard:c}=n;return{[e]:{name:r,number:e,description:o,supported:i,action:s,forced:a,standard:c}}};const findSignalByNumber=function(e,t){const n=t.find((({name:t})=>r.constants.signals[t]===e));if(n!==undefined){return n}return t.find((t=>t.number===e))};const a=getSignalsByNumber();t.signalsByNumber=a},934:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.SIGRTMAX=t.getRealtimeSignals=void 0;const getRealtimeSignals=function(){const e=r-n+1;return Array.from({length:e},getRealtimeSignal)};t.getRealtimeSignals=getRealtimeSignals;const getRealtimeSignal=function(e,t){return{name:`SIGRT${t+1}`,number:n+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}};const n=34;const r=64;t.SIGRTMAX=r},67:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getSignals=void 0;var r=n(87);var o=n(570);var i=n(934);const getSignals=function(){const e=(0,i.getRealtimeSignals)();const t=[...o.SIGNALS,...e].map(normalizeSignal);return t};t.getSignals=getSignals;const normalizeSignal=function({name:e,number:t,description:n,action:o,forced:i=false,standard:s}){const{signals:{[e]:a}}=r.constants;const c=a!==undefined;const d=c?a:t;return{name:e,number:d,description:n,supported:c,action:o,forced:i,standard:s}}},8:function(e){"use strict";const isStream=e=>e!==null&&typeof e==="object"&&typeof e.pipe==="function";isStream.writable=e=>isStream(e)&&e.writable!==false&&typeof e._write==="function"&&typeof e._writableState==="object";isStream.readable=e=>isStream(e)&&e.readable!==false&&typeof e._read==="function"&&typeof e._readableState==="object";isStream.duplex=e=>isStream.writable(e)&&isStream.readable(e);isStream.transform=e=>isStream.duplex(e)&&typeof e._transform==="function";e.exports=isStream},450:function(e,t,n){"use strict";const{PassThrough:r}=n(413);e.exports=function(){var e=[];var t=new r({objectMode:true});t.setMaxListeners(0);t.add=add;t.isEmpty=isEmpty;t.on("unpipe",remove);Array.prototype.slice.call(arguments).forEach(add);return t;function add(n){if(Array.isArray(n)){n.forEach(add);return this}e.push(n);n.once("end",remove.bind(null,n));n.once("error",t.emit.bind(t,"error"));n.pipe(t,{end:false});return this}function isEmpty(){return e.length==0}function remove(n){e=e.filter((function(e){return e!==n}));if(!e.length&&t.readable){t.end()}}}},317:function(e){"use strict";const mimicFn=(e,t)=>{for(const n of Reflect.ownKeys(t)){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}return e};e.exports=mimicFn;e.exports.default=mimicFn},799:function(e,t,n){"use strict";const r=n(622);const o=n(646);const npmRunPath=e=>{e={cwd:process.cwd(),path:process.env[o()],execPath:process.execPath,...e};let t;let n=r.resolve(e.cwd);const i=[];while(t!==n){i.push(r.join(n,"node_modules/.bin"));t=n;n=r.resolve(n,"..")}const s=r.resolve(e.cwd,e.execPath,"..");i.push(s);return i.concat(e.path).join(r.delimiter)};e.exports=npmRunPath;e.exports.default=npmRunPath;e.exports.env=t=>{t={env:process.env,...t};const n={...t.env};const r=o({env:n});t.path=n[r];n[r]=e.exports(t);return n}},390:function(e,t,n){"use strict";const r=n(317);const o=new WeakMap;const onetime=(e,t={})=>{if(typeof e!=="function"){throw new TypeError("Expected a function")}let n;let i=0;const s=e.displayName||e.name||"<anonymous>";const onetime=function(...r){o.set(onetime,++i);if(i===1){n=e.apply(this,r);e=null}else if(t.throw===true){throw new Error(`Function \`${s}\` can only be called once`)}return n};r(onetime,e);o.set(onetime,i);return onetime};e.exports=onetime;e.exports.default=onetime;e.exports.callCount=e=>{if(!o.has(e)){throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`)}return o.get(e)}},646:function(e){"use strict";const pathKey=(e={})=>{const t=e.env||process.env;const n=e.platform||process.platform;if(n!=="win32"){return"PATH"}return Object.keys(t).reverse().find((e=>e.toUpperCase()==="PATH"))||"Path"};e.exports=pathKey;e.exports.default=pathKey},370:function(e,t,n){var r=global.process;if(typeof r!=="object"||!r){e.exports=function(){}}else{var o=n(357);var i=n(569);var s=/^win/i.test(r.platform);var a=n(759);if(typeof a!=="function"){a=a.EventEmitter}var c;if(r.__signal_exit_emitter__){c=r.__signal_exit_emitter__}else{c=r.__signal_exit_emitter__=new a;c.count=0;c.emitted={}}if(!c.infinite){c.setMaxListeners(Infinity);c.infinite=true}e.exports=function(e,t){if(global.process!==r){return}o.equal(typeof e,"function","a callback must be provided for exit handler");if(f===false){p()}var n="exit";if(t&&t.alwaysLast){n="afterexit"}var remove=function(){c.removeListener(n,e);if(c.listeners("exit").length===0&&c.listeners("afterexit").length===0){d()}};c.on(n,e);return remove};var d=function unload(){if(!f||global.process!==r){return}f=false;i.forEach((function(e){try{r.removeListener(e,l[e])}catch(e){}}));r.emit=x;r.reallyExit=m;c.count-=1};e.exports.unload=d;var u=function emit(e,t,n){if(c.emitted[e]){return}c.emitted[e]=true;c.emit(e,t,n)};var l={};i.forEach((function(e){l[e]=function listener(){if(r!==global.process){return}var t=r.listeners(e);if(t.length===c.count){d();u("exit",null,e);u("afterexit",null,e);if(s&&e==="SIGHUP"){e="SIGINT"}r.kill(r.pid,e)}}}));e.exports.signals=function(){return i};var f=false;var p=function load(){if(f||r!==global.process){return}f=true;c.count+=1;i=i.filter((function(e){try{r.on(e,l[e]);return true}catch(e){return false}}));r.emit=b;r.reallyExit=g};e.exports.load=p;var m=r.reallyExit;var g=function processReallyExit(e){if(r!==global.process){return}r.exitCode=e||0;u("exit",r.exitCode,null);u("afterexit",r.exitCode,null);m.call(r,r.exitCode)};var x=r.emit;var b=function processEmit(e,t){if(e==="exit"&&r===global.process){if(t!==undefined){r.exitCode=t}var n=x.apply(this,arguments);u("exit",r.exitCode,null);u("afterexit",r.exitCode,null);return n}else{return x.apply(this,arguments)}}}},569:function(e){e.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];if(process.platform!=="win32"){e.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT")}if(process.platform==="linux"){e.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")}},614:function(e){"use strict";e.exports=e=>{const t=typeof e==="string"?"\n":"\n".charCodeAt();const n=typeof e==="string"?"\r":"\r".charCodeAt();if(e[e.length-1]===t){e=e.slice(0,e.length-1)}if(e[e.length-1]===n){e=e.slice(0,e.length-1)}return e}},178:function(e){"use strict";e.exports=require("@umijs/utils/compiled/cross-spawn")},357:function(e){"use strict";e.exports=require("assert")},293:function(e){"use strict";e.exports=require("buffer")},129:function(e){"use strict";e.exports=require("child_process")},759:function(e){"use strict";e.exports=require("events")},87:function(e){"use strict";e.exports=require("os")},622:function(e){"use strict";e.exports=require("path")},413:function(e){"use strict";e.exports=require("stream")},669:function(e){"use strict";e.exports=require("util")}};var t={};function __nccwpck_require__(n){var r=t[n];if(r!==undefined){return r.exports}var o=t[n]={exports:{}};var i=true;try{e[n](o,o.exports,__nccwpck_require__);i=false}finally{if(i)delete t[n]}return o.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var n=__nccwpck_require__(184);module.exports=n})();
|
|
1
|
+
(function(){var e={782:function(e,t,n){"use strict";const{PassThrough:r}=n(781);e.exports=e=>{e={...e};const{array:t}=e;let{encoding:n}=e;const o=n==="buffer";let i=false;if(t){i=!(n||o)}else{n=n||"utf8"}if(o){n=null}const s=new r({objectMode:i});if(n){s.setEncoding(n)}let a=0;const c=[];s.on("data",(e=>{c.push(e);if(i){a=c.length}else{a+=e.length}}));s.getBufferedValue=()=>{if(t){return c}return o?Buffer.concat(c,a):c.join("")};s.getBufferedLength=()=>a;return s}},981:function(e,t,n){"use strict";const{constants:r}=n(300);const o=n(781);const{promisify:i}=n(837);const s=n(782);const a=i(o.pipeline);class MaxBufferError extends Error{constructor(){super("maxBuffer exceeded");this.name="MaxBufferError"}}async function getStream(e,t){if(!e){throw new Error("Expected a stream")}t={maxBuffer:Infinity,...t};const{maxBuffer:n}=t;const o=s(t);await new Promise(((t,i)=>{const rejectPromise=e=>{if(e&&o.getBufferedLength()<=r.MAX_LENGTH){e.bufferedData=o.getBufferedValue()}i(e)};(async()=>{try{await a(e,o);t()}catch(e){rejectPromise(e)}})();o.on("data",(()=>{if(o.getBufferedLength()>n){rejectPromise(new MaxBufferError)}}))}));return o.getBufferedValue()}e.exports=getStream;e.exports.buffer=(e,t)=>getStream(e,{...t,encoding:"buffer"});e.exports.array=(e,t)=>getStream(e,{...t,array:true});e.exports.MaxBufferError=MaxBufferError},853:function(e,t,n){"use strict";const{PassThrough:r}=n(781);e.exports=function(){var e=[];var t=new r({objectMode:true});t.setMaxListeners(0);t.add=add;t.isEmpty=isEmpty;t.on("unpipe",remove);Array.prototype.slice.call(arguments).forEach(add);return t;function add(n){if(Array.isArray(n)){n.forEach(add);return this}e.push(n);n.once("end",remove.bind(null,n));n.once("error",t.emit.bind(t,"error"));n.pipe(t,{end:false});return this}function isEmpty(){return e.length==0}function remove(n){e=e.filter((function(e){return e!==n}));if(!e.length&&t.readable){t.end()}}}},580:function(e,t,n){var r=global.process;const processOk=function(e){return e&&typeof e==="object"&&typeof e.removeListener==="function"&&typeof e.emit==="function"&&typeof e.reallyExit==="function"&&typeof e.listeners==="function"&&typeof e.kill==="function"&&typeof e.pid==="number"&&typeof e.on==="function"};if(!processOk(r)){e.exports=function(){return function(){}}}else{var o=n(491);var i=n(357);var s=/^win/i.test(r.platform);var a=n(361);if(typeof a!=="function"){a=a.EventEmitter}var c;if(r.__signal_exit_emitter__){c=r.__signal_exit_emitter__}else{c=r.__signal_exit_emitter__=new a;c.count=0;c.emitted={}}if(!c.infinite){c.setMaxListeners(Infinity);c.infinite=true}e.exports=function(e,t){if(!processOk(global.process)){return function(){}}o.equal(typeof e,"function","a callback must be provided for exit handler");if(l===false){p()}var n="exit";if(t&&t.alwaysLast){n="afterexit"}var remove=function(){c.removeListener(n,e);if(c.listeners("exit").length===0&&c.listeners("afterexit").length===0){u()}};c.on(n,e);return remove};var u=function unload(){if(!l||!processOk(global.process)){return}l=false;i.forEach((function(e){try{r.removeListener(e,f[e])}catch(e){}}));r.emit=g;r.reallyExit=m;c.count-=1};e.exports.unload=u;var d=function emit(e,t,n){if(c.emitted[e]){return}c.emitted[e]=true;c.emit(e,t,n)};var f={};i.forEach((function(e){f[e]=function listener(){if(!processOk(global.process)){return}var t=r.listeners(e);if(t.length===c.count){u();d("exit",null,e);d("afterexit",null,e);if(s&&e==="SIGHUP"){e="SIGINT"}r.kill(r.pid,e)}}}));e.exports.signals=function(){return i};var l=false;var p=function load(){if(l||!processOk(global.process)){return}l=true;c.count+=1;i=i.filter((function(e){try{r.on(e,f[e]);return true}catch(e){return false}}));r.emit=y;r.reallyExit=b};e.exports.load=p;var m=r.reallyExit;var b=function processReallyExit(e){if(!processOk(global.process)){return}r.exitCode=e||0;d("exit",r.exitCode,null);d("afterexit",r.exitCode,null);m.call(r,r.exitCode)};var g=r.emit;var y=function processEmit(e,t){if(e==="exit"&&processOk(global.process)){if(t!==undefined){r.exitCode=t}var n=g.apply(this,arguments);d("exit",r.exitCode,null);d("afterexit",r.exitCode,null);return n}else{return g.apply(this,arguments)}}}},357:function(e){e.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];if(process.platform!=="win32"){e.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT")}if(process.platform==="linux"){e.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")}},491:function(e){"use strict";e.exports=require("assert")},300:function(e){"use strict";e.exports=require("buffer")},361:function(e){"use strict";e.exports=require("events")},781:function(e){"use strict";e.exports=require("stream")},837:function(e){"use strict";e.exports=require("util")}};var t={};function __nccwpck_require__(n){var r=t[n];if(r!==undefined){return r.exports}var o=t[n]={exports:{}};var i=true;try{e[n](o,o.exports,__nccwpck_require__);i=false}finally{if(i)delete t[n]}return o.exports}!function(){__nccwpck_require__.d=function(e,t){for(var n in t){if(__nccwpck_require__.o(t,n)&&!__nccwpck_require__.o(e,n)){Object.defineProperty(e,n,{enumerable:true,get:t[n]})}}}}();!function(){__nccwpck_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}}();!function(){__nccwpck_require__.r=function(e){if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(e,"__esModule",{value:true})}}();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var n={};!function(){"use strict";__nccwpck_require__.r(n);__nccwpck_require__.d(n,{execa:function(){return execa},execaCommand:function(){return execaCommand},execaCommandSync:function(){return execaCommandSync},execaNode:function(){return execaNode},execaSync:function(){return execaSync}});var e=require("node:buffer");var t=require("node:path");var r=require("node:child_process");var o=require("node:process");var i=require("@umijs/utils/compiled/cross-spawn");function stripFinalNewline(e){const t=typeof e==="string"?"\n":"\n".charCodeAt();const n=typeof e==="string"?"\r":"\r".charCodeAt();if(e[e.length-1]===t){e=e.slice(0,-1)}if(e[e.length-1]===n){e=e.slice(0,-1)}return e}var s=require("node:url");function pathKey(e={}){const{env:t=process.env,platform:n=process.platform}=e;if(n!=="win32"){return"PATH"}return Object.keys(t).reverse().find((e=>e.toUpperCase()==="PATH"))||"Path"}function npmRunPath(e={}){const{cwd:n=o.cwd(),path:r=o.env[pathKey()],execPath:i=o.execPath}=e;let a;const c=n instanceof URL?s.fileURLToPath(n):n;let u=t.resolve(c);const d=[];while(a!==u){d.push(t.join(u,"node_modules/.bin"));a=u;u=t.resolve(u,"..")}d.push(t.resolve(c,i,".."));return[...d,r].join(t.delimiter)}function npmRunPathEnv({env:e=o.env,...t}={}){e={...e};const n=pathKey({env:e});t.path=e[n];e[n]=npmRunPath(t);return e}const copyProperty=(e,t,n,r)=>{if(n==="length"||n==="prototype"){return}if(n==="arguments"||n==="caller"){return}const o=Object.getOwnPropertyDescriptor(e,n);const i=Object.getOwnPropertyDescriptor(t,n);if(!canCopyProperty(o,i)&&r){return}Object.defineProperty(e,n,i)};const canCopyProperty=function(e,t){return e===undefined||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)};const changePrototype=(e,t)=>{const n=Object.getPrototypeOf(t);if(n===Object.getPrototypeOf(e)){return}Object.setPrototypeOf(e,n)};const wrappedToString=(e,t)=>`/* Wrapped ${e}*/\n${t}`;const a=Object.getOwnPropertyDescriptor(Function.prototype,"toString");const c=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name");const changeToString=(e,t,n)=>{const r=n===""?"":`with ${n.trim()}() `;const o=wrappedToString.bind(null,r,t.toString());Object.defineProperty(o,"name",c);Object.defineProperty(e,"toString",{...a,value:o})};function mimicFunction(e,t,{ignoreNonConfigurable:n=false}={}){const{name:r}=e;for(const r of Reflect.ownKeys(t)){copyProperty(e,t,r,n)}changePrototype(e,t);changeToString(e,t,r);return e}const u=new WeakMap;const onetime=(e,t={})=>{if(typeof e!=="function"){throw new TypeError("Expected a function")}let n;let r=0;const o=e.displayName||e.name||"<anonymous>";const onetime=function(...i){u.set(onetime,++r);if(r===1){n=e.apply(this,i);e=null}else if(t.throw===true){throw new Error(`Function \`${o}\` can only be called once`)}return n};mimicFunction(onetime,e);u.set(onetime,r);return onetime};onetime.callCount=e=>{if(!u.has(e)){throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`)}return u.get(e)};var d=onetime;var f=require("os");const getRealtimeSignals=function(){const e=p-l+1;return Array.from({length:e},getRealtimeSignal)};const getRealtimeSignal=function(e,t){return{name:`SIGRT${t+1}`,number:l+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}};const l=34;const p=64;const m=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:true},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:true},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:true},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];const getSignals=function(){const e=getRealtimeSignals();const t=[...m,...e].map(normalizeSignal);return t};const normalizeSignal=function({name:e,number:t,description:n,action:r,forced:o=false,standard:i}){const{signals:{[e]:s}}=f.constants;const a=s!==undefined;const c=a?s:t;return{name:e,number:c,description:n,supported:a,action:r,forced:o,standard:i}};const getSignalsByName=function(){const e=getSignals();return e.reduce(getSignalByName,{})};const getSignalByName=function(e,{name:t,number:n,description:r,supported:o,action:i,forced:s,standard:a}){return{...e,[t]:{name:t,number:n,description:r,supported:o,action:i,forced:s,standard:a}}};const b=getSignalsByName();const getSignalsByNumber=function(){const e=getSignals();const t=p+1;const n=Array.from({length:t},((t,n)=>getSignalByNumber(n,e)));return Object.assign({},...n)};const getSignalByNumber=function(e,t){const n=findSignalByNumber(e,t);if(n===undefined){return{}}const{name:r,description:o,supported:i,action:s,forced:a,standard:c}=n;return{[e]:{name:r,number:e,description:o,supported:i,action:s,forced:a,standard:c}}};const findSignalByNumber=function(e,t){const n=t.find((({name:t})=>f.constants.signals[t]===e));if(n!==undefined){return n}return t.find((t=>t.number===e))};const g=getSignalsByNumber();const getErrorPrefix=({timedOut:e,timeout:t,errorCode:n,signal:r,signalDescription:o,exitCode:i,isCanceled:s})=>{if(e){return`timed out after ${t} milliseconds`}if(s){return"was canceled"}if(n!==undefined){return`failed with ${n}`}if(r!==undefined){return`was killed with ${r} (${o})`}if(i!==undefined){return`failed with exit code ${i}`}return"failed"};const makeError=({stdout:e,stderr:t,all:n,error:r,signal:o,exitCode:i,command:s,escapedCommand:a,timedOut:c,isCanceled:u,killed:d,parsed:{options:{timeout:f}}})=>{i=i===null?undefined:i;o=o===null?undefined:o;const l=o===undefined?undefined:b[o].description;const p=r&&r.code;const m=getErrorPrefix({timedOut:c,timeout:f,errorCode:p,signal:o,signalDescription:l,exitCode:i,isCanceled:u});const g=`Command ${m}: ${s}`;const y=Object.prototype.toString.call(r)==="[object Error]";const x=y?`${g}\n${r.message}`:g;const h=[x,t,e].filter(Boolean).join("\n");if(y){r.originalMessage=r.message;r.message=h}else{r=new Error(h)}r.shortMessage=x;r.command=s;r.escapedCommand=a;r.exitCode=i;r.signal=o;r.signalDescription=l;r.stdout=e;r.stderr=t;if(n!==undefined){r.all=n}if("bufferedData"in r){delete r.bufferedData}r.failed=true;r.timedOut=Boolean(c);r.isCanceled=u;r.killed=d&&!c;return r};const y=["stdin","stdout","stderr"];const hasAlias=e=>y.some((t=>e[t]!==undefined));const normalizeStdio=e=>{if(!e){return}const{stdio:t}=e;if(t===undefined){return y.map((t=>e[t]))}if(hasAlias(e)){throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${y.map((e=>`\`${e}\``)).join(", ")}`)}if(typeof t==="string"){return t}if(!Array.isArray(t)){throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``)}const n=Math.max(t.length,y.length);return Array.from({length:n},((e,n)=>t[n]))};const normalizeStdioNode=e=>{const t=normalizeStdio(e);if(t==="ipc"){return"ipc"}if(t===undefined||typeof t==="string"){return[t,t,t,"ipc"]}if(t.includes("ipc")){return t}return[...t,"ipc"]};var x=require("node:os");var h=__nccwpck_require__(580);const S=1e3*5;const spawnedKill=(e,t="SIGTERM",n={})=>{const r=e(t);setKillTimeout(e,t,n,r);return r};const setKillTimeout=(e,t,n,r)=>{if(!shouldForceKill(t,n,r)){return}const o=getForceKillAfterTimeout(n);const i=setTimeout((()=>{e("SIGKILL")}),o);if(i.unref){i.unref()}};const shouldForceKill=(e,{forceKillAfterTimeout:t},n)=>isSigterm(e)&&t!==false&&n;const isSigterm=e=>e===x.constants.signals.SIGTERM||typeof e==="string"&&e.toUpperCase()==="SIGTERM";const getForceKillAfterTimeout=({forceKillAfterTimeout:e=true})=>{if(e===true){return S}if(!Number.isFinite(e)||e<0){throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)}return e};const spawnedCancel=(e,t)=>{const n=e.kill();if(n){t.isCanceled=true}};const timeoutKill=(e,t,n)=>{e.kill(t);n(Object.assign(new Error("Timed out"),{timedOut:true,signal:t}))};const setupTimeout=(e,{timeout:t,killSignal:n="SIGTERM"},r)=>{if(t===0||t===undefined){return r}let o;const i=new Promise(((r,i)=>{o=setTimeout((()=>{timeoutKill(e,n,i)}),t)}));const s=r.finally((()=>{clearTimeout(o)}));return Promise.race([i,s])};const validateTimeout=({timeout:e})=>{if(e!==undefined&&(!Number.isFinite(e)||e<0)){throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)}};const setExitHandler=async(e,{cleanup:t,detached:n},r)=>{if(!t||n){return r}const o=h((()=>{e.kill()}));return r.finally((()=>{o()}))};function isStream(e){return e!==null&&typeof e==="object"&&typeof e.pipe==="function"}function isWritableStream(e){return isStream(e)&&e.writable!==false&&typeof e._write==="function"&&typeof e._writableState==="object"}function isReadableStream(e){return isStream(e)&&e.readable!==false&&typeof e._read==="function"&&typeof e._readableState==="object"}function isDuplexStream(e){return isWritableStream(e)&&isReadableStream(e)}function isTransformStream(e){return isDuplexStream(e)&&typeof e._transform==="function"}var w=__nccwpck_require__(981);var _=__nccwpck_require__(853);const handleInput=(e,t)=>{if(t===undefined||e.stdin===undefined){return}if(isStream(t)){t.pipe(e.stdin)}else{e.stdin.end(t)}};const makeAllStream=(e,{all:t})=>{if(!t||!e.stdout&&!e.stderr){return}const n=_();if(e.stdout){n.add(e.stdout)}if(e.stderr){n.add(e.stderr)}return n};const getBufferedData=async(e,t)=>{if(!e){return}e.destroy();try{return await t}catch(e){return e.bufferedData}};const getStreamPromise=(e,{encoding:t,buffer:n,maxBuffer:r})=>{if(!e||!n){return}if(t){return w(e,{encoding:t,maxBuffer:r})}return w.buffer(e,{maxBuffer:r})};const getSpawnedResult=async({stdout:e,stderr:t,all:n},{encoding:r,buffer:o,maxBuffer:i},s)=>{const a=getStreamPromise(e,{encoding:r,buffer:o,maxBuffer:i});const c=getStreamPromise(t,{encoding:r,buffer:o,maxBuffer:i});const u=getStreamPromise(n,{encoding:r,buffer:o,maxBuffer:i*2});try{return await Promise.all([s,a,c,u])}catch(r){return Promise.all([{error:r,signal:r.signal,timedOut:r.timedOut},getBufferedData(e,a),getBufferedData(t,c),getBufferedData(n,u)])}};const validateInputSync=({input:e})=>{if(isStream(e)){throw new TypeError("The `input` option cannot be a stream in sync mode")}};const v=(async()=>{})().constructor.prototype;const I=["then","catch","finally"].map((e=>[e,Reflect.getOwnPropertyDescriptor(v,e)]));const mergePromise=(e,t)=>{for(const[n,r]of I){const o=typeof t==="function"?(...e)=>Reflect.apply(r.value,t(),e):r.value.bind(t);Reflect.defineProperty(e,n,{...r,value:o})}return e};const getSpawnedPromise=e=>new Promise(((t,n)=>{e.on("exit",((e,n)=>{t({exitCode:e,signal:n})}));e.on("error",(e=>{n(e)}));if(e.stdin){e.stdin.on("error",(e=>{n(e)}))}}));const normalizeArgs=(e,t=[])=>{if(!Array.isArray(t)){return[e]}return[e,...t]};const C=/^[\w.-]+$/;const T=/"/g;const escapeArg=e=>{if(typeof e!=="string"||C.test(e)){return e}return`"${e.replace(T,'\\"')}"`};const joinCommand=(e,t)=>normalizeArgs(e,t).join(" ");const getEscapedCommand=(e,t)=>normalizeArgs(e,t).map((e=>escapeArg(e))).join(" ");const G=/ +/g;const parseCommand=e=>{const t=[];for(const n of e.trim().split(G)){const e=t[t.length-1];if(e&&e.endsWith("\\")){t[t.length-1]=`${e.slice(0,-1)} ${n}`}else{t.push(n)}}return t};const P=1e3*1e3*100;const getEnv=({env:e,extendEnv:t,preferLocal:n,localDir:r,execPath:i})=>{const s=t?{...o.env,...e}:e;if(n){return npmRunPathEnv({env:s,cwd:r,execPath:i})}return s};const handleArguments=(e,n,r={})=>{const s=i._parse(e,n,r);e=s.command;n=s.args;r=s.options;r={maxBuffer:P,buffer:true,stripFinalNewline:true,extendEnv:true,preferLocal:false,localDir:r.cwd||o.cwd(),execPath:o.execPath,encoding:"utf8",reject:true,cleanup:true,all:false,windowsHide:true,...r};r.env=getEnv(r);r.stdio=normalizeStdio(r);if(o.platform==="win32"&&t.basename(e,".exe")==="cmd"){n.unshift("/q")}return{file:e,args:n,options:r,parsed:s}};const handleOutput=(t,n,r)=>{if(typeof n!=="string"&&!e.Buffer.isBuffer(n)){return r===undefined?undefined:""}if(t.stripFinalNewline){return stripFinalNewline(n)}return n};function execa(e,t,n){const o=handleArguments(e,t,n);const i=joinCommand(e,t);const s=getEscapedCommand(e,t);validateTimeout(o.options);let a;try{a=r.spawn(o.file,o.args,o.options)}catch(e){const t=new r.ChildProcess;const n=Promise.reject(makeError({error:e,stdout:"",stderr:"",all:"",command:i,escapedCommand:s,parsed:o,timedOut:false,isCanceled:false,killed:false}));return mergePromise(t,n)}const c=getSpawnedPromise(a);const u=setupTimeout(a,o.options,c);const f=setExitHandler(a,o.options,u);const l={isCanceled:false};a.kill=spawnedKill.bind(null,a.kill.bind(a));a.cancel=spawnedCancel.bind(null,a,l);const handlePromise=async()=>{const[{error:e,exitCode:t,signal:n,timedOut:r},c,u,d]=await getSpawnedResult(a,o.options,f);const p=handleOutput(o.options,c);const m=handleOutput(o.options,u);const b=handleOutput(o.options,d);if(e||t!==0||n!==null){const c=makeError({error:e,exitCode:t,signal:n,stdout:p,stderr:m,all:b,command:i,escapedCommand:s,parsed:o,timedOut:r,isCanceled:l.isCanceled||(o.options.signal?o.options.signal.aborted:false),killed:a.killed});if(!o.options.reject){return c}throw c}return{command:i,escapedCommand:s,exitCode:0,stdout:p,stderr:m,all:b,failed:false,timedOut:false,isCanceled:false,killed:false}};const p=d(handlePromise);handleInput(a,o.options.input);a.all=makeAllStream(a,o.options);return mergePromise(a,p)}function execaSync(e,t,n){const o=handleArguments(e,t,n);const i=joinCommand(e,t);const s=getEscapedCommand(e,t);validateInputSync(o.options);let a;try{a=r.spawnSync(o.file,o.args,o.options)}catch(e){throw makeError({error:e,stdout:"",stderr:"",all:"",command:i,escapedCommand:s,parsed:o,timedOut:false,isCanceled:false,killed:false})}const c=handleOutput(o.options,a.stdout,a.error);const u=handleOutput(o.options,a.stderr,a.error);if(a.error||a.status!==0||a.signal!==null){const e=makeError({stdout:c,stderr:u,error:a.error,signal:a.signal,exitCode:a.status,command:i,escapedCommand:s,parsed:o,timedOut:a.error&&a.error.code==="ETIMEDOUT",isCanceled:false,killed:a.signal!==null});if(!o.options.reject){return e}throw e}return{command:i,escapedCommand:s,exitCode:0,stdout:c,stderr:u,failed:false,timedOut:false,isCanceled:false,killed:false}}function execaCommand(e,t){const[n,...r]=parseCommand(e);return execa(n,r,t)}function execaCommandSync(e,t){const[n,...r]=parseCommand(e);return execaSync(n,r,t)}function execaNode(e,t,n={}){if(t&&!Array.isArray(t)&&typeof t==="object"){n=t;t=[]}const r=normalizeStdioNode(n);const i=o.execArgv.filter((e=>!e.startsWith("--inspect")));const{nodePath:s=o.execPath,nodeOptions:a=i}=n;return execa(s,[...a,e,...Array.isArray(t)?t:[]],{...n,stdin:undefined,stdout:undefined,stderr:undefined,stdio:r,shell:false})}}();module.exports=n})();
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type * as fsStat from '../../../@nodelib/fs.stat';
|
|
2
|
+
import type { Dirent, ErrnoException } from '../types';
|
|
3
|
+
export interface ReaddirAsynchronousMethod {
|
|
4
|
+
(filepath: string, options: {
|
|
5
|
+
withFileTypes: true;
|
|
6
|
+
}, callback: (error: ErrnoException | null, files: Dirent[]) => void): void;
|
|
7
|
+
(filepath: string, callback: (error: ErrnoException | null, files: string[]) => void): void;
|
|
8
|
+
}
|
|
9
|
+
export interface ReaddirSynchronousMethod {
|
|
10
|
+
(filepath: string, options: {
|
|
11
|
+
withFileTypes: true;
|
|
12
|
+
}): Dirent[];
|
|
13
|
+
(filepath: string): string[];
|
|
14
|
+
}
|
|
15
|
+
export declare type FileSystemAdapter = fsStat.FileSystemAdapter & {
|
|
16
|
+
readdir: ReaddirAsynchronousMethod;
|
|
17
|
+
readdirSync: ReaddirSynchronousMethod;
|
|
18
|
+
};
|
|
19
|
+
export declare const FILE_SYSTEM_ADAPTER: FileSystemAdapter;
|
|
20
|
+
export declare function createFileSystemAdapter(fsMethods?: Partial<FileSystemAdapter>): FileSystemAdapter;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { FileSystemAdapter, ReaddirAsynchronousMethod, ReaddirSynchronousMethod } from './adapters/fs';
|
|
2
|
+
import * as async from './providers/async';
|
|
3
|
+
import Settings, { Options } from './settings';
|
|
4
|
+
import type { Dirent, Entry } from './types';
|
|
5
|
+
declare type AsyncCallback = async.AsyncCallback;
|
|
6
|
+
declare function scandir(path: string, callback: AsyncCallback): void;
|
|
7
|
+
declare function scandir(path: string, optionsOrSettings: Options | Settings, callback: AsyncCallback): void;
|
|
8
|
+
declare namespace scandir {
|
|
9
|
+
function __promisify__(path: string, optionsOrSettings?: Options | Settings): Promise<Entry[]>;
|
|
10
|
+
}
|
|
11
|
+
declare function scandirSync(path: string, optionsOrSettings?: Options | Settings): Entry[];
|
|
12
|
+
export { scandir, scandirSync, Settings, AsyncCallback, Dirent, Entry, FileSystemAdapter, ReaddirAsynchronousMethod, ReaddirSynchronousMethod, Options };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import type Settings from '../settings';
|
|
3
|
+
import type { Entry } from '../types';
|
|
4
|
+
export declare type AsyncCallback = (error: NodeJS.ErrnoException, entries: Entry[]) => void;
|
|
5
|
+
export declare function read(directory: string, settings: Settings, callback: AsyncCallback): void;
|
|
6
|
+
export declare function readdirWithFileTypes(directory: string, settings: Settings, callback: AsyncCallback): void;
|
|
7
|
+
export declare function readdir(directory: string, settings: Settings, callback: AsyncCallback): void;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as fsStat from '../../@nodelib/fs.stat';
|
|
2
|
+
import * as fs from './adapters/fs';
|
|
3
|
+
export interface Options {
|
|
4
|
+
followSymbolicLinks?: boolean;
|
|
5
|
+
fs?: Partial<fs.FileSystemAdapter>;
|
|
6
|
+
pathSegmentSeparator?: string;
|
|
7
|
+
stats?: boolean;
|
|
8
|
+
throwErrorOnBrokenSymbolicLink?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export default class Settings {
|
|
11
|
+
private readonly _options;
|
|
12
|
+
readonly followSymbolicLinks: boolean;
|
|
13
|
+
readonly fs: fs.FileSystemAdapter;
|
|
14
|
+
readonly pathSegmentSeparator: string;
|
|
15
|
+
readonly stats: boolean;
|
|
16
|
+
readonly throwErrorOnBrokenSymbolicLink: boolean;
|
|
17
|
+
readonly fsStatSettings: fsStat.Settings;
|
|
18
|
+
constructor(_options?: Options);
|
|
19
|
+
private _getValue;
|
|
20
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import type * as fs from 'fs';
|
|
3
|
+
export interface Entry {
|
|
4
|
+
dirent: Dirent;
|
|
5
|
+
name: string;
|
|
6
|
+
path: string;
|
|
7
|
+
stats?: Stats;
|
|
8
|
+
}
|
|
9
|
+
export declare type Stats = fs.Stats;
|
|
10
|
+
export declare type ErrnoException = NodeJS.ErrnoException;
|
|
11
|
+
export interface Dirent {
|
|
12
|
+
isBlockDevice: () => boolean;
|
|
13
|
+
isCharacterDevice: () => boolean;
|
|
14
|
+
isDirectory: () => boolean;
|
|
15
|
+
isFIFO: () => boolean;
|
|
16
|
+
isFile: () => boolean;
|
|
17
|
+
isSocket: () => boolean;
|
|
18
|
+
isSymbolicLink: () => boolean;
|
|
19
|
+
name: string;
|
|
20
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import * as fs from 'fs';
|
|
3
|
+
import type { ErrnoException } from '../types';
|
|
4
|
+
export declare type StatAsynchronousMethod = (path: string, callback: (error: ErrnoException | null, stats: fs.Stats) => void) => void;
|
|
5
|
+
export declare type StatSynchronousMethod = (path: string) => fs.Stats;
|
|
6
|
+
export interface FileSystemAdapter {
|
|
7
|
+
lstat: StatAsynchronousMethod;
|
|
8
|
+
stat: StatAsynchronousMethod;
|
|
9
|
+
lstatSync: StatSynchronousMethod;
|
|
10
|
+
statSync: StatSynchronousMethod;
|
|
11
|
+
}
|
|
12
|
+
export declare const FILE_SYSTEM_ADAPTER: FileSystemAdapter;
|
|
13
|
+
export declare function createFileSystemAdapter(fsMethods?: Partial<FileSystemAdapter>): FileSystemAdapter;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { FileSystemAdapter, StatAsynchronousMethod, StatSynchronousMethod } from './adapters/fs';
|
|
2
|
+
import * as async from './providers/async';
|
|
3
|
+
import Settings, { Options } from './settings';
|
|
4
|
+
import type { Stats } from './types';
|
|
5
|
+
declare type AsyncCallback = async.AsyncCallback;
|
|
6
|
+
declare function stat(path: string, callback: AsyncCallback): void;
|
|
7
|
+
declare function stat(path: string, optionsOrSettings: Options | Settings, callback: AsyncCallback): void;
|
|
8
|
+
declare namespace stat {
|
|
9
|
+
function __promisify__(path: string, optionsOrSettings?: Options | Settings): Promise<Stats>;
|
|
10
|
+
}
|
|
11
|
+
declare function statSync(path: string, optionsOrSettings?: Options | Settings): Stats;
|
|
12
|
+
export { Settings, stat, statSync, AsyncCallback, FileSystemAdapter, StatAsynchronousMethod, StatSynchronousMethod, Options, Stats };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type Settings from '../settings';
|
|
2
|
+
import type { ErrnoException, Stats } from '../types';
|
|
3
|
+
export declare type AsyncCallback = (error: ErrnoException, stats: Stats) => void;
|
|
4
|
+
export declare function read(path: string, settings: Settings, callback: AsyncCallback): void;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as fs from './adapters/fs';
|
|
2
|
+
export interface Options {
|
|
3
|
+
followSymbolicLink?: boolean;
|
|
4
|
+
fs?: Partial<fs.FileSystemAdapter>;
|
|
5
|
+
markSymbolicLink?: boolean;
|
|
6
|
+
throwErrorOnBrokenSymbolicLink?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export default class Settings {
|
|
9
|
+
private readonly _options;
|
|
10
|
+
readonly followSymbolicLink: boolean;
|
|
11
|
+
readonly fs: fs.FileSystemAdapter;
|
|
12
|
+
readonly markSymbolicLink: boolean;
|
|
13
|
+
readonly throwErrorOnBrokenSymbolicLink: boolean;
|
|
14
|
+
constructor(_options?: Options);
|
|
15
|
+
private _getValue;
|
|
16
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import type { Readable } from 'stream';
|
|
3
|
+
import type { Dirent, FileSystemAdapter } from '../../@nodelib/fs.scandir';
|
|
4
|
+
import { AsyncCallback } from './providers/async';
|
|
5
|
+
import Settings, { DeepFilterFunction, EntryFilterFunction, ErrorFilterFunction, Options } from './settings';
|
|
6
|
+
import type { Entry } from './types';
|
|
7
|
+
declare function walk(directory: string, callback: AsyncCallback): void;
|
|
8
|
+
declare function walk(directory: string, optionsOrSettings: Options | Settings, callback: AsyncCallback): void;
|
|
9
|
+
declare namespace walk {
|
|
10
|
+
function __promisify__(directory: string, optionsOrSettings?: Options | Settings): Promise<Entry[]>;
|
|
11
|
+
}
|
|
12
|
+
declare function walkSync(directory: string, optionsOrSettings?: Options | Settings): Entry[];
|
|
13
|
+
declare function walkStream(directory: string, optionsOrSettings?: Options | Settings): Readable;
|
|
14
|
+
export { walk, walkSync, walkStream, Settings, AsyncCallback, Dirent, Entry, FileSystemAdapter, Options, DeepFilterFunction, EntryFilterFunction, ErrorFilterFunction };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import AsyncReader from '../readers/async';
|
|
2
|
+
import type Settings from '../settings';
|
|
3
|
+
import type { Entry, Errno } from '../types';
|
|
4
|
+
export declare type AsyncCallback = (error: Errno, entries: Entry[]) => void;
|
|
5
|
+
export default class AsyncProvider {
|
|
6
|
+
private readonly _root;
|
|
7
|
+
private readonly _settings;
|
|
8
|
+
protected readonly _reader: AsyncReader;
|
|
9
|
+
private readonly _storage;
|
|
10
|
+
constructor(_root: string, _settings: Settings);
|
|
11
|
+
read(callback: AsyncCallback): void;
|
|
12
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { EventEmitter } from 'events';
|
|
3
|
+
import * as fsScandir from '../../../@nodelib/fs.scandir';
|
|
4
|
+
import type Settings from '../settings';
|
|
5
|
+
import type { Entry, Errno } from '../types';
|
|
6
|
+
import Reader from './reader';
|
|
7
|
+
declare type EntryEventCallback = (entry: Entry) => void;
|
|
8
|
+
declare type ErrorEventCallback = (error: Errno) => void;
|
|
9
|
+
declare type EndEventCallback = () => void;
|
|
10
|
+
export default class AsyncReader extends Reader {
|
|
11
|
+
protected readonly _settings: Settings;
|
|
12
|
+
protected readonly _scandir: typeof fsScandir.scandir;
|
|
13
|
+
protected readonly _emitter: EventEmitter;
|
|
14
|
+
private readonly _queue;
|
|
15
|
+
private _isFatalError;
|
|
16
|
+
private _isDestroyed;
|
|
17
|
+
constructor(_root: string, _settings: Settings);
|
|
18
|
+
read(): EventEmitter;
|
|
19
|
+
get isDestroyed(): boolean;
|
|
20
|
+
destroy(): void;
|
|
21
|
+
onEntry(callback: EntryEventCallback): void;
|
|
22
|
+
onError(callback: ErrorEventCallback): void;
|
|
23
|
+
onEnd(callback: EndEventCallback): void;
|
|
24
|
+
private _pushToQueue;
|
|
25
|
+
private _worker;
|
|
26
|
+
private _handleError;
|
|
27
|
+
private _handleEntry;
|
|
28
|
+
private _emitEntry;
|
|
29
|
+
}
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as fsScandir from '../../@nodelib/fs.scandir';
|
|
2
|
+
import type { Entry, Errno } from './types';
|
|
3
|
+
export declare type FilterFunction<T> = (value: T) => boolean;
|
|
4
|
+
export declare type DeepFilterFunction = FilterFunction<Entry>;
|
|
5
|
+
export declare type EntryFilterFunction = FilterFunction<Entry>;
|
|
6
|
+
export declare type ErrorFilterFunction = FilterFunction<Errno>;
|
|
7
|
+
export interface Options {
|
|
8
|
+
basePath?: string;
|
|
9
|
+
concurrency?: number;
|
|
10
|
+
deepFilter?: DeepFilterFunction;
|
|
11
|
+
entryFilter?: EntryFilterFunction;
|
|
12
|
+
errorFilter?: ErrorFilterFunction;
|
|
13
|
+
followSymbolicLinks?: boolean;
|
|
14
|
+
fs?: Partial<fsScandir.FileSystemAdapter>;
|
|
15
|
+
pathSegmentSeparator?: string;
|
|
16
|
+
stats?: boolean;
|
|
17
|
+
throwErrorOnBrokenSymbolicLink?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export default class Settings {
|
|
20
|
+
private readonly _options;
|
|
21
|
+
readonly basePath?: string;
|
|
22
|
+
readonly concurrency: number;
|
|
23
|
+
readonly deepFilter: DeepFilterFunction | null;
|
|
24
|
+
readonly entryFilter: EntryFilterFunction | null;
|
|
25
|
+
readonly errorFilter: ErrorFilterFunction | null;
|
|
26
|
+
readonly pathSegmentSeparator: string;
|
|
27
|
+
readonly fsScandirSettings: fsScandir.Settings;
|
|
28
|
+
constructor(_options?: Options);
|
|
29
|
+
private _getValue;
|
|
30
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import * as taskManager from './managers/tasks';
|
|
3
|
+
import { Options as OptionsInternal } from './settings';
|
|
4
|
+
import { Entry as EntryInternal, FileSystemAdapter as FileSystemAdapterInternal, Pattern as PatternInternal } from './types';
|
|
5
|
+
declare type EntryObjectModePredicate = {
|
|
6
|
+
[TKey in keyof Pick<OptionsInternal, 'objectMode'>]-?: true;
|
|
7
|
+
};
|
|
8
|
+
declare type EntryStatsPredicate = {
|
|
9
|
+
[TKey in keyof Pick<OptionsInternal, 'stats'>]-?: true;
|
|
10
|
+
};
|
|
11
|
+
declare type EntryObjectPredicate = EntryObjectModePredicate | EntryStatsPredicate;
|
|
12
|
+
declare function FastGlob(source: PatternInternal | PatternInternal[], options: OptionsInternal & EntryObjectPredicate): Promise<EntryInternal[]>;
|
|
13
|
+
declare function FastGlob(source: PatternInternal | PatternInternal[], options?: OptionsInternal): Promise<string[]>;
|
|
14
|
+
declare namespace FastGlob {
|
|
15
|
+
type Options = OptionsInternal;
|
|
16
|
+
type Entry = EntryInternal;
|
|
17
|
+
type Task = taskManager.Task;
|
|
18
|
+
type Pattern = PatternInternal;
|
|
19
|
+
type FileSystemAdapter = FileSystemAdapterInternal;
|
|
20
|
+
function sync(source: PatternInternal | PatternInternal[], options: OptionsInternal & EntryObjectPredicate): EntryInternal[];
|
|
21
|
+
function sync(source: PatternInternal | PatternInternal[], options?: OptionsInternal): string[];
|
|
22
|
+
function stream(source: PatternInternal | PatternInternal[], options?: OptionsInternal): NodeJS.ReadableStream;
|
|
23
|
+
function generateTasks(source: PatternInternal | PatternInternal[], options?: OptionsInternal): Task[];
|
|
24
|
+
function isDynamicPattern(source: PatternInternal, options?: OptionsInternal): boolean;
|
|
25
|
+
function escapePath(source: PatternInternal): PatternInternal;
|
|
26
|
+
}
|
|
27
|
+
export = FastGlob;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import Settings from '../settings';
|
|
2
|
+
import { Pattern, PatternsGroup } from '../types';
|
|
3
|
+
export declare type Task = {
|
|
4
|
+
base: string;
|
|
5
|
+
dynamic: boolean;
|
|
6
|
+
patterns: Pattern[];
|
|
7
|
+
positive: Pattern[];
|
|
8
|
+
negative: Pattern[];
|
|
9
|
+
};
|
|
10
|
+
export declare function generate(patterns: Pattern[], settings: Settings): Task[];
|
|
11
|
+
/**
|
|
12
|
+
* Returns tasks grouped by basic pattern directories.
|
|
13
|
+
*
|
|
14
|
+
* Patterns that can be found inside (`./`) and outside (`../`) the current directory are handled separately.
|
|
15
|
+
* This is necessary because directory traversal starts at the base directory and goes deeper.
|
|
16
|
+
*/
|
|
17
|
+
export declare function convertPatternsToTasks(positive: Pattern[], negative: Pattern[], dynamic: boolean): Task[];
|
|
18
|
+
export declare function getPositivePatterns(patterns: Pattern[]): Pattern[];
|
|
19
|
+
export declare function getNegativePatternsAsPositive(patterns: Pattern[], ignore: Pattern[]): Pattern[];
|
|
20
|
+
export declare function groupPatternsByBaseDirectory(patterns: Pattern[]): PatternsGroup;
|
|
21
|
+
export declare function convertPatternGroupsToTasks(positive: PatternsGroup, negative: Pattern[], dynamic: boolean): Task[];
|
|
22
|
+
export declare function convertPatternGroupToTask(base: string, positive: Pattern[], negative: Pattern[], dynamic: boolean): Task;
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { FileSystemAdapter, Pattern } from './types';
|
|
2
|
+
export declare const DEFAULT_FILE_SYSTEM_ADAPTER: FileSystemAdapter;
|
|
3
|
+
export declare type Options = {
|
|
4
|
+
/**
|
|
5
|
+
* Return the absolute path for entries.
|
|
6
|
+
*
|
|
7
|
+
* @default false
|
|
8
|
+
*/
|
|
9
|
+
absolute?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* If set to `true`, then patterns without slashes will be matched against
|
|
12
|
+
* the basename of the path if it contains slashes.
|
|
13
|
+
*
|
|
14
|
+
* @default false
|
|
15
|
+
*/
|
|
16
|
+
baseNameMatch?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Enables Bash-like brace expansion.
|
|
19
|
+
*
|
|
20
|
+
* @default true
|
|
21
|
+
*/
|
|
22
|
+
braceExpansion?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Enables a case-sensitive mode for matching files.
|
|
25
|
+
*
|
|
26
|
+
* @default true
|
|
27
|
+
*/
|
|
28
|
+
caseSensitiveMatch?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Specifies the maximum number of concurrent requests from a reader to read
|
|
31
|
+
* directories.
|
|
32
|
+
*
|
|
33
|
+
* @default os.cpus().length
|
|
34
|
+
*/
|
|
35
|
+
concurrency?: number;
|
|
36
|
+
/**
|
|
37
|
+
* The current working directory in which to search.
|
|
38
|
+
*
|
|
39
|
+
* @default process.cwd()
|
|
40
|
+
*/
|
|
41
|
+
cwd?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Specifies the maximum depth of a read directory relative to the start
|
|
44
|
+
* directory.
|
|
45
|
+
*
|
|
46
|
+
* @default Infinity
|
|
47
|
+
*/
|
|
48
|
+
deep?: number;
|
|
49
|
+
/**
|
|
50
|
+
* Allow patterns to match entries that begin with a period (`.`).
|
|
51
|
+
*
|
|
52
|
+
* @default false
|
|
53
|
+
*/
|
|
54
|
+
dot?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Enables Bash-like `extglob` functionality.
|
|
57
|
+
*
|
|
58
|
+
* @default true
|
|
59
|
+
*/
|
|
60
|
+
extglob?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Indicates whether to traverse descendants of symbolic link directories.
|
|
63
|
+
*
|
|
64
|
+
* @default true
|
|
65
|
+
*/
|
|
66
|
+
followSymbolicLinks?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Custom implementation of methods for working with the file system.
|
|
69
|
+
*
|
|
70
|
+
* @default fs.*
|
|
71
|
+
*/
|
|
72
|
+
fs?: Partial<FileSystemAdapter>;
|
|
73
|
+
/**
|
|
74
|
+
* Enables recursively repeats a pattern containing `**`.
|
|
75
|
+
* If `false`, `**` behaves exactly like `*`.
|
|
76
|
+
*
|
|
77
|
+
* @default true
|
|
78
|
+
*/
|
|
79
|
+
globstar?: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* An array of glob patterns to exclude matches.
|
|
82
|
+
* This is an alternative way to use negative patterns.
|
|
83
|
+
*
|
|
84
|
+
* @default []
|
|
85
|
+
*/
|
|
86
|
+
ignore?: Pattern[];
|
|
87
|
+
/**
|
|
88
|
+
* Mark the directory path with the final slash.
|
|
89
|
+
*
|
|
90
|
+
* @default false
|
|
91
|
+
*/
|
|
92
|
+
markDirectories?: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* Returns objects (instead of strings) describing entries.
|
|
95
|
+
*
|
|
96
|
+
* @default false
|
|
97
|
+
*/
|
|
98
|
+
objectMode?: boolean;
|
|
99
|
+
/**
|
|
100
|
+
* Return only directories.
|
|
101
|
+
*
|
|
102
|
+
* @default false
|
|
103
|
+
*/
|
|
104
|
+
onlyDirectories?: boolean;
|
|
105
|
+
/**
|
|
106
|
+
* Return only files.
|
|
107
|
+
*
|
|
108
|
+
* @default true
|
|
109
|
+
*/
|
|
110
|
+
onlyFiles?: boolean;
|
|
111
|
+
/**
|
|
112
|
+
* Enables an object mode (`objectMode`) with an additional `stats` field.
|
|
113
|
+
*
|
|
114
|
+
* @default false
|
|
115
|
+
*/
|
|
116
|
+
stats?: boolean;
|
|
117
|
+
/**
|
|
118
|
+
* By default this package suppress only `ENOENT` errors.
|
|
119
|
+
* Set to `true` to suppress any error.
|
|
120
|
+
*
|
|
121
|
+
* @default false
|
|
122
|
+
*/
|
|
123
|
+
suppressErrors?: boolean;
|
|
124
|
+
/**
|
|
125
|
+
* Throw an error when symbolic link is broken if `true` or safely
|
|
126
|
+
* return `lstat` call if `false`.
|
|
127
|
+
*
|
|
128
|
+
* @default false
|
|
129
|
+
*/
|
|
130
|
+
throwErrorOnBrokenSymbolicLink?: boolean;
|
|
131
|
+
/**
|
|
132
|
+
* Ensures that the returned entries are unique.
|
|
133
|
+
*
|
|
134
|
+
* @default true
|
|
135
|
+
*/
|
|
136
|
+
unique?: boolean;
|
|
137
|
+
};
|
|
138
|
+
export default class Settings {
|
|
139
|
+
private readonly _options;
|
|
140
|
+
readonly absolute: boolean;
|
|
141
|
+
readonly baseNameMatch: boolean;
|
|
142
|
+
readonly braceExpansion: boolean;
|
|
143
|
+
readonly caseSensitiveMatch: boolean;
|
|
144
|
+
readonly concurrency: number;
|
|
145
|
+
readonly cwd: string;
|
|
146
|
+
readonly deep: number;
|
|
147
|
+
readonly dot: boolean;
|
|
148
|
+
readonly extglob: boolean;
|
|
149
|
+
readonly followSymbolicLinks: boolean;
|
|
150
|
+
readonly fs: FileSystemAdapter;
|
|
151
|
+
readonly globstar: boolean;
|
|
152
|
+
readonly ignore: Pattern[];
|
|
153
|
+
readonly markDirectories: boolean;
|
|
154
|
+
readonly objectMode: boolean;
|
|
155
|
+
readonly onlyDirectories: boolean;
|
|
156
|
+
readonly onlyFiles: boolean;
|
|
157
|
+
readonly stats: boolean;
|
|
158
|
+
readonly suppressErrors: boolean;
|
|
159
|
+
readonly throwErrorOnBrokenSymbolicLink: boolean;
|
|
160
|
+
readonly unique: boolean;
|
|
161
|
+
constructor(_options?: Options);
|
|
162
|
+
private _getValue;
|
|
163
|
+
private _getFileSystemMethods;
|
|
164
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import * as fsWalk from '../../../@nodelib/fs.walk';
|
|
3
|
+
export declare type ErrnoException = NodeJS.ErrnoException;
|
|
4
|
+
export declare type Entry = fsWalk.Entry;
|
|
5
|
+
export declare type EntryItem = string | Entry;
|
|
6
|
+
export declare type Pattern = string;
|
|
7
|
+
export declare type PatternRe = RegExp;
|
|
8
|
+
export declare type PatternsGroup = Record<string, Pattern[]>;
|
|
9
|
+
export declare type ReaderOptions = fsWalk.Options & {
|
|
10
|
+
transform(entry: Entry): EntryItem;
|
|
11
|
+
deepFilter: DeepFilterFunction;
|
|
12
|
+
entryFilter: EntryFilterFunction;
|
|
13
|
+
errorFilter: ErrorFilterFunction;
|
|
14
|
+
fs: FileSystemAdapter;
|
|
15
|
+
stats: boolean;
|
|
16
|
+
};
|
|
17
|
+
export declare type ErrorFilterFunction = fsWalk.ErrorFilterFunction;
|
|
18
|
+
export declare type EntryFilterFunction = fsWalk.EntryFilterFunction;
|
|
19
|
+
export declare type DeepFilterFunction = fsWalk.DeepFilterFunction;
|
|
20
|
+
export declare type EntryTransformerFunction = (entry: Entry) => EntryItem;
|
|
21
|
+
export declare type MicromatchOptions = {
|
|
22
|
+
dot?: boolean;
|
|
23
|
+
matchBase?: boolean;
|
|
24
|
+
nobrace?: boolean;
|
|
25
|
+
nocase?: boolean;
|
|
26
|
+
noext?: boolean;
|
|
27
|
+
noglobstar?: boolean;
|
|
28
|
+
posix?: boolean;
|
|
29
|
+
strictSlashes?: boolean;
|
|
30
|
+
};
|
|
31
|
+
export declare type FileSystemAdapter = fsWalk.FileSystemAdapter;
|