@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.
Files changed (96) hide show
  1. package/bin/mwsp.js +2 -31
  2. package/es/cli/build.d.ts +0 -1
  3. package/es/cli/build.js +69 -61
  4. package/es/cli/cli.js +4 -12
  5. package/es/cli/start.d.ts +0 -1
  6. package/es/cli/start.js +48 -26
  7. package/es/index.d.ts +2 -0
  8. package/es/index.js +3 -1
  9. package/es/utils/chalk/LICENSE +9 -0
  10. package/es/utils/chalk/index.d.ts +416 -0
  11. package/es/utils/chalk/index.js +1719 -0
  12. package/es/utils/chalk/package.json +6 -0
  13. package/es/{cli/update.js → utils/changelog.js} +41 -34
  14. package/es/utils/cross-spawn/package.json +7 -0
  15. package/es/{internal → utils}/datetimeFormat.js +1 -3
  16. package/es/utils/defineConfig.js +20 -0
  17. package/es/{internal → utils}/exec.js +3 -2
  18. package/{lib/internal → es/utils}/execa/index.d.ts +41 -11
  19. package/es/utils/execa/package.json +11 -0
  20. package/es/utils/getPackages.js +9 -0
  21. package/es/{cli/dev.js → utils/git.js} +88 -36
  22. package/es/{internal/utils.js → utils/index.js} +270 -70
  23. package/es/utils/isNextVersion.js +3 -0
  24. package/{lib/internal → es/utils}/merge-stream/index.d.ts +3 -1
  25. package/es/utils/merge-stream/package.json +7 -0
  26. package/es/utils/parseDoc.js +33 -0
  27. package/es/utils/yargs-parser/index.d.ts +114 -0
  28. package/es/utils/yargs-parser/index.js +919 -0
  29. package/es/utils/yargs-parser/package.json +7 -0
  30. package/lib/cli/build.d.ts +0 -1
  31. package/lib/cli/build.js +54 -50
  32. package/lib/cli/cli.js +0 -8
  33. package/lib/cli/start.d.ts +0 -1
  34. package/lib/cli/start.js +25 -30
  35. package/lib/index.d.ts +2 -0
  36. package/lib/index.js +3 -0
  37. package/lib/utils/chalk/LICENSE +9 -0
  38. package/lib/utils/chalk/index.d.ts +416 -0
  39. package/lib/utils/chalk/index.js +1538 -0
  40. package/lib/utils/chalk/package.json +6 -0
  41. package/lib/utils/changelog.js +21 -0
  42. package/lib/{internal → utils}/cross-spawn/index.js +9 -3
  43. package/lib/utils/cross-spawn/package.json +7 -0
  44. package/lib/{internal → utils}/datetimeFormat.js +14 -30
  45. package/lib/utils/defineConfig.js +26 -0
  46. package/lib/utils/exec.js +23 -0
  47. package/{es/internal → lib/utils}/execa/index.d.ts +41 -11
  48. package/lib/{internal → utils}/execa/index.js +76 -18
  49. package/lib/utils/execa/package.json +11 -0
  50. package/lib/utils/getPackages.js +8 -0
  51. package/lib/utils/git.js +31 -0
  52. package/lib/utils/index.js +183 -0
  53. package/lib/utils/isNextVersion.js +4 -0
  54. package/{es/internal → lib/utils}/merge-stream/index.d.ts +3 -1
  55. package/lib/{internal → utils}/merge-stream/index.js +1 -1
  56. package/lib/utils/merge-stream/package.json +7 -0
  57. package/lib/utils/parseDoc.js +30 -0
  58. package/lib/utils/yargs-parser/index.d.ts +114 -0
  59. package/lib/utils/yargs-parser/index.js +919 -0
  60. package/lib/utils/yargs-parser/package.json +7 -0
  61. package/package.json +7 -14
  62. package/es/cli/dev.d.ts +0 -1
  63. package/es/cli/update.d.ts +0 -2
  64. package/es/internal/buildNotify.d.ts +0 -10
  65. package/es/internal/buildNotify.js +0 -123
  66. package/es/internal/cross-spawn/package.json +0 -1
  67. package/es/internal/datetimeFormat.d.ts +0 -9
  68. package/es/internal/exec.d.ts +0 -1
  69. package/es/internal/execa/package.json +0 -1
  70. package/es/internal/merge-stream/package.json +0 -1
  71. package/es/internal/utils.d.ts +0 -14
  72. package/lib/cli/dev.d.ts +0 -1
  73. package/lib/cli/dev.js +0 -62
  74. package/lib/cli/update.d.ts +0 -2
  75. package/lib/cli/update.js +0 -50
  76. package/lib/internal/buildNotify.d.ts +0 -10
  77. package/lib/internal/buildNotify.js +0 -112
  78. package/lib/internal/cross-spawn/package.json +0 -1
  79. package/lib/internal/datetimeFormat.d.ts +0 -9
  80. package/lib/internal/exec.d.ts +0 -1
  81. package/lib/internal/exec.js +0 -60
  82. package/lib/internal/execa/package.json +0 -1
  83. package/lib/internal/merge-stream/package.json +0 -1
  84. package/lib/internal/utils.d.ts +0 -14
  85. package/lib/internal/utils.js +0 -100
  86. /package/es/{internal → utils}/cross-spawn/LICENSE +0 -0
  87. /package/es/{internal → utils}/cross-spawn/index.d.ts +0 -0
  88. /package/es/{internal → utils}/cross-spawn/index.js +0 -0
  89. /package/es/{internal → utils}/execa/LICENSE +0 -0
  90. /package/es/{internal → utils}/execa/index.js +0 -0
  91. /package/es/{internal → utils}/merge-stream/LICENSE +0 -0
  92. /package/es/{internal → utils}/merge-stream/index.js +0 -0
  93. /package/lib/{internal → utils}/cross-spawn/LICENSE +0 -0
  94. /package/lib/{internal → utils}/cross-spawn/index.d.ts +0 -0
  95. /package/lib/{internal → utils}/execa/LICENSE +0 -0
  96. /package/lib/{internal → utils}/merge-stream/LICENSE +0 -0
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "chalk",
3
+ "license": "MIT",
4
+ "main": "index.js",
5
+ "types": "index.d.ts"
6
+ }
@@ -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
- import * as logger from '@umijs/utils/dist/logger';
8
- import { assert } from "../internal/utils";
9
- import 'zx/globals';
10
- export default function update() {
11
- return _update.apply(this, arguments);
12
- }
13
- function _update() {
14
- _update = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
15
- var pnpmVersion;
16
- return _regeneratorRuntime().wrap(function _callee$(_context) {
17
- while (1) switch (_context.prev = _context.next) {
18
- case 0:
19
- // Check pnpm version
20
- logger.event('check pnpm version');
21
- _context.next = 3;
22
- return $(_templateObject || (_templateObject = _taggedTemplateLiteral(["pnpm --version"])));
23
- case 3:
24
- pnpmVersion = _context.sent.stdout.trim();
25
- assert(!pnpmVersion.includes('not found'), 'pnpm: command not found please use npm install -g pnpm');
26
- logger.event('update @teams-max/*');
27
- _context.next = 8;
28
- return $(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["pnpm up \"@teams-max/*\""])));
29
- case 8:
30
- logger.info("Success update @teams-max/*");
31
- case 9:
32
- case "end":
33
- return _context.stop();
34
- }
35
- }, _callee);
36
- }));
37
- return _update.apply(this, arguments);
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
+ }));
@@ -0,0 +1,7 @@
1
+ {
2
+ "name": "cross-spawn",
3
+ "license": "MIT",
4
+ "author": "André Cruz <andre@moxy.studio>",
5
+ "main": "index.js",
6
+ "types": "index.d.ts"
7
+ }
@@ -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
- export default datetimeFormat;
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
- import spawn from '@umijs/utils/compiled/cross-spawn';
8
- export var exec = function exec(command, args, opts) {
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 { Stream, Readable as ReadableStream } from 'stream';
3
+ import { Readable as ReadableStream, Stream } from 'stream';
4
4
 
5
5
  declare namespace execa {
6
- type StdioOption = 'pipe' | 'ipc' | 'ignore' | 'inherit' | Stream | number | undefined;
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> extends CommonOptions<EncodingType> {
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> extends ExecaSyncError<StdoutErrorType> {
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?: (reason: ExecaError<StdoutErrorType>) => ResultType | PromiseLike<ResultType>,
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
- (file: string, arguments?: readonly string[], options?: execa.Options): execa.ExecaChildProcess;
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
- (file: string, options?: execa.Options<null>): execa.ExecaChildProcess<Buffer>;
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(file: string, options?: execa.SyncOptions<null>): execa.ExecaSyncReturnValue<Buffer>;
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(command: string, options?: execa.Options<null>): execa.ExecaChildProcess<Buffer>;
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(command: string, options?: execa.SyncOptions): execa.ExecaSyncReturnValue;
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(scriptPath: string, options?: execa.Options<null>): execa.ExecaChildProcess<Buffer>;
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,11 @@
1
+ {
2
+ "name": "execa",
3
+ "license": "MIT",
4
+ "author": {
5
+ "name": "Sindre Sorhus",
6
+ "email": "sindresorhus@gmail.com",
7
+ "url": "https://sindresorhus.com"
8
+ },
9
+ "main": "index.js",
10
+ "types": "index.d.ts"
11
+ }
@@ -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
- import * as logger from '@umijs/utils/dist/logger';
6
- import { assert } from "../internal/utils";
7
- import { join } from 'path';
8
- import { exec } from "../internal/exec";
9
- var execa = require("../internal/execa");
10
- var cwd = process.cwd();
11
- export default function start() {
12
- return _start.apply(this, arguments);
13
- }
14
- function _start() {
15
- _start = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
16
- var pkg, env, pnpmVersion;
17
- return _regeneratorRuntime().wrap(function _callee$(_context) {
18
- while (1) switch (_context.prev = _context.next) {
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
- pkg = require(join(cwd, 'package.json')); // Do this as the first thing so that any code reading it knows the right env.
21
- process.env.MAX_APP_ENV = 'development';
22
- process.env.BABEL_ENV = 'development';
23
- process.env.MAX_APP_TYPE = 'max';
24
- process.env.MAX_APP_KEY = pkg.appKey || "";
25
- env = Object.create(process.env); // Check pnpm version
26
- logger.event('check pnpm version');
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 _context.stop();
40
+ return _context2.stop();
40
41
  }
41
- }, _callee);
42
+ }, _callee2);
42
43
  }));
43
- return _start.apply(this, arguments);
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
+ }();