@atlaskit/dependency-version-analytics 1.2.1 → 1.3.0
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/product.js +0 -15
- package/dist/cjs/util/get-package-version-history.js +2 -2
- 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/product.js +0 -16
- package/dist/es2019/util/get-package-version-history.js +2 -2
- 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 +42 -45
- package/dist/esm/commands/populate-historic-data/product.js +186 -230
- package/dist/esm/util/analytics.js +59 -62
- package/dist/esm/util/get-package-version-history.js +2 -2
- 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/package.json +1 -1
- package/tmp/api-report-tmp.d.ts +0 -79
- package/tokenize-arg-string.ts +0 -0
package/dist/esm/util/statlas.js
CHANGED
|
@@ -1,27 +1,24 @@
|
|
|
1
|
-
import _typeof from "@babel/runtime/helpers/typeof";
|
|
2
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
|
-
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; }
|
|
2
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
4
3
|
import fetch from 'node-fetch';
|
|
5
4
|
var STATLAS_BASE_URL = 'https://statlas.prod.atl-paas.net/af-product-analytics';
|
|
6
5
|
export function getMeta(_x) {
|
|
7
6
|
return _getMeta.apply(this, arguments);
|
|
8
7
|
}
|
|
9
8
|
function _getMeta() {
|
|
10
|
-
_getMeta = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime
|
|
9
|
+
_getMeta = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(product) {
|
|
11
10
|
var response;
|
|
12
|
-
return _regeneratorRuntime
|
|
13
|
-
while (1) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
return _context.stop();
|
|
24
|
-
}
|
|
11
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
12
|
+
while (1) switch (_context.prev = _context.next) {
|
|
13
|
+
case 0:
|
|
14
|
+
_context.next = 2;
|
|
15
|
+
return retrieveJSON(getProductMetaPath(product));
|
|
16
|
+
case 2:
|
|
17
|
+
response = _context.sent;
|
|
18
|
+
return _context.abrupt("return", response.json);
|
|
19
|
+
case 4:
|
|
20
|
+
case "end":
|
|
21
|
+
return _context.stop();
|
|
25
22
|
}
|
|
26
23
|
}, _callee);
|
|
27
24
|
}));
|
|
@@ -39,34 +36,32 @@ function retrieveJSON(_x2) {
|
|
|
39
36
|
return _retrieveJSON.apply(this, arguments);
|
|
40
37
|
}
|
|
41
38
|
function _retrieveJSON() {
|
|
42
|
-
_retrieveJSON = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime
|
|
39
|
+
_retrieveJSON = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(filepath) {
|
|
43
40
|
var response, json;
|
|
44
|
-
return _regeneratorRuntime
|
|
45
|
-
while (1) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
return _context2.stop();
|
|
69
|
-
}
|
|
41
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
42
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
43
|
+
case 0:
|
|
44
|
+
_context2.next = 2;
|
|
45
|
+
return fetch("".concat(STATLAS_BASE_URL, "/").concat(filepath, "?statlasredirect"));
|
|
46
|
+
case 2:
|
|
47
|
+
response = _context2.sent;
|
|
48
|
+
json = null;
|
|
49
|
+
if (!response.ok) {
|
|
50
|
+
_context2.next = 8;
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
_context2.next = 7;
|
|
54
|
+
return response.json();
|
|
55
|
+
case 7:
|
|
56
|
+
json = _context2.sent;
|
|
57
|
+
case 8:
|
|
58
|
+
return _context2.abrupt("return", {
|
|
59
|
+
json: json,
|
|
60
|
+
rawResponse: response
|
|
61
|
+
});
|
|
62
|
+
case 9:
|
|
63
|
+
case "end":
|
|
64
|
+
return _context2.stop();
|
|
70
65
|
}
|
|
71
66
|
}, _callee2);
|
|
72
67
|
}));
|
|
@@ -76,31 +71,29 @@ function uploadJSON(_x3, _x4) {
|
|
|
76
71
|
return _uploadJSON.apply(this, arguments);
|
|
77
72
|
}
|
|
78
73
|
function _uploadJSON() {
|
|
79
|
-
_uploadJSON = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime
|
|
74
|
+
_uploadJSON = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(filepath, json) {
|
|
80
75
|
var res;
|
|
81
|
-
return _regeneratorRuntime
|
|
82
|
-
while (1) {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
Authorization: "Bearer ".concat(process.env.bamboo_JWT_TOKEN)
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
case 2:
|
|
94
|
-
res = _context3.sent;
|
|
95
|
-
if (res.ok) {
|
|
96
|
-
_context3.next = 5;
|
|
97
|
-
break;
|
|
76
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
77
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
78
|
+
case 0:
|
|
79
|
+
_context3.next = 2;
|
|
80
|
+
return fetch("".concat(STATLAS_BASE_URL, "/").concat(filepath), {
|
|
81
|
+
method: 'PUT',
|
|
82
|
+
body: JSON.stringify(json),
|
|
83
|
+
headers: {
|
|
84
|
+
Authorization: "Bearer ".concat(process.env.bamboo_JWT_TOKEN)
|
|
98
85
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
86
|
+
});
|
|
87
|
+
case 2:
|
|
88
|
+
res = _context3.sent;
|
|
89
|
+
if (res.ok) {
|
|
90
|
+
_context3.next = 5;
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
throw new Error("Statlas upload failed: ".concat(res.statusText));
|
|
94
|
+
case 5:
|
|
95
|
+
case "end":
|
|
96
|
+
return _context3.stop();
|
|
104
97
|
}
|
|
105
98
|
}, _callee3);
|
|
106
99
|
}));
|
package/dist/esm/util/yarn.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import _typeof from "@babel/runtime/helpers/typeof";
|
|
2
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
3
2
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
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
|
import path from 'path';
|
|
6
5
|
import debugModule from 'debug';
|
|
7
6
|
import micromatch from 'micromatch';
|
|
@@ -12,53 +11,51 @@ export function getWorkspaceGlobs(_x, _x2) {
|
|
|
12
11
|
return _getWorkspaceGlobs.apply(this, arguments);
|
|
13
12
|
}
|
|
14
13
|
function _getWorkspaceGlobs() {
|
|
15
|
-
_getWorkspaceGlobs = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime
|
|
14
|
+
_getWorkspaceGlobs = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(ref, cwd) {
|
|
16
15
|
var file, rootPackageJsonFile, workspaces, workspacePackages;
|
|
17
|
-
return _regeneratorRuntime
|
|
18
|
-
while (1) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
16
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
17
|
+
while (1) switch (_context.prev = _context.next) {
|
|
18
|
+
case 0:
|
|
19
|
+
_context.prev = 0;
|
|
20
|
+
_context.next = 3;
|
|
21
|
+
return git.showFile(ref, rootPackageJsonPath, {
|
|
22
|
+
cwd: cwd
|
|
23
|
+
});
|
|
24
|
+
case 3:
|
|
25
|
+
file = _context.sent;
|
|
26
|
+
_context.next = 10;
|
|
27
|
+
break;
|
|
28
|
+
case 6:
|
|
29
|
+
_context.prev = 6;
|
|
30
|
+
_context.t0 = _context["catch"](0);
|
|
31
|
+
debug("".concat(rootPackageJsonPath, " does not exist"));
|
|
32
|
+
return _context.abrupt("return", new Set([]));
|
|
33
|
+
case 10:
|
|
34
|
+
_context.prev = 10;
|
|
35
|
+
rootPackageJsonFile = JSON.parse(file);
|
|
36
|
+
_context.next = 18;
|
|
37
|
+
break;
|
|
38
|
+
case 14:
|
|
39
|
+
_context.prev = 14;
|
|
40
|
+
_context.t1 = _context["catch"](10);
|
|
41
|
+
console.error("Error parsing ".concat(file, "@").concat(ref, ": ").concat(_context.t1));
|
|
42
|
+
return _context.abrupt("return", null);
|
|
43
|
+
case 18:
|
|
44
|
+
workspaces = rootPackageJsonFile.workspaces;
|
|
45
|
+
if (workspaces) {
|
|
46
|
+
_context.next = 21;
|
|
29
47
|
break;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
_context.prev = 14;
|
|
42
|
-
_context.t1 = _context["catch"](10);
|
|
43
|
-
console.error("Error parsing ".concat(file, "@").concat(ref, ": ").concat(_context.t1));
|
|
44
|
-
return _context.abrupt("return", null);
|
|
45
|
-
case 18:
|
|
46
|
-
workspaces = rootPackageJsonFile.workspaces;
|
|
47
|
-
if (workspaces) {
|
|
48
|
-
_context.next = 21;
|
|
49
|
-
break;
|
|
50
|
-
}
|
|
51
|
-
return _context.abrupt("return", new Set([rootPackageJsonPath]));
|
|
52
|
-
case 21:
|
|
53
|
-
// There are actually two formats for workspaces and they are poorly documented
|
|
54
|
-
workspacePackages = Array.isArray(workspaces) ? workspaces : workspaces.packages;
|
|
55
|
-
return _context.abrupt("return", new Set([rootPackageJsonPath].concat(_toConsumableArray(workspacePackages.map(function (glob) {
|
|
56
|
-
return path.join(glob, 'package.json');
|
|
57
|
-
})))));
|
|
58
|
-
case 23:
|
|
59
|
-
case "end":
|
|
60
|
-
return _context.stop();
|
|
61
|
-
}
|
|
48
|
+
}
|
|
49
|
+
return _context.abrupt("return", new Set([rootPackageJsonPath]));
|
|
50
|
+
case 21:
|
|
51
|
+
// There are actually two formats for workspaces and they are poorly documented
|
|
52
|
+
workspacePackages = Array.isArray(workspaces) ? workspaces : workspaces.packages;
|
|
53
|
+
return _context.abrupt("return", new Set([rootPackageJsonPath].concat(_toConsumableArray(workspacePackages.map(function (glob) {
|
|
54
|
+
return path.join(glob, 'package.json');
|
|
55
|
+
})))));
|
|
56
|
+
case 23:
|
|
57
|
+
case "end":
|
|
58
|
+
return _context.stop();
|
|
62
59
|
}
|
|
63
60
|
}, _callee, null, [[0, 6], [10, 14]]);
|
|
64
61
|
}));
|
|
@@ -68,36 +65,34 @@ export function getWorkspacePaths(_x3, _x4, _x5) {
|
|
|
68
65
|
return _getWorkspacePaths.apply(this, arguments);
|
|
69
66
|
}
|
|
70
67
|
function _getWorkspacePaths() {
|
|
71
|
-
_getWorkspacePaths = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime
|
|
68
|
+
_getWorkspacePaths = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(ref, workspaceGlobs, cwd) {
|
|
72
69
|
var workspacePackageJsons, matchedWorkspaces;
|
|
73
|
-
return _regeneratorRuntime
|
|
74
|
-
while (1) {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
return _context2.stop();
|
|
100
|
-
}
|
|
70
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
71
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
72
|
+
case 0:
|
|
73
|
+
if (!(workspaceGlobs.size === 0)) {
|
|
74
|
+
_context2.next = 2;
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
return _context2.abrupt("return", []);
|
|
78
|
+
case 2:
|
|
79
|
+
_context2.next = 4;
|
|
80
|
+
return git.getFiles(ref, '**/package.json', {
|
|
81
|
+
cwd: cwd
|
|
82
|
+
});
|
|
83
|
+
case 4:
|
|
84
|
+
workspacePackageJsons = _context2.sent;
|
|
85
|
+
matchedWorkspaces = micromatch(workspacePackageJsons, _toConsumableArray(workspaceGlobs));
|
|
86
|
+
if (!(matchedWorkspaces.length === 0)) {
|
|
87
|
+
_context2.next = 8;
|
|
88
|
+
break;
|
|
89
|
+
}
|
|
90
|
+
throw new Error("Could not find any workspace or package.json under ".concat(cwd));
|
|
91
|
+
case 8:
|
|
92
|
+
return _context2.abrupt("return", matchedWorkspaces);
|
|
93
|
+
case 9:
|
|
94
|
+
case "end":
|
|
95
|
+
return _context2.stop();
|
|
101
96
|
}
|
|
102
97
|
}, _callee2);
|
|
103
98
|
}));
|
package/dist/esm/version.json
CHANGED
package/package.json
CHANGED
package/tmp/api-report-tmp.d.ts
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
## API Report File for "@atlaskit/dependency-version-analytics"
|
|
2
|
-
|
|
3
|
-
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
-
|
|
5
|
-
```ts
|
|
6
|
-
|
|
7
|
-
import { ReleaseType } from 'semver';
|
|
8
|
-
|
|
9
|
-
// @public (undocumented)
|
|
10
|
-
export type DependencyType = 'dependency' | 'devDependency' | 'optionalDependency' | 'peerDependency';
|
|
11
|
-
|
|
12
|
-
// @public (undocumented)
|
|
13
|
-
type PopulateHistoricDataFlags = {
|
|
14
|
-
cwd?: string;
|
|
15
|
-
dev: boolean;
|
|
16
|
-
dryRun: boolean;
|
|
17
|
-
limit?: number;
|
|
18
|
-
interactive: boolean;
|
|
19
|
-
includeRestrictedScopes?: boolean;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
// @public (undocumented)
|
|
23
|
-
export function populatePackage(flags: PopulatePackageFlags): Promise<UpgradeEvent[]>;
|
|
24
|
-
|
|
25
|
-
// @public (undocumented)
|
|
26
|
-
type PopulatePackageFlags = PopulateHistoricDataFlags & {
|
|
27
|
-
since?: string;
|
|
28
|
-
pkg: string;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
// @public (undocumented)
|
|
32
|
-
export function populateProduct(flags: PopulateProductFlags): Promise<void>;
|
|
33
|
-
|
|
34
|
-
// @public (undocumented)
|
|
35
|
-
type PopulateProductFlags = PopulateHistoricDataFlags & {
|
|
36
|
-
csv: boolean;
|
|
37
|
-
product: string;
|
|
38
|
-
reset: boolean;
|
|
39
|
-
statlas?: boolean;
|
|
40
|
-
tag?: string;
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
// @public (undocumented)
|
|
44
|
-
export function sendAnalytics(analyticsEvents: UpgradeEvent[], { dev, limit, product, skipPrompt, }: {
|
|
45
|
-
dev?: boolean;
|
|
46
|
-
limit?: number;
|
|
47
|
-
product: string;
|
|
48
|
-
skipPrompt?: boolean;
|
|
49
|
-
}): Promise<void>;
|
|
50
|
-
|
|
51
|
-
// @public (undocumented)
|
|
52
|
-
export type UpgradeEvent = {
|
|
53
|
-
dependencyName: string;
|
|
54
|
-
versionString: string;
|
|
55
|
-
major: null | string;
|
|
56
|
-
minor: null | string;
|
|
57
|
-
patch: null | string;
|
|
58
|
-
date: string;
|
|
59
|
-
upgradeType: UpgradeType;
|
|
60
|
-
upgradeSubType: UpgradeSubType;
|
|
61
|
-
cliVersion: string;
|
|
62
|
-
latestTag: null | string;
|
|
63
|
-
nextTag: null | string;
|
|
64
|
-
hotfixTag: null | string;
|
|
65
|
-
rcTag: null | string;
|
|
66
|
-
dependencyType?: DependencyType;
|
|
67
|
-
historical?: boolean;
|
|
68
|
-
commitHash?: string;
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
// @public (undocumented)
|
|
72
|
-
export type UpgradeSubType = ReleaseType | null;
|
|
73
|
-
|
|
74
|
-
// @public (undocumented)
|
|
75
|
-
export type UpgradeType = 'add' | 'downgrade' | 'remove' | 'upgrade';
|
|
76
|
-
|
|
77
|
-
// (No @packageDocumentation comment for this package)
|
|
78
|
-
|
|
79
|
-
```
|
package/tokenize-arg-string.ts
DELETED
|
File without changes
|