UNPKG

@umijs/deps

Version:

[![Install size](https://badgen.net/packagephobia/install/@umijs/deps)](https://packagephobia.now.sh/result?p=@umijs/deps)

1 lines 7.62 kB
module.exports=(()=>{var t={746:(t,e,n)=>{"use strict";const r=n(129);const s=n(855);const o=n(101);function spawn(t,e,n){const c=s(t,e,n);const i=r.spawn(c.command,c.args,c.options);o.hookChildProcess(i,c);return i}function spawnSync(t,e,n){const c=s(t,e,n);const i=r.spawnSync(c.command,c.args,c.options);i.error=i.error||o.verifyENOENTSync(i.status,c);return i}t.exports=spawn;t.exports.spawn=spawn;t.exports.sync=spawnSync;t.exports._parse=s;t.exports._enoent=o},101:t=>{"use strict";const e=process.platform==="win32";function notFoundError(t,e){return Object.assign(new Error(`${e} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${t.command}`,path:t.command,spawnargs:t.args})}function hookChildProcess(t,n){if(!e){return}const r=t.emit;t.emit=function(e,s){if(e==="exit"){const e=verifyENOENT(s,n,"spawn");if(e){return r.call(t,"error",e)}}return r.apply(t,arguments)}}function verifyENOENT(t,n){if(e&&t===1&&!n.file){return notFoundError(n.original,"spawn")}return null}function verifyENOENTSync(t,n){if(e&&t===1&&!n.file){return notFoundError(n.original,"spawnSync")}return null}t.exports={hookChildProcess:hookChildProcess,verifyENOENT:verifyENOENT,verifyENOENTSync:verifyENOENTSync,notFoundError:notFoundError}},855:(t,e,n)=>{"use strict";const r=n(622);const s=n(274);const o=n(48);const c=n(252);const i=process.platform==="win32";const a=/\.(?:com|exe)$/i;const u=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function detectShebang(t){t.file=s(t);const e=t.file&&c(t.file);if(e){t.args.unshift(t.file);t.command=e;return s(t)}return t.file}function parseNonShell(t){if(!i){return t}const e=detectShebang(t);const n=!a.test(e);if(t.options.forceShell||n){const n=u.test(e);t.command=r.normalize(t.command);t.command=o.command(t.command);t.args=t.args.map(t=>o.argument(t,n));const s=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${s}"`];t.command=process.env.comspec||"cmd.exe";t.options.windowsVerbatimArguments=true}return t}function parse(t,e,n){if(e&&!Array.isArray(e)){n=e;e=null}e=e?e.slice(0):[];n=Object.assign({},n);const r={command:t,args:e,options:n,file:undefined,original:{command:t,args:e}};return n.shell?r:parseNonShell(r)}t.exports=parse},48:t=>{"use strict";const e=/([()\][%!^"`<>&|;, *?])/g;function escapeCommand(t){t=t.replace(e,"^$1");return t}function escapeArgument(t,n){t=`${t}`;t=t.replace(/(\\*)"/g,'$1$1\\"');t=t.replace(/(\\*)$/,"$1$1");t=`"${t}"`;t=t.replace(e,"^$1");if(n){t=t.replace(e,"^$1")}return t}t.exports.command=escapeCommand;t.exports.argument=escapeArgument},252:(t,e,n)=>{"use strict";const r=n(747);const s=n(32);function readShebang(t){const e=150;const n=Buffer.alloc(e);let o;try{o=r.openSync(t,"r");r.readSync(o,n,0,e,0);r.closeSync(o)}catch(t){}return s(n.toString())}t.exports=readShebang},274:(t,e,n)=>{"use strict";const r=n(622);const s=n(207);const o=n(60);function resolveCommandAttempt(t,e){const n=t.options.env||process.env;const c=process.cwd();const i=t.options.cwd!=null;const a=i&&process.chdir!==undefined&&!process.chdir.disabled;if(a){try{process.chdir(t.options.cwd)}catch(t){}}let u;try{u=s.sync(t.command,{path:n[o({env:n})],pathExt:e?r.delimiter:undefined})}catch(t){}finally{if(a){process.chdir(c)}}if(u){u=r.resolve(i?t.options.cwd:"",u)}return u}function resolveCommand(t){return resolveCommandAttempt(t)||resolveCommandAttempt(t,true)}t.exports=resolveCommand},60:t=>{"use strict";const e=(t={})=>{const e=t.env||process.env;const n=t.platform||process.platform;if(n!=="win32"){return"PATH"}return Object.keys(e).reverse().find(t=>t.toUpperCase()==="PATH")||"Path"};t.exports=e;t.exports.default=e},126:(t,e,n)=>{var r=n(747);var s;if(process.platform==="win32"||global.TESTING_WINDOWS){s=n(1)}else{s=n(728)}t.exports=isexe;isexe.sync=sync;function isexe(t,e,n){if(typeof e==="function"){n=e;e={}}if(!n){if(typeof Promise!=="function"){throw new TypeError("callback not provided")}return new Promise(function(n,r){isexe(t,e||{},function(t,e){if(t){r(t)}else{n(e)}})})}s(t,e||{},function(t,r){if(t){if(t.code==="EACCES"||e&&e.ignoreErrors){t=null;r=false}}n(t,r)})}function sync(t,e){try{return s.sync(t,e||{})}catch(t){if(e&&e.ignoreErrors||t.code==="EACCES"){return false}else{throw t}}}},728:(t,e,n)=>{t.exports=isexe;isexe.sync=sync;var r=n(747);function isexe(t,e,n){r.stat(t,function(t,r){n(t,t?false:checkStat(r,e))})}function sync(t,e){return checkStat(r.statSync(t),e)}function checkStat(t,e){return t.isFile()&&checkMode(t,e)}function checkMode(t,e){var n=t.mode;var r=t.uid;var s=t.gid;var o=e.uid!==undefined?e.uid:process.getuid&&process.getuid();var c=e.gid!==undefined?e.gid:process.getgid&&process.getgid();var i=parseInt("100",8);var a=parseInt("010",8);var u=parseInt("001",8);var p=i|a;var l=n&u||n&a&&s===c||n&i&&r===o||n&p&&o===0;return l}},1:(t,e,n)=>{t.exports=isexe;isexe.sync=sync;var r=n(747);function checkPathExt(t,e){var n=e.pathExt!==undefined?e.pathExt:process.env.PATHEXT;if(!n){return true}n=n.split(";");if(n.indexOf("")!==-1){return true}for(var r=0;r<n.length;r++){var s=n[r].toLowerCase();if(s&&t.substr(-s.length).toLowerCase()===s){return true}}return false}function checkStat(t,e,n){if(!t.isSymbolicLink()&&!t.isFile()){return false}return checkPathExt(e,n)}function isexe(t,e,n){r.stat(t,function(r,s){n(r,r?false:checkStat(s,t,e))})}function sync(t,e){return checkStat(r.statSync(t),t,e)}},32:(t,e,n)=>{"use strict";const r=n(638);t.exports=((t="")=>{const e=t.match(r);if(!e){return null}const[n,s]=e[0].replace(/#! ?/,"").split(" ");const o=n.split("/").pop();if(o==="env"){return s}return s?`${o} ${s}`:o})},638:t=>{"use strict";t.exports=/^#!(.*)/},207:(t,e,n)=>{const r=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys";const s=n(622);const o=r?";":":";const c=n(126);const i=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"});const a=(t,e)=>{const n=e.colon||o;const s=t.match(/\//)||r&&t.match(/\\/)?[""]:[...r?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(n)];const c=r?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"";const i=r?c.split(n):[""];if(r){if(t.indexOf(".")!==-1&&i[0]!=="")i.unshift("")}return{pathEnv:s,pathExt:i,pathExtExe:c}};const u=(t,e,n)=>{if(typeof e==="function"){n=e;e={}}if(!e)e={};const{pathEnv:r,pathExt:o,pathExtExe:u}=a(t,e);const p=[];const l=n=>new Promise((o,c)=>{if(n===r.length)return e.all&&p.length?o(p):c(i(t));const a=r[n];const u=/^".*"$/.test(a)?a.slice(1,-1):a;const l=s.join(u,t);const d=!u&&/^\.[\\\/]/.test(t)?t.slice(0,2)+l:l;o(f(d,n,0))});const f=(t,n,r)=>new Promise((s,i)=>{if(r===o.length)return s(l(n+1));const a=o[r];c(t+a,{pathExt:u},(o,c)=>{if(!o&&c){if(e.all)p.push(t+a);else return s(t+a)}return s(f(t,n,r+1))})});return n?l(0).then(t=>n(null,t),n):l(0)};const p=(t,e)=>{e=e||{};const{pathEnv:n,pathExt:r,pathExtExe:o}=a(t,e);const u=[];for(let i=0;i<n.length;i++){const a=n[i];const p=/^".*"$/.test(a)?a.slice(1,-1):a;const l=s.join(p,t);const f=!p&&/^\.[\\\/]/.test(t)?t.slice(0,2)+l:l;for(let t=0;t<r.length;t++){const n=f+r[t];try{const t=c.sync(n,{pathExt:o});if(t){if(e.all)u.push(n);else return n}}catch(t){}}}if(e.all&&u.length)return u;if(e.nothrow)return null;throw i(t)};t.exports=u;u.sync=p},129:t=>{"use strict";t.exports=require("child_process")},747:t=>{"use strict";t.exports=require("fs")},622:t=>{"use strict";t.exports=require("path")}};var e={};function __nccwpck_require__(n){if(e[n]){return e[n].exports}var r=e[n]={exports:{}};var s=true;try{t[n](r,r.exports,__nccwpck_require__);s=false}finally{if(s)delete e[n]}return r.exports}__nccwpck_require__.ab=__dirname+"/";return __nccwpck_require__(746)})();