UNPKG

new-project-cli

Version:

Opinionated command line tool that creates a new git repository for an npm package.

7 lines 43.4 kB
#!/usr/bin/env node /*! *** new-project-cli 1.4.0 *** 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 i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.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 i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));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("escape-string-regexp")},function(t,e){t.exports=require("execa")},function(t,e){t.exports=require("@absolunet/fsp")},function(t,e){t.exports=require("which-promise")},function(t,e){t.exports=require("camel-case")},function(t,e){t.exports=require("constant-case")},function(t,e){t.exports=require("has-content")},function(t,e){t.exports=require("header-case")},function(t,e){t.exports=require("pascal-case")},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,n){!function(){"use strict";var e=n(30)("simple-git"),r=n(39),i=n(13),o=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,i(t,i.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)||{},i=r.splitter||u("ListLogSummary").SPLITTER,o=["stash","list","--pretty=format:"+u("ListLogSummary").START_BOUNDARY+"%H %ai %s%d %aN %ae".replace(/\s+/g,i)+u("ListLogSummary").COMMIT_BOUNDARY];return Array.isArray(r)&&(o=o.concat(r)),this._run(o,a._responseHandler(n,"ListLogSummary",i))},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 i=a.trailingFunctionArgument(arguments),o=["clone"].concat(a.trailingArrayArgument(arguments)),s=0,u=arguments.length;u>s;s++)"string"==typeof arguments[s]&&o.push(arguments[s]);return this._run(o,(function(t,e){i&&i(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),i=[].concat(t);i.unshift("mv","-v"),i.push(e),this._run(i,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 i=a.trailingFunctionArgument(arguments),o=["commit"];return[].concat(t).forEach((function(t){o.push("-m",t)})),[].push.apply(o,[].concat("string"==typeof e||Array.isArray(e)?e:[])),a._appendOptions(o,a.trailingOptionsArgument(arguments)),this._run(o,a._responseHandler(i,"CommitSummary"))},a.prototype._getLog=function(t,e){var n=this._silentLogging?o:console[t].bind(console);return arguments.length>1&&n(e),n},a.prototype.pull=function(t,e,n,r){var i=["pull"],o=a.trailingFunctionArgument(arguments);return"string"==typeof t&&"string"==typeof e&&i.push(t,e),a._appendOptions(i,a.trailingOptionsArgument(arguments)),this._run(i,a._responseHandler(o,"PullSummary"))},a.prototype.fetch=function(t,e,n){var r=["fetch"],i=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(i,"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 i=r.some((function(t){return/^--sort=/.test(t)}));return this.tag(r,a._responseHandler(n,"TagList",[i]))},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 i=["mixed","soft","hard"].includes(t)?t:"soft";n.push("--"+i)}return this._run(n,(function(t){r&&r(t||null)}))},a.prototype.revert=function(t,e,n){var r=a.trailingFunctionArgument(arguments),i=["revert"];return a._appendOptions(i,a.trailingOptionsArgument(arguments)),"string"!=typeof t?this.exec((function(){r&&r(new TypeError("Commit must be a string"))})):(i.push(t),this._run(i,(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,i=a.trailingFunctionArgument(arguments),o=["branch"];return o.push.apply(o,a.trailingArrayArgument(arguments)),a._appendOptions(o,a.trailingOptionsArgument(arguments)),arguments.length&&i!==t||o.push("-a"),n=["-d","-D","--delete"].reduce((function(t,e){return t||o.indexOf(e)>0}),!1),0>o.indexOf("-v")&&o.splice(1,0,"-v"),r=n?a._responseHandler(i,"BranchDeleteSummary",!1):a._responseHandler(i,"BranchSummary"),this._run(o,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 i=[t,e],o=a.trailingFunctionArgument(arguments);return Array.isArray(n)&&(i=i.concat(n)),this.merge(i,o)},a.prototype.merge=function(t,e){var n=this,r=a.trailingFunctionArgument(arguments)||o,i=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(i,"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=[],i=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){i&&i(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"],i=e[0];if("string"==typeof i)throw new TypeError("Git#catFile: options must be supplied as an array of strings");return Array.isArray(i)&&r.push.apply(r,i),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,i=["show"];return"string"==typeof t?(i=i+" "+t,this._getLog("warn","Git#show: supplying options as a single string is now deprecated, switch to an array of strings")):Array.isArray(t)&&i.push.apply(i,t),this._run(i,(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 i=["clean","-"+t];return Array.isArray(e)&&(i=i.concat(e)),i.some(o)?this.exec((function(){r&&r(new TypeError("Git clean interactive mode is not supported"))})):this._run(i,(function(t,e){r&&r(t,!t&&e)}));function o(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("error","\nGit#then is deprecated after version 1.72 and will be removed in version 2.x\nTo use promises switch to importing 'simple-git/promise'."),this.exec(t)},a.prototype.log=function(t,e){var n=a.trailingFunctionArgument(arguments),r=(n===e?t:null)||{},i=r.splitter||u("ListLogSummary").SPLITTER,o=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(o),p=c.map((function(t){return o[t]})).join(i),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",[i,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),i=["rm",e];return i.push.apply(i,r),this._run(i,(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,i=t._runCache.shift(),o=i[0],s=i[1],u=i[2];e(o);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,o.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 i(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,i);else if(e&&h.length)i(n.concat(h).toString("utf-8"));else{u.concatStdErr&&[].push.apply(f,h);var o=n.concat(f);"buffer"!==u.format&&(o=o.toString(u.format||"utf-8")),r(o)}process.nextTick(t._schedule.bind(t))})),t._childProcess=m,t._outputHandler&&t._outputHandler(o[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,i){if("function"==typeof t){if(r)return t(r,null);if(!e)return t(null,i);var o=u(e),s=o.parse.apply(o,[i].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,i=Number(new Date),o=i-(n||i);e.diff=o,e.prev=n,e.curr=i,n=i,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,i)=>{if("%%"===n)return n;a++;const o=r.formatters[i];if("function"==typeof o){const r=t[a];n=o.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=i,s.extend=o,"function"==typeof r.init&&r.init(s),r.instances.push(s),s}function i(){const t=r.instances.indexOf(this);return-1!==t&&(r.instances.splice(t,1),!0)}function o(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,]+/),i=n.length;for(e=0;i>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 i(t,e,n){try{var i=!1,o=r.statSync(t);return i=(i=i||e&&o.isFile())||n&&o.isDirectory()}catch(t){if("ENOENT"===t.code)return!1;throw t}}t.exports=function(t,e){return e?i(t,1&e,2&e):i(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 i(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,o=t.trim().split("\n"),s=new n,a=o.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=o.shift();)r(e,s.files)||i(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 i=r.fromPathRegex.exec(t)||[null,t,t];this.from=i[1],this.path=i[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 i=r[2].length;i&&(t.insertions[r[1]]=i);var o=r[3].length;return o&&(t.deletions[r[1]]=o),!0}function i(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 o(t,e){var r=n.ACTION_REGEX.exec(e);if(!r)return!1;var i=r[2];return 0>t.files.indexOf(i)&&t.files.push(i),("create"===r[1]?t.created:t.deleted).push(i),!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)||i(e,a)||o(e,a))}return e}},function(t,e){t.exports=require("ensure-array")},function(t,e){t.exports=require("fetch-git-repo")},function(t,e){t.exports=require("handlebars")},function(t,e){t.exports=require("is-git-repo-dirty")},function(t,e){t.exports=require("npm-check-updates")},function(t,e){t.exports=require("npm-name-exists")},function(t,e){t.exports=require("open")},function(t,e){t.exports=require("replace-in-file")},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(11),i=n(51),o=Promise.resolve();try{e=i(t)}catch(t){o=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 o.then((function(){return new Promise((function(r,i){n.push((function(t,e){t?i(new Error(t)):r(e)})),e[t].apply(e,n)}))}))}}(n,e):function(){return o},t)}),{})}},function(t,e){t.exports=require("validate-npm-package-name")},function(t,e){t.exports=require("yargs")},function(t,e){t.exports=require("essential-config")},function(t,e){t.exports=require("jaid-logger")},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,i=0;e[0].replace(/%[a-zA-Z%]/g,t=>{"%%"!==t&&(r++,"%c"===t&&(i=r))}),e.splice(i,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(12)(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,i=60*r,o=24*i,s=7*o,a=365.25*o;function u(t,e,n,r){var i=e>=1.5*n;return Math.round(t/n)+" "+r+(i?"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*o;case"hours":case"hour":case"hrs":case"hr":case"h":return u*i;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>=o)return u(t,e,o,"day");if(e>=i)return u(t,e,i,"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>=o)return Math.round(t/o)+"d";if(e>=i)return Math.round(t/i)+"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),i=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(i.format(...t)+"\n")},e.formatArgs=function(n){const{namespace:r,useColors:i}=this;if(i){const e=this.color,i="[3"+(8>e?e:"8;5;"+e),o=` ${i};1m${r} `;n[0]=o+n[0].split("\n").join("\n"+o),n.push(i+"m+"+t.exports.humanize(this.diff)+"")}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(12)(e);const{formatters:o}=t.exports;o.o=function(t){return this.inspectOpts.colors=this.useColors,i.inspect(t,this.inspectOpts).replace(/\s*\n\s*/g," ")},o.O=function(t){return this.inspectOpts.colors=this.useColors,i.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),i=n(38),o=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(i("color=16m")||i("color=full")||i("color=truecolor"))return 3;if(i("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 o)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(t=>t in o)||"codeship"===o.CI_NAME?1:e;if("TEAMCITY_VERSION"in o)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(o.TEAMCITY_VERSION)?1:0;if("truecolor"===o.COLORTERM)return 3;if("TERM_PROGRAM"in o){const t=parseInt((o.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(o.TERM_PROGRAM){case"iTerm.app":return 3>t?2:3;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(o.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(o.TERM)?1:"COLORTERM"in o?1:(o.TERM,e)}(t))}i("no-color")||i("no-colors")||i("color=false")?s=!1:(i("color")||i("colors")||i("color=true")||i("color=always"))&&(s=!0),"FORCE_COLOR"in o&&(s=0===o.FORCE_COLOR.length||0!==parseInt(o.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),i=e.indexOf("--");return-1!==r&&(-1===i||i>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(14),FetchSummary:n(45),FileStatusSummary:n(15),ListLogSummary:n(46),MergeSummary:n(47),MoveSummary:n(48),PullSummary:n(16),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,i=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?i:i.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,i){t&&(this.detached=e,this.current=n),this.all.push(n),this.branches[n]={current:t,name:n,commit:r,label:i}},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,i=n.detachedRegex.exec(t);i||(r=!1,i=n.branchRegex.exec(t)),i&&e.push("*"===i[1].charAt(0),r,i[2],i[3],i[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]+) ([^\]]+)/,i=/\s*Author:\s(.+)/i;n.parse=function(t){var e=t.trim().split("\n"),o=new n;return function(t,e){e&&(t.branch=e[1],t.commit=e[2])}(o,r.exec(e.shift())),i.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()})}(o,i.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)}(o,/(\d+)[^,]*(?:,\s*(\d+)[^,]*)?(?:,\s*(\d+))?/g.exec(e.shift())),o}},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=i;var r=n(14);function i(t){this.all=t,this.latest=t.length&&t[0]||null,this.total=t.length}function o(t,e){for(var n=0;n<e.length;n++)this[e[n]]=t[n]||""}i.prototype.all=null,i.prototype.latest=null,i.prototype.total=0,o.prototype.diff=null,i.START_BOUNDARY="òòòòòò ",i.COMMIT_BOUNDARY=" òò",i.SPLITTER=" ò ",i.parse=function(t,e,n){return n=n||["hash","date","message","refs","author_name","author_email"],new i(t.trim().split(i.START_BOUNDARY).filter((function(t){return!!t.trim()})).map((function(t){var s=t.trim().split(i.COMMIT_BOUNDARY),a=new o(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=o;var r=n(16);function i(t,e){this.reason=t,this.file=e}function o(){r.call(this),this.conflicts=[],this.merges=[]}i.prototype.toString=function(){return this.file+":"+this.reason},o.prototype=Object.create(r.prototype),o.prototype.result="success",o.prototype.toString=function(){return this.conflicts.length?"CONFLICTS: "+this.conflicts.join(", "):"OK"},Object.defineProperty(o.prototype,"failed",{get:function(){return this.conflicts.length>0}}),o.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 i(t[1],t[2]))}},{test:/^Automatic merge failed;\s+(.+)$/,handle:function(t,e){e.reason=t[1]}}],o.parse=function(t){let e=new o;t.trim().split("\n").forEach((function(t){for(var n=0,r=o.parsers.length;r>n;n++){let r=o.parsers[n];var i=r.test.exec(t);if(i){r.handle(i,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"),i=new n,o=0,s=r.length;s>o;o++)(e=n.SUMMARY_REGEX.exec(r[o].trim()))&&i.moves.push({from:e[1],to:e[2]});return i}},function(t,e,n){var r=n(15);function i(){this.not_added=[],this.conflicted=[],this.created=[],this.deleted=[],this.modified=[],this.renamed=[],this.files=[],this.staged=[]}function o(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:i.parsers[n.trim()],path:e[3]}}}t.exports=i,i.prototype.ahead=0,i.prototype.behind=0,i.prototype.current=null,i.prototype.tracking=null,i.prototype.files=null,i.prototype.isClean=function(){return 0===Object.keys(this).filter((function(t){return Array.isArray(this[t])&&this[t].length}),this).length},i.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)}},i.parsers.MM=i.parsers.M,i.parse=function(t){for(var e,n,s=t.trim().split("\n"),a=new i;n=s.shift();)(e=o(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},i=t.trim().split("\n").map((function(t){return t.trim()})).filter(Boolean);e||i.sort((function(t,e){var n=t.split("."),i=e.split(".");if(1===n.length||1===i.length)return t-e>0?1:-1;for(var o=0,s=Math.max(n.length,i.length);s>o;o++){var a=r(n[o])-r(i[o]);if(a)return a>0?1:-1}return 0}));var o=e?i[0]:i.filter((function(t){return t.indexOf(".")>=0})).pop();return new n(i,o)}},function(t,e,n){var r=n(11);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(13)}},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(3),i=n.n(r),o=n(5),s=n.n(o),a=n(6),u=n.n(a),c=n(17),p=n.n(c),l=n(1),f=n.n(l),h=n(2),m=n.n(h),d=n(18),g=n.n(d),y=n(19),v=n.n(y),C=n(7),w=n.n(C),_=n(8),x=n.n(_),b=n(20),A=n.n(b),F=n(21),O=n.n(F),E=n(22),S=n.n(E),R=n(23),k=n.n(R),T=n(9),L=n.n(T),j=n(0),M=n.n(j),I=n(24),N=n.n(I),P=n(25),D=n.n(P),G=n(26),$=n.n(G),q=n(4),U=n.n(q),B=n(27),H=n.n(B),Y=n(28),z=n.n(Y),V=n(29);const X=n.n(V)()("new-project-cli");X.info("new-project-cli v1.4.0");X.info;var J=X,K=n(10),W=n.n(K);const Z=z()("new-project-cli",{defaults:W.a});Z||J.warn("Set up default config, please review and edit this file");Z.appFolder;var Q=Z.config||W.a;const tt=async({projectName:t,description:e,hubPath:n,codePath:r,npmPath:o,skipNameCheck:a,projectsFolder:c,template:l,initialVersion:h,privateRepo:d,owner:y})=>{var _,b,F,E,R,T,j,I;if(Object(C.isEmpty)(t)&&(J.warn("Given project name is empty"),process.exit(1)),!a){var P;const e=$()(t),n=[...e.warnings||[],...e.errors||[]];if(P=n,w()(P)){J.error("Invalid npm package name %s",t);for(const t of n)J.error(t);process.exit(1)}await S()(t)&&(J.error(`Already exists: https://yarnpkg.com/package/${t}`),process.exit(1))}c=M.a.resolve(c);const G=M.a.join(c,t);await i.a.pathExists(G)&&(J.error(`${G} already exists!`),process.exit(1));const q=e=>v.a.compile(e,{noEscape:!0})({owner:y,template:l,initialVersion:h,projectName:t}),U=e||q(Q.description);J.info(`Cloning from ${`${y}/${l}`}`),await g()(`${y}/${l}`,G),J.info("Transforming file contents"),await i.a.writeFile(M.a.join(G,"readme.md"),q(Q.readme));const B=M.a.join(G,"package.json"),H=await i.a.readJson(B);H.description=U,H.version=h,await i.a.writeJson(B,H),await N()({files:M.a.join(G,"**"),from:[new RegExp(f()(l),"g"),new RegExp(f()((_=l,s()(_))),"g"),new RegExp(f()((b=l,L()(b))),"g"),new RegExp(f()((F=l,u()(F))),"g"),new RegExp(f()((E=l,x()(E))),"g")],to:[t,(R=t,s()(R)),(T=t,L()(T)),(j=t,u()(j)),(I=t,x()(I))]}),J.info("Creating git repository");const Y=D()(G);if(await Y.init(),await Y.add(G),await Y.commit(q(Q.initialCommitMessage)),await m()(o,["install"],{cwd:G,env:{NODE_ENV:"development"}}),await Y.add(G),await Y.commit(q(Q.lockfileCreationCommitMessage)),J.info("Upgrading dependencies"),await O.a.run({jsonUpgraded:!0,packageManager:"npm",upgrade:!0,timeout:3e5,silent:!0,packageFile:M.a.join(G,"package.json"),packageFileDir:G}),J.info("Installing dependencies again"),await m()(o,["install"],{cwd:G,env:{NODE_ENV:"development"}}),await A()(G)){await Y.add(G);const t=q(Q.upgradeCommitMessage);J.info(`Commit: ${t}`),await Y.commit(t)}await m()(n,["create",...d?["--private"]:[],"-d",U,"-h",`https://github.com/${y}/${t}`],{cwd:G}),await m()(n,["push","--set-upstream","origin","master"],{cwd:G}),await m()(r,["--new-window",G]);for(const t of p()(Q.openUrls))k()(q(t),{})};(async()=>{const[t,e,n]=await Promise.all([U()("code"),U()("hub"),U()("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:Q.projectsFolder},template:{type:"string",default:Q.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:Q.githubUser,description:"Username of GitHub account"},description:{type:"string",description:"Description for GitHub"}};H.a.scriptName("new-project").version("1.4.0").command("$0 <projectName>","Creates a new project based of an existing repo",r,tt).argv})()}]);