@atlaskit/dependency-version-analytics 1.6.2 → 1.6.4
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 +3 -0
- package/dist/cjs/util/analytics.js +1 -1
- package/dist/cjs/util/git.js +5 -2
- package/dist/es2019/commands/populate-historic-data/product.js +3 -0
- package/dist/es2019/util/analytics.js +1 -1
- package/dist/es2019/util/git.js +5 -2
- package/dist/esm/commands/populate-historic-data/product.js +32 -29
- package/dist/esm/util/analytics.js +1 -1
- package/dist/esm/util/git.js +9 -6
- package/package.json +10 -5
- package/tmp/api-report-tmp.d.ts +0 -81
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/dependency-version-analytics
|
|
2
2
|
|
|
3
|
+
## 1.6.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#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
|
|
8
|
+
|
|
9
|
+
## 1.6.3
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#66058](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/66058) [`f602c4298340`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/f602c4298340) - Migrate @atlaskit/dependency-version-analytics to use declarative entry points
|
|
14
|
+
|
|
3
15
|
## 1.6.2
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -104,11 +104,14 @@ async function getSinceRef(flags) {
|
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
async function populateProduct(flags) {
|
|
107
|
+
console.log('running populateProduct with flags: ', flags);
|
|
107
108
|
if (flags.cwd) {
|
|
108
109
|
process.chdir(flags.cwd);
|
|
109
110
|
}
|
|
110
111
|
const sinceRef = flags.reset ? undefined : await getSinceRef(flags);
|
|
112
|
+
console.log('sinceRef: ', sinceRef);
|
|
111
113
|
const log = await (0, _git.getChangesSince)(sinceRef);
|
|
114
|
+
console.log('log: ', log);
|
|
112
115
|
const supportedScopes = (0, _allowedScopes.getSupportedScopes)(flags.includeRestrictedScopes);
|
|
113
116
|
const supportedPackages = flags.supportedPackages ? JSON.parse(flags.supportedPackages) : [];
|
|
114
117
|
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.4",
|
|
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))
|
|
@@ -95,11 +95,14 @@ async function getSinceRef(flags) {
|
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
export default async function populateProduct(flags) {
|
|
98
|
+
console.log('running populateProduct with flags: ', flags);
|
|
98
99
|
if (flags.cwd) {
|
|
99
100
|
process.chdir(flags.cwd);
|
|
100
101
|
}
|
|
101
102
|
const sinceRef = flags.reset ? undefined : await getSinceRef(flags);
|
|
103
|
+
console.log('sinceRef: ', sinceRef);
|
|
102
104
|
const log = await getChangesSince(sinceRef);
|
|
105
|
+
console.log('log: ', log);
|
|
103
106
|
const supportedScopes = getSupportedScopes(flags.includeRestrictedScopes);
|
|
104
107
|
const supportedPackages = flags.supportedPackages ? JSON.parse(flags.supportedPackages) : [];
|
|
105
108
|
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.4",
|
|
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))
|
|
@@ -182,42 +182,45 @@ function _populateProduct() {
|
|
|
182
182
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
183
183
|
while (1) switch (_context3.prev = _context3.next) {
|
|
184
184
|
case 0:
|
|
185
|
+
console.log('running populateProduct with flags: ', flags);
|
|
185
186
|
if (flags.cwd) {
|
|
186
187
|
process.chdir(flags.cwd);
|
|
187
188
|
}
|
|
188
189
|
if (!flags.reset) {
|
|
189
|
-
_context3.next =
|
|
190
|
+
_context3.next = 6;
|
|
190
191
|
break;
|
|
191
192
|
}
|
|
192
193
|
_context3.t0 = undefined;
|
|
193
|
-
_context3.next =
|
|
194
|
+
_context3.next = 9;
|
|
194
195
|
break;
|
|
195
|
-
case
|
|
196
|
-
_context3.next =
|
|
196
|
+
case 6:
|
|
197
|
+
_context3.next = 8;
|
|
197
198
|
return getSinceRef(flags);
|
|
198
|
-
case 7:
|
|
199
|
-
_context3.t0 = _context3.sent;
|
|
200
199
|
case 8:
|
|
200
|
+
_context3.t0 = _context3.sent;
|
|
201
|
+
case 9:
|
|
201
202
|
sinceRef = _context3.t0;
|
|
202
|
-
|
|
203
|
+
console.log('sinceRef: ', sinceRef);
|
|
204
|
+
_context3.next = 13;
|
|
203
205
|
return getChangesSince(sinceRef);
|
|
204
|
-
case
|
|
206
|
+
case 13:
|
|
205
207
|
log = _context3.sent;
|
|
208
|
+
console.log('log: ', log);
|
|
206
209
|
supportedScopes = getSupportedScopes(flags.includeRestrictedScopes);
|
|
207
210
|
supportedPackages = flags.supportedPackages ? JSON.parse(flags.supportedPackages) : [];
|
|
208
211
|
console.log("Supported packages ".concat(supportedPackages.length, " and scopes ").concat(supportedScopes));
|
|
209
212
|
if (!(log.all.length === 0)) {
|
|
210
|
-
_context3.next =
|
|
213
|
+
_context3.next = 21;
|
|
211
214
|
break;
|
|
212
215
|
}
|
|
213
216
|
console.log("No package.json changes found since '".concat(sinceRef, "'."));
|
|
214
217
|
return _context3.abrupt("return");
|
|
215
|
-
case
|
|
216
|
-
_context3.next =
|
|
218
|
+
case 21:
|
|
219
|
+
_context3.next = 23;
|
|
217
220
|
return getEventsFromHistory(log, sinceRef, {
|
|
218
221
|
subWorkDir: flags.subWorkDir
|
|
219
222
|
}, supportedScopes, supportedPackages);
|
|
220
|
-
case
|
|
223
|
+
case 23:
|
|
221
224
|
_yield$getEventsFromH = _context3.sent;
|
|
222
225
|
allPackageChanges = _yield$getEventsFromH.allPackageChanges;
|
|
223
226
|
allUpgradeEvents = _yield$getEventsFromH.allUpgradeEvents;
|
|
@@ -225,53 +228,53 @@ function _populateProduct() {
|
|
|
225
228
|
console.log("Found no dependency changes from supported scopes ".concat(supportedScopes.join(', '), " since last run from ref \"").concat(sinceRef, "\"'"));
|
|
226
229
|
}
|
|
227
230
|
if (!flags.csv) {
|
|
228
|
-
_context3.next =
|
|
231
|
+
_context3.next = 31;
|
|
229
232
|
break;
|
|
230
233
|
}
|
|
231
234
|
csv = generateCSV(allPackageChanges);
|
|
232
235
|
console.log('Generated csv: ', csv);
|
|
233
236
|
return _context3.abrupt("return");
|
|
234
|
-
case
|
|
237
|
+
case 31:
|
|
235
238
|
if (!flags.dryRun) {
|
|
236
|
-
_context3.next =
|
|
239
|
+
_context3.next = 34;
|
|
237
240
|
break;
|
|
238
241
|
}
|
|
239
242
|
console.log('All upgrade events: ', JSON.stringify(allUpgradeEvents));
|
|
240
243
|
return _context3.abrupt("return");
|
|
241
|
-
case
|
|
244
|
+
case 34:
|
|
242
245
|
if (!(allUpgradeEvents.length > 0)) {
|
|
243
|
-
_context3.next =
|
|
246
|
+
_context3.next = 37;
|
|
244
247
|
break;
|
|
245
248
|
}
|
|
246
|
-
_context3.next =
|
|
249
|
+
_context3.next = 37;
|
|
247
250
|
return sendAnalytics(allUpgradeEvents, {
|
|
248
251
|
dev: flags.dev,
|
|
249
252
|
limit: flags.limit,
|
|
250
253
|
product: flags.product,
|
|
251
254
|
skipPrompt: !flags.interactive
|
|
252
255
|
});
|
|
253
|
-
case
|
|
256
|
+
case 37:
|
|
254
257
|
if (!flags.statlas) {
|
|
255
|
-
_context3.next =
|
|
258
|
+
_context3.next = 46;
|
|
256
259
|
break;
|
|
257
260
|
}
|
|
258
|
-
_context3.next =
|
|
261
|
+
_context3.next = 40;
|
|
259
262
|
return getHash('HEAD');
|
|
260
|
-
case
|
|
263
|
+
case 40:
|
|
261
264
|
currentCommit = _context3.sent;
|
|
262
|
-
_context3.next =
|
|
265
|
+
_context3.next = 43;
|
|
263
266
|
return statlas.uploadMeta(flags.product, currentCommit);
|
|
264
|
-
case
|
|
267
|
+
case 43:
|
|
265
268
|
console.log('Finished');
|
|
266
|
-
_context3.next =
|
|
269
|
+
_context3.next = 50;
|
|
267
270
|
break;
|
|
268
|
-
case
|
|
271
|
+
case 46:
|
|
269
272
|
console.log('Updating tag to current commit...');
|
|
270
|
-
_context3.next =
|
|
273
|
+
_context3.next = 49;
|
|
271
274
|
return tagCommit(DEFAULT_TAG);
|
|
272
|
-
case
|
|
275
|
+
case 49:
|
|
273
276
|
console.log("Finished. Run 'git push origin tag ".concat(sinceRef, "'."));
|
|
274
|
-
case
|
|
277
|
+
case 50:
|
|
275
278
|
case "end":
|
|
276
279
|
return _context3.stop();
|
|
277
280
|
}
|
|
@@ -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.4",
|
|
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
|
}
|
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.4",
|
|
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",
|
|
@@ -22,7 +22,6 @@
|
|
|
22
22
|
"atlaskit:src": "src/index.ts",
|
|
23
23
|
"atlassian": {
|
|
24
24
|
"team": "UIP - Platform Integration Trust (PITa)",
|
|
25
|
-
"deprecatedAutoEntryPoints": true,
|
|
26
25
|
"releaseModel": "continuous"
|
|
27
26
|
},
|
|
28
27
|
"bin": {
|
|
@@ -57,5 +56,11 @@
|
|
|
57
56
|
"ts-node": "^10.9.1",
|
|
58
57
|
"typescript": "~4.9.5"
|
|
59
58
|
},
|
|
60
|
-
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.0"
|
|
61
|
-
|
|
59
|
+
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.0",
|
|
60
|
+
"af:exports": {
|
|
61
|
+
".": "./src/index.ts",
|
|
62
|
+
"./cli": "./src/cli.ts",
|
|
63
|
+
"./constants": "./src/constants.ts",
|
|
64
|
+
"./types": "./src/types.ts"
|
|
65
|
+
}
|
|
66
|
+
}
|
package/tmp/api-report-tmp.d.ts
DELETED
|
@@ -1,81 +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
|
-
supportedPackages?: string;
|
|
42
|
-
subWorkDir?: string;
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
// @public (undocumented)
|
|
46
|
-
export function sendAnalytics(analyticsEvents: UpgradeEvent[], { dev, limit, product, skipPrompt, }: {
|
|
47
|
-
dev?: boolean;
|
|
48
|
-
limit?: number;
|
|
49
|
-
product: string;
|
|
50
|
-
skipPrompt?: boolean;
|
|
51
|
-
}): Promise<void>;
|
|
52
|
-
|
|
53
|
-
// @public (undocumented)
|
|
54
|
-
export type UpgradeEvent = {
|
|
55
|
-
dependencyName: string;
|
|
56
|
-
versionString: string;
|
|
57
|
-
major: null | string;
|
|
58
|
-
minor: null | string;
|
|
59
|
-
patch: null | string;
|
|
60
|
-
date: string;
|
|
61
|
-
upgradeType: UpgradeType;
|
|
62
|
-
upgradeSubType: UpgradeSubType;
|
|
63
|
-
cliVersion: string;
|
|
64
|
-
latestTag: null | string;
|
|
65
|
-
nextTag: null | string;
|
|
66
|
-
hotfixTag: null | string;
|
|
67
|
-
rcTag: null | string;
|
|
68
|
-
dependencyType?: DependencyType;
|
|
69
|
-
historical?: boolean;
|
|
70
|
-
commitHash?: string;
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
// @public (undocumented)
|
|
74
|
-
export type UpgradeSubType = ReleaseType | null;
|
|
75
|
-
|
|
76
|
-
// @public (undocumented)
|
|
77
|
-
export type UpgradeType = 'add' | 'downgrade' | 'remove' | 'upgrade';
|
|
78
|
-
|
|
79
|
-
// (No @packageDocumentation comment for this package)
|
|
80
|
-
|
|
81
|
-
```
|