dotcom-tool-kit 3.4.2 → 3.4.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/lib/install.d.ts.map +1 -1
- package/lib/install.js +12 -14
- package/package.json +4 -4
package/lib/install.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../src/install.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AACrC,OAAO,EAAc,WAAW,EAAE,MAAM,UAAU,CAAA;AAalD,wBAA8B,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,
|
|
1
|
+
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../src/install.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AACrC,OAAO,EAAc,WAAW,EAAE,MAAM,UAAU,CAAA;AAalD,wBAA8B,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAyD/E"}
|
package/lib/install.js
CHANGED
|
@@ -6,14 +6,14 @@ const options_1 = require("@dotcom-tool-kit/options");
|
|
|
6
6
|
const groupBy_1 = tslib_1.__importDefault(require("lodash/groupBy"));
|
|
7
7
|
const config_1 = require("./config");
|
|
8
8
|
const postInstall_1 = require("./postInstall");
|
|
9
|
-
// implementation of the Array.
|
|
10
|
-
async function
|
|
9
|
+
// implementation of the Array.every method that supports asynchronous predicates
|
|
10
|
+
async function asyncEvery(arr, pred) {
|
|
11
11
|
for (const val of arr) {
|
|
12
|
-
if (await pred(val)) {
|
|
13
|
-
return
|
|
12
|
+
if (!(await pred(val))) {
|
|
13
|
+
return false;
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
|
-
return
|
|
16
|
+
return true;
|
|
17
17
|
}
|
|
18
18
|
async function installHooks(logger) {
|
|
19
19
|
const config = await (0, config_1.loadConfig)(logger);
|
|
@@ -23,24 +23,18 @@ async function installHooks(logger) {
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
const errors = [];
|
|
26
|
-
// HACK: achieve backwards compatibility with older versions of the circleci
|
|
27
|
-
// plugin that required a postinstall function to run instead of the new
|
|
28
|
-
// commitInstall method. remove in major update of cli.
|
|
29
|
-
let usesNewCircleCIGroup = false;
|
|
30
26
|
// group hooks without an installGroup separately so that their check()
|
|
31
27
|
// method runs independently
|
|
32
28
|
const groups = (0, groupBy_1.default)(config.hooks, (hook) => hook.installGroup ?? '__' + hook.id);
|
|
33
|
-
for (const
|
|
29
|
+
for (const group of Object.values(groups)) {
|
|
34
30
|
try {
|
|
35
|
-
|
|
31
|
+
const allChecksPassed = await asyncEvery(group, (hook) => hook.check());
|
|
32
|
+
if (!allChecksPassed) {
|
|
36
33
|
let state = undefined;
|
|
37
34
|
for (const hook of group) {
|
|
38
35
|
state = await hook.install(state);
|
|
39
36
|
}
|
|
40
37
|
if (state) {
|
|
41
|
-
if (groupId === 'circleci') {
|
|
42
|
-
usesNewCircleCIGroup = true;
|
|
43
|
-
}
|
|
44
38
|
try {
|
|
45
39
|
await group[0].commitInstall(state);
|
|
46
40
|
}
|
|
@@ -64,6 +58,10 @@ async function installHooks(logger) {
|
|
|
64
58
|
}
|
|
65
59
|
}
|
|
66
60
|
}
|
|
61
|
+
// HACK: achieve backwards compatibility with older versions of the circleci
|
|
62
|
+
// plugin that required a postinstall function to run instead of the new
|
|
63
|
+
// commitInstall method. remove in major update of cli.
|
|
64
|
+
const usesNewCircleCIGroup = Object.keys(groups).includes('circleci');
|
|
67
65
|
if (!usesNewCircleCIGroup) {
|
|
68
66
|
await (0, postInstall_1.postInstall)(logger);
|
|
69
67
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dotcom-tool-kit",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.4",
|
|
4
4
|
"description": "modern, maintainable, modular developer tooling for FT.com projects",
|
|
5
5
|
"author": "FT.com Platforms Team <platforms-team.customer-products@ft.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -21,11 +21,11 @@
|
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@dotcom-tool-kit/babel": "^3.2.0",
|
|
24
|
-
"@dotcom-tool-kit/backend-heroku-app": "^3.1.
|
|
24
|
+
"@dotcom-tool-kit/backend-heroku-app": "^3.1.3",
|
|
25
25
|
"@dotcom-tool-kit/circleci": "^6.0.0",
|
|
26
|
-
"@dotcom-tool-kit/circleci-deploy": "^3.4.
|
|
26
|
+
"@dotcom-tool-kit/circleci-deploy": "^3.4.2",
|
|
27
27
|
"@dotcom-tool-kit/eslint": "^3.2.0",
|
|
28
|
-
"@dotcom-tool-kit/frontend-app": "^3.2.
|
|
28
|
+
"@dotcom-tool-kit/frontend-app": "^3.2.3",
|
|
29
29
|
"@dotcom-tool-kit/heroku": "^3.4.1",
|
|
30
30
|
"@dotcom-tool-kit/mocha": "^3.2.0",
|
|
31
31
|
"@dotcom-tool-kit/n-test": "^3.3.1",
|