feat: try support packageManager

This commit is contained in:
Jack Works committed 2022-02-22 12:26:05 +08:00
1 parent ad2b35ae0c
commit 1d51e20937
6 files changed
+94 -45

No files matched your search

+5 -1
View File
@@ -6,7 +6,11 @@ Install pnpm package manager.
### `version`
**Required** Version of pnpm to install. It supports npm versioning scheme, it could be an exact version (such as `6.24.1`), or a version range (such as `6`, `6.x.x`, `6.24.x`, `^6.24.1`, `*`, etc.), or `latest`.
Version of pnpm to install.
**Optional** when there is a [`packageManager` field in the `package.json`](https://nodejs.org/api/corepack.html).
otherwise, this field is **required** It supports npm versioning scheme, it could be an exact version (such as `6.24.1`), or a version range (such as `6`, `6.x.x`, `6.24.x`, `^6.24.1`, `*`, etc.), or `latest`.
### `dest`
+38 -1
View File
@@ -1 +1,38 @@
module.exports=(()=>{var __webpack_modules__={2492:e=>{"use strict";e.exports=JSON.parse('{"anyOf":[{"$ref":"#/definitions/RunInstall"},{"type":"array","items":{"$ref":"#/definitions/RunInstall"}},{"type":["null","boolean"]}],"definitions":{"RunInstall":{"type":"object","properties":{"recursive":{"type":"boolean"},"cwd":{"type":"string"},"args":{"type":"array","items":{"type":"string"}}}}},"$schema":"http://json-schema.org/draft-07/schema#"}')},6152:function(e,n,r){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n,"__esModule",{value:true});const i=r(6105);const f=s(r(539));const l=s(r(7701));const t=s(r(9875));const o=s(r(4882));const c=s(r(4424));async function main(){const e=(0,f.default)();const n=(0,i.getState)("is_post");if(n==="true")return(0,c.default)(e);(0,i.saveState)("is_post","true");await(0,t.default)(e);console.log("Installation Completed!");(0,l.default)(e);(0,o.default)(e)}main().catch(e=>{console.error(e);(0,i.setFailed)(e)})},539:function(e,n,r){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n,"__esModule",{value:true});n.getInputs=void 0;const i=r(6105);const f=s(r(9413));const l=r(4019);const t={required:true};const o=e=>(0,f.default)((0,i.getInput)(e,t));const c=()=>({version:(0,i.getInput)("version",t),dest:o("dest"),runInstall:(0,l.parseRunInstall)("run_install")});n.getInputs=c;n.default=n.getInputs},4019:function(e,n,r){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n,"__esModule",{value:true});n.parseRunInstall=void 0;const i=s(r(1765));const f=r(6070);const l=s(r(6562));const t=r(6105);const o=s(r(2492));const c={required:true};function parseRunInstall(e){const n=(0,f.load)((0,t.getInput)(e,c));const r=new l.default({allErrors:true});const s=r.compile(o.default);if(!s(n)){for(const e of s.errors){(0,t.error)(`with.run_install${e.dataPath}: ${e.message}`)}return i.default.exit(1)}if(!n)return[];if(n===true)return[{recursive:true}];if(Array.isArray(n))return n;return[n]}n.parseRunInstall=parseRunInstall},9875:function(e,n,r){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n,"__esModule",{value:true});n.install=n.runSelfInstaller=void 0;const i=r(6105);const f=s(r(7529));n.runSelfInstaller=f.default;async function install(e){(0,i.startGroup)("Running self-installer...");const n=await(0,f.default)(e);(0,i.endGroup)();if(n){return(0,i.setFailed)(`Something went wrong, self-installer exits with code ${n}`)}}n.install=install;n.default=install},7529:function(e,n,r){"use strict";var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n,"__esModule",{value:true});n.runSelfInstaller=void 0;const i=r(6105);const f=r(3129);const l=r(1765);const t=s(r(5622));const o=r(4982);const c=s(r(1868));async function runSelfInstaller(e){const{version:n,dest:r}=e;const s=n?`pnpm@${n}`:"pnpm";const a=t.default.join(r,"package.json");await(0,o.remove)(r);await(0,o.ensureFile)(a);await(0,o.writeFile)(a,JSON.stringify({private:true}));const d=(0,f.spawn)(l.execPath,["-","install",s,"--no-lockfile"],{cwd:r,stdio:["pipe","inherit","inherit"]});const p=await(0,c.default)("https://get.pnpm.io/v6.16.js");if(!p.body)throw new Error("Did not receive response body");p.body.pipe(d.stdin);const u=await new Promise((e,n)=>{d.on("error",n);d.on("close",e)});if(u===0){const e=t.default.join(r,"node_modules/.bin");(0,i.addPath)(e);(0,i.exportVariable)("PNPM_HOME",e)}return u}n.runSelfInstaller=runSelfInstaller;n.default=runSelfInstaller},7701:(e,n,r)=>{"use strict";Object.defineProperty(n,"__esModule",{value:true});n.setOutputs=void 0;const s=r(6105);const i=r(6656);function setOutputs(e){const n=(0,i.getBinDest)(e);(0,s.addPath)(n);(0,s.setOutput)("dest",e.dest);(0,s.setOutput)("bin_dest",n)}n.setOutputs=setOutputs;n.default=setOutputs},4882:(e,n,r)=>{"use strict";Object.defineProperty(n,"__esModule",{value:true});n.runPnpmInstall=void 0;const s=r(3129);const i=r(6105);const f=r(6656);function runPnpmInstall(e){const n=(0,f.patchPnpmEnv)(e);for(const r of e.runInstall){const e=["install"];if(r.recursive)e.unshift("recursive");if(r.args)e.push(...r.args);const f=["pnpm",...e].join(" ");(0,i.startGroup)(`Running ${f}...`);const{error:l,status:t}=(0,s.spawnSync)("pnpm",e,{stdio:"inherit",cwd:r.cwd,shell:true,env:n});(0,i.endGroup)();if(l){(0,i.setFailed)(l);continue}if(t){(0,i.setFailed)(`Command ${f} (cwd: ${r.cwd}) exits with status ${t}`);continue}}}n.runPnpmInstall=runPnpmInstall;n.default=runPnpmInstall},4424:(e,n,r)=>{"use strict";Object.defineProperty(n,"__esModule",{value:true});n.pruneStore=void 0;const s=r(3129);const i=r(6105);const f=r(6656);function pruneStore(e){if(e.runInstall.length===0){console.log("Pruning is unnecessary.");return}(0,i.startGroup)("Running pnpm store prune..Line truncated
(()=>{var __webpack_modules__={8243:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const i=r(3031);const s=n(r(4694));const o=n(r(2759));const a=n(r(1142));const u=n(r(4207));const l=n(r(5659));async function main(){const e=(0,s.default)();const t=(0,i.getState)("is_post");if(t==="true")return(0,l.default)(e);(0,i.saveState)("is_post","true");await(0,a.default)(e);console.log("Installation Completed!");(0,o.default)(e);(0,u.default)(e)}main().catch((e=>{console.error(e);(0,i.setFailed)(e)}))},4694:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.getInputs=void 0;const i=r(3031);const s=n(r(4790));const o=r(5400);const a={required:true};const parseInputPath=e=>(0,s.default)((0,i.getInput)(e,a));const getInputs=()=>({version:(0,i.getInput)("version"),dest:parseInputPath("dest"),runInstall:(0,o.parseRunInstall)("run_install")});t.getInputs=getInputs;t["default"]=t.getInputs},5400:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.parseRunInstall=void 0;const i=n(r(7282));const s=r(3639);const o=n(r(8438));const a=r(3031);const u=n(r(5379));const l={required:true};function parseRunInstall(e){const t=(0,s.load)((0,a.getInput)(e,l));const r=new o.default({allErrors:true});const n=r.compile(u.default);if(!n(t)){for(const e of n.errors){(0,a.error)(`with.run_install${e.dataPath}: ${e.message}`)}return i.default.exit(1)}if(!t)return[];if(t===true)return[{recursive:true}];if(Array.isArray(t))return t;return[t]}t.parseRunInstall=parseRunInstall},1142:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.install=t.runSelfInstaller=void 0;const i=r(3031);const s=n(r(9536));t.runSelfInstaller=s.default;async function install(e){(0,i.startGroup)("Running self-installer...");const t=await(0,s.default)(e);(0,i.endGroup)();if(t){return(0,i.setFailed)(`Something went wrong, self-installer exits with code ${t}`)}}t.install=install;t["default"]=install},9536:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.runSelfInstaller=void 0;const i=r(3031);const s=r(2081);const o=r(7282);const a=n(r(1017));const u=r(5176);const l=n(r(2043));async function runSelfInstaller(e){const{version:t,dest:r}=e;const n=a.default.join(r,"package.json");let c;if(!t){const e=JSON.parse(await(0,u.readFile)(n,"utf8")).packageManager;if(e){if(!e.startsWith("pnpm@")){throw new Error("packageManager field is not pnpm")}c=e}else{throw new Error("None of packageManager (in package.json) or version (in action config) is defined")}}else{c=`pnpm@${t}`}await(0,u.remove)(r);await(0,u.ensureFile)(n);await(0,u.writeFile)(n,JSON.stringify({private:true}));const f=(0,s.spawn)(o.execPath,["-","install",c,"--no-lockfile"],{cwd:r,stdio:["pipe","inherit","inherit"]});const d=await(0,l.default)("https://get.pnpm.io/v6.16.js");if(!d.body)throw new Error("Did not receive response body");d.body.pipe(f.stdin);const p=await new Promise(((e,t)=>{f.on("error",t);f.on("close",e)}));if(p===0){const e=a.default.join(r,"node_modules/.bin");(0,i.addPath)(e);(0,i.exportVariable)("PNPM_HOME",e)}return p}t.runSelfInstaller=runSelfInstaller;t["default"]=runSelfInstaller},2759:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.setOutputs=void 0;const n=r(3031);const i=r(6392);function setOutputs(e){const t=(0,i.getBinDest)(e);(0,n.addPath)(t);(0,n.setOutput)("dest",e.dest);(0,n.setOutput)("bin_dest",t)}t.setOutputs=setOutputs;t["default"]=setOutputs},4207:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.runPnpmInstall=void 0;const n=r(2081);const i=r(3031);const s=r(6392);function runPnpmInstall(e){const t=(0,s.patchPnpmEnv)(e);for(const r of e.runInstall){const e=["install"];if(r.recursive)e.unshift("recursive");if(r.args)e.push(...r.args);const s=["pnpm",...e].join(" ");(0,i.startGroup)(`Running ${s}...`);const{error:o,status:a}=(0,n.spawnSync)("pnpm",e,{stdio:"inherit",cwd:r.cwd,shell:true,env:t});(0,i.endGroup)();if(o){(0,i.setFailed)(o);continue}if(a){(0,i.setFailed)(`Command ${s} (cwd: ${r.cwd}) exits with status ${a}`);continue}}}t.runPnpmInstall=runPnpmInstall;t["default"]=runPnpmInstall},5659:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.pruneStore=void 0;const n=r(2081);const i=r(3031);const s=r(6392);function pruneStore(e){if(e.runInstall.length===0){console.log("Pruning is unnecessary.");return}(0,i.startGroup)("Running pnpm store prune...");const{error:t,status:r}=(0,n.spawnSync)("pnpm",["store","prune"],{stdio:"inherit",shell:tLine truncated
/*!
* depd
* Copyright(c) 2014-2017 Douglas Christopher Wilson
* MIT Licensed
*/
var callSiteToString=__nccwpck_require__(2775).callSiteToString;var eventListenerCount=__nccwpck_require__(2775).eventListenerCount;var relative=__nccwpck_require__(1017).relative;module.exports=depd;var basePath=process.cwd();function containsNamespace(e,t){var r=e.split(/[ ,]+/);var n=String(t).toLowerCase();for(var i=0;i<r.length;i++){var s=r[i];if(s&&(s==="*"||s.toLowerCase()===n)){return true}}return false}function convertDataDescriptorToAccessor(e,t,r){var n=Object.getOwnPropertyDescriptor(e,t);var i=n.value;n.get=function getter(){return i};if(n.writable){n.set=function setter(e){return i=e}}delete n.value;delete n.writable;Object.defineProperty(e,t,n);return n}function createArgumentsString(e){var t="";for(var r=0;r<e;r++){t+=", arg"+r}return t.substr(2)}function createStackString(e){var t=this.name+": "+this.namespace;if(this.message){t+=" deprecated "+this.message}for(var r=0;r<e.length;r++){t+="\n at "+callSiteToString(e[r])}return t}function depd(e){if(!e){throw new TypeError("argument namespace is required")}var t=getStack();var r=callSiteLocation(t[1]);var n=r[0];function deprecate(e){log.call(deprecate,e)}deprecate._file=n;deprecate._ignored=isignored(e);deprecate._namespace=e;deprecate._traced=istraced(e);deprecate._warned=Object.create(null);deprecate.function=wrapfunction;deprecate.property=wrapproperty;return deprecate}function isignored(e){if(process.noDeprecation){return true}var t=process.env.NO_DEPRECATION||"";return containsNamespace(t,e)}function istraced(e){if(process.traceDeprecation){return true}var t=process.env.TRACE_DEPRECATION||"";return containsNamespace(t,e)}function log(e,t){var r=eventListenerCount(process,"deprecation")!==0;if(!r&&this._ignored){return}var n;var i;var s;var o;var a=0;var u=false;var l=getStack();var c=this._file;if(t){o=t;s=callSiteLocation(l[1]);s.name=o.name;c=s[0]}else{a=2;o=callSiteLocation(l[a]);s=o}for(;a<l.length;a++){n=callSiteLocation(l[a]);i=n[0];if(i===c){u=true}else if(i===this._file){c=this._file}else if(u){break}}var f=n?o.join(":")+"__"+n.join(":"):undefined;if(f!==undefined&&f in this._warned){return}this._warned[f]=true;var d=e;if(!d){d=s===o||!s.name?defaultMessage(o):defaultMessage(s)}if(r){var p=DeprecationError(this._namespace,d,l.slice(a));process.emit("deprecation",p);return}var h=process.stderr.isTTY?formatColor:formatPlain;var m=h.call(this,d,n,l.slice(a));process.stderr.write(m+"\n","utf8")}function callSiteLocation(e){var t=e.getFileName()||"<anonymous>";var r=e.getLineNumber();var n=e.getColumnNumber();if(e.isEval()){t=e.getEvalOrigin()+", "+t}var i=[t,r,n];i.callSite=e;i.name=e.getFunctionName();return i}function defaultMessage(e){var t=e.callSite;var r=e.name;if(!r){r="<anonymous@"+formatLocation(e)+">"}var n=t.getThis();var i=n&&t.getTypeName();if(i==="Object"){i=undefined}if(i==="Function"){i=n.name||i}return i&&t.getMethodName()?i+"."+r:r}function formatPlain(e,t,r){var n=(new Date).toUTCString();var i=n+" "+this._namespace+" deprecated "+e;if(this._traced){for(var s=0;s<r.length;s++){i+="\n at "+callSiteToString(r[s])}return i}if(t){i+=" at "+formatLocation(t)}return i}function formatColor(e,t,r){var n=""+this._namespace+""+" deprecated"+" "+e+"";if(this._traced){for(var i=0;i<r.length;i++){n+="\n at "+callSiteToString(r[i])+""}return n}if(t){n+=" "+formatLocation(t)+""}return n}function formatLocation(e){return relative(basePath,e[0])+":"+e[1]+":"+e[2]}function getStack(){var e=Error.stackTraceLimit;var t={};var r=Error.prepareStackTrace;Error.prepareStackTrace=prepareObjectStackTrace;Error.stackTraceLimit=Math.max(10,e);Error.captureStackTrace(t);var n=t.stack.slice(1);Error.prepareStackTrace=r;Error.stackTraceLimit=e;return n}function prepareObjectStackTrace(e,t){return t}function wrapfunction(fn,message){if(typeof fn!=="function"){throw new TypeError("argument fn must be a function")}var args=createArgumentsString(fn.length);var deprecate=this;var stack=getStack();var site=callSiteLocation(stack[1]);site.name=fn.name;var deprecatedfn=eval("(function ("+args+") {\n"+'"use strict"\n'+"log.call(deprecate, message, site)\n"+"return fn.apply(this, arguments)\n"+"})");return deprecatedfn}function wrapproperty(e,t,r){if(!e||typeof e!=="object"&&typeof e!=="function"){throw new TypeError("argument obj must be object")}var n=Object.getOwnPropertyDescriptor(e,t);if(!n){throw new TypeError("must call property on owner object")}if(!n.configurable){throw new TypeError("property must be configurable")}var i=this;var s=getStack();var o=callSiteLocation(s[1]);o.name=t;if("value"in n){n=convertDataDescriptorToAccessor(e,t,r)}var a=n.get;var u=n.set;if(typeof a==="function"){n.get=function getter(){log.call(i,r,o);return a.apply(this,arguments)}}if(typeof u==="function"){n.set=function setter(){log.call(i,r,o);return u.apply(this,arguments)}}Object.defineProperty(e,t,n)}function DeprecationError(e,t,r){var n=new Error;var i;Object.defineProperty(n,"constructor",{valuLine truncated
/*!
* depd
* Copyright(c) 2014 Douglas Christopher Wilson
* MIT Licensed
*/e.exports=callSiteToString;function callSiteFileLocation(e){var t;var r="";if(e.isNative()){r="native"}else if(e.isEval()){t=e.getScriptNameOrSourceURL();if(!t){r=e.getEvalOrigin()}}else{t=e.getFileName()}if(t){r+=t;var n=e.getLineNumber();if(n!=null){r+=":"+n;var i=e.getColumnNumber();if(i){r+=":"+i}}}return r||"unknown source"}function callSiteToString(e){var t=true;var r=callSiteFileLocation(e);var n=e.getFunctionName();var i=e.isConstructor();var s=!(e.isToplevel()||i);var o="";if(s){var a=e.getMethodName();var u=getConstructorName(e);if(n){if(u&&n.indexOf(u)!==0){o+=u+"."}o+=n;if(a&&n.lastIndexOf("."+a)!==n.length-a.length-1){o+=" [as "+a+"]"}}else{o+=u+"."+(a||"<anonymous>")}}else if(i){o+="new "+(n||"<anonymous>")}else if(n){o+=n}else{t=false;o+=r}if(t){o+=" ("+r+")"}return o}function getConstructorName(e){var t=e.receiver;return t.constructor&&t.constructor.name||null}},7723:e=>{"use strict";
/*!
* depd
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*/e.exports=eventListenerCount;function eventListenerCount(e,t){return e.listeners(t).length}},2775:(e,t,r)=>{"use strict";
/*!
* depd
* Copyright(c) 2014-2015 Douglas Christopher Wilson
* MIT Licensed
*/var n=r(2361).EventEmitter;lazyProperty(e.exports,"callSiteToString",(function callSiteToString(){var e=Error.stackTraceLimit;var t={};var n=Error.prepareStackTrace;function prepareObjectStackTrace(e,t){return t}Error.prepareStackTrace=prepareObjectStackTrace;Error.stackTraceLimit=2;Error.captureStackTrace(t);var i=t.stack.slice();Error.prepareStackTrace=n;Error.stackTraceLimit=e;return i[0].toString?toString:r(7264)}));lazyProperty(e.exports,"eventListenerCount",(function eventListenerCount(){return n.listenerCount||r(7723)}));function lazyProperty(e,t,r){function get(){var n=r();Object.defineProperty(e,t,{configurable:true,enumerable:true,value:n});return n}Object.defineProperty(e,t,{configurable:true,enumerable:true,get:get})}function toString(e){return e.toString()}},4790:(e,t,r)=>{
/*!
* expand-tilde <https://github.com/jonschlinkert/expand-tilde>
*
* Copyright (c) 2015 Jon Schlinkert.
* Licensed under the MIT license.
*/
var n=r(2157);var i=r(1017);e.exports=function expandTilde(e){var t=n();if(e.charCodeAt(0)===126){if(e.charCodeAt(1)===43){return i.join(process.cwd(),e.slice(2))}return t?i.join(t,e.slice(1)):e}return e}},3064:e=>{"use strict";e.exports=function equal(e,t){if(e===t)return true;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return false;var r,n,i;if(Array.isArray(e)){r=e.length;if(r!=t.length)return false;for(n=r;n--!==0;)if(!equal(e[n],t[n]))return false;return true}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();i=Object.keys(e);r=i.length;if(r!==Object.keys(t).length)return false;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[n]))return false;for(n=r;n--!==0;){var s=i[n];if(!equal(e[s],t[s]))return false}return true}return e!==e&&t!==t}},4486:e=>{"use strict";e.exports=function(e,t){if(!t)t={};if(typeof t==="function")t={cmp:t};var r=typeof t.cycles==="boolean"?t.cycles:false;var n=t.cmp&&function(e){return function(t){return function(r,n){var i={key:r,value:t[r]};var s={key:n,value:t[n]};return e(i,s)}}}(t.cmp);var i=[];return function stringify(e){if(e&&e.toJSON&&typeof e.toJSON==="function"){e=e.toJSON()}if(e===undefined)return;if(typeof e=="number")return isFinite(e)?""+e:"null";if(typeof e!=="object")return JSON.stringify(e);var t,s;if(Array.isArray(e)){s="[";for(t=0;t<e.length;t++){if(t)s+=",";s+=stringify(e[t])||"null"}return s+"]"}if(e===null)return"null";if(i.indexOf(e)!==-1){if(r)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var o=i.push(e)-1;var a=Object.keys(e).sort(n&&n(e));s="";for(t=0;t<a.length;t++){var u=a[t];var l=stringify(e[u]);if(!l)continue;if(s)s+=",";s+=JSON.stringify(u)+":"+l}i.splice(o,1);return"{"+s+"}"}(e)}},4389:e=>{e.exports=stringify;stringify.default=stringify;stringify.stable=deterministicStringify;stringify.stableStringify=deterministicStringify;var t="[...]";var r="[Circular]";var n=[];var i=[];function defaultOptions(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function stringify(e,t,r,s){if(typeof s==="undefined"){s=defaultOptions()}decirc(e,"",0,[],undefined,0,s);var o;try{if(i.length===0){o=JSON.stringify(e,t,r)}else{o=JSON.stringify(e,replaceGetterValues(t),r)}}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{while(n.length!==0){var a=n.pop();if(a.length===4){Object.defineProperty(a[0],a[1],a[3])}else{a[0][a[1]]=a[2]}}}return o}function setReplace(e,t,r,s){var o=Object.getOwnPropertyDescriptor(s,r);if(o.get!==undefined){if(o.configurable){Object.defineProperty(s,r,{value:e});n.push([s,r,t,o])}else{i.push([t,r,e])}}else{s[r]=e;n.push([s,r,t])}}function decirc(e,n,i,s,o,a,u){a+=1;var l;if(typeof e==="object"&&e!==null){for(l=0;l<s.length;l++){if(s[l]===e){setReplace(r,e,n,o);return}}if(typeof u.depthLimit!=="undefined"&&a>u.depthLimit){setReplace(t,e,n,o);return}if(typeof u.edgesLimit!=="undefined"&&i+1>u.edgesLimit){setReplace(t,e,n,o);return}s.push(e);if(Array.isArray(e)){for(l=0;l<e.length;l++){decirc(e[l],l,l,s,e,a,u)}}else{var c=Object.keys(e);for(l=0;l<c.length;l++){var f=c[l];decirc(e[f],f,l,s,e,a,u)}}s.pop()}}function compareFunction(e,t){if(e<t){return-1}if(e>t){return 1}return 0}function deterministicStringify(e,t,r,s){if(typeof s==="undefined"){s=defaultOptions()}var o=deterministicDecirc(e,"",0,[],undefined,0,s)||e;var a;try{if(i.length===0){a=JSON.stringify(o,t,r)}else{a=JSON.stringify(o,replaceGetterValues(t),r)}}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{while(n.length!==0){var u=n.pop();if(u.length===4){Object.defineProperty(u[0],u[1],u[3])}else{u[0][u[1]]=u[2]}}}return a}function deterministicDecirc(e,i,s,o,a,u,l){u+=1;var c;if(typeof e==="object"&&e!==null){for(c=0;c<o.length;c++){if(o[c]===e){setReplace(r,e,i,a);return}}try{if(typeof e.toJSON==="function"){return}}catch(e){return}if(typeof l.depthLimit!=="undefined"&&u>l.depthLimit){setReplace(t,e,i,a);return}if(typeof l.edgesLimit!=="undefined"&&s+1>l.edgesLimit){setReplace(t,e,i,a);return}o.push(e);if(Array.isArray(e)){for(c=0;c<e.length;c++){deterministicDecirc(e[c],c,c,o,e,u,l)}}else{var f={};var d=Object.keys(e).sort(compareFunction);for(c=0;c<d.length;c++){var p=d[c];deterministicDecirc(e[p],p,c,o,e,u,l);f[p]=e[p]}if(typeof a!=="undefined"){n.push([a,i,e]);a[i]=f}else{return f}}o.pop()}}function replaceGetterValues(e){e=typeof e!=="undefined"?e:function(e,t){return t};return function(t,r){if(i.length>0){for(var n=0;n<i.length;n++){var s=i[n];if(s[1]===t&&s[0]===r){r=s[2];i.splice(n,1);break}}}return e.call(this,t,r)}}},5314:(e,t,r)=>{const{Readable:n}=r(2781);const i=new WeakMap;async function*read(e){for(const t of e){if("stream"in t){yield*t.stream()}else{yieldLine truncated
/*!
* humanize-ms - index.js
* Copyright(c) 2014 dead_horse <dead_horse@qq.com>
* MIT Licensed
*/var n=r(3837);var i=r(8527);e.exports=function(e){if(typeof e==="number")return e;var t=i(e);if(t===undefined){var r=new Error(n.format("humanize-ms(%j) result undefined",e));console.warn(r.stack)}return t}},1972:e=>{"use strict";var t=typeof window!=="undefined"?window:typeof global!=="undefined"?global:{};e.exports=Individual;function Individual(e,r){if(e in t){return t[e]}t[e]=r;return r}},5651:(e,t,r)=>{try{var n=r(3837);if(typeof n.inherits!=="function")throw"";e.exports=n.inherits}catch(t){e.exports=r(5940)}},5940:e=>{if(typeof Object.create==="function"){e.exports=function inherits(e,t){if(t){e.super_=t;e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}})}}}else{e.exports=function inherits(e,t){if(t){e.super_=t;var TempCtor=function(){};TempCtor.prototype=t.prototype;e.prototype=new TempCtor;e.prototype.constructor=e}}}},9316:(e,t,r)=>{"use strict";var n=t;var i=r(4300).Buffer;var s=r(2037);n.toBuffer=function(e,t,r){r=~~r;var n;if(this.isV4Format(e)){n=t||new i(r+4);e.split(/\./g).map((function(e){n[r++]=parseInt(e,10)&255}))}else if(this.isV6Format(e)){var s=e.split(":",8);var o;for(o=0;o<s.length;o++){var a=this.isV4Format(s[o]);var u;if(a){u=this.toBuffer(s[o]);s[o]=u.slice(0,2).toString("hex")}if(u&&++o<8){s.splice(o,0,u.slice(2,4).toString("hex"))}}if(s[0]===""){while(s.length<8)s.unshift("0")}else if(s[s.length-1]===""){while(s.length<8)s.push("0")}else if(s.length<8){for(o=0;o<s.length&&s[o]!=="";o++);var l=[o,1];for(o=9-s.length;o>0;o--){l.push("0")}s.splice.apply(s,l)}n=t||new i(r+16);for(o=0;o<s.length;o++){var c=parseInt(s[o],16);n[r++]=c>>8&255;n[r++]=c&255}}if(!n){throw Error("Invalid ip address: "+e)}return n};n.toString=function(e,t,r){t=~~t;r=r||e.length-t;var n=[];if(r===4){for(var i=0;i<r;i++){n.push(e[t+i])}n=n.join(".")}else if(r===16){for(var i=0;i<r;i+=2){n.push(e.readUInt16BE(t+i).toString(16))}n=n.join(":");n=n.replace(/(^|:)0(:0)*:0(:|$)/,"$1::$3");n=n.replace(/:{3,4}/,"::")}return n};var o=/^(\d{1,3}\.){3,3}\d{1,3}$/;var a=/^(::)?(((\d{1,3}\.){3}(\d{1,3}){1})?([0-9a-f]){0,4}:{0,2}){1,8}(::)?$/i;n.isV4Format=function(e){return o.test(e)};n.isV6Format=function(e){return a.test(e)};function _normalizeFamily(e){return e?e.toLowerCase():"ipv4"}n.fromPrefixLen=function(e,t){if(e>32){t="ipv6"}else{t=_normalizeFamily(t)}var r=4;if(t==="ipv6"){r=16}var s=new i(r);for(var o=0,a=s.length;o<a;++o){var u=8;if(e<8){u=e}e-=u;s[o]=~(255>>u)&255}return n.toString(s)};n.mask=function(e,t){e=n.toBuffer(e);t=n.toBuffer(t);var r=new i(Math.max(e.length,t.length));var s=0;if(e.length===t.length){for(s=0;s<e.length;s++){r[s]=e[s]&t[s]}}else if(t.length===4){for(s=0;s<t.length;s++){r[s]=e[e.length-4+s]&t[s]}}else{for(var s=0;s<r.length-6;s++){r[s]=0}r[10]=255;r[11]=255;for(s=0;s<e.length;s++){r[s+12]=e[s]&t[s+12]}s=s+12}for(;s<r.length;s++)r[s]=0;return n.toString(r)};n.cidr=function(e){var t=e.split("/");var r=t[0];if(t.length!==2)throw new Error("invalid CIDR subnet: "+r);var i=n.fromPrefixLen(parseInt(t[1],10));return n.mask(r,i)};n.subnet=function(e,t){var r=n.toLong(n.mask(e,t));var i=n.toBuffer(t);var s=0;for(var o=0;o<i.length;o++){if(i[o]===255){s+=8}else{var a=i[o]&255;while(a){a=a<<1&255;s++}}}var u=Math.pow(2,32-s);return{networkAddress:n.fromLong(r),firstAddress:u<=2?n.fromLong(r):n.fromLong(r+1),lastAddress:u<=2?n.fromLong(r+u-1):n.fromLong(r+u-2),broadcastAddress:n.fromLong(r+u-1),subnetMask:t,subnetMaskLength:s,numHosts:u<=2?u:u-2,length:u,contains:function(e){return r===n.toLong(n.mask(e,t))}}};n.cidrSubnet=function(e){var t=e.split("/");var r=t[0];if(t.length!==2)throw new Error("invalid CIDR subnet: "+r);var i=n.fromPrefixLen(parseInt(t[1],10));return n.subnet(r,i)};n.not=function(e){var t=n.toBuffer(e);for(var r=0;r<t.length;r++){t[r]=255^t[r]}return n.toString(t)};n.or=function(e,t){e=n.toBuffer(e);t=n.toBuffer(t);if(e.length===t.length){for(var r=0;r<e.length;++r){e[r]|=t[r]}return n.toString(e)}else{var i=e;var s=t;if(t.length>e.length){i=t;s=e}var o=i.length-s.length;for(var r=o;r<i.length;++r){i[r]|=s[r-o]}return n.toString(i)}};n.isEqual=function(e,t){e=n.toBuffer(e);t=n.toBuffer(t);if(e.length===t.length){for(var r=0;r<e.length;r++){if(e[r]!==t[r])return false}return true}if(t.length===4){var i=t;t=e;e=i}for(var r=0;r<10;r++){if(t[r]!==0)return false}var s=t.readUInt16BE(10);if(s!==0&&s!==65535)return false;for(var r=0;r<4;r++){if(e[r]!==t[r+12])return false}return true};n.isPrivate=function(e){return/^(::f{4}:)?10\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(e)||/^(::f{4}:)?192\.168\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(e)||/^(::f{4}:)?172\.(1[6-9]|2\d|30|31)\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(e)||/^(::f{4}:)?127\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(e)||/^(::f{4}:)?169\.254\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(e)||/^f[cd][0-9a-f]{2}:/i.test(e)||/^fe80:/i.test(e)||/^::1$/.test(e)||/^::$/.test(e)};n.isPublic=function(e){return!n.isPrivate(e)};n.isLoopback=function(e){return/^(::f{4}:)?127\.([0-9Line truncated
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
var n=r(4300);var i=n.Buffer;function copyProps(e,t){for(var r in e){t[r]=e[r]}}if(i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow){e.exports=n}else{copyProps(n,t);t.Buffer=SafeBuffer}function SafeBuffer(e,t,r){return i(e,t,r)}SafeBuffer.prototype=Object.create(i.prototype);copyProps(i,SafeBuffer);SafeBuffer.from=function(e,t,r){if(typeof e==="number"){throw new TypeError("Argument must not be a number")}return i(e,t,r)};SafeBuffer.alloc=function(e,t,r){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}var n=i(e);if(t!==undefined){if(typeof r==="string"){n.fill(t,r)}else{n.fill(t)}}else{n.fill(0)}return n};SafeBuffer.allocUnsafe=function(e){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}return i(e)};SafeBuffer.allocUnsafeSlow=function(e){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}return n.SlowBuffer(e)}},8795:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const n=r(4105);const i=4096;const s="utf8";class SmartBuffer{constructor(e){this.length=0;this._encoding=s;this._writeOffset=0;this._readOffset=0;if(SmartBuffer.isSmartBufferOptions(e)){if(e.encoding){n.checkEncoding(e.encoding);this._encoding=e.encoding}if(e.size){if(n.isFiniteInteger(e.size)&&e.size>0){this._buff=Buffer.allocUnsafe(e.size)}else{throw new Error(n.ERRORS.INVALID_SMARTBUFFER_SIZE)}}else if(e.buff){if(Buffer.isBuffer(e.buff)){this._buff=e.buff;this.length=e.buff.length}else{throw new Error(n.ERRORS.INVALID_SMARTBUFFER_BUFFER)}}else{this._buff=Buffer.allocUnsafe(i)}}else{if(typeof e!=="undefined"){throw new Error(n.ERRORS.INVALID_SMARTBUFFER_OBJECT)}this._buff=Buffer.allocUnsafe(i)}}static fromSize(e,t){return new this({size:e,encoding:t})}static fromBuffer(e,t){return new this({buff:e,encoding:t})}static fromOptions(e){return new this(e)}static isSmartBufferOptions(e){const t=e;return t&&(t.encoding!==undefined||t.size!==undefined||t.buff!==undefined)}readInt8(e){return this._readNumberValue(Buffer.prototype.readInt8,1,e)}readInt16BE(e){return this._readNumberValue(Buffer.prototype.readInt16BE,2,e)}readInt16LE(e){return this._readNumberValue(Buffer.prototype.readInt16LE,2,e)}readInt32BE(e){return this._readNumberValue(Buffer.prototype.readInt32BE,4,e)}readInt32LE(e){return this._readNumberValue(Buffer.prototype.readInt32LE,4,e)}readBigInt64BE(e){n.bigIntAndBufferInt64Check("readBigInt64BE");return this._readNumberValue(Buffer.prototype.readBigInt64BE,8,e)}readBigInt64LE(e){n.bigIntAndBufferInt64Check("readBigInt64LE");return this._readNumberValue(Buffer.prototype.readBigInt64LE,8,e)}writeInt8(e,t){this._writeNumberValue(Buffer.prototype.writeInt8,1,e,t);return this}insertInt8(e,t){return this._insertNumberValue(Buffer.prototype.writeInt8,1,e,t)}writeInt16BE(e,t){return this._writeNumberValue(Buffer.prototype.writeInt16BE,2,e,t)}insertInt16BE(e,t){return this._insertNumberValue(Buffer.prototype.writeInt16BE,2,e,t)}writeInt16LE(e,t){return this._writeNumberValue(Buffer.prototype.writeInt16LE,2,e,t)}insertInt16LE(e,t){return this._insertNumberValue(Buffer.prototype.writeInt16LE,2,e,t)}writeInt32BE(e,t){return this._writeNumberValue(Buffer.prototype.writeInt32BE,4,e,t)}insertInt32BE(e,t){return this._insertNumberValue(Buffer.prototype.writeInt32BE,4,e,t)}writeInt32LE(e,t){return this._writeNumberValue(Buffer.prototype.writeInt32LE,4,e,t)}insertInt32LE(e,t){return this._insertNumberValue(Buffer.prototype.writeInt32LE,4,e,t)}writeBigInt64BE(e,t){n.bigIntAndBufferInt64Check("writeBigInt64BE");return this._writeNumberValue(Buffer.prototype.writeBigInt64BE,8,e,t)}insertBigInt64BE(e,t){n.bigIntAndBufferInt64Check("writeBigInt64BE");return this._insertNumberValue(Buffer.prototype.writeBigInt64BE,8,e,t)}writeBigInt64LE(e,t){n.bigIntAndBufferInt64Check("writeBigInt64LE");return this._writeNumberValue(Buffer.prototype.writeBigInt64LE,8,e,t)}insertBigInt64LE(e,t){n.bigIntAndBufferInt64Check("writeBigInt64LE");return this._insertNumberValue(Buffer.prototype.writeBigInt64LE,8,e,t)}readUInt8(e){return this._readNumberValue(Buffer.prototype.readUInt8,1,e)}readUInt16BE(e){return this._readNumberValue(Buffer.prototype.readUInt16BE,2,e)}readUInt16LE(e){return this._readNumberValue(Buffer.prototype.readUInt16LE,2,e)}readUInt32BE(e){return this._readNumberValue(Buffer.prototype.readUInt32BE,4,e)}readUInt32LE(e){return this._readNumberValue(Buffer.prototype.readUInt32LE,4,e)}readBigUInt64BE(e){n.bigIntAndBufferInt64Check("readBigUInt64BE");return this._readNumberValue(Buffer.prototype.readBigUInt64BE,8,e)}readBigUInt64LE(e){n.bigIntAndBufferInt64Check("readBigUInt64LE");return this._readNumberValue(Buffer.prototype.readBigUInt64LE,8,e)}writeUInt8(e,t){return this._writeNumberValue(Buffer.prototype.writeUInt8,1,e,t)}insertUInt8(e,t){return this._insertNumberValue(Buffer.prototype.writeUInt8,1,e,t)}writeUInt16BE(e,t){return this._writeNumberValue(Buffer.prototype.writeUInt16BE,2,e,t)}insertUInt16BE(e,t){return this._insertNumberValue(Buffer.prototype.writeUIntLine truncated
/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */
(function(e,r){true?r(t):0})(this,(function(e){"use strict";function merge(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++){t[r]=arguments[r]}if(t.length>1){t[0]=t[0].slice(0,-1);var n=t.length-1;for(var i=1;i<n;++i){t[i]=t[i].slice(1,-1)}t[n]=t[n].slice(1);return t.join("")}else{return t[0]}}function subexp(e){return"(?:"+e+")"}function typeOf(e){return e===undefined?"undefined":e===null?"null":Object.prototype.toString.call(e).split(" ").pop().split("]").shift().toLowerCase()}function toUpperCase(e){return e.toUpperCase()}function toArray(e){return e!==undefined&&e!==null?e instanceof Array?e:typeof e.length!=="number"||e.split||e.setInterval||e.call?[e]:Array.prototype.slice.call(e):[]}function assign(e,t){var r=e;if(t){for(var n in t){r[n]=t[n]}}return r}function buildExps(e){var t="[A-Za-z]",r="[\\x0D]",n="[0-9]",i="[\\x22]",s=merge(n,"[A-Fa-f]"),o="[\\x0A]",a="[\\x20]",u=subexp(subexp("%[EFef]"+s+"%"+s+s+"%"+s+s)+"|"+subexp("%[89A-Fa-f]"+s+"%"+s+s)+"|"+subexp("%"+s+s)),l="[\\:\\/\\?\\#\\[\\]\\@]",c="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",f=merge(l,c),d=e?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",p=e?"[\\uE000-\\uF8FF]":"[]",h=merge(t,n,"[\\-\\.\\_\\~]",d),m=subexp(t+merge(t,n,"[\\+\\-\\.]")+"*"),v=subexp(subexp(u+"|"+merge(h,c,"[\\:]"))+"*"),g=subexp(subexp("25[0-5]")+"|"+subexp("2[0-4]"+n)+"|"+subexp("1"+n+n)+"|"+subexp("[1-9]"+n)+"|"+n),y=subexp(subexp("25[0-5]")+"|"+subexp("2[0-4]"+n)+"|"+subexp("1"+n+n)+"|"+subexp("0?[1-9]"+n)+"|0?0?"+n),b=subexp(y+"\\."+y+"\\."+y+"\\."+y),S=subexp(s+"{1,4}"),w=subexp(subexp(S+"\\:"+S)+"|"+b),_=subexp(subexp(S+"\\:")+"{6}"+w),E=subexp("\\:\\:"+subexp(S+"\\:")+"{5}"+w),k=subexp(subexp(S)+"?\\:\\:"+subexp(S+"\\:")+"{4}"+w),P=subexp(subexp(subexp(S+"\\:")+"{0,1}"+S)+"?\\:\\:"+subexp(S+"\\:")+"{3}"+w),C=subexp(subexp(subexp(S+"\\:")+"{0,2}"+S)+"?\\:\\:"+subexp(S+"\\:")+"{2}"+w),x=subexp(subexp(subexp(S+"\\:")+"{0,3}"+S)+"?\\:\\:"+S+"\\:"+w),O=subexp(subexp(subexp(S+"\\:")+"{0,4}"+S)+"?\\:\\:"+w),R=subexp(subexp(subexp(S+"\\:")+"{0,5}"+S)+"?\\:\\:"+S),I=subexp(subexp(subexp(S+"\\:")+"{0,6}"+S)+"?\\:\\:"),A=subexp([_,E,k,P,C,x,O,R,I].join("|")),T=subexp(subexp(h+"|"+u)+"+"),D=subexp(A+"\\%25"+T),F=subexp(A+subexp("\\%25|\\%(?!"+s+"{2})")+T),L=subexp("[vV]"+s+"+\\."+merge(h,c,"[\\:]")+"+"),N=subexp("\\["+subexp(F+"|"+A+"|"+L)+"\\]"),j=subexp(subexp(u+"|"+merge(h,c))+"*"),B=subexp(N+"|"+b+"(?!"+j+")"+"|"+j),M=subexp(n+"*"),$=subexp(subexp(v+"@")+"?"+B+subexp("\\:"+M)+"?"),U=subexp(u+"|"+merge(h,c,"[\\:\\@]")),H=subexp(U+"*"),q=subexp(U+"+"),V=subexp(subexp(u+"|"+merge(h,c,"[\\@]"))+"+"),z=subexp(subexp("\\/"+H)+"*"),W=subexp("\\/"+subexp(q+z)+"?"),K=subexp(V+z),Y=subexp(q+z),G="(?!"+U+")",Q=subexp(z+"|"+W+"|"+K+"|"+Y+"|"+G),J=subexp(subexp(U+"|"+merge("[\\/\\?]",p))+"*"),Z=subexp(subexp(U+"|[\\/\\?]")+"*"),X=subexp(subexp("\\/\\/"+$+z)+"|"+W+"|"+Y+"|"+G),ee=subexp(m+"\\:"+X+subexp("\\?"+J)+"?"+subexp("\\#"+Z)+"?"),te=subexp(subexp("\\/\\/"+$+z)+"|"+W+"|"+K+"|"+G),re=subexp(te+subexp("\\?"+J)+"?"+subexp("\\#"+Z)+"?"),ne=subexp(ee+"|"+re),ie=subexp(m+"\\:"+X+subexp("\\?"+J)+"?"),se="^("+m+")\\:"+subexp(subexp("\\/\\/("+subexp("("+v+")@")+"?("+B+")"+subexp("\\:("+M+")")+"?)")+"?("+z+"|"+W+"|"+Y+"|"+G+")")+subexp("\\?("+J+")")+"?"+subexp("\\#("+Z+")")+"?$",oe="^(){0}"+subexp(subexp("\\/\\/("+subexp("("+v+")@")+"?("+B+")"+subexp("\\:("+M+")")+"?)")+"?("+z+"|"+W+"|"+K+"|"+G+")")+subexp("\\?("+J+")")+"?"+subexp("\\#("+Z+")")+"?$",ae="^("+m+")\\:"+subexp(subexp("\\/\\/("+subexp("("+v+")@")+"?("+B+")"+subexp("\\:("+M+")")+"?)")+"?("+z+"|"+W+"|"+Y+"|"+G+")")+subexp("\\?("+J+")")+"?$",ue="^"+subexp("\\#("+Z+")")+"?$",le="^"+subexp("("+v+")@")+"?("+B+")"+subexp("\\:("+M+")")+"?$";return{NOT_SCHEME:new RegExp(merge("[^]",t,n,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(merge("[^\\%\\:]",h,c),"g"),NOT_HOST:new RegExp(merge("[^\\%\\[\\]\\:]",h,c),"g"),NOT_PATH:new RegExp(merge("[^\\%\\/\\:\\@]",h,c),"g"),NOT_PATH_NOSCHEME:new RegExp(merge("[^\\%\\/\\@]",h,c),"g"),NOT_QUERY:new RegExp(merge("[^\\%]",h,c,"[\\:\\@\\/\\?]",p),"g"),NOT_FRAGMENT:new RegExp(merge("[^\\%]",h,c,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(merge("[^]",h,c),"g"),UNRESERVED:new RegExp(h,"g"),OTHER_CHARS:new RegExp(merge("[^\\%]",h,f),"g"),PCT_ENCODED:new RegExp(u,"g"),IPV4ADDRESS:new RegExp("^("+b+")$"),IPV6ADDRESS:new RegExp("^\\[?("+A+")"+subexp(subexp("\\%25|\\%(?!"+s+"{2})")+"("+T+")")+"?\\]?$")}}var t=buildExps(false);var r=buildExps(true);var n=function(){function sliceIterator(e,t){var r=[];var n=true;var i=false;var s=undefined;try{for(var o=e[Symbol.iterator](),a;!(n=(a=o.next()).done);n=true){r.push(a.value);if(t&&r.length===t)break}}catch(e){i=true;s=e}finally{try{if(!n&&o["return"])o["return"]()}finally{if(i)throw s}}return r}return function(e,t){if(Array.isArray(e)){return e}else if(Symbol.iterator in Object(e)){return sliceIterator(e,t)}else{throw new TypeError("Invalid attempt to destructure non-iterable instance")}}}();var toConsumableArray=function(e){if(ArrayLine truncated
+4 -4
View File
@@ -8,21 +8,21 @@
},
"dependencies": {
"@actions/core": "^1.6.0",
"@pnpm/fetch": "^4.2.4",
"@pnpm/fetch": "^4.2.5",
"@pnpm/logger": "^4.0.0",
"@types/expand-tilde": "^2.0.0",
"@types/fs-extra": "^9.0.13",
"@types/js-yaml": "^4.0.5",
"@types/node": "^14.18.10",
"@types/node-fetch": "^2.5.12",
"@types/node-fetch": "^2.6.1",
"ajv": "^6.12.6",
"expand-tilde": "^2.0.2",
"fs-extra": "^9.1.0",
"fs-extra": "^10.0.0",
"js-yaml": "^4.1.0"
},
"devDependencies": {
"@ts-schema-autogen/cli": "^0.1.2",
"@vercel/ncc": "^0.27.0",
"@vercel/ncc": "^0.33.3",
"typescript": "^4.5.5"
}
}
+29 -35
View File
@@ -2,38 +2,38 @@ lockfileVersion: 5.3
specifiers:
'@actions/core': ^1.6.0
'@pnpm/fetch': ^4.2.4
'@pnpm/fetch': ^4.2.5
'@pnpm/logger': ^4.0.0
'@ts-schema-autogen/cli': ^0.1.2
'@types/expand-tilde': ^2.0.0
'@types/fs-extra': ^9.0.13
'@types/js-yaml': ^4.0.5
'@types/node': ^14.18.10
'@types/node-fetch': ^2.5.12
'@vercel/ncc': ^0.27.0
'@types/node-fetch': ^2.6.1
'@vercel/ncc': ^0.33.3
ajv: ^6.12.6
expand-tilde: ^2.0.2
fs-extra: ^9.1.0
fs-extra: ^10.0.0
js-yaml: ^4.1.0
typescript: ^4.5.5
dependencies:
'@actions/core': 1.6.0
'@pnpm/fetch': 4.2.4_@pnpm+logger@4.0.0
'@pnpm/fetch': 4.2.5_@pnpm+logger@4.0.0
'@pnpm/logger': 4.0.0
'@types/expand-tilde': 2.0.0
'@types/fs-extra': 9.0.13
'@types/js-yaml': 4.0.5
'@types/node': 14.18.10
'@types/node-fetch': 2.5.12
'@types/node-fetch': 2.6.1
ajv: 6.12.6
expand-tilde: 2.0.2
fs-extra: 9.1.0
fs-extra: 10.0.0
js-yaml: 4.1.0
devDependencies:
'@ts-schema-autogen/cli': 0.1.2
'@vercel/ncc': 0.27.0
'@vercel/ncc': 0.33.3
typescript: 4.5.5
packages:
@@ -50,23 +50,23 @@ packages:
tunnel: 0.0.6
dev: false
/@pnpm/core-loggers/6.1.3_@pnpm+logger@4.0.0:
resolution: {integrity: sha512-X3mEhYz+8DKy4Xxbr24tGK9jPD+1AIhigGiJ9Fd0q+ywHXQ6ECSFyGGikKEAlBQIKVJxG788Mi0Zo13TU91fEQ==}
/@pnpm/core-loggers/6.1.4_@pnpm+logger@4.0.0:
resolution: {integrity: sha512-vF4Qc8E8e4uCGbVc7USCgqxrRe4eZsz8XEuCTUy6asZFVnNnRY/N1vJaVG3hti/UYKI/1si1dJYibppXhgTimA==}
engines: {node: '>=12.17'}
peerDependencies:
'@pnpm/logger': ^4.0.0
dependencies:
'@pnpm/logger': 4.0.0
'@pnpm/types': 7.9.0
'@pnpm/types': 7.10.0
dev: false
/@pnpm/fetch/4.2.4_@pnpm+logger@4.0.0:
resolution: {integrity: sha512-PnFPVxhAK0+mOgKsVMrzS1bFokeO3PB6/aaBBjQprtvBG6jYZ8d8JnHvwhRcCKM/LxqVsazMFgqYPEFyMjg0Pw==}
/@pnpm/fetch/4.2.5_@pnpm+logger@4.0.0:
resolution: {integrity: sha512-8zUWgrP+6mK/LJcLkNfjqKLSwOs4n/LR3BACZGSwcFH7yh28YJhKo142gFPOVTzS0pBUDvVVsDNQ7sxp2lOmDw==}
engines: {node: '>=12.17'}
peerDependencies:
'@pnpm/logger': ^4.0.0
dependencies:
'@pnpm/core-loggers': 6.1.3_@pnpm+logger@4.0.0
'@pnpm/core-loggers': 6.1.4_@pnpm+logger@4.0.0
'@pnpm/fetching-types': 2.2.1
'@pnpm/logger': 4.0.0
'@pnpm/npm-registry-agent': 5.0.2
@@ -108,8 +108,8 @@ packages:
- supports-color
dev: false
/@pnpm/types/7.9.0:
resolution: {integrity: sha512-WJol7zZKMktP8bvoFEh/ANCrYsIDcfpGFgRZmAMeULuskFVND4NLXXIkBqNhtmv+ipt6mVUnsZTGHrVaXrlsNA==}
/@pnpm/types/7.10.0:
resolution: {integrity: sha512-7NKyfwepNccR6f9htiXAw0tt6rCajvtiX5HsTOi3odSFJ04iri43yjh70Ekw25hAynQwRR0rkJ7l6BBNFrJ/2g==}
engines: {node: '>=12.17'}
dev: false
@@ -286,8 +286,8 @@ packages:
resolution: {integrity: sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==}
dev: true
/@types/node-fetch/2.5.12:
resolution: {integrity: sha512-MKgC4dlq4kKNa/mYrwpKfzQMB5X3ee5U6fSprkKpToBqBmX4nFZL9cW5jl6sWn+xpRJ7ypWh2yyqqr8UUCstSw==}
/@types/node-fetch/2.6.1:
resolution: {integrity: sha512-oMqjURCaxoSIsHSr1E47QHzbmzNR5rK8McHuNb11BOM9cHcIK3Avy0s/b2JlXHoQGTYS3NsvWzV1M0iK7l0wbA==}
dependencies:
'@types/node': 14.18.10
form-data: 3.0.1
@@ -310,8 +310,8 @@ packages:
'@types/yargs-parser': 20.2.1
dev: true
/@vercel/ncc/0.27.0:
resolution: {integrity: sha512-DllIJQapnU2YwewIhh/4dYesmMQw3h2cFtabECc/zSJHqUbNa0eJuEkRa6DXbZvh1YPWBtYQoPV17NlDpBw1Vw==}
/@vercel/ncc/0.33.3:
resolution: {integrity: sha512-JGZ11QV+/ZcfudW2Cz2JVp54/pJNXbsuWRgSh2ZmmZdQBKXqBtIGrwI1Wyx8nlbzAiEFe7FHi4K1zX4//jxTnQ==}
hasBin: true
dev: true
@@ -386,11 +386,6 @@ packages:
resolution: {integrity: sha1-x57Zf380y48robyXkLzDZkdLS3k=}
dev: false
/at-least-node/1.0.0:
resolution: {integrity: sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==}
engines: {node: '>= 4.0.0'}
dev: false
/balanced-match/1.0.2:
resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==}
dev: true
@@ -580,6 +575,15 @@ packages:
mime-types: 2.1.34
dev: false
/fs-extra/10.0.0:
resolution: {integrity: sha512-C5owb14u9eJwizKGdchcDUQeFtlSHHthBk8pbX9Vc1PFZrLombudjDnNns88aYslCyF6IY5SUw3Roz6xShcEIQ==}
engines: {node: '>=12'}
dependencies:
graceful-fs: 4.2.9
jsonfile: 6.1.0
universalify: 2.0.0
dev: false
/fs-extra/8.1.0:
resolution: {integrity: sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==}
engines: {node: '>=6 <7 || >=8'}
@@ -589,16 +593,6 @@ packages:
universalify: 0.1.2
dev: true
/fs-extra/9.1.0:
resolution: {integrity: sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==}
engines: {node: '>=10'}
dependencies:
at-least-node: 1.0.0
graceful-fs: 4.2.9
jsonfile: 6.1.0
universalify: 2.0.0
dev: false
/fs.realpath/1.0.0:
resolution: {integrity: sha1-FQStJSMVjKpA20onh8sBQRmU6k8=}
dev: true
+2 -2
View File
@@ -3,7 +3,7 @@ import expandTilde from 'expand-tilde'
import { RunInstall, parseRunInstall } from './run-install'
export interface Inputs {
readonly version: string
readonly version?: string
readonly dest: string
readonly runInstall: RunInstall[]
}
@@ -15,7 +15,7 @@ const options: InputOptions = {
const parseInputPath = (name: string) => expandTilde(getInput(name, options))
export const getInputs = (): Inputs => ({
version: getInput('version', options),
version: getInput('version'),
dest: parseInputPath('dest'),
runInstall: parseRunInstall('run_install'),
})
+16 -2
View File
@@ -2,14 +2,28 @@ import { addPath, exportVariable } from '@actions/core'
import { spawn } from 'child_process'
import { execPath } from 'process'
import path from 'path'
import { remove, ensureFile, writeFile } from 'fs-extra'
import { remove, ensureFile, writeFile, readFile } from 'fs-extra'
import fetch from '@pnpm/fetch'
import { Inputs } from '../inputs'
export async function runSelfInstaller(inputs: Inputs): Promise<number> {
const { version, dest } = inputs
const target = version ? `pnpm@${version}` : 'pnpm'
const pkgJson = path.join(dest, 'package.json')
let target: string
if (!version) {
const packageManager = JSON.parse(await readFile(pkgJson, 'utf8')).packageManager
if (packageManager) {
if (!packageManager.startsWith('pnpm@')) {
throw new Error('packageManager field is not pnpm')
}
target = packageManager
} else {
throw new Error('None of packageManager (in package.json) or version (in action config) is defined')
}
} else {
target = `pnpm@${version}`
}
await remove(dest)
await ensureFile(pkgJson)