new-project-cli
Version:
Opinionated command line tool that creates a new git repository for an npm package.
7 lines • 43.4 kB
JavaScript
/*!
*** new-project-cli 1.3.4
*** Copyright © 2019, Jaid <jaid.jsx@gmail.com> (https://github.com/Jaid)
*** @license MIT
*** See https://github.com/Jaid/new-project-cli
!*/!function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=55)}([function(t,e){t.exports=require("path")},function(t,e){t.exports=require("execa")},function(t,e){t.exports=require("escape-string-regexp")},function(t,e){t.exports=require("which-promise")},function(t,e){t.exports=require("@absolunet/fsp")},function(t,e){t.exports={githubUser:"Jaid",projectsFolder:"E:/Projects",template:"epoch-seconds",readme:"# {{projectName}}\n## Under construction\nNot much to see right now. Come back lator! :crocodile:",description:"Node module {{projectName}} (:construction: Under construction, usage is not recommended!)",initialCommitMessage:"Initialized based on https://github.com/{{owner}}/{{template}}",lockfileCreationCommitMessage:"Generated lockfile",upgradeCommitMessage:"Automatically upgraded dependencies",openUrls:["https://github.com/{{owner}}/{{projectName}}","https://travis-ci.com/{{owner}}/{{projectName}}/settings"]}},function(t,e){t.exports=require("has-content")},function(t,e){t.exports=require("constant-case")},function(t,e){t.exports=require("header-case")},function(t,e){t.exports=require("camel-case")},function(t,e){t.exports=require("replace-in-file")},function(t,e){t.exports=require("pascal-case")},function(t,e,n){!function(){"use strict";var e=n(30)("simple-git"),r=n(39),o=n(14),i=function(){},s=n(41);function a(t,e,n){this._baseDir=t,this._runCache=[],this.ChildProcess=e,this.Buffer=n}function u(t){return s[t]}a.prototype._command="git",a.prototype._env=null,a.prototype._outputHandler=null,a.prototype._silentLogging=/prod/.test(process.env.NODE_ENV),a.prototype.customBinary=function(t){return this._command=t,this},a.prototype.env=function(t,e){return 1===arguments.length&&"object"==typeof t?this._env=t:(this._env=this._env||{})[t]=e,this},a.prototype.cwd=function(t,e){var n=this,r=a.trailingFunctionArgument(arguments);return this.exec((function(){n._baseDir=t,o(t,o.FOLDER)?r&&r(null,t):a.exception(n,'Git.cwd: cannot change to non-directory "'+t+'"',r)}))},a.prototype.outputHandler=function(t){return this._outputHandler=t,this},a.prototype.init=function(t,e){var n=["init"],r=a.trailingFunctionArgument(arguments);return!0===t&&n.push("--bare"),this._run(n,(function(t){r&&r(t)}))},a.prototype.status=function(t){return this._run(["status","--porcelain","-b","-u"],a._responseHandler(t,"StatusSummary"))},a.prototype.stashList=function(t,e){var n=a.trailingFunctionArgument(arguments),r=(n===e?t:null)||{},o=r.splitter||u("ListLogSummary").SPLITTER,i=["stash","list","--pretty=format:"+u("ListLogSummary").START_BOUNDARY+"%H %ai %s%d %aN %ae".replace(/\s+/g,o)+u("ListLogSummary").COMMIT_BOUNDARY];return Array.isArray(r)&&(i=i.concat(r)),this._run(i,a._responseHandler(n,"ListLogSummary",o))},a.prototype.stash=function(t,e){var n=["stash"];return a._appendOptions(n,a.trailingOptionsArgument(arguments)),n.push.apply(n,a.trailingArrayArgument(arguments)),this._run(n,a._responseHandler(a.trailingFunctionArgument(arguments)))},a.prototype.clone=function(t,e,n,r){for(var o=a.trailingFunctionArgument(arguments),i=["clone"].concat(a.trailingArrayArgument(arguments)),s=0,u=arguments.length;u>s;s++)"string"==typeof arguments[s]&&i.push(arguments[s]);return this._run(i,(function(t,e){o&&o(t,e)}))},a.prototype.mirror=function(t,e,n){return this.clone(t,e,["--mirror"],n)},a.prototype.mv=function(t,e,n){var r=a.trailingFunctionArgument(arguments),o=[].concat(t);o.unshift("mv","-v"),o.push(e),this._run(o,a._responseHandler(r,"MoveSummary"))},a.prototype.checkoutLatestTag=function(t){var e=this;return this.pull((function(){e.tags((function(n,r){e.checkout(r.latest,t)}))}))},a.prototype.add=function(t,e){return this._run(["add"].concat(t),(function(t,n){e&&e(t)}))},a.prototype.commit=function(t,e,n,r){var o=a.trailingFunctionArgument(arguments),i=["commit"];return[].concat(t).forEach((function(t){i.push("-m",t)})),[].push.apply(i,[].concat("string"==typeof e||Array.isArray(e)?e:[])),a._appendOptions(i,a.trailingOptionsArgument(arguments)),this._run(i,a._responseHandler(o,"CommitSummary"))},a.prototype._getLog=function(t,e){var n=this._silentLogging?i:console[t].bind(console);return arguments.length>1&&n(e),n},a.prototype.pull=function(t,e,n,r){var o=["pull"],i=a.trailingFunctionArgument(arguments);return"string"==typeof t&&"string"==typeof e&&o.push(t,e),a._appendOptions(o,a.trailingOptionsArgument(arguments)),this._run(o,a._responseHandler(i,"PullSummary"))},a.prototype.fetch=function(t,e,n){var r=["fetch"],o=a.trailingFunctionArgument(arguments);return a._appendOptions(r,a.trailingOptionsArgument(arguments)),"string"==typeof t&&"string"==typeof e&&r.push(t,e),Array.isArray(t)&&(r=r.concat(t)),this._run(r,a._responseHandler(o,"FetchSummary"),{concatStdErr:!0})},a.prototype.silent=function(t){return this._silentLogging=!!t,this},a.prototype.tags=function(t,e){var n=a.trailingFunctionArgument(arguments),r=["-l"];a._appendOptions(r,a.trailingOptionsArgument(arguments));var o=r.some((function(t){return/^--sort=/.test(t)}));return this.tag(r,a._responseHandler(n,"TagList",[o]))},a.prototype.rebase=function(t,e){var n=["rebase"];return a._appendOptions(n,a.trailingOptionsArgument(arguments)),n.push.apply(n,a.trailingArrayArgument(arguments)),this._run(n,a._responseHandler(a.trailingFunctionArgument(arguments)))},a.prototype.reset=function(t,e){var n=["reset"],r=a.trailingFunctionArgument(arguments);if(r!==t&&"string"!=typeof t&&t)Array.isArray(t)&&n.push.apply(n,t);else{var o=["mixed","soft","hard"].includes(t)?t:"soft";n.push("--"+o)}return this._run(n,(function(t){r&&r(t||null)}))},a.prototype.revert=function(t,e,n){var r=a.trailingFunctionArgument(arguments),o=["revert"];return a._appendOptions(o,a.trailingOptionsArgument(arguments)),"string"!=typeof t?this.exec((function(){r&&r(new TypeError("Commit must be a string"))})):(o.push(t),this._run(o,(function(t){r&&r(t||null)})))},a.prototype.addTag=function(t,e){return"string"!=typeof t?this.exec((function(){e&&e(new TypeError("Git.addTag requires a tag name"))})):this.tag([t],e)},a.prototype.addAnnotatedTag=function(t,e,n){return this.tag(["-a","-m",e,t],(function(t){n&&n(t)}))},a.prototype.checkout=function(t,e){var n=["checkout"];return n=n.concat(t),this._run(n,(function(t,n){e&&e(t,!t&&this._parseCheckout(n))}))},a.prototype.checkoutBranch=function(t,e,n){return this.checkout(["-b",t,e],n)},a.prototype.checkoutLocalBranch=function(t,e){return this.checkout(["-b",t],e)},a.prototype.deleteLocalBranch=function(t,e){return this.branch(["-d",t],e)},a.prototype.branch=function(t,e){var n,r,o=a.trailingFunctionArgument(arguments),i=["branch"];return i.push.apply(i,a.trailingArrayArgument(arguments)),a._appendOptions(i,a.trailingOptionsArgument(arguments)),arguments.length&&o!==t||i.push("-a"),n=["-d","-D","--delete"].reduce((function(t,e){return t||i.indexOf(e)>0}),!1),0>i.indexOf("-v")&&i.splice(1,0,"-v"),r=n?a._responseHandler(o,"BranchDeleteSummary",!1):a._responseHandler(o,"BranchSummary"),this._run(i,r)},a.prototype.branchLocal=function(t){return this.branch(["-v"],t)},a.prototype.addConfig=function(t,e,n){return this._run(["config","--local",t,e],(function(t,e){n&&n(t,!t&&e)}))},a.prototype.raw=function(t,e){var n=[];Array.isArray(t)?n=t.slice(0):a._appendOptions(n,a.trailingOptionsArgument(arguments));var r=a.trailingFunctionArgument(arguments);return n.length?this._run(n,(function(t,e){r&&r(t,!t&&e||null)})):this.exec((function(){r&&r(new Error("Raw: must supply one or more command to execute"),null)}))},a.prototype.submoduleAdd=function(t,e,n){return this._run(["submodule","add",t,e],(function(t){n&&n(t)}))},a.prototype.submoduleUpdate=function(t,e){"string"==typeof t&&this._getLog("warn","Git#submoduleUpdate: args should be supplied as an array of individual arguments");var n=a.trailingFunctionArgument(arguments),r=t!==n?t:[];return this.subModule(["update"].concat(r),(function(t,e){n&&n(t,e)}))},a.prototype.submoduleInit=function(t,e){"string"==typeof t&&this._getLog("warn","Git#submoduleInit: args should be supplied as an array of individual arguments");var n=a.trailingFunctionArgument(arguments),r=t!==n?t:[];return this.subModule(["init"].concat(r),(function(t,e){n&&n(t,e)}))},a.prototype.subModule=function(t,e){return Array.isArray(t)?("submodule"!==t[0]&&t.unshift("submodule"),this._run(t,(function(t,n){e&&e(t||null,t?null:n)}))):this.exec((function(){e&&e(new TypeError("Git.subModule requires an array of arguments"))}))},a.prototype.listRemote=function(t,e){var n=a.trailingFunctionArgument(arguments),r=n===t||void 0===t?[]:t;return"string"==typeof r&&this._getLog("warn","Git#listRemote: args should be supplied as an array of individual arguments"),this._run(["ls-remote"].concat(r),(function(t,e){n&&n(t,e)}))},a.prototype.addRemote=function(t,e,n){return this._run(["remote","add",t,e],(function(t){n&&n(t)}))},a.prototype.removeRemote=function(t,e){return this._run(["remote","remove",t],(function(t){e&&e(t)}))},a.prototype.getRemotes=function(t,e){var n=a.trailingFunctionArgument(arguments),r=!0===t?["-v"]:[];return this.remote(r,(function(t,e){n&&n(t,!t&&e.trim().split("\n").filter(Boolean).reduce((function(t,e){var n=e.trim().split(/\s+/),r=n.shift();return t[r]||(t[r]=t[t.length]={name:r,refs:{}}),n.length&&(t[r].refs[n.pop().replace(/[^a-z]/g,"")]=n.pop()),t}),[]).slice(0))}))},a.prototype.remote=function(t,e){return Array.isArray(t)?("remote"!==t[0]&&t.unshift("remote"),this._run(t,(function(t,n){e&&e(t||null,t?null:n)}))):this.exec((function(){e&&e(new TypeError("Git.remote requires an array of arguments"))}))},a.prototype.mergeFromTo=function(t,e,n,r){var o=[t,e],i=a.trailingFunctionArgument(arguments);return Array.isArray(n)&&(o=o.concat(n)),this.merge(o,i)},a.prototype.merge=function(t,e){var n=this,r=a.trailingFunctionArgument(arguments)||i,o=function(t,e){if(!t&&e.failed)return a.fail(n,e,r);r(t,e)},s=[];return a._appendOptions(s,a.trailingOptionsArgument(arguments)),s.push.apply(s,a.trailingArrayArgument(arguments)),"merge"!==s[0]&&s.unshift("merge"),1===s.length?this.exec((function(){e&&e(new TypeError("Git.merge requires at least one option"))})):this._run(s,a._responseHandler(o,"MergeSummary"),{concatStdErr:!0})},a.prototype.tag=function(t,e){var n=[];return a._appendOptions(n,a.trailingOptionsArgument(arguments)),n.push.apply(n,a.trailingArrayArgument(arguments)),"tag"!==n[0]&&n.unshift("tag"),this._run(n,a._responseHandler(a.trailingFunctionArgument(arguments)))},a.prototype.updateServerInfo=function(t){return this._run(["update-server-info"],(function(e,n){t&&t(e,!e&&n)}))},a.prototype.push=function(t,e,n){var r=[],o=a.trailingFunctionArgument(arguments);return"string"==typeof t&&"string"==typeof e&&r.push(t,e),Array.isArray(t)&&(r=r.concat(t)),a._appendOptions(r,a.trailingOptionsArgument(arguments)),"push"!==r[0]&&r.unshift("push"),this._run(r,(function(t,e){o&&o(t,!t&&e)}))},a.prototype.pushTags=function(t,e){var n=["push"];return"string"==typeof t&&n.push(t),n.push("--tags"),e="function"==typeof arguments[arguments.length-1]?arguments[arguments.length-1]:null,this._run(n,(function(t,n){e&&e(t,!t&&n)}))},a.prototype.rm=function(t,e){return this._rm(t,"-f",e)},a.prototype.rmKeepLocal=function(t,e){return this._rm(t,"--cached",e)},a.prototype.catFile=function(t,e){return this._catFile("utf-8",arguments)},a.prototype.binaryCatFile=function(t,e){return this._catFile("buffer",arguments)},a.prototype._catFile=function(t,e){var n=a.trailingFunctionArgument(e),r=["cat-file"],o=e[0];if("string"==typeof o)throw new TypeError("Git#catFile: options must be supplied as an array of strings");return Array.isArray(o)&&r.push.apply(r,o),this._run(r,(function(t,e){n&&n(t,e)}),{format:t})},a.prototype.diff=function(t,e){var n=["diff"];return"string"==typeof t?(n[0]+=" "+t,this._getLog("warn","Git#diff: supplying options as a single string is now deprecated, switch to an array of strings")):Array.isArray(t)&&n.push.apply(n,t),"function"==typeof arguments[arguments.length-1]&&(e=arguments[arguments.length-1]),this._run(n,(function(t,n){e&&e(t,n)}))},a.prototype.diffSummary=function(t,e){var n=a.trailingFunctionArgument(arguments),r=["--stat=4096"];return t&&t!==n&&r.push.apply(r,[].concat(t)),this.diff(r,a._responseHandler(n,"DiffSummary"))},a.prototype.revparse=function(t,e){var n=["rev-parse"];return"string"==typeof t?(n=n+" "+t,this._getLog("warn","Git#revparse: supplying options as a single string is now deprecated, switch to an array of strings")):Array.isArray(t)&&n.push.apply(n,t),"function"==typeof arguments[arguments.length-1]&&(e=arguments[arguments.length-1]),this._run(n,(function(t,n){e&&e(t,t?null:String(n).trim())}))},a.prototype.show=function(t,e){var n=[].slice.call(arguments,0),r="function"==typeof n[n.length-1]?n.pop():null,o=["show"];return"string"==typeof t?(o=o+" "+t,this._getLog("warn","Git#show: supplying options as a single string is now deprecated, switch to an array of strings")):Array.isArray(t)&&o.push.apply(o,t),this._run(o,(function(t,e){r&&r(t,!t&&e)}))},a.prototype.clean=function(t,e,n){var r=a.trailingFunctionArgument(arguments);if("string"!=typeof t||!/[nf]/.test(t))return this.exec((function(){r&&r(new TypeError('Git clean mode parameter ("n" or "f") is required'))}));if(/[^dfinqxX]/.test(t))return this.exec((function(){r&&r(new TypeError("Git clean unknown option found in "+JSON.stringify(t)))}));var o=["clean","-"+t];return Array.isArray(e)&&(o=o.concat(e)),o.some(i)?this.exec((function(){r&&r(new TypeError("Git clean interactive mode is not supported"))})):this._run(o,(function(t,e){r&&r(t,!t&&e)}));function i(t){return/^-[^\-]/.test(t)?t.indexOf("i")>0:"--interactive"===t}},a.prototype.exec=function(t){return this._run([],(function(){"function"==typeof t&&t()})),this},a.prototype.then=function(t){return this._getLog("warn","\nGit#then is deprecated after version 1.72 and will be removed in version 2.x\nPlease switch to using Git#exec to run arbitrary functions as part of the command chain.\n"),this.exec(t)},a.prototype.log=function(t,e){var n=a.trailingFunctionArgument(arguments),r=(n===e?t:null)||{},o=r.splitter||u("ListLogSummary").SPLITTER,i=r.format||{hash:"%H",date:"%ai",message:"%s",refs:"%D",body:r.multiLine?"%B":"%b",author_name:"%aN",author_email:"%ae"},s=!1!==r.symmetric?"...":"..",c=Object.keys(i),p=c.map((function(t){return i[t]})).join(o),l=[],f=["log","--pretty=format:"+u("ListLogSummary").START_BOUNDARY+p+u("ListLogSummary").COMMIT_BOUNDARY];return Array.isArray(r)?(f=f.concat(r),r={}):"string"!=typeof arguments[0]&&"string"!=typeof arguments[1]||(this._getLog("warn","Git#log: supplying to or from as strings is now deprecated, switch to an options configuration object"),r={from:arguments[0],to:arguments[1]}),(r.n||r["max-count"])&&f.push("--max-count="+(r.n||r["max-count"])),r.from&&r.to&&f.push(r.from+s+r.to),r.file&&l.push("--follow",t.file),"splitter n max-count file from to --pretty format symmetric multiLine".split(" ").forEach((function(t){delete r[t]})),a._appendOptions(f,r),this._run(f.concat(l),a._responseHandler(n,"ListLogSummary",[o,c]))},a.prototype.clearQueue=function(){return this._runCache.length=0,this},a.prototype.checkIgnore=function(t,e){var n=a.trailingFunctionArgument(arguments),r=["check-ignore"];return n!==t&&(r=r.concat(t)),this._run(r,(function(t,e){n&&n(t,!t&&this._parseCheckIgnore(e))}))},a.prototype.checkIsRepo=function(t){return this._run(["rev-parse","--is-inside-work-tree"],(function(e,n){t&&t(e,"true"===String(n).trim())}),{onError:function(t,e,n,r){if(128===t&&/(Not a git repository|Kein Git-Repository)/i.test(e))return n(!1);r(e)}})},a.prototype._rm=function(t,e,n){var r=[].concat(t),o=["rm",e];return o.push.apply(o,r),this._run(o,(function(t){n&&n(t)}))},a.prototype._parseCheckout=function(t){},a.prototype._parseCheckIgnore=function(t){return t.split(/\n/g).filter(Boolean).map((function(t){return t.trim()}))},a.prototype._run=function(t,e,n){return"string"==typeof t&&(t=t.split(" ")),this._runCache.push([t,e,n||{}]),this._schedule(),this},a.prototype._schedule=function(){if(!this._childProcess&&this._runCache.length){var t=this,n=t.Buffer,o=t._runCache.shift(),i=o[0],s=o[1],u=o[2];e(i);var c=r(),p=!1,l=function t(e){(p||h.length||f.length)&&(c.resolve(e),p=!0),p||(p=!0,setTimeout(t.bind(this,e),50))},f=[],h=[],m=t.ChildProcess.spawn(t._command,i.slice(0),{cwd:t._baseDir,env:t._env,windowsHide:!0});m.stdout.on("data",(function(t){f.push(t)})),m.stderr.on("data",(function(t){h.push(t)})),m.on("error",(function(t){h.push(n.from(t.stack,"ascii"))})),m.on("close",l),m.on("exit",l),c.promise.then((function(e){function r(e){s.call(t,null,e)}function o(e){a.fail(t,e,s)}if(delete t._childProcess,e&&h.length&&u.onError)u.onError(e,n.concat(h).toString("utf-8"),r,o);else if(e&&h.length)o(n.concat(h).toString("utf-8"));else{u.concatStdErr&&[].push.apply(f,h);var i=n.concat(f);"buffer"!==u.format&&(i=i.toString(u.format||"utf-8")),r(i)}process.nextTick(t._schedule.bind(t))})),t._childProcess=m,t._outputHandler&&t._outputHandler(i[0],t._childProcess.stdout,t._childProcess.stderr)}},a.fail=function(t,e,n){t._getLog("error",e),t._runCache.length=0,"function"==typeof n&&n.call(t,e,null)},a.trailingFunctionArgument=function(t){var e=t[t.length-1];return"function"==typeof e?e:null},a.trailingOptionsArgument=function(t){var e=t[t.length-(a.trailingFunctionArgument(t)?2:1)];return"[object Object]"===Object.prototype.toString.call(e)?e:null},a.trailingArrayArgument=function(t){var e=t[t.length-(a.trailingFunctionArgument(t)?2:1)];return"[object Array]"===Object.prototype.toString.call(e)?e:[]},a._appendOptions=function(t,e){null!==e&&Object.keys(e).forEach((function(n){var r=e[n];"string"==typeof r?t.push(n+"="+r):t.push(n)}))},a._responseHandler=function(t,e,n){return function(r,o){if("function"==typeof t){if(r)return t(r,null);if(!e)return t(null,o);var i=u(e),s=i.parse.apply(i,[o].concat(void 0===n?[]:n));t(null,s)}}},a.exception=function(t,e,n){t._runCache.length=0,"function"==typeof n&&n(e instanceof Error?e:new Error(e)),t._getLog("error",e)},t.exports=a}()},function(t,e,n){t.exports=function(t){function e(t){let e=0;for(let n=0;n<t.length;n++)e=(e<<5)-e+t.charCodeAt(n),e|=0;return r.colors[Math.abs(e)%r.colors.length]}function r(t){let n;function s(...t){if(!s.enabled)return;const e=s,o=Number(new Date),i=o-(n||o);e.diff=i,e.prev=n,e.curr=o,n=o,t[0]=r.coerce(t[0]),"string"!=typeof t[0]&&t.unshift("%O");let a=0;t[0]=t[0].replace(/%([a-zA-Z%])/g,(n,o)=>{if("%%"===n)return n;a++;const i=r.formatters[o];if("function"==typeof i){const r=t[a];n=i.call(e,r),t.splice(a,1),a--}return n}),r.formatArgs.call(e,t),(e.log||r.log).apply(e,t)}return s.namespace=t,s.enabled=r.enabled(t),s.useColors=r.useColors(),s.color=e(t),s.destroy=o,s.extend=i,"function"==typeof r.init&&r.init(s),r.instances.push(s),s}function o(){const t=r.instances.indexOf(this);return-1!==t&&(r.instances.splice(t,1),!0)}function i(t,e){const n=r(this.namespace+(void 0===e?":":e)+t);return n.log=this.log,n}function s(t){return t.toString().substring(2,t.toString().length-2).replace(/\.\*\?$/,"*")}return r.debug=r,r.default=r,r.coerce=function(t){if(t instanceof Error)return t.stack||t.message;return t},r.disable=function(){const t=[...r.names.map(s),...r.skips.map(s).map(t=>"-"+t)].join(",");return r.enable(""),t},r.enable=function(t){let e;r.save(t),r.names=[],r.skips=[];const n=("string"==typeof t?t:"").split(/[\s,]+/),o=n.length;for(e=0;o>e;e++)n[e]&&("-"===(t=n[e].replace(/\*/g,".*?"))[0]?r.skips.push(new RegExp("^"+t.substr(1)+"$")):r.names.push(new RegExp("^"+t+"$")));for(e=0;e<r.instances.length;e++){const t=r.instances[e];t.enabled=r.enabled(t.namespace)}},r.enabled=function(t){if("*"===t[t.length-1])return!0;let e,n;for(e=0,n=r.skips.length;n>e;e++)if(r.skips[e].test(t))return!1;for(e=0,n=r.names.length;n>e;e++)if(r.names[e].test(t))return!0;return!1},r.humanize=n(32),Object.keys(t).forEach(e=>{r[e]=t[e]}),r.instances=[],r.names=[],r.skips=[],r.formatters={},r.selectColor=e,r.enable(r.load()),r}},function(t,e,n){var r=n(40);function o(t,e,n){try{var o=!1,i=r.statSync(t);return o=(o=o||e&&i.isFile())||n&&i.isDirectory()}catch(t){if("ENOENT"===t.code)return!1;throw t}}t.exports=function(t,e){return e?o(t,1&e,2&e):o(t,!0,!0)},t.exports.FILE=1,t.exports.FOLDER=2},function(t,e){function n(){this.files=[],this.insertions=0,this.deletions=0,this.changed=0}function r(t,e){if(t=t.trim().match(/^(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/)){var n=(t[3]||"").trim();return e.push({file:t[1].trim(),changes:parseInt(t[2],10),insertions:n.replace(/-/g,"").length,deletions:n.replace(/\+/g,"").length,binary:!1}),!0}}function o(t,e){if(t=t.match(/^(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)$/))return e.push({file:t[1].trim(),before:+t[2],after:+t[3],binary:!0}),!0}t.exports=n,n.prototype.insertions=0,n.prototype.deletions=0,n.prototype.changed=0,n.parse=function(t){var e,i=t.trim().split("\n"),s=new n,a=i.pop();for(a&&a.trim().split(", ").forEach((function(t){var e=/(\d+)\s([a-z]+)/.exec(t);e&&(/files?/.test(e[2])?s.changed=parseInt(e[1],10):s[e[2].replace(/s$/,"")+"s"]=parseInt(e[1],10))}));e=i.shift();)r(e,s.files)||o(e,s.files);return s}},function(t,e,n){"use strict";function r(t,e,n){if(this.path=t,this.index=e,this.working_dir=n,"R"===e+n){var o=r.fromPathRegex.exec(t)||[null,t,t];this.from=o[1],this.path=o[2]}}r.fromPathRegex=/^(.+) -> (.+)$/,r.prototype={path:"",from:""},t.exports=r},function(t,e){function n(){this.files=[],this.insertions={},this.deletions={},this.summary={changes:0,insertions:0,deletions:0},this.created=[],this.deleted=[]}function r(t,e){var r=n.FILE_UPDATE_REGEX.exec(e);if(!r)return!1;t.files.push(r[1]);var o=r[2].length;o&&(t.insertions[r[1]]=o);var i=r[3].length;return i&&(t.deletions[r[1]]=i),!0}function o(t,e){if(!t.files.length)return!1;var r=n.SUMMARY_REGEX.exec(e);return!(!r||void 0===r[3]&&void 0===r[5])&&(t.summary.changes=+r[1]||0,t.summary.insertions=+r[3]||0,t.summary.deletions=+r[5]||0,!0)}function i(t,e){var r=n.ACTION_REGEX.exec(e);if(!r)return!1;var o=r[2];return 0>t.files.indexOf(o)&&t.files.push(o),("create"===r[1]?t.created:t.deleted).push(o),!0}t.exports=n,n.prototype.created=null,n.prototype.deleted=null,n.prototype.files=null,n.prototype.insertions=null,n.prototype.deletions=null,n.prototype.summary=null,n.FILE_UPDATE_REGEX=/^\s*(.+?)\s+\|\s+\d+\s*(\+*)(-*)/,n.SUMMARY_REGEX=/(\d+)\D+((\d+)\D+\(\+\))?(\D+(\d+)\D+\(-\))?/,n.ACTION_REGEX=/(create|delete) mode \d+ (.+)/,n.parse=function(t){for(var e=new n,s=t.split("\n");s.length;){var a=s.shift().trim();a&&(r(e,a)||o(e,a)||i(e,a))}return e}},function(t,e){t.exports=require("yargs")},function(t,e,n){"use strict";if("undefined"==typeof Promise)throw new ReferenceError("Promise wrappers must be enabled to use the promise API");t.exports=function(t){var e,r=n(12),o=n(51),i=Promise.resolve();try{e=o(t)}catch(t){i=Promise.reject(t)}return Object.keys(r.prototype).reduce((function(t,n){return/^_|then/.test(n)?t:(!function(t){return/^[^\)]+then\s*\)/.test(t)||/\._run\(/.test(t)}(r.prototype[n])?t[n]=e?function(t,e,n){return function(){return e[t].apply(e,arguments),n}}(n,e,t):function(){return t}:t[n]=e?function(t,e){return function(){var n=[].slice.call(arguments);if("function"==typeof n[n.length])throw new TypeError("Promise interface requires that handlers are not supplied inline, trailing function not allowed in call to "+t);return i.then((function(){return new Promise((function(r,o){n.push((function(t,e){t?o(new Error(t)):r(e)})),e[t].apply(e,n)}))}))}}(n,e):function(){return i},t)}),{})}},function(t,e){t.exports=require("npm-check-updates")},function(t,e){t.exports=require("essential-config")},function(t,e){t.exports=require("jaid-logger")},function(t,e){t.exports=require("npm-name-exists")},function(t,e){t.exports=require("validate-npm-package-name")},function(t,e){t.exports=require("handlebars")},function(t,e){t.exports=require("ensure-array")},function(t,e){t.exports=require("open")},function(t,e){t.exports=require("fetch-git-repo")},function(t,e){t.exports=require("is-git-repo-dirty")},function(t,e,n){"undefined"==typeof process||"renderer"===process.type||process.__nwjs?t.exports=n(31):t.exports=n(33)},function(t,e,n){e.log=function(...t){return"object"==typeof console&&console.log&&console.log(...t)},e.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;e.splice(1,0,n,"color: inherit");let r=0,o=0;e[0].replace(/%[a-zA-Z%]/g,t=>{"%%"!==t&&(r++,"%c"===t&&(o=r))}),e.splice(o,0,n)},e.save=function(t){try{t?e.storage.setItem("debug",t):e.storage.removeItem("debug")}catch(t){}},e.load=function(){let t;try{t=e.storage.getItem("debug")}catch(t){}!t&&"undefined"!=typeof process&&"env"in process&&(t=process.env.DEBUG);return t},e.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},e.storage=function(){try{return localStorage}catch(t){}}(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.exports=n(13)(e);const{formatters:r}=t.exports;r.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}},function(t,e){var n=1e3,r=60*n,o=60*r,i=24*o,s=7*i,a=365.25*i;function u(t,e,n,r){var o=e>=1.5*n;return Math.round(t/n)+" "+r+(o?"s":"")}t.exports=function(t,e){e=e||{};var c=typeof t;if("string"===c&&t.length>0)return function(t){if((t=String(t)).length>100)return;var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(!e)return;var u=parseFloat(e[1]);switch((e[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return u*a;case"weeks":case"week":case"w":return u*s;case"days":case"day":case"d":return u*i;case"hours":case"hour":case"hrs":case"hr":case"h":return u*o;case"minutes":case"minute":case"mins":case"min":case"m":return u*r;case"seconds":case"second":case"secs":case"sec":case"s":return u*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return u;default:return}}(t);if("number"===c&&isFinite(t))return e.long?function(t){var e=Math.abs(t);if(e>=i)return u(t,e,i,"day");if(e>=o)return u(t,e,o,"hour");if(e>=r)return u(t,e,r,"minute");if(e>=n)return u(t,e,n,"second");return t+" ms"}(t):function(t){var e=Math.abs(t);if(e>=i)return Math.round(t/i)+"d";if(e>=o)return Math.round(t/o)+"h";if(e>=r)return Math.round(t/r)+"m";if(e>=n)return Math.round(t/n)+"s";return t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},function(t,e,n){const r=n(34),o=n(35);e.init=function(t){t.inspectOpts={};const n=Object.keys(e.inspectOpts);for(let r=0;r<n.length;r++)t.inspectOpts[n[r]]=e.inspectOpts[n[r]]},e.log=function(...t){return process.stderr.write(o.format(...t)+"\n")},e.formatArgs=function(n){const{namespace:r,useColors:o}=this;if(o){const e=this.color,o="[3"+(8>e?e:"8;5;"+e),i=` ${o};1m${r} [0m`;n[0]=i+n[0].split("\n").join("\n"+i),n.push(o+"m+"+t.exports.humanize(this.diff)+"[0m")}else n[0]=function(){if(e.inspectOpts.hideDate)return"";return(new Date).toISOString()+" "}()+r+" "+n[0]},e.save=function(t){t?process.env.DEBUG=t:delete process.env.DEBUG},e.load=function(){return process.env.DEBUG},e.useColors=function(){return"colors"in e.inspectOpts?Boolean(e.inspectOpts.colors):r.isatty(process.stderr.fd)},e.colors=[6,2,3,4,5,1];try{const t=n(36);t&&(t.stderr||t).level>=2&&(e.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(t){}e.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{const n=e.substring(6).toLowerCase().replace(/_([a-z])/g,(t,e)=>e.toUpperCase());let r=process.env[e];return r=!!/^(yes|on|true|enabled)$/i.test(r)||!/^(no|off|false|disabled)$/i.test(r)&&("null"===r?null:Number(r)),t[n]=r,t},{}),t.exports=n(13)(e);const{formatters:i}=t.exports;i.o=function(t){return this.inspectOpts.colors=this.useColors,o.inspect(t,this.inspectOpts).replace(/\s*\n\s*/g," ")},i.O=function(t){return this.inspectOpts.colors=this.useColors,o.inspect(t,this.inspectOpts)}},function(t,e){t.exports=require("tty")},function(t,e){t.exports=require("util")},function(t,e,n){"use strict";const r=n(37),o=n(38),i=process.env;let s;function a(t){return function(t){return 0!==t&&{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}(function(t){if(!1===s)return 0;if(o("color=16m")||o("color=full")||o("color=truecolor"))return 3;if(o("color=256"))return 2;if(t&&!t.isTTY&&!0!==s)return 0;const e=s?1:0;if("win32"===process.platform){const t=r.release().split(".");return 8>Number(process.versions.node.split(".")[0])||10>Number(t[0])||10586>Number(t[2])?1:14931>Number(t[2])?2:3}if("CI"in i)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(t=>t in i)||"codeship"===i.CI_NAME?1:e;if("TEAMCITY_VERSION"in i)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(i.TEAMCITY_VERSION)?1:0;if("truecolor"===i.COLORTERM)return 3;if("TERM_PROGRAM"in i){const t=parseInt((i.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(i.TERM_PROGRAM){case"iTerm.app":return 3>t?2:3;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(i.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(i.TERM)?1:"COLORTERM"in i?1:(i.TERM,e)}(t))}o("no-color")||o("no-colors")||o("color=false")?s=!1:(o("color")||o("colors")||o("color=true")||o("color=always"))&&(s=!0),"FORCE_COLOR"in i&&(s=0===i.FORCE_COLOR.length||0!==parseInt(i.FORCE_COLOR,10)),t.exports={supportsColor:a,stdout:a(process.stdout),stderr:a(process.stderr)}},function(t,e){t.exports=require("os")},function(t,e,n){"use strict";t.exports=(t,e)=>{e=e||process.argv;const n=t.startsWith("-")?"":1===t.length?"-":"--",r=e.indexOf(n+t),o=e.indexOf("--");return-1!==r&&(-1===o||o>r)}},function(t,e){t.exports=function(){var t={};return t.promise=new Promise((function(e,n){t.resolve=e,t.reject=n})),t}},function(t,e){t.exports=require("fs")},function(t,e,n){t.exports={BranchDeleteSummary:n(42),BranchSummary:n(43),CommitSummary:n(44),DiffSummary:n(15),FetchSummary:n(45),FileStatusSummary:n(16),ListLogSummary:n(46),MergeSummary:n(47),MoveSummary:n(48),PullSummary:n(17),StatusSummary:n(49),TagList:n(50)}},function(t,e){function n(t,e){this.branch=t,this.hash=e,this.success=null!==e}t.exports=n,n.deleteSuccessRegex=/(\S+)\s+\(\S+\s([^\)]+)\)/,n.deleteErrorRegex=/^error[^']+'([^']+)'/,n.parse=function(t,e){var r,o=t.trim().split("\n").map((function(t){return(r=n.deleteSuccessRegex.exec(t))?new n(r[1],r[2]):(r=n.deleteErrorRegex.exec(t))?new n(r[1],null):void 0})).filter(Boolean);return e?o:o.pop()}},function(t,e){function n(){this.detached=!1,this.current="",this.all=[],this.branches={}}t.exports=n,n.prototype.push=function(t,e,n,r,o){t&&(this.detached=e,this.current=n),this.all.push(n),this.branches[n]={current:t,name:n,commit:r,label:o}},n.detachedRegex=/^(\*?\s+)\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/,n.branchRegex=/^(\*?\s+)(\S+)\s+([a-z0-9]+)\s(.*)$/,n.parse=function(t){var e=new n;return t.split("\n").forEach((function(t){var r=!0,o=n.detachedRegex.exec(t);o||(r=!1,o=n.branchRegex.exec(t)),o&&e.push("*"===o[1].charAt(0),r,o[2],o[3],o[4])})),e}},function(t,e){function n(){this.branch="",this.commit="",this.summary={changes:0,insertions:0,deletions:0},this.author=null}t.exports=n;var r=/\[([^\s]+) ([^\]]+)/,o=/\s*Author:\s(.+)/i;n.parse=function(t){var e=t.trim().split("\n"),i=new n;return function(t,e){e&&(t.branch=e[1],t.commit=e[2])}(i,r.exec(e.shift())),o.test(e[0])&&function(t,e){var n=e[1].split("<"),r=n.pop();r.indexOf("@")>0&&(t.author={email:r.substr(0,r.length-1),name:n.join("<").trim()})}(i,o.exec(e.shift())),function(t,e){t.branch&&e&&(t.summary.changes=e[1]||0,t.summary.insertions=e[2]||0,t.summary.deletions=e[3]||0)}(i,/(\d+)[^,]*(?:,\s*(\d+)[^,]*)?(?:,\s*(\d+))?/g.exec(e.shift())),i}},function(t,e,n){"use strict";function r(t){this.raw=t,this.remote=null,this.branches=[],this.tags=[]}r.parsers=[[/From (.+)$/,function(t,e){t.remote=e[0]}],[/\* \[new branch\]\s+(\S+)\s*\-> (.+)$/,function(t,e){t.branches.push({name:e[0],tracking:e[1]})}],[/\* \[new tag\]\s+(\S+)\s*\-> (.+)$/,function(t,e){t.tags.push({name:e[0],tracking:e[1]})}]],r.parse=function(t){var e=new r(t);return String(t).trim().split("\n").forEach((function(t){var n=t.trim();r.parsers.some((function(t){var r=t[0].exec(n);if(r)return t[1](e,r.slice(1)),!0}))})),e},t.exports=r},function(t,e,n){t.exports=o;var r=n(15);function o(t){this.all=t,this.latest=t.length&&t[0]||null,this.total=t.length}function i(t,e){for(var n=0;n<e.length;n++)this[e[n]]=t[n]||""}o.prototype.all=null,o.prototype.latest=null,o.prototype.total=0,i.prototype.diff=null,o.START_BOUNDARY="òòòòòò ",o.COMMIT_BOUNDARY=" òò",o.SPLITTER=" ò ",o.parse=function(t,e,n){return n=n||["hash","date","message","refs","author_name","author_email"],new o(t.trim().split(o.START_BOUNDARY).filter((function(t){return!!t.trim()})).map((function(t){var s=t.trim().split(o.COMMIT_BOUNDARY),a=new i(s[0].trim().split(e),n);return s.length>1&&s[1].trim()&&(a.diff=r.parse(s[1])),a})))}},function(t,e,n){"use strict";t.exports=i;var r=n(17);function o(t,e){this.reason=t,this.file=e}function i(){r.call(this),this.conflicts=[],this.merges=[]}o.prototype.toString=function(){return this.file+":"+this.reason},i.prototype=Object.create(r.prototype),i.prototype.result="success",i.prototype.toString=function(){return this.conflicts.length?"CONFLICTS: "+this.conflicts.join(", "):"OK"},Object.defineProperty(i.prototype,"failed",{get:function(){return this.conflicts.length>0}}),i.parsers=[{test:/^Auto-merging\s+(.+)$/,handle:function(t,e){e.merges.push(t[1])}},{test:/^CONFLICT\s+\((.+)\).+ in (.+)$/,handle:function(t,e){e.conflicts.push(new o(t[1],t[2]))}},{test:/^Automatic merge failed;\s+(.+)$/,handle:function(t,e){e.reason=t[1]}}],i.parse=function(t){let e=new i;t.trim().split("\n").forEach((function(t){for(var n=0,r=i.parsers.length;r>n;n++){let r=i.parsers[n];var o=r.test.exec(t);if(o){r.handle(o,e);break}}}));let n=r.parse(t);return n.summary.changes&&Object.assign(e,n),e}},function(t,e){function n(){this.moves=[],this.sources={}}t.exports=n,n.SUMMARY_REGEX=/^Renaming (.+) to (.+)$/,n.parse=function(t){for(var e,r=t.split("\n"),o=new n,i=0,s=r.length;s>i;i++)(e=n.SUMMARY_REGEX.exec(r[i].trim()))&&o.moves.push({from:e[1],to:e[2]});return o}},function(t,e,n){var r=n(16);function o(){this.not_added=[],this.conflicted=[],this.created=[],this.deleted=[],this.modified=[],this.renamed=[],this.files=[],this.staged=[]}function i(t){var e=t.trim().match(/(..?)(\s+)(.*)/);if(e&&e[1].trim()||(e=t.trim().match(/(..?)\s+(.*)/)),e){var n=e[1];return e[2].length>1&&(n+=" "),1===n.length&&1===e[2].length&&(n=" "+n),{raw:n,code:n.trim(),index:n.charAt(0),workingDir:n.charAt(1),handler:o.parsers[n.trim()],path:e[3]}}}t.exports=o,o.prototype.ahead=0,o.prototype.behind=0,o.prototype.current=null,o.prototype.tracking=null,o.prototype.files=null,o.prototype.isClean=function(){return 0===Object.keys(this).filter((function(t){return Array.isArray(this[t])&&this[t].length}),this).length},o.parsers={"##":function(t,e){var n;n=/ahead (\d+)/.exec(t),e.ahead=n&&+n[1]||0,n=/behind (\d+)/.exec(t),e.behind=n&&+n[1]||0,n=/^(.+?(?=(?:\.{3}|\s|$)))/.exec(t),e.current=n&&n[1],n=/\.{3}(\S*)/.exec(t),e.tracking=n&&n[1]},"??":function(t,e){e.not_added.push(t)},A:function(t,e){e.created.push(t)},AM:function(t,e){e.created.push(t)},D:function(t,e){e.deleted.push(t)},M:function(t,e,n){e.modified.push(t),"M"===n&&e.staged.push(t)},R:function(t,e){var n=/^(.+) -> (.+)$/.exec(t)||[null,t,t];e.renamed.push({from:n[1],to:n[2]})},UU:function(t,e){e.conflicted.push(t)}},o.parsers.MM=o.parsers.M,o.parse=function(t){for(var e,n,s=t.trim().split("\n"),a=new o;n=s.shift();)(e=i(n))&&(e.handler&&e.handler(e.path,a,e.index,e.workingDir),"##"!==e.code&&a.files.push(new r(e.path,e.index,e.workingDir)));return a}},function(t,e){function n(t,e){this.latest=e,this.all=t}t.exports=n,n.parse=function(t,e){var r=function(t){return"string"==typeof t&&parseInt(t.replace(/^\D+/g,""),10)||0},o=t.trim().split("\n").map((function(t){return t.trim()})).filter(Boolean);e||o.sort((function(t,e){var n=t.split("."),o=e.split(".");if(1===n.length||1===o.length)return t-e>0?1:-1;for(var i=0,s=Math.max(n.length,o.length);s>i;i++){var a=r(n[i])-r(o[i]);if(a)return a>0?1:-1}return 0}));var i=e?o[0]:o.filter((function(t){return t.indexOf(".")>=0})).pop();return new n(o,i)}},function(t,e,n){var r=n(12);t.exports=function(t){var e=n(52);if(t&&!e.exists(t,e.exists.FOLDER))throw new Error("Cannot use simple-git on a directory that does not exist.");return new r(t||process.cwd(),e.childProcess(),e.buffer())}},function(t,e,n){t.exports={buffer:function(){return n(53).Buffer},childProcess:function(){return n(54)},exists:n(14)}},function(t,e){t.exports=require("buffer")},function(t,e){t.exports=require("child_process")},function(t,e,n){"use strict";n.r(e);var r=n(0),o=n.n(r),i=n(18),s=n.n(i),a=n(4),u=n.n(a),c=n(1),p=n.n(c),l=n(19),f=n.n(l),h=n(20),m=n.n(h),d=n(3),g=n.n(d),y=n(21),v=n.n(y),C=n(22);const _=n.n(C)()("new-project-cli");_.info("new-project-cli v1.3.4");_.info;var w=_,x=n(5),b=n.n(x);const A=v()("new-project-cli",{defaults:b.a});A||w.warn("Set up default config, please review and edit this file");A.appFolder;var F=A.config||b.a,O=n(23),E=n.n(O),S=n(6),R=n.n(S),k=n(24),T=n.n(k),L=n(25),j=n.n(L),M=n(7),I=n.n(M),N=n(8),P=n.n(N),D=n(9),G=n.n(D),$=n(26),q=n.n($),U=n(27),B=n.n(U),H=n(10),Y=n.n(H),z=n(2),V=n.n(z),X=n(11),J=n.n(X),K=n(28),W=n.n(K),Z=n(29),Q=n.n(Z);const tt=async({projectName:t,description:e,hubPath:n,codePath:r,npmPath:i,skipNameCheck:s,projectsFolder:a,template:c,initialVersion:l,privateRepo:h,owner:d})=>{var g,y,v,C,_,x,b,A;if(Object(S.isEmpty)(t)&&(w.warn("Given project name is empty"),process.exit(1)),!s){var O;const e=T()(t),n=[...e.warnings||[],...e.errors||[]];if(O=n,R()(O)){w.error("Invalid npm package name %s",t);for(const t of n)w.error(t);process.exit(1)}await E()(t)&&(w.error(`Already exists: https://yarnpkg.com/package/${t}`),process.exit(1))}a=o.a.resolve(a);const k=o.a.join(a,t);await u.a.pathExists(k)&&(w.error(`${k} already exists!`),process.exit(1));const L=e=>j.a.compile(e,{noEscape:!0})({owner:d,template:c,initialVersion:l,projectName:t});w.info(`Cloning from ${`${d}/${c}`}`),await W()(`${d}/${c}`,k),w.info("Transforming file contents"),await Promise.all([u.a.writeFile(o.a.join(k,"readme.md"),L(F.readme)),Y()({files:o.a.join(k,"package.json"),from:/"version": "\d+\.\d+\.\d+"/,to:`"version": "${l}"`})]),await Y()({files:o.a.join(k,"**"),from:[new RegExp(V()(c),"g"),new RegExp(V()((g=c,G()(g))),"g"),new RegExp(V()((y=c,J()(y))),"g"),new RegExp(V()((v=c,I()(v))),"g"),new RegExp(V()((C=c,P()(C))),"g")],to:[t,(_=t,G()(_)),(x=t,J()(x)),(b=t,I()(b)),(A=t,P()(A))]}),w.info("Creating git repository");const M=f()(k);if(await M.init(),await M.add(k),await M.commit(L(F.initialCommitMessage)),await p()(i,["install"],{cwd:k,env:{NODE_ENV:"development"}}),await M.add(k),await M.commit(L(F.lockfileCreationCommitMessage)),w.info("Upgrading dependencies"),await m.a.run({jsonUpgraded:!0,packageManager:"npm",upgrade:!0,timeout:3e5,silent:!0,packageFile:o.a.join(k,"package.json"),packageFileDir:k}),w.info("Installing dependencies again"),await p()(i,["install"],{cwd:k,env:{NODE_ENV:"development"}}),await Q()(k)){await M.add(k);const t=L(F.upgradeCommitMessage);w.info(`Commit: ${t}`),await M.commit(t)}await p()(n,["create",...h?["--private"]:[],"-d",e||L(F.description),"-h",`https://github.com/${d}/${t}`],{cwd:k}),await p()(n,["push","--set-upstream","origin","master"],{cwd:k}),await p()(r,["--new-window",k]);for(const t of q()(F.openUrls))B()(L(t),{})};(async()=>{const[t,e,n]=await Promise.all([g()("code"),g()("hub"),g()("npm")]),r={"code-path":{type:"string",default:t,description:"Path to the VSCode binary"},"hub-path":{type:"string",default:e,description:"Path to Hub (GitHub wrapper) binary"},"npm-path":{type:"string",default:n,description:"Path to npm binary"},"skip-name-check":{type:"boolean",default:!1,description:"Skip checking if name is taken on npm"},"projects-folder":{type:"string",default:F.projectsFolder},template:{type:"string",default:F.template,description:"Name of the template repository"},"initial-version":{type:"string",default:"0.1.0",description:"Version field in new package.json"},"private-repo":{type:"boolean",default:!1,description:"Initialize private GitHub repository instead of public"},owner:{type:"string",default:F.githubUser,description:"Username of GitHub account"},description:{type:"string",description:"Description for GitHub"}};s.a.scriptName("new-project").version("1.3.4").command("$0 <projectName>","Creates a new project based of an existing repo",r,tt).argv})()}]);