@atlaskit/dependency-version-analytics 1.2.0 → 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.
- package/CHANGELOG.md +12 -0
- package/dist/cjs/commands/populate-historic-data/package.js +2 -3
- package/dist/cjs/commands/populate-historic-data/product.js +0 -15
- package/dist/cjs/util/analytics.js +4 -3
- package/dist/cjs/util/get-package-version-history.js +2 -0
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/commands/populate-historic-data/lib/dependency-store.js +3 -6
- package/dist/es2019/commands/populate-historic-data/package.js +2 -3
- package/dist/es2019/commands/populate-historic-data/product.js +0 -16
- package/dist/es2019/util/analytics.js +5 -4
- package/dist/es2019/util/get-package-version-history.js +2 -0
- package/dist/es2019/version.json +1 -1
- package/dist/esm/commands/populate-historic-data/lib/dependency-store.js +213 -225
- package/dist/esm/commands/populate-historic-data/package.js +44 -48
- package/dist/esm/commands/populate-historic-data/product.js +186 -230
- package/dist/esm/util/analytics.js +65 -66
- package/dist/esm/util/get-package-version-history.js +2 -0
- package/dist/esm/util/git.js +112 -125
- package/dist/esm/util/statlas.js +59 -66
- package/dist/esm/util/yarn.js +71 -76
- package/dist/esm/version.json +1 -1
- package/dist/types/util/analytics.d.ts +2 -3
- package/package.json +1 -1
- package/tokenize-arg-string.ts +0 -0
|
@@ -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';
|
|
@@ -44,9 +43,12 @@ function getUpgradeSubType(version, previousVersion) {
|
|
|
44
43
|
}
|
|
45
44
|
return upgradeSubType;
|
|
46
45
|
}
|
|
46
|
+
|
|
47
|
+
// optionalEventArgs will be included within the event.
|
|
47
48
|
export function createUpgradeEvent(name, version, previousVersion, date) {
|
|
48
|
-
var
|
|
49
|
-
var
|
|
49
|
+
var _ref, _tags$next, _tags$hotfix, _ref2;
|
|
50
|
+
var optionalEventArgs = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
|
|
51
|
+
var tags = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {};
|
|
50
52
|
if (Number.isNaN(Date.parse(date))) {
|
|
51
53
|
throw new Error("Invalid date: '".concat(date, "'"));
|
|
52
54
|
}
|
|
@@ -59,7 +61,6 @@ export function createUpgradeEvent(name, version, previousVersion, date) {
|
|
|
59
61
|
var eventVersion = upgradeType !== 'remove' ? version : previousVersion;
|
|
60
62
|
var parsedVersion = semver.coerce(eventVersion);
|
|
61
63
|
var rcKey = null;
|
|
62
|
-
var tags = (_optionalArgs$tags = optionalArgs === null || optionalArgs === void 0 ? void 0 : optionalArgs.tags) !== null && _optionalArgs$tags !== void 0 ? _optionalArgs$tags : {};
|
|
63
64
|
Object.keys(tags).forEach(function (key) {
|
|
64
65
|
if (key.startsWith('rc')) {
|
|
65
66
|
rcKey = key;
|
|
@@ -80,74 +81,72 @@ export function createUpgradeEvent(name, version, previousVersion, date) {
|
|
|
80
81
|
nextTag: (_tags$next = tags['next']) !== null && _tags$next !== void 0 ? _tags$next : null,
|
|
81
82
|
hotfixTag: (_tags$hotfix = tags['hotfix']) !== null && _tags$hotfix !== void 0 ? _tags$hotfix : null,
|
|
82
83
|
rcTag: (_ref2 = rcKey && tags[rcKey]) !== null && _ref2 !== void 0 ? _ref2 : null
|
|
83
|
-
},
|
|
84
|
+
}, optionalEventArgs);
|
|
84
85
|
}
|
|
85
86
|
export function sendAnalytics(_x, _x2) {
|
|
86
87
|
return _sendAnalytics.apply(this, arguments);
|
|
87
88
|
}
|
|
88
89
|
function _sendAnalytics() {
|
|
89
|
-
_sendAnalytics = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime
|
|
90
|
+
_sendAnalytics = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(analyticsEvents, _ref3) {
|
|
90
91
|
var dev, limit, product, skipPrompt, analyticsEnv, eventsToSend, client, answers, promises;
|
|
91
|
-
return _regeneratorRuntime
|
|
92
|
-
while (1) {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
_context.next = 9;
|
|
104
|
-
break;
|
|
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;
|
|
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;
|
|
140
104
|
break;
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
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();
|
|
151
150
|
}
|
|
152
151
|
}, _callee, null, [[9, 16]]);
|
|
153
152
|
}));
|
|
@@ -3,9 +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.error("error: Unable to execute yarn info for ".concat(packageName));
|
|
6
7
|
reject(error);
|
|
7
8
|
}
|
|
8
9
|
if (stderr) {
|
|
10
|
+
console.error("stderr: Unable to execute yarn info for ".concat(packageName));
|
|
9
11
|
reject(stderr);
|
|
10
12
|
}
|
|
11
13
|
var json;
|
package/dist/esm/util/git.js
CHANGED
|
@@ -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
|
|
15
|
+
_getChangesSince = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(since) {
|
|
17
16
|
var revisionRange, listLogSummary;
|
|
18
|
-
return _regeneratorRuntime
|
|
19
|
-
while (1) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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
|
|
96
|
-
return _regeneratorRuntime
|
|
97
|
-
while (1) {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
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
|
|
109
|
+
_doesTagExist = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(tag) {
|
|
115
110
|
var tags;
|
|
116
|
-
return _regeneratorRuntime
|
|
117
|
-
while (1) {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
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
|
|
131
|
+
_refetchTag = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(tag) {
|
|
139
132
|
var fetchTagResult;
|
|
140
|
-
return _regeneratorRuntime
|
|
141
|
-
while (1) {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
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
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
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
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
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
|
|
192
|
-
return _regeneratorRuntime
|
|
193
|
-
while (1) {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
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
|
|
203
|
+
_getFiles = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(ref, glob) {
|
|
215
204
|
var opts,
|
|
216
205
|
result,
|
|
217
206
|
_args6 = arguments;
|
|
218
|
-
return _regeneratorRuntime
|
|
219
|
-
while (1) {
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
return
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
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
|
}));
|