@atlaskit/dependency-version-analytics 1.6.3 → 1.6.5
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/lib/dependency-store.js +9 -5
- package/dist/cjs/commands/populate-historic-data/product.js +7 -1
- package/dist/cjs/util/analytics.js +1 -1
- package/dist/cjs/util/git.js +5 -2
- package/dist/es2019/commands/populate-historic-data/lib/dependency-store.js +9 -5
- package/dist/es2019/commands/populate-historic-data/product.js +7 -1
- package/dist/es2019/util/analytics.js +1 -1
- package/dist/es2019/util/git.js +5 -2
- package/dist/esm/commands/populate-historic-data/lib/dependency-store.js +46 -44
- package/dist/esm/commands/populate-historic-data/product.js +36 -30
- package/dist/esm/util/analytics.js +1 -1
- package/dist/esm/util/git.js +9 -6
- package/dist/types/commands/populate-historic-data/lib/dependency-store.d.ts +4 -1
- package/dist/types-ts4.5/commands/populate-historic-data/lib/dependency-store.d.ts +4 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/dependency-version-analytics
|
|
2
2
|
|
|
3
|
+
## 1.6.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#68871](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/68871) [`1cb2b8f4e1d7`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/1cb2b8f4e1d7) - Take subWorkDir into consideration when checking for root package.json changes
|
|
8
|
+
|
|
9
|
+
## 1.6.4
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#68766](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/68766) [`da0d4d88ccc6`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/da0d4d88ccc6) - added logs to debug issue related to UPMI-247
|
|
14
|
+
|
|
3
15
|
## 1.6.3
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -55,12 +55,16 @@ class DependencyStore {
|
|
|
55
55
|
/** Updates the repo dependency store based on the changes in `logItem`.
|
|
56
56
|
* Returns the updated flattened dependencies
|
|
57
57
|
*/
|
|
58
|
-
async update(
|
|
58
|
+
async update({
|
|
59
|
+
item,
|
|
60
|
+
subWorkDir
|
|
61
|
+
}) {
|
|
59
62
|
this.assertInitialised();
|
|
60
|
-
const hash =
|
|
61
|
-
(0, _assert.assert)(!!
|
|
62
|
-
const changedPackageJsons =
|
|
63
|
-
const
|
|
63
|
+
const hash = item.hash;
|
|
64
|
+
(0, _assert.assert)(!!item.diff, `Diff must exist in log ${item} ${hash}`);
|
|
65
|
+
const changedPackageJsons = item.diff.files.filter(f => f.file.endsWith('package.json')).map(f => f.file);
|
|
66
|
+
const rootPackageJson = `${subWorkDir ? `${subWorkDir}/` : ''}package.json`;
|
|
67
|
+
const didRootPackageJsonChange = !!changedPackageJsons.find(file => file === rootPackageJson);
|
|
64
68
|
if (didRootPackageJsonChange) {
|
|
65
69
|
const workspacePackageJsonPaths = await (0, _yarn.getWorkspacePackageJsonPaths)(hash, this.subWorkDir);
|
|
66
70
|
const workspacePackageJsonPathsChanged = workspacePackageJsonPaths !== null && (this.workspacePackageJsonPaths.size !== workspacePackageJsonPaths.size || [...this.workspacePackageJsonPaths].some(glob => !workspacePackageJsonPaths.has(glob)));
|
|
@@ -67,7 +67,10 @@ const getEventsFromHistory = async (packageChangesLog, prevRunHash, directoryOpt
|
|
|
67
67
|
if (allPackageChanges.length > 0) {
|
|
68
68
|
dependencies = allPackageChanges[allPackageChanges.length - 1].deps;
|
|
69
69
|
}
|
|
70
|
-
const newDependencies = await dependencyStore.update(
|
|
70
|
+
const newDependencies = await dependencyStore.update({
|
|
71
|
+
item,
|
|
72
|
+
subWorkDir: directoryOptions.subWorkDir
|
|
73
|
+
});
|
|
71
74
|
const packageChange = {
|
|
72
75
|
date: new Date(item.date).toISOString(),
|
|
73
76
|
deps: newDependencies
|
|
@@ -104,11 +107,14 @@ async function getSinceRef(flags) {
|
|
|
104
107
|
}
|
|
105
108
|
}
|
|
106
109
|
async function populateProduct(flags) {
|
|
110
|
+
console.log('running populateProduct with flags: ', flags);
|
|
107
111
|
if (flags.cwd) {
|
|
108
112
|
process.chdir(flags.cwd);
|
|
109
113
|
}
|
|
110
114
|
const sinceRef = flags.reset ? undefined : await getSinceRef(flags);
|
|
115
|
+
console.log('sinceRef: ', sinceRef);
|
|
111
116
|
const log = await (0, _git.getChangesSince)(sinceRef);
|
|
117
|
+
console.log('log: ', log);
|
|
112
118
|
const supportedScopes = (0, _allowedScopes.getSupportedScopes)(flags.includeRestrictedScopes);
|
|
113
119
|
const supportedPackages = flags.supportedPackages ? JSON.parse(flags.supportedPackages) : [];
|
|
114
120
|
console.log(`Supported packages ${supportedPackages.length} and scopes ${supportedScopes}`);
|
|
@@ -67,7 +67,7 @@ function createUpgradeEvent(name, version, previousVersion, date, optionalEventA
|
|
|
67
67
|
}
|
|
68
68
|
});
|
|
69
69
|
return {
|
|
70
|
-
cliVersion: "1.6.
|
|
70
|
+
cliVersion: "1.6.5",
|
|
71
71
|
dependencyName: name,
|
|
72
72
|
versionString: eventVersion,
|
|
73
73
|
major: parsedVersion ? `${parsedVersion.major}` : null,
|
package/dist/cjs/util/git.js
CHANGED
|
@@ -15,7 +15,7 @@ var _simpleGit = _interopRequireDefault(require("simple-git"));
|
|
|
15
15
|
var _assert = require("./assert");
|
|
16
16
|
async function getChangesSince(since) {
|
|
17
17
|
const revisionRange = since ? [`${since}..`] : [];
|
|
18
|
-
const
|
|
18
|
+
const logArgument = [
|
|
19
19
|
// Only commits on mainline master
|
|
20
20
|
'--first-parent',
|
|
21
21
|
// Show merge commit contents
|
|
@@ -27,7 +27,10 @@ async function getChangesSince(since) {
|
|
|
27
27
|
// Make +- graph width as small as possible to maximise filename length
|
|
28
28
|
'--stat-graph-width=1', ...revisionRange,
|
|
29
29
|
// Any commit that modifies a package.json in any directory
|
|
30
|
-
':(glob)**/package.json']
|
|
30
|
+
':(glob)**/package.json'];
|
|
31
|
+
console.log('logArgument: ', logArgument);
|
|
32
|
+
const listLogSummary = await (0, _simpleGit.default)().log(logArgument);
|
|
33
|
+
console.log('listLogSummary: ', listLogSummary);
|
|
31
34
|
return {
|
|
32
35
|
...listLogSummary,
|
|
33
36
|
all: listLogSummary.all.map(logLine => parseLogLine(logLine))
|
|
@@ -48,12 +48,16 @@ export class DependencyStore {
|
|
|
48
48
|
/** Updates the repo dependency store based on the changes in `logItem`.
|
|
49
49
|
* Returns the updated flattened dependencies
|
|
50
50
|
*/
|
|
51
|
-
async update(
|
|
51
|
+
async update({
|
|
52
|
+
item,
|
|
53
|
+
subWorkDir
|
|
54
|
+
}) {
|
|
52
55
|
this.assertInitialised();
|
|
53
|
-
const hash =
|
|
54
|
-
assert(!!
|
|
55
|
-
const changedPackageJsons =
|
|
56
|
-
const
|
|
56
|
+
const hash = item.hash;
|
|
57
|
+
assert(!!item.diff, `Diff must exist in log ${item} ${hash}`);
|
|
58
|
+
const changedPackageJsons = item.diff.files.filter(f => f.file.endsWith('package.json')).map(f => f.file);
|
|
59
|
+
const rootPackageJson = `${subWorkDir ? `${subWorkDir}/` : ''}package.json`;
|
|
60
|
+
const didRootPackageJsonChange = !!changedPackageJsons.find(file => file === rootPackageJson);
|
|
57
61
|
if (didRootPackageJsonChange) {
|
|
58
62
|
const workspacePackageJsonPaths = await getWorkspacePackageJsonPaths(hash, this.subWorkDir);
|
|
59
63
|
const workspacePackageJsonPathsChanged = workspacePackageJsonPaths !== null && (this.workspacePackageJsonPaths.size !== workspacePackageJsonPaths.size || [...this.workspacePackageJsonPaths].some(glob => !workspacePackageJsonPaths.has(glob)));
|
|
@@ -58,7 +58,10 @@ const getEventsFromHistory = async (packageChangesLog, prevRunHash, directoryOpt
|
|
|
58
58
|
if (allPackageChanges.length > 0) {
|
|
59
59
|
dependencies = allPackageChanges[allPackageChanges.length - 1].deps;
|
|
60
60
|
}
|
|
61
|
-
const newDependencies = await dependencyStore.update(
|
|
61
|
+
const newDependencies = await dependencyStore.update({
|
|
62
|
+
item,
|
|
63
|
+
subWorkDir: directoryOptions.subWorkDir
|
|
64
|
+
});
|
|
62
65
|
const packageChange = {
|
|
63
66
|
date: new Date(item.date).toISOString(),
|
|
64
67
|
deps: newDependencies
|
|
@@ -95,11 +98,14 @@ async function getSinceRef(flags) {
|
|
|
95
98
|
}
|
|
96
99
|
}
|
|
97
100
|
export default async function populateProduct(flags) {
|
|
101
|
+
console.log('running populateProduct with flags: ', flags);
|
|
98
102
|
if (flags.cwd) {
|
|
99
103
|
process.chdir(flags.cwd);
|
|
100
104
|
}
|
|
101
105
|
const sinceRef = flags.reset ? undefined : await getSinceRef(flags);
|
|
106
|
+
console.log('sinceRef: ', sinceRef);
|
|
102
107
|
const log = await getChangesSince(sinceRef);
|
|
108
|
+
console.log('log: ', log);
|
|
103
109
|
const supportedScopes = getSupportedScopes(flags.includeRestrictedScopes);
|
|
104
110
|
const supportedPackages = flags.supportedPackages ? JSON.parse(flags.supportedPackages) : [];
|
|
105
111
|
console.log(`Supported packages ${supportedPackages.length} and scopes ${supportedScopes}`);
|
|
@@ -59,7 +59,7 @@ export function createUpgradeEvent(name, version, previousVersion, date, optiona
|
|
|
59
59
|
}
|
|
60
60
|
});
|
|
61
61
|
return {
|
|
62
|
-
cliVersion: "1.6.
|
|
62
|
+
cliVersion: "1.6.5",
|
|
63
63
|
dependencyName: name,
|
|
64
64
|
versionString: eventVersion,
|
|
65
65
|
major: parsedVersion ? `${parsedVersion.major}` : null,
|
package/dist/es2019/util/git.js
CHANGED
|
@@ -2,7 +2,7 @@ import git from 'simple-git';
|
|
|
2
2
|
import { assert } from './assert';
|
|
3
3
|
export async function getChangesSince(since) {
|
|
4
4
|
const revisionRange = since ? [`${since}..`] : [];
|
|
5
|
-
const
|
|
5
|
+
const logArgument = [
|
|
6
6
|
// Only commits on mainline master
|
|
7
7
|
'--first-parent',
|
|
8
8
|
// Show merge commit contents
|
|
@@ -14,7 +14,10 @@ export async function getChangesSince(since) {
|
|
|
14
14
|
// Make +- graph width as small as possible to maximise filename length
|
|
15
15
|
'--stat-graph-width=1', ...revisionRange,
|
|
16
16
|
// Any commit that modifies a package.json in any directory
|
|
17
|
-
':(glob)**/package.json']
|
|
17
|
+
':(glob)**/package.json'];
|
|
18
|
+
console.log('logArgument: ', logArgument);
|
|
19
|
+
const listLogSummary = await git().log(logArgument);
|
|
20
|
+
console.log('listLogSummary: ', listLogSummary);
|
|
18
21
|
return {
|
|
19
22
|
...listLogSummary,
|
|
20
23
|
all: listLogSummary.all.map(logLine => parseLogLine(logLine))
|
|
@@ -81,68 +81,70 @@ export var DependencyStore = /*#__PURE__*/function () {
|
|
|
81
81
|
}, {
|
|
82
82
|
key: "update",
|
|
83
83
|
value: function () {
|
|
84
|
-
var _update = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(
|
|
85
|
-
var hash, changedPackageJsons, didRootPackageJsonChange, workspacePackageJsonPaths, workspacePackageJsonPathsChanged, changedWorkspaces, _iterator, _step, workspacePath, workspaceDeps, validWorkspace, noLongerWorkspace;
|
|
84
|
+
var _update = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref2) {
|
|
85
|
+
var item, subWorkDir, hash, changedPackageJsons, rootPackageJson, didRootPackageJsonChange, workspacePackageJsonPaths, workspacePackageJsonPathsChanged, changedWorkspaces, _iterator, _step, workspacePath, workspaceDeps, validWorkspace, noLongerWorkspace;
|
|
86
86
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
87
87
|
while (1) switch (_context2.prev = _context2.next) {
|
|
88
88
|
case 0:
|
|
89
|
+
item = _ref2.item, subWorkDir = _ref2.subWorkDir;
|
|
89
90
|
this.assertInitialised();
|
|
90
|
-
hash =
|
|
91
|
-
assert(!!
|
|
92
|
-
changedPackageJsons =
|
|
91
|
+
hash = item.hash;
|
|
92
|
+
assert(!!item.diff, "Diff must exist in log ".concat(item, " ").concat(hash));
|
|
93
|
+
changedPackageJsons = item.diff.files.filter(function (f) {
|
|
93
94
|
return f.file.endsWith('package.json');
|
|
94
95
|
}).map(function (f) {
|
|
95
96
|
return f.file;
|
|
96
97
|
});
|
|
98
|
+
rootPackageJson = "".concat(subWorkDir ? "".concat(subWorkDir, "/") : '', "package.json");
|
|
97
99
|
didRootPackageJsonChange = !!changedPackageJsons.find(function (file) {
|
|
98
|
-
return file ===
|
|
100
|
+
return file === rootPackageJson;
|
|
99
101
|
});
|
|
100
102
|
if (!didRootPackageJsonChange) {
|
|
101
|
-
_context2.next =
|
|
103
|
+
_context2.next = 17;
|
|
102
104
|
break;
|
|
103
105
|
}
|
|
104
|
-
_context2.next =
|
|
106
|
+
_context2.next = 10;
|
|
105
107
|
return getWorkspacePackageJsonPaths(hash, this.subWorkDir);
|
|
106
|
-
case
|
|
108
|
+
case 10:
|
|
107
109
|
workspacePackageJsonPaths = _context2.sent;
|
|
108
110
|
workspacePackageJsonPathsChanged = workspacePackageJsonPaths !== null && (this.workspacePackageJsonPaths.size !== workspacePackageJsonPaths.size || _toConsumableArray(this.workspacePackageJsonPaths).some(function (glob) {
|
|
109
111
|
return !workspacePackageJsonPaths.has(glob);
|
|
110
112
|
}));
|
|
111
113
|
if (!workspacePackageJsonPathsChanged) {
|
|
112
|
-
_context2.next =
|
|
114
|
+
_context2.next = 17;
|
|
113
115
|
break;
|
|
114
116
|
}
|
|
115
117
|
debug("Workspace globs changed: ".concat(_toConsumableArray(workspacePackageJsonPaths), ". Resetting store."));
|
|
116
|
-
_context2.next =
|
|
118
|
+
_context2.next = 16;
|
|
117
119
|
return this.resetStore(hash);
|
|
118
|
-
case
|
|
120
|
+
case 16:
|
|
119
121
|
return _context2.abrupt("return", this.getFlattenedDeps());
|
|
120
|
-
case
|
|
122
|
+
case 17:
|
|
121
123
|
changedWorkspaces = micromatch(changedPackageJsons, _toConsumableArray(this.workspacePackageJsonPaths));
|
|
122
124
|
debug("Updating changed workspaces@".concat(hash, ": ").concat(changedWorkspaces));
|
|
123
125
|
|
|
124
126
|
// Iterate over all changed package.jsons rather than only valid workspaces so that we can
|
|
125
127
|
// remove older workspaces that are no longer valid
|
|
126
128
|
_iterator = _createForOfIteratorHelper(changedPackageJsons);
|
|
127
|
-
_context2.prev =
|
|
129
|
+
_context2.prev = 20;
|
|
128
130
|
_iterator.s();
|
|
129
|
-
case
|
|
131
|
+
case 22:
|
|
130
132
|
if ((_step = _iterator.n()).done) {
|
|
131
|
-
_context2.next =
|
|
133
|
+
_context2.next = 35;
|
|
132
134
|
break;
|
|
133
135
|
}
|
|
134
136
|
workspacePath = _step.value;
|
|
135
|
-
_context2.next =
|
|
137
|
+
_context2.next = 26;
|
|
136
138
|
return this.getWorkspaceDependencies(hash, workspacePath);
|
|
137
|
-
case
|
|
139
|
+
case 26:
|
|
138
140
|
workspaceDeps = _context2.sent;
|
|
139
141
|
validWorkspace = changedWorkspaces.includes(workspacePath);
|
|
140
142
|
if (!(!validWorkspace && !this.workspaces[workspacePath])) {
|
|
141
|
-
_context2.next =
|
|
143
|
+
_context2.next = 30;
|
|
142
144
|
break;
|
|
143
145
|
}
|
|
144
|
-
return _context2.abrupt("continue",
|
|
145
|
-
case
|
|
146
|
+
return _context2.abrupt("continue", 33);
|
|
147
|
+
case 30:
|
|
146
148
|
// For workspaces that are no longer a valid workspace but were previously, explicitly remove them
|
|
147
149
|
noLongerWorkspace = !validWorkspace && this.workspaces[workspacePath];
|
|
148
150
|
if (workspaceDeps == null || noLongerWorkspace) {
|
|
@@ -155,27 +157,27 @@ export var DependencyStore = /*#__PURE__*/function () {
|
|
|
155
157
|
workspaceDeps = {};
|
|
156
158
|
}
|
|
157
159
|
this.updateWorkspaces(workspacePath, workspaceDeps);
|
|
158
|
-
case 31:
|
|
159
|
-
_context2.next = 20;
|
|
160
|
-
break;
|
|
161
160
|
case 33:
|
|
162
|
-
_context2.next =
|
|
161
|
+
_context2.next = 22;
|
|
163
162
|
break;
|
|
164
163
|
case 35:
|
|
165
|
-
_context2.
|
|
166
|
-
|
|
164
|
+
_context2.next = 40;
|
|
165
|
+
break;
|
|
166
|
+
case 37:
|
|
167
|
+
_context2.prev = 37;
|
|
168
|
+
_context2.t0 = _context2["catch"](20);
|
|
167
169
|
_iterator.e(_context2.t0);
|
|
168
|
-
case
|
|
169
|
-
_context2.prev =
|
|
170
|
+
case 40:
|
|
171
|
+
_context2.prev = 40;
|
|
170
172
|
_iterator.f();
|
|
171
|
-
return _context2.finish(
|
|
172
|
-
case
|
|
173
|
+
return _context2.finish(40);
|
|
174
|
+
case 43:
|
|
173
175
|
return _context2.abrupt("return", this.getFlattenedDeps());
|
|
174
|
-
case
|
|
176
|
+
case 44:
|
|
175
177
|
case "end":
|
|
176
178
|
return _context2.stop();
|
|
177
179
|
}
|
|
178
|
-
}, _callee2, this, [[
|
|
180
|
+
}, _callee2, this, [[20, 37, 40, 43]]);
|
|
179
181
|
}));
|
|
180
182
|
function update(_x2) {
|
|
181
183
|
return _update.apply(this, arguments);
|
|
@@ -189,14 +191,14 @@ export var DependencyStore = /*#__PURE__*/function () {
|
|
|
189
191
|
}, {
|
|
190
192
|
key: "getFlattenedDeps",
|
|
191
193
|
value: function getFlattenedDeps() {
|
|
192
|
-
var deps = Object.entries(this.dependencies).filter(function (
|
|
193
|
-
var
|
|
194
|
-
versions =
|
|
194
|
+
var deps = Object.entries(this.dependencies).filter(function (_ref3) {
|
|
195
|
+
var _ref4 = _slicedToArray(_ref3, 2),
|
|
196
|
+
versions = _ref4[1];
|
|
195
197
|
return versions.length > 0;
|
|
196
|
-
}).map(function (
|
|
197
|
-
var
|
|
198
|
-
depName =
|
|
199
|
-
versions =
|
|
198
|
+
}).map(function (_ref5) {
|
|
199
|
+
var _ref6 = _slicedToArray(_ref5, 2),
|
|
200
|
+
depName = _ref6[0],
|
|
201
|
+
versions = _ref6[1];
|
|
200
202
|
return [depName, DependencyStore.getMinimumVersion(versions, depName)];
|
|
201
203
|
});
|
|
202
204
|
return Object.fromEntries(deps);
|
|
@@ -411,10 +413,10 @@ export var DependencyStore = /*#__PURE__*/function () {
|
|
|
411
413
|
key: "getSupportedDependencies",
|
|
412
414
|
value: function getSupportedDependencies(depMap, dependencyType) {
|
|
413
415
|
var _this = this;
|
|
414
|
-
return Object.entries(depMap).reduce(function (supportedDependencies,
|
|
415
|
-
var
|
|
416
|
-
rawPackageName =
|
|
417
|
-
packageVersion =
|
|
416
|
+
return Object.entries(depMap).reduce(function (supportedDependencies, _ref7) {
|
|
417
|
+
var _ref8 = _slicedToArray(_ref7, 2),
|
|
418
|
+
rawPackageName = _ref8[0],
|
|
419
|
+
packageVersion = _ref8[1];
|
|
418
420
|
// Ignore suffixed `--next` deps in jira used for independent upgrades
|
|
419
421
|
if (rawPackageName.endsWith('--next')) {
|
|
420
422
|
return supportedDependencies;
|
|
@@ -91,7 +91,10 @@ var getEventsFromHistory = /*#__PURE__*/function () {
|
|
|
91
91
|
dependencies = allPackageChanges[allPackageChanges.length - 1].deps;
|
|
92
92
|
}
|
|
93
93
|
_context.next = 13;
|
|
94
|
-
return dependencyStore.update(
|
|
94
|
+
return dependencyStore.update({
|
|
95
|
+
item: item,
|
|
96
|
+
subWorkDir: directoryOptions.subWorkDir
|
|
97
|
+
});
|
|
95
98
|
case 13:
|
|
96
99
|
newDependencies = _context.sent;
|
|
97
100
|
packageChange = {
|
|
@@ -182,42 +185,45 @@ function _populateProduct() {
|
|
|
182
185
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
183
186
|
while (1) switch (_context3.prev = _context3.next) {
|
|
184
187
|
case 0:
|
|
188
|
+
console.log('running populateProduct with flags: ', flags);
|
|
185
189
|
if (flags.cwd) {
|
|
186
190
|
process.chdir(flags.cwd);
|
|
187
191
|
}
|
|
188
192
|
if (!flags.reset) {
|
|
189
|
-
_context3.next =
|
|
193
|
+
_context3.next = 6;
|
|
190
194
|
break;
|
|
191
195
|
}
|
|
192
196
|
_context3.t0 = undefined;
|
|
193
|
-
_context3.next =
|
|
197
|
+
_context3.next = 9;
|
|
194
198
|
break;
|
|
195
|
-
case
|
|
196
|
-
_context3.next =
|
|
199
|
+
case 6:
|
|
200
|
+
_context3.next = 8;
|
|
197
201
|
return getSinceRef(flags);
|
|
198
|
-
case 7:
|
|
199
|
-
_context3.t0 = _context3.sent;
|
|
200
202
|
case 8:
|
|
203
|
+
_context3.t0 = _context3.sent;
|
|
204
|
+
case 9:
|
|
201
205
|
sinceRef = _context3.t0;
|
|
202
|
-
|
|
206
|
+
console.log('sinceRef: ', sinceRef);
|
|
207
|
+
_context3.next = 13;
|
|
203
208
|
return getChangesSince(sinceRef);
|
|
204
|
-
case
|
|
209
|
+
case 13:
|
|
205
210
|
log = _context3.sent;
|
|
211
|
+
console.log('log: ', log);
|
|
206
212
|
supportedScopes = getSupportedScopes(flags.includeRestrictedScopes);
|
|
207
213
|
supportedPackages = flags.supportedPackages ? JSON.parse(flags.supportedPackages) : [];
|
|
208
214
|
console.log("Supported packages ".concat(supportedPackages.length, " and scopes ").concat(supportedScopes));
|
|
209
215
|
if (!(log.all.length === 0)) {
|
|
210
|
-
_context3.next =
|
|
216
|
+
_context3.next = 21;
|
|
211
217
|
break;
|
|
212
218
|
}
|
|
213
219
|
console.log("No package.json changes found since '".concat(sinceRef, "'."));
|
|
214
220
|
return _context3.abrupt("return");
|
|
215
|
-
case
|
|
216
|
-
_context3.next =
|
|
221
|
+
case 21:
|
|
222
|
+
_context3.next = 23;
|
|
217
223
|
return getEventsFromHistory(log, sinceRef, {
|
|
218
224
|
subWorkDir: flags.subWorkDir
|
|
219
225
|
}, supportedScopes, supportedPackages);
|
|
220
|
-
case
|
|
226
|
+
case 23:
|
|
221
227
|
_yield$getEventsFromH = _context3.sent;
|
|
222
228
|
allPackageChanges = _yield$getEventsFromH.allPackageChanges;
|
|
223
229
|
allUpgradeEvents = _yield$getEventsFromH.allUpgradeEvents;
|
|
@@ -225,53 +231,53 @@ function _populateProduct() {
|
|
|
225
231
|
console.log("Found no dependency changes from supported scopes ".concat(supportedScopes.join(', '), " since last run from ref \"").concat(sinceRef, "\"'"));
|
|
226
232
|
}
|
|
227
233
|
if (!flags.csv) {
|
|
228
|
-
_context3.next =
|
|
234
|
+
_context3.next = 31;
|
|
229
235
|
break;
|
|
230
236
|
}
|
|
231
237
|
csv = generateCSV(allPackageChanges);
|
|
232
238
|
console.log('Generated csv: ', csv);
|
|
233
239
|
return _context3.abrupt("return");
|
|
234
|
-
case
|
|
240
|
+
case 31:
|
|
235
241
|
if (!flags.dryRun) {
|
|
236
|
-
_context3.next =
|
|
242
|
+
_context3.next = 34;
|
|
237
243
|
break;
|
|
238
244
|
}
|
|
239
245
|
console.log('All upgrade events: ', JSON.stringify(allUpgradeEvents));
|
|
240
246
|
return _context3.abrupt("return");
|
|
241
|
-
case
|
|
247
|
+
case 34:
|
|
242
248
|
if (!(allUpgradeEvents.length > 0)) {
|
|
243
|
-
_context3.next =
|
|
249
|
+
_context3.next = 37;
|
|
244
250
|
break;
|
|
245
251
|
}
|
|
246
|
-
_context3.next =
|
|
252
|
+
_context3.next = 37;
|
|
247
253
|
return sendAnalytics(allUpgradeEvents, {
|
|
248
254
|
dev: flags.dev,
|
|
249
255
|
limit: flags.limit,
|
|
250
256
|
product: flags.product,
|
|
251
257
|
skipPrompt: !flags.interactive
|
|
252
258
|
});
|
|
253
|
-
case
|
|
259
|
+
case 37:
|
|
254
260
|
if (!flags.statlas) {
|
|
255
|
-
_context3.next =
|
|
261
|
+
_context3.next = 46;
|
|
256
262
|
break;
|
|
257
263
|
}
|
|
258
|
-
_context3.next =
|
|
264
|
+
_context3.next = 40;
|
|
259
265
|
return getHash('HEAD');
|
|
260
|
-
case
|
|
266
|
+
case 40:
|
|
261
267
|
currentCommit = _context3.sent;
|
|
262
|
-
_context3.next =
|
|
268
|
+
_context3.next = 43;
|
|
263
269
|
return statlas.uploadMeta(flags.product, currentCommit);
|
|
264
|
-
case
|
|
270
|
+
case 43:
|
|
265
271
|
console.log('Finished');
|
|
266
|
-
_context3.next =
|
|
272
|
+
_context3.next = 50;
|
|
267
273
|
break;
|
|
268
|
-
case
|
|
274
|
+
case 46:
|
|
269
275
|
console.log('Updating tag to current commit...');
|
|
270
|
-
_context3.next =
|
|
276
|
+
_context3.next = 49;
|
|
271
277
|
return tagCommit(DEFAULT_TAG);
|
|
272
|
-
case
|
|
278
|
+
case 49:
|
|
273
279
|
console.log("Finished. Run 'git push origin tag ".concat(sinceRef, "'."));
|
|
274
|
-
case
|
|
280
|
+
case 50:
|
|
275
281
|
case "end":
|
|
276
282
|
return _context3.stop();
|
|
277
283
|
}
|
|
@@ -66,7 +66,7 @@ export function createUpgradeEvent(name, version, previousVersion, date) {
|
|
|
66
66
|
}
|
|
67
67
|
});
|
|
68
68
|
return _objectSpread({
|
|
69
|
-
cliVersion: "1.6.
|
|
69
|
+
cliVersion: "1.6.5",
|
|
70
70
|
dependencyName: name,
|
|
71
71
|
versionString: eventVersion,
|
|
72
72
|
major: parsedVersion ? "".concat(parsedVersion.major) : null,
|
package/dist/esm/util/git.js
CHANGED
|
@@ -11,13 +11,12 @@ export function getChangesSince(_x) {
|
|
|
11
11
|
}
|
|
12
12
|
function _getChangesSince() {
|
|
13
13
|
_getChangesSince = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(since) {
|
|
14
|
-
var revisionRange, listLogSummary;
|
|
14
|
+
var revisionRange, logArgument, listLogSummary;
|
|
15
15
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
16
16
|
while (1) switch (_context.prev = _context.next) {
|
|
17
17
|
case 0:
|
|
18
18
|
revisionRange = since ? ["".concat(since, "..")] : [];
|
|
19
|
-
|
|
20
|
-
return git().log([
|
|
19
|
+
logArgument = [
|
|
21
20
|
// Only commits on mainline master
|
|
22
21
|
'--first-parent',
|
|
23
22
|
// Show merge commit contents
|
|
@@ -29,15 +28,19 @@ function _getChangesSince() {
|
|
|
29
28
|
// Make +- graph width as small as possible to maximise filename length
|
|
30
29
|
'--stat-graph-width=1'].concat(revisionRange, [
|
|
31
30
|
// Any commit that modifies a package.json in any directory
|
|
32
|
-
':(glob)**/package.json'])
|
|
33
|
-
|
|
31
|
+
':(glob)**/package.json']);
|
|
32
|
+
console.log('logArgument: ', logArgument);
|
|
33
|
+
_context.next = 5;
|
|
34
|
+
return git().log(logArgument);
|
|
35
|
+
case 5:
|
|
34
36
|
listLogSummary = _context.sent;
|
|
37
|
+
console.log('listLogSummary: ', listLogSummary);
|
|
35
38
|
return _context.abrupt("return", _objectSpread(_objectSpread({}, listLogSummary), {}, {
|
|
36
39
|
all: listLogSummary.all.map(function (logLine) {
|
|
37
40
|
return parseLogLine(logLine);
|
|
38
41
|
})
|
|
39
42
|
}));
|
|
40
|
-
case
|
|
43
|
+
case 8:
|
|
41
44
|
case "end":
|
|
42
45
|
return _context.stop();
|
|
43
46
|
}
|
|
@@ -30,7 +30,10 @@ export declare class DependencyStore {
|
|
|
30
30
|
/** Updates the repo dependency store based on the changes in `logItem`.
|
|
31
31
|
* Returns the updated flattened dependencies
|
|
32
32
|
*/
|
|
33
|
-
update(
|
|
33
|
+
update({ item, subWorkDir, }: {
|
|
34
|
+
item: DefaultLogFields & ListLogLine;
|
|
35
|
+
subWorkDir?: string;
|
|
36
|
+
}): Promise<DependencyMap>;
|
|
34
37
|
/** Retrieve a flattened list of p repo dependencies.
|
|
35
38
|
* If multiple versions of a dependency exist, the lowest version is returned.
|
|
36
39
|
* If the dependency is listed under multiple dependency types, 'dependencies' is prioritised over 'devDependencies'
|
|
@@ -30,7 +30,10 @@ export declare class DependencyStore {
|
|
|
30
30
|
/** Updates the repo dependency store based on the changes in `logItem`.
|
|
31
31
|
* Returns the updated flattened dependencies
|
|
32
32
|
*/
|
|
33
|
-
update(
|
|
33
|
+
update({ item, subWorkDir, }: {
|
|
34
|
+
item: DefaultLogFields & ListLogLine;
|
|
35
|
+
subWorkDir?: string;
|
|
36
|
+
}): Promise<DependencyMap>;
|
|
34
37
|
/** Retrieve a flattened list of p repo dependencies.
|
|
35
38
|
* If multiple versions of a dependency exist, the lowest version is returned.
|
|
36
39
|
* If the dependency is listed under multiple dependency types, 'dependencies' is prioritised over 'devDependencies'
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/dependency-version-analytics",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.5",
|
|
4
4
|
"description": "Tool to pull atlaskit version history from a repo",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
7
7
|
},
|
|
8
|
-
"repository": "https://bitbucket.org/atlassian/atlassian-frontend",
|
|
8
|
+
"repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
|
|
9
9
|
"author": "Atlassian Pty Ltd",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"main": "dist/cjs/index.js",
|