@teams-max/mwsp 1.0.2 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/mwsp.js +2 -31
- package/es/cli/build.d.ts +0 -1
- package/es/cli/build.js +69 -61
- package/es/cli/cli.js +4 -12
- package/es/cli/start.d.ts +0 -1
- package/es/cli/start.js +48 -26
- package/es/index.d.ts +2 -0
- package/es/index.js +3 -1
- package/es/utils/chalk/LICENSE +9 -0
- package/es/utils/chalk/index.d.ts +416 -0
- package/es/utils/chalk/index.js +1719 -0
- package/es/utils/chalk/package.json +6 -0
- package/es/{cli/update.js → utils/changelog.js} +41 -34
- package/es/utils/cross-spawn/package.json +7 -0
- package/es/{internal → utils}/datetimeFormat.js +1 -3
- package/es/utils/defineConfig.js +20 -0
- package/es/{internal → utils}/exec.js +3 -2
- package/{lib/internal → es/utils}/execa/index.d.ts +41 -11
- package/es/utils/execa/package.json +11 -0
- package/es/utils/getPackages.js +9 -0
- package/es/{cli/dev.js → utils/git.js} +88 -36
- package/es/{internal/utils.js → utils/index.js} +270 -70
- package/es/utils/isNextVersion.js +3 -0
- package/{lib/internal → es/utils}/merge-stream/index.d.ts +3 -1
- package/es/utils/merge-stream/package.json +7 -0
- package/es/utils/parseDoc.js +33 -0
- package/es/utils/yargs-parser/index.d.ts +114 -0
- package/es/utils/yargs-parser/index.js +919 -0
- package/es/utils/yargs-parser/package.json +7 -0
- package/lib/cli/build.d.ts +0 -1
- package/lib/cli/build.js +54 -50
- package/lib/cli/cli.js +0 -8
- package/lib/cli/start.d.ts +0 -1
- package/lib/cli/start.js +25 -30
- package/lib/index.d.ts +2 -0
- package/lib/index.js +3 -0
- package/lib/utils/chalk/LICENSE +9 -0
- package/lib/utils/chalk/index.d.ts +416 -0
- package/lib/utils/chalk/index.js +1538 -0
- package/lib/utils/chalk/package.json +6 -0
- package/lib/utils/changelog.js +21 -0
- package/lib/{internal → utils}/cross-spawn/index.js +9 -3
- package/lib/utils/cross-spawn/package.json +7 -0
- package/lib/{internal → utils}/datetimeFormat.js +14 -30
- package/lib/utils/defineConfig.js +26 -0
- package/lib/utils/exec.js +23 -0
- package/{es/internal → lib/utils}/execa/index.d.ts +41 -11
- package/lib/{internal → utils}/execa/index.js +76 -18
- package/lib/utils/execa/package.json +11 -0
- package/lib/utils/getPackages.js +8 -0
- package/lib/utils/git.js +31 -0
- package/lib/utils/index.js +183 -0
- package/lib/utils/isNextVersion.js +4 -0
- package/{es/internal → lib/utils}/merge-stream/index.d.ts +3 -1
- package/lib/{internal → utils}/merge-stream/index.js +1 -1
- package/lib/utils/merge-stream/package.json +7 -0
- package/lib/utils/parseDoc.js +30 -0
- package/lib/utils/yargs-parser/index.d.ts +114 -0
- package/lib/utils/yargs-parser/index.js +919 -0
- package/lib/utils/yargs-parser/package.json +7 -0
- package/package.json +7 -14
- package/es/cli/dev.d.ts +0 -1
- package/es/cli/update.d.ts +0 -2
- package/es/internal/buildNotify.d.ts +0 -10
- package/es/internal/buildNotify.js +0 -123
- package/es/internal/cross-spawn/package.json +0 -1
- package/es/internal/datetimeFormat.d.ts +0 -9
- package/es/internal/exec.d.ts +0 -1
- package/es/internal/execa/package.json +0 -1
- package/es/internal/merge-stream/package.json +0 -1
- package/es/internal/utils.d.ts +0 -14
- package/lib/cli/dev.d.ts +0 -1
- package/lib/cli/dev.js +0 -62
- package/lib/cli/update.d.ts +0 -2
- package/lib/cli/update.js +0 -50
- package/lib/internal/buildNotify.d.ts +0 -10
- package/lib/internal/buildNotify.js +0 -112
- package/lib/internal/cross-spawn/package.json +0 -1
- package/lib/internal/datetimeFormat.d.ts +0 -9
- package/lib/internal/exec.d.ts +0 -1
- package/lib/internal/exec.js +0 -60
- package/lib/internal/execa/package.json +0 -1
- package/lib/internal/merge-stream/package.json +0 -1
- package/lib/internal/utils.d.ts +0 -14
- package/lib/internal/utils.js +0 -100
- /package/es/{internal → utils}/cross-spawn/LICENSE +0 -0
- /package/es/{internal → utils}/cross-spawn/index.d.ts +0 -0
- /package/es/{internal → utils}/cross-spawn/index.js +0 -0
- /package/es/{internal → utils}/execa/LICENSE +0 -0
- /package/es/{internal → utils}/execa/index.js +0 -0
- /package/es/{internal → utils}/merge-stream/LICENSE +0 -0
- /package/es/{internal → utils}/merge-stream/index.js +0 -0
- /package/lib/{internal → utils}/cross-spawn/LICENSE +0 -0
- /package/lib/{internal → utils}/cross-spawn/index.d.ts +0 -0
- /package/lib/{internal → utils}/execa/LICENSE +0 -0
- /package/lib/{internal → utils}/merge-stream/LICENSE +0 -0
|
@@ -1,38 +1,45 @@
|
|
|
1
1
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
-
var _templateObject, _templateObject2;
|
|
3
2
|
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
4
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
5
3
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
6
4
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
5
|
+
var _require = require('escape-goat'),
|
|
6
|
+
htmlEscape = _require.htmlEscape;
|
|
7
|
+
var git = require("./git");
|
|
8
|
+
exports.getChangelog = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
9
|
+
var repoUrl, latest, log, commits;
|
|
10
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
11
|
+
while (1) switch (_context.prev = _context.next) {
|
|
12
|
+
case 0:
|
|
13
|
+
repoUrl = 'https://v.src.corp.qihoo.net/it_informatization/pro-teams';
|
|
14
|
+
_context.next = 3;
|
|
15
|
+
return git.latestTagOrFirstCommit();
|
|
16
|
+
case 3:
|
|
17
|
+
latest = _context.sent;
|
|
18
|
+
_context.next = 6;
|
|
19
|
+
return git.commitLogFromRevision(latest);
|
|
20
|
+
case 6:
|
|
21
|
+
log = _context.sent;
|
|
22
|
+
if (log) {
|
|
23
|
+
_context.next = 9;
|
|
24
|
+
break;
|
|
25
|
+
}
|
|
26
|
+
throw new Error("get changelog failed, no new commits was found.");
|
|
27
|
+
case 9:
|
|
28
|
+
commits = log.split('\n').map(function (commit) {
|
|
29
|
+
var splitIndex = commit.lastIndexOf(' ');
|
|
30
|
+
return {
|
|
31
|
+
message: commit.slice(0, splitIndex),
|
|
32
|
+
id: commit.slice(splitIndex + 1)
|
|
33
|
+
};
|
|
34
|
+
});
|
|
35
|
+
return _context.abrupt("return", function (nextTag) {
|
|
36
|
+
return commits.map(function (commit) {
|
|
37
|
+
return "- ".concat(htmlEscape(commit.message), " ").concat(commit.id);
|
|
38
|
+
}).join('\n') + "\n\n".concat(repoUrl, "/compare/").concat(latest, "...").concat(nextTag);
|
|
39
|
+
});
|
|
40
|
+
case 11:
|
|
41
|
+
case "end":
|
|
42
|
+
return _context.stop();
|
|
43
|
+
}
|
|
44
|
+
}, _callee);
|
|
45
|
+
}));
|
|
@@ -82,15 +82,13 @@ function datetimeFormat(value, format, isCoerce) {
|
|
|
82
82
|
6: '六'
|
|
83
83
|
};
|
|
84
84
|
if (/(E+)/.test(format)) {
|
|
85
|
-
// @ts-ignore
|
|
86
85
|
format = format.replace(RegExp.$1, (RegExp.$1.length > 1 ? RegExp.$1.length > 2 ? '星期' : '周' : '') + week[date.getDay() + '']);
|
|
87
86
|
}
|
|
88
87
|
for (var k in o) {
|
|
89
88
|
if (new RegExp('(' + k + ')').test(format)) {
|
|
90
|
-
// @ts-ignore
|
|
91
89
|
format = format.replace(RegExp.$1, RegExp.$1.length === 1 ? o[k] : ('00' + o[k]).substr(('' + o[k]).length));
|
|
92
90
|
}
|
|
93
91
|
}
|
|
94
92
|
return format;
|
|
95
93
|
}
|
|
96
|
-
|
|
94
|
+
module.exports = datetimeFormat;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
var path = require('path');
|
|
2
|
+
var _require = require("./index"),
|
|
3
|
+
logStep = _require.logStep,
|
|
4
|
+
printErrorAndExit = _require.printErrorAndExit;
|
|
5
|
+
function defineConfig(config) {
|
|
6
|
+
if (!process.env.ASG_DIR) {
|
|
7
|
+
logStep('The Asgard directory does not exist, using default config...');
|
|
8
|
+
return config;
|
|
9
|
+
}
|
|
10
|
+
var iConfigFromPlugins = null;
|
|
11
|
+
try {
|
|
12
|
+
iConfigFromPlugins = require(path.join(process.env.ASG_DIR, 'base', 'pluginConfig.js'));
|
|
13
|
+
} catch (error) {
|
|
14
|
+
printErrorAndExit('The Asgard directory does not exist.', "Reason: ".concat(error.message));
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
logStep('The Asgard directory exists, using config from plugins...');
|
|
18
|
+
return iConfigFromPlugins(config);
|
|
19
|
+
}
|
|
20
|
+
module.exports = defineConfig;
|
|
@@ -4,8 +4,9 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
4
4
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
5
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
6
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
var _require = require('child_process'),
|
|
8
|
+
spawn = _require.spawn;
|
|
9
|
+
module.exports = function exec(command, args, opts) {
|
|
9
10
|
return new Promise(function (resolve, reject) {
|
|
10
11
|
var child = spawn(command, args, _objectSpread({
|
|
11
12
|
shell: true,
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
/// <reference types="node"/>
|
|
2
2
|
import { ChildProcess } from 'child_process';
|
|
3
|
-
import {
|
|
3
|
+
import { Readable as ReadableStream, Stream } from 'stream';
|
|
4
4
|
|
|
5
5
|
declare namespace execa {
|
|
6
|
-
type StdioOption =
|
|
6
|
+
type StdioOption =
|
|
7
|
+
| 'pipe'
|
|
8
|
+
| 'ipc'
|
|
9
|
+
| 'ignore'
|
|
10
|
+
| 'inherit'
|
|
11
|
+
| Stream
|
|
12
|
+
| number
|
|
13
|
+
| undefined;
|
|
7
14
|
|
|
8
15
|
interface CommonOptions<EncodingType> {
|
|
9
16
|
/**
|
|
@@ -220,7 +227,8 @@ declare namespace execa {
|
|
|
220
227
|
readonly input?: string | Buffer | ReadableStream;
|
|
221
228
|
}
|
|
222
229
|
|
|
223
|
-
interface SyncOptions<EncodingType = string>
|
|
230
|
+
interface SyncOptions<EncodingType = string>
|
|
231
|
+
extends CommonOptions<EncodingType> {
|
|
224
232
|
/**
|
|
225
233
|
Write some input to the `stdin` of your binary.
|
|
226
234
|
*/
|
|
@@ -347,7 +355,8 @@ declare namespace execa {
|
|
|
347
355
|
originalMessage?: string;
|
|
348
356
|
}
|
|
349
357
|
|
|
350
|
-
interface ExecaError<StdoutErrorType = string>
|
|
358
|
+
interface ExecaError<StdoutErrorType = string>
|
|
359
|
+
extends ExecaSyncError<StdoutErrorType> {
|
|
351
360
|
/**
|
|
352
361
|
The output of the process with `stdout` and `stderr` interleaved.
|
|
353
362
|
|
|
@@ -376,7 +385,9 @@ declare namespace execa {
|
|
|
376
385
|
|
|
377
386
|
interface ExecaChildPromise<StdoutErrorType> {
|
|
378
387
|
catch<ResultType = never>(
|
|
379
|
-
onRejected?: (
|
|
388
|
+
onRejected?: (
|
|
389
|
+
reason: ExecaError<StdoutErrorType>,
|
|
390
|
+
) => ResultType | PromiseLike<ResultType>,
|
|
380
391
|
): Promise<ExecaReturnValue<StdoutErrorType> | ResultType>;
|
|
381
392
|
|
|
382
393
|
/**
|
|
@@ -438,14 +449,21 @@ declare const execa: {
|
|
|
438
449
|
execa('echo', ['unicorns']).stdout.pipe(process.stdout);
|
|
439
450
|
```
|
|
440
451
|
*/
|
|
441
|
-
(
|
|
452
|
+
(
|
|
453
|
+
file: string,
|
|
454
|
+
arguments?: readonly string[],
|
|
455
|
+
options?: execa.Options,
|
|
456
|
+
): execa.ExecaChildProcess;
|
|
442
457
|
(
|
|
443
458
|
file: string,
|
|
444
459
|
arguments?: readonly string[],
|
|
445
460
|
options?: execa.Options<null>,
|
|
446
461
|
): execa.ExecaChildProcess<Buffer>;
|
|
447
462
|
(file: string, options?: execa.Options): execa.ExecaChildProcess;
|
|
448
|
-
(
|
|
463
|
+
(
|
|
464
|
+
file: string,
|
|
465
|
+
options?: execa.Options<null>,
|
|
466
|
+
): execa.ExecaChildProcess<Buffer>;
|
|
449
467
|
|
|
450
468
|
/**
|
|
451
469
|
Execute a file synchronously.
|
|
@@ -467,7 +485,10 @@ declare const execa: {
|
|
|
467
485
|
options?: execa.SyncOptions<null>,
|
|
468
486
|
): execa.ExecaSyncReturnValue<Buffer>;
|
|
469
487
|
sync(file: string, options?: execa.SyncOptions): execa.ExecaSyncReturnValue;
|
|
470
|
-
sync(
|
|
488
|
+
sync(
|
|
489
|
+
file: string,
|
|
490
|
+
options?: execa.SyncOptions<null>,
|
|
491
|
+
): execa.ExecaSyncReturnValue<Buffer>;
|
|
471
492
|
|
|
472
493
|
/**
|
|
473
494
|
Same as `execa()` except both file and arguments are specified in a single `command` string. For example, `execa('echo', ['unicorns'])` is the same as `execa.command('echo unicorns')`.
|
|
@@ -491,7 +512,10 @@ declare const execa: {
|
|
|
491
512
|
```
|
|
492
513
|
*/
|
|
493
514
|
command(command: string, options?: execa.Options): execa.ExecaChildProcess;
|
|
494
|
-
command(
|
|
515
|
+
command(
|
|
516
|
+
command: string,
|
|
517
|
+
options?: execa.Options<null>,
|
|
518
|
+
): execa.ExecaChildProcess<Buffer>;
|
|
495
519
|
|
|
496
520
|
/**
|
|
497
521
|
Same as `execa.command()` but synchronous.
|
|
@@ -499,7 +523,10 @@ declare const execa: {
|
|
|
499
523
|
@param command - The program/script to execute and its arguments.
|
|
500
524
|
@returns A result `Object` with `stdout` and `stderr` properties.
|
|
501
525
|
*/
|
|
502
|
-
commandSync(
|
|
526
|
+
commandSync(
|
|
527
|
+
command: string,
|
|
528
|
+
options?: execa.SyncOptions,
|
|
529
|
+
): execa.ExecaSyncReturnValue;
|
|
503
530
|
commandSync(
|
|
504
531
|
command: string,
|
|
505
532
|
options?: execa.SyncOptions<null>,
|
|
@@ -528,7 +555,10 @@ declare const execa: {
|
|
|
528
555
|
options?: execa.Options<null>,
|
|
529
556
|
): execa.ExecaChildProcess<Buffer>;
|
|
530
557
|
node(scriptPath: string, options?: execa.Options): execa.ExecaChildProcess;
|
|
531
|
-
node(
|
|
558
|
+
node(
|
|
559
|
+
scriptPath: string,
|
|
560
|
+
options?: execa.Options<null>,
|
|
561
|
+
): execa.ExecaChildProcess<Buffer>;
|
|
532
562
|
};
|
|
533
563
|
|
|
534
564
|
export = execa;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
var _require = require('fs'),
|
|
2
|
+
readdirSync = _require.readdirSync;
|
|
3
|
+
var _require2 = require('path'),
|
|
4
|
+
join = _require2.join;
|
|
5
|
+
module.exports = function getPackages() {
|
|
6
|
+
return readdirSync(join(__dirname, '../../packages')).filter(function (pkg) {
|
|
7
|
+
return pkg.charAt(0) !== '.';
|
|
8
|
+
});
|
|
9
|
+
};
|
|
@@ -2,43 +2,95 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
2
2
|
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
3
3
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
4
4
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
5
|
+
var _require = require("./index"),
|
|
6
|
+
execa = _require.execa,
|
|
7
|
+
chalk = _require.chalk,
|
|
8
|
+
yParser = _require.yParser;
|
|
9
|
+
exports.latestTag = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
10
|
+
var _yield$execa, stdout;
|
|
11
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
12
|
+
while (1) switch (_context.prev = _context.next) {
|
|
13
|
+
case 0:
|
|
14
|
+
_context.next = 2;
|
|
15
|
+
return execa('git', ['describe', '--abbrev=0', '--tags']);
|
|
16
|
+
case 2:
|
|
17
|
+
_yield$execa = _context.sent;
|
|
18
|
+
stdout = _yield$execa.stdout;
|
|
19
|
+
return _context.abrupt("return", stdout);
|
|
20
|
+
case 5:
|
|
21
|
+
case "end":
|
|
22
|
+
return _context.stop();
|
|
23
|
+
}
|
|
24
|
+
}, _callee);
|
|
25
|
+
}));
|
|
26
|
+
var firstCommit = /*#__PURE__*/function () {
|
|
27
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
28
|
+
var _yield$execa2, stdout;
|
|
29
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
30
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
19
31
|
case 0:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
pnpmVersion = execa.sync('pnpm', ['--version']).stdout;
|
|
28
|
-
assert(!pnpmVersion.includes('not found'), 'pnpm: command not found please use npm install -g pnpm');
|
|
29
|
-
logger.info("MAX_APP_ENV: ".concat(env.MAX_APP_ENV, " MAX_APP_KEY: ").concat(env.MAX_APP_KEY, " MAX_APP_TYPE: ").concat(env.MAX_APP_TYPE));
|
|
30
|
-
logger.event('max dev');
|
|
31
|
-
_context.next = 13;
|
|
32
|
-
return exec('max', ['dev'], {
|
|
33
|
-
env: env
|
|
34
|
-
});
|
|
35
|
-
case 13:
|
|
36
|
-
logger.info("Success MAX_APP_ENV: ".concat(env.MAX_APP_ENV, " MAX_APP_KEY: ").concat(env.MAX_APP_KEY, " MAX_APP_TYPE: ").concat(env.MAX_APP_TYPE));
|
|
37
|
-
case 14:
|
|
32
|
+
_context2.next = 2;
|
|
33
|
+
return execa('git', ['rev-list', '--max-parents=0', 'HEAD']);
|
|
34
|
+
case 2:
|
|
35
|
+
_yield$execa2 = _context2.sent;
|
|
36
|
+
stdout = _yield$execa2.stdout;
|
|
37
|
+
return _context2.abrupt("return", stdout);
|
|
38
|
+
case 5:
|
|
38
39
|
case "end":
|
|
39
|
-
return
|
|
40
|
+
return _context2.stop();
|
|
40
41
|
}
|
|
41
|
-
},
|
|
42
|
+
}, _callee2);
|
|
42
43
|
}));
|
|
43
|
-
return
|
|
44
|
-
|
|
44
|
+
return function firstCommit() {
|
|
45
|
+
return _ref2.apply(this, arguments);
|
|
46
|
+
};
|
|
47
|
+
}();
|
|
48
|
+
exports.latestTagOrFirstCommit = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
49
|
+
var latest;
|
|
50
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
51
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
52
|
+
case 0:
|
|
53
|
+
_context3.prev = 0;
|
|
54
|
+
_context3.next = 3;
|
|
55
|
+
return exports.latestTag();
|
|
56
|
+
case 3:
|
|
57
|
+
latest = _context3.sent;
|
|
58
|
+
_context3.next = 11;
|
|
59
|
+
break;
|
|
60
|
+
case 6:
|
|
61
|
+
_context3.prev = 6;
|
|
62
|
+
_context3.t0 = _context3["catch"](0);
|
|
63
|
+
_context3.next = 10;
|
|
64
|
+
return firstCommit();
|
|
65
|
+
case 10:
|
|
66
|
+
latest = _context3.sent;
|
|
67
|
+
case 11:
|
|
68
|
+
return _context3.abrupt("return", latest);
|
|
69
|
+
case 12:
|
|
70
|
+
case "end":
|
|
71
|
+
return _context3.stop();
|
|
72
|
+
}
|
|
73
|
+
}, _callee3, null, [[0, 6]]);
|
|
74
|
+
}));
|
|
75
|
+
exports.commitLogFromRevision = /*#__PURE__*/function () {
|
|
76
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(revision) {
|
|
77
|
+
var _yield$execa3, stdout;
|
|
78
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
79
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
80
|
+
case 0:
|
|
81
|
+
_context4.next = 2;
|
|
82
|
+
return execa('git', ['log', '--format=%s %h', "".concat(revision, "..HEAD")]);
|
|
83
|
+
case 2:
|
|
84
|
+
_yield$execa3 = _context4.sent;
|
|
85
|
+
stdout = _yield$execa3.stdout;
|
|
86
|
+
return _context4.abrupt("return", stdout);
|
|
87
|
+
case 5:
|
|
88
|
+
case "end":
|
|
89
|
+
return _context4.stop();
|
|
90
|
+
}
|
|
91
|
+
}, _callee4);
|
|
92
|
+
}));
|
|
93
|
+
return function (_x) {
|
|
94
|
+
return _ref4.apply(this, arguments);
|
|
95
|
+
};
|
|
96
|
+
}();
|