@atlaskit/dependency-version-analytics 1.2.1 → 1.2.2

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.
@@ -1,7 +1,6 @@
1
- import _typeof from "@babel/runtime/helpers/typeof";
2
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
- 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
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
5
4
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
6
5
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
7
6
  import chalk from 'chalk';
@@ -88,68 +87,66 @@ export function sendAnalytics(_x, _x2) {
88
87
  return _sendAnalytics.apply(this, arguments);
89
88
  }
90
89
  function _sendAnalytics() {
91
- _sendAnalytics = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(analyticsEvents, _ref3) {
90
+ _sendAnalytics = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(analyticsEvents, _ref3) {
92
91
  var dev, limit, product, skipPrompt, analyticsEnv, eventsToSend, client, answers, promises;
93
- return _regeneratorRuntime().wrap(function _callee$(_context) {
94
- while (1) {
95
- switch (_context.prev = _context.next) {
96
- case 0:
97
- dev = _ref3.dev, limit = _ref3.limit, product = _ref3.product, skipPrompt = _ref3.skipPrompt;
98
- analyticsEnv = dev ? 'dev' : 'prod';
99
- eventsToSend = limit != null ? analyticsEvents.slice(0, limit) : analyticsEvents;
100
- client = analyticsClient({
101
- env: dev ? 'dev' : 'prod',
102
- product: product
103
- });
104
- if (skipPrompt) {
105
- _context.next = 9;
106
- break;
107
- }
108
- _context.next = 7;
109
- return inquirer.prompt([{
110
- type: 'confirm',
111
- name: 'continue',
112
- message: "Are you sure you want to send ".concat(eventsToSend.length, " historical analytics events to '").concat(analyticsEnv, "' env for product '").concat(product, "?"),
113
- default: false
114
- }]);
115
- case 7:
116
- answers = _context.sent;
117
- if (!answers.continue) {
118
- console.log('Aborting');
119
- process.exit(0);
120
- }
121
- case 9:
122
- _context.prev = 9;
123
- _context.next = 12;
124
- return Promise.all(eventsToSend.map(function (event) {
125
- return client.sendTrackEvent({
126
- anonymousId: 'unknown',
127
- trackEvent: {
128
- tags: ['atlaskit'],
129
- source: '@atlaskit/dependency-version-analytics',
130
- action: 'upgraded',
131
- actionSubject: 'akDependency',
132
- attributes: _objectSpread({}, event),
133
- origin: 'console',
134
- platform: 'bot'
135
- }
136
- });
137
- }));
138
- case 12:
139
- promises = _context.sent;
140
- console.log(chalk.green("Sent ".concat(promises.length, " dependency version upgrade analytics events")));
141
- _context.next = 21;
92
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
93
+ while (1) switch (_context.prev = _context.next) {
94
+ case 0:
95
+ dev = _ref3.dev, limit = _ref3.limit, product = _ref3.product, skipPrompt = _ref3.skipPrompt;
96
+ analyticsEnv = dev ? 'dev' : 'prod';
97
+ eventsToSend = limit != null ? analyticsEvents.slice(0, limit) : analyticsEvents;
98
+ client = analyticsClient({
99
+ env: dev ? 'dev' : 'prod',
100
+ product: product
101
+ });
102
+ if (skipPrompt) {
103
+ _context.next = 9;
142
104
  break;
143
- case 16:
144
- _context.prev = 16;
145
- _context.t0 = _context["catch"](9);
146
- console.error(chalk.red('Sending analytics failed'));
147
- console.error(_context.t0);
148
- process.exit(1);
149
- case 21:
150
- case "end":
151
- return _context.stop();
152
- }
105
+ }
106
+ _context.next = 7;
107
+ return inquirer.prompt([{
108
+ type: 'confirm',
109
+ name: 'continue',
110
+ message: "Are you sure you want to send ".concat(eventsToSend.length, " historical analytics events to '").concat(analyticsEnv, "' env for product '").concat(product, "?"),
111
+ default: false
112
+ }]);
113
+ case 7:
114
+ answers = _context.sent;
115
+ if (!answers.continue) {
116
+ console.log('Aborting');
117
+ process.exit(0);
118
+ }
119
+ case 9:
120
+ _context.prev = 9;
121
+ _context.next = 12;
122
+ return Promise.all(eventsToSend.map(function (event) {
123
+ return client.sendTrackEvent({
124
+ anonymousId: 'unknown',
125
+ trackEvent: {
126
+ tags: ['atlaskit'],
127
+ source: '@atlaskit/dependency-version-analytics',
128
+ action: 'upgraded',
129
+ actionSubject: 'akDependency',
130
+ attributes: _objectSpread({}, event),
131
+ origin: 'console',
132
+ platform: 'bot'
133
+ }
134
+ });
135
+ }));
136
+ case 12:
137
+ promises = _context.sent;
138
+ console.log(chalk.green("Sent ".concat(promises.length, " dependency version upgrade analytics events")));
139
+ _context.next = 21;
140
+ break;
141
+ case 16:
142
+ _context.prev = 16;
143
+ _context.t0 = _context["catch"](9);
144
+ console.error(chalk.red('Sending analytics failed'));
145
+ console.error(_context.t0);
146
+ process.exit(1);
147
+ case 21:
148
+ case "end":
149
+ return _context.stop();
153
150
  }
154
151
  }, _callee, null, [[9, 16]]);
155
152
  }));
@@ -3,11 +3,11 @@ export default function getPackageVersionHistoryAndTags(packageName) {
3
3
  return new Promise(function (resolve, reject) {
4
4
  exec("yarn info ".concat(packageName, " --json"), function (error, stdout, stderr) {
5
5
  if (error) {
6
- console.log("error: Unable to execute yarn info for ".concat(packageName));
6
+ console.error("error: Unable to execute yarn info for ".concat(packageName));
7
7
  reject(error);
8
8
  }
9
9
  if (stderr) {
10
- console.log("stderr: Unable to execute yarn info for ".concat(packageName));
10
+ console.error("stderr: Unable to execute yarn info for ".concat(packageName));
11
11
  reject(stderr);
12
12
  }
13
13
  var json;
@@ -1,8 +1,7 @@
1
- import _typeof from "@babel/runtime/helpers/typeof";
2
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
2
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
4
3
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
5
- 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
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
6
5
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
7
6
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
8
7
  // @ts-ignore
@@ -13,38 +12,36 @@ export function getChangesSince(_x) {
13
12
  return _getChangesSince.apply(this, arguments);
14
13
  }
15
14
  function _getChangesSince() {
16
- _getChangesSince = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(since) {
15
+ _getChangesSince = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(since) {
17
16
  var revisionRange, listLogSummary;
18
- return _regeneratorRuntime().wrap(function _callee$(_context) {
19
- while (1) {
20
- switch (_context.prev = _context.next) {
21
- case 0:
22
- revisionRange = since ? ["".concat(since, "..")] : [];
23
- _context.next = 3;
24
- return git().log([
25
- // Only commits on mainline master
26
- '--first-parent',
27
- // Show merge commit contents
28
- '-m',
29
- // Reverse the order
30
- '--reverse',
31
- // Show filename changes - simple-git parses --stat flag but not --name-only unfortunately
32
- '--stat=4096',
33
- // Make +- graph width as small as possible to maximise filename length
34
- '--stat-graph-width=1'].concat(revisionRange, [
35
- // Any commit that modifies a package.json
36
- ':(glob)**/package.json']));
37
- case 3:
38
- listLogSummary = _context.sent;
39
- return _context.abrupt("return", _objectSpread(_objectSpread({}, listLogSummary), {}, {
40
- all: listLogSummary.all.map(function (logLine) {
41
- return parseLogLine(logLine);
42
- })
43
- }));
44
- case 5:
45
- case "end":
46
- return _context.stop();
47
- }
17
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
18
+ while (1) switch (_context.prev = _context.next) {
19
+ case 0:
20
+ revisionRange = since ? ["".concat(since, "..")] : [];
21
+ _context.next = 3;
22
+ return git().log([
23
+ // Only commits on mainline master
24
+ '--first-parent',
25
+ // Show merge commit contents
26
+ '-m',
27
+ // Reverse the order
28
+ '--reverse',
29
+ // Show filename changes - simple-git parses --stat flag but not --name-only unfortunately
30
+ '--stat=4096',
31
+ // Make +- graph width as small as possible to maximise filename length
32
+ '--stat-graph-width=1'].concat(revisionRange, [
33
+ // Any commit that modifies a package.json
34
+ ':(glob)**/package.json']));
35
+ case 3:
36
+ listLogSummary = _context.sent;
37
+ return _context.abrupt("return", _objectSpread(_objectSpread({}, listLogSummary), {}, {
38
+ all: listLogSummary.all.map(function (logLine) {
39
+ return parseLogLine(logLine);
40
+ })
41
+ }));
42
+ case 5:
43
+ case "end":
44
+ return _context.stop();
48
45
  }
49
46
  }, _callee);
50
47
  }));
@@ -92,16 +89,14 @@ export function tagCommit(_x2) {
92
89
  return _tagCommit.apply(this, arguments);
93
90
  }
94
91
  function _tagCommit() {
95
- _tagCommit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(tag) {
96
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
97
- while (1) {
98
- switch (_context2.prev = _context2.next) {
99
- case 0:
100
- return _context2.abrupt("return", git().tag(['-f', tag]));
101
- case 1:
102
- case "end":
103
- return _context2.stop();
104
- }
92
+ _tagCommit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(tag) {
93
+ return _regeneratorRuntime.wrap(function _callee2$(_context2) {
94
+ while (1) switch (_context2.prev = _context2.next) {
95
+ case 0:
96
+ return _context2.abrupt("return", git().tag(['-f', tag]));
97
+ case 1:
98
+ case "end":
99
+ return _context2.stop();
105
100
  }
106
101
  }, _callee2);
107
102
  }));
@@ -111,21 +106,19 @@ export function doesTagExist(_x3) {
111
106
  return _doesTagExist.apply(this, arguments);
112
107
  }
113
108
  function _doesTagExist() {
114
- _doesTagExist = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(tag) {
109
+ _doesTagExist = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(tag) {
115
110
  var tags;
116
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
117
- while (1) {
118
- switch (_context3.prev = _context3.next) {
119
- case 0:
120
- _context3.next = 2;
121
- return git().tags(_defineProperty({}, tag, null));
122
- case 2:
123
- tags = _context3.sent;
124
- return _context3.abrupt("return", tags.all.length > 0);
125
- case 4:
126
- case "end":
127
- return _context3.stop();
128
- }
111
+ return _regeneratorRuntime.wrap(function _callee3$(_context3) {
112
+ while (1) switch (_context3.prev = _context3.next) {
113
+ case 0:
114
+ _context3.next = 2;
115
+ return git().tags(_defineProperty({}, tag, null));
116
+ case 2:
117
+ tags = _context3.sent;
118
+ return _context3.abrupt("return", tags.all.length > 0);
119
+ case 4:
120
+ case "end":
121
+ return _context3.stop();
129
122
  }
130
123
  }, _callee3);
131
124
  }));
@@ -135,50 +128,48 @@ export function refetchTag(_x4) {
135
128
  return _refetchTag.apply(this, arguments);
136
129
  }
137
130
  function _refetchTag() {
138
- _refetchTag = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(tag) {
131
+ _refetchTag = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(tag) {
139
132
  var fetchTagResult;
140
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
141
- while (1) {
142
- switch (_context4.prev = _context4.next) {
143
- case 0:
144
- _context4.prev = 0;
145
- _context4.next = 3;
146
- return git().tag(['-d', tag]);
147
- case 3:
133
+ return _regeneratorRuntime.wrap(function _callee4$(_context4) {
134
+ while (1) switch (_context4.prev = _context4.next) {
135
+ case 0:
136
+ _context4.prev = 0;
137
+ _context4.next = 3;
138
+ return git().tag(['-d', tag]);
139
+ case 3:
140
+ _context4.next = 9;
141
+ break;
142
+ case 5:
143
+ _context4.prev = 5;
144
+ _context4.t0 = _context4["catch"](0);
145
+ if (/tag.*not found/.test(_context4.t0.message)) {
148
146
  _context4.next = 9;
149
147
  break;
150
- case 5:
151
- _context4.prev = 5;
152
- _context4.t0 = _context4["catch"](0);
153
- if (/tag.*not found/.test(_context4.t0.message)) {
154
- _context4.next = 9;
155
- break;
156
- }
157
- throw _context4.t0;
158
- case 9:
159
- _context4.prev = 9;
160
- _context4.next = 12;
161
- return git().fetch(['origin', 'tag', tag]);
162
- case 12:
163
- fetchTagResult = _context4.sent;
148
+ }
149
+ throw _context4.t0;
150
+ case 9:
151
+ _context4.prev = 9;
152
+ _context4.next = 12;
153
+ return git().fetch(['origin', 'tag', tag]);
154
+ case 12:
155
+ fetchTagResult = _context4.sent;
156
+ _context4.next = 19;
157
+ break;
158
+ case 15:
159
+ _context4.prev = 15;
160
+ _context4.t1 = _context4["catch"](9);
161
+ if (/Couldn't find remote ref refs\/tags\//.test(_context4.t1.message)) {
164
162
  _context4.next = 19;
165
163
  break;
166
- case 15:
167
- _context4.prev = 15;
168
- _context4.t1 = _context4["catch"](9);
169
- if (/Couldn't find remote ref refs\/tags\//.test(_context4.t1.message)) {
170
- _context4.next = 19;
171
- break;
172
- }
173
- throw _context4.t1;
174
- case 19:
175
- return _context4.abrupt("return", {
176
- fetchTagResult: fetchTagResult
177
- });
178
- case 20:
179
- case "end":
180
- return _context4.stop();
181
- }
164
+ }
165
+ throw _context4.t1;
166
+ case 19:
167
+ return _context4.abrupt("return", {
168
+ fetchTagResult: fetchTagResult
169
+ });
170
+ case 20:
171
+ case "end":
172
+ return _context4.stop();
182
173
  }
183
174
  }, _callee4, null, [[0, 5], [9, 15]]);
184
175
  }));
@@ -188,16 +179,14 @@ export function getHash(_x5) {
188
179
  return _getHash.apply(this, arguments);
189
180
  }
190
181
  function _getHash() {
191
- _getHash = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(ref) {
192
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
193
- while (1) {
194
- switch (_context5.prev = _context5.next) {
195
- case 0:
196
- return _context5.abrupt("return", git().revparse([ref]));
197
- case 1:
198
- case "end":
199
- return _context5.stop();
200
- }
182
+ _getHash = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(ref) {
183
+ return _regeneratorRuntime.wrap(function _callee5$(_context5) {
184
+ while (1) switch (_context5.prev = _context5.next) {
185
+ case 0:
186
+ return _context5.abrupt("return", git().revparse([ref]));
187
+ case 1:
188
+ case "end":
189
+ return _context5.stop();
201
190
  }
202
191
  }, _callee5);
203
192
  }));
@@ -211,28 +200,26 @@ export function getFiles(_x6, _x7) {
211
200
  return _getFiles.apply(this, arguments);
212
201
  }
213
202
  function _getFiles() {
214
- _getFiles = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(ref, glob) {
203
+ _getFiles = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(ref, glob) {
215
204
  var opts,
216
205
  result,
217
206
  _args6 = arguments;
218
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
219
- while (1) {
220
- switch (_context6.prev = _context6.next) {
221
- case 0:
222
- opts = _args6.length > 2 && _args6[2] !== undefined ? _args6[2] : {};
223
- _context6.next = 3;
224
- return git(opts.cwd || process.cwd()).raw(['grep', '--name-only', '', ref, '--', ":(glob)".concat(glob)]);
225
- case 3:
226
- result = _context6.sent;
227
- return _context6.abrupt("return", result.split('\n').filter(function (line) {
228
- return line !== '';
229
- }).map(function (line) {
230
- return line.split(':')[1];
231
- }));
232
- case 5:
233
- case "end":
234
- return _context6.stop();
235
- }
207
+ return _regeneratorRuntime.wrap(function _callee6$(_context6) {
208
+ while (1) switch (_context6.prev = _context6.next) {
209
+ case 0:
210
+ opts = _args6.length > 2 && _args6[2] !== undefined ? _args6[2] : {};
211
+ _context6.next = 3;
212
+ return git(opts.cwd || process.cwd()).raw(['grep', '--name-only', '', ref, '--', ":(glob)".concat(glob)]);
213
+ case 3:
214
+ result = _context6.sent;
215
+ return _context6.abrupt("return", result.split('\n').filter(function (line) {
216
+ return line !== '';
217
+ }).map(function (line) {
218
+ return line.split(':')[1];
219
+ }));
220
+ case 5:
221
+ case "end":
222
+ return _context6.stop();
236
223
  }
237
224
  }, _callee6);
238
225
  }));