dotcom-tool-kit 2.5.0 → 2.6.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/lib/config.d.ts +12 -7
- package/lib/config.d.ts.map +1 -1
- package/lib/config.js +30 -6
- package/lib/install.js +1 -1
- package/lib/messages.d.ts +4 -1
- package/lib/messages.d.ts.map +1 -1
- package/lib/messages.js +10 -1
- package/lib/plugin.js +4 -3
- package/lib/postInstall.js +3 -3
- package/lib/rc-file.js +1 -1
- package/package.json +17 -16
package/lib/config.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { Logger } from 'winston';
|
|
|
2
2
|
import type { HookTask } from './hook';
|
|
3
3
|
import { Conflict } from './conflict';
|
|
4
4
|
import { TaskClass, Hook, Plugin, Validated } from '@dotcom-tool-kit/types';
|
|
5
|
+
import { Options as SchemaOptions } from '@dotcom-tool-kit/types/lib/schema';
|
|
5
6
|
export interface PluginOptions {
|
|
6
7
|
options: Record<string, unknown>;
|
|
7
8
|
plugin: Plugin;
|
|
@@ -26,27 +27,31 @@ export interface RawConfig {
|
|
|
26
27
|
[id: string]: Hook<unknown> | Conflict<Hook<unknown>>;
|
|
27
28
|
};
|
|
28
29
|
}
|
|
29
|
-
export
|
|
30
|
+
export type ValidPluginsConfig = Omit<RawConfig, 'plugins'> & {
|
|
30
31
|
plugins: {
|
|
31
32
|
[id: string]: Plugin;
|
|
32
33
|
};
|
|
33
34
|
};
|
|
34
|
-
export
|
|
35
|
+
export type ValidPluginOptions<Id extends keyof SchemaOptions> = Omit<PluginOptions, 'options'> & {
|
|
36
|
+
options: SchemaOptions[Id];
|
|
37
|
+
};
|
|
38
|
+
export type ValidOptions = {
|
|
39
|
+
[Id in keyof SchemaOptions]: ValidPluginOptions<Id>;
|
|
40
|
+
};
|
|
41
|
+
export type ValidConfig = Omit<ValidPluginsConfig, 'tasks' | 'hookTasks' | 'options' | 'hooks'> & {
|
|
35
42
|
tasks: {
|
|
36
43
|
[id: string]: TaskClass;
|
|
37
44
|
};
|
|
38
45
|
hookTasks: {
|
|
39
46
|
[id: string]: HookTask;
|
|
40
47
|
};
|
|
41
|
-
options:
|
|
42
|
-
[id: string]: PluginOptions;
|
|
43
|
-
};
|
|
48
|
+
options: ValidOptions;
|
|
44
49
|
hooks: {
|
|
45
50
|
[id: string]: Hook<unknown>;
|
|
46
51
|
};
|
|
47
|
-
}
|
|
52
|
+
};
|
|
48
53
|
export declare const createConfig: () => RawConfig;
|
|
49
|
-
export declare function validateConfig(config: ValidPluginsConfig):
|
|
54
|
+
export declare function validateConfig(config: ValidPluginsConfig, logger: Logger): ValidConfig;
|
|
50
55
|
export declare function validatePlugins(config: RawConfig): Validated<ValidPluginsConfig>;
|
|
51
56
|
export declare function checkInstall(config: ValidConfig): Promise<void>;
|
|
52
57
|
export declare function loadConfig(logger: Logger, options?: {
|
package/lib/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAErC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AAEtC,OAAO,EAAE,QAAQ,EAA+C,MAAM,YAAY,CAAA;AAElF,OAAO,EAAE,SAAS,EAAE,IAAI,EAAgB,MAAM,EAAmB,SAAS,EAAE,MAAM,wBAAwB,CAAA;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAErC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AAEtC,OAAO,EAAE,QAAQ,EAA+C,MAAM,YAAY,CAAA;AAElF,OAAO,EAAE,SAAS,EAAE,IAAI,EAAgB,MAAM,EAAmB,SAAS,EAAE,MAAM,wBAAwB,CAAA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stall = exports.validatePlugins = exports.validateConfig = exports.createConfig = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const path_1 =
|
|
5
|
+
const path_1 = tslib_1.__importDefault(require("path"));
|
|
6
6
|
const plugin_1 = require("./plugin");
|
|
7
7
|
const conflict_1 = require("./conflict");
|
|
8
8
|
const error_1 = require("@dotcom-tool-kit/error");
|
|
9
9
|
const types_1 = require("@dotcom-tool-kit/types");
|
|
10
|
+
const schema_1 = require("@dotcom-tool-kit/types/lib/schema");
|
|
10
11
|
const messages_1 = require("./messages");
|
|
11
12
|
const coreRoot = path_1.default.resolve(__dirname, '../');
|
|
12
13
|
const createConfig = () => ({
|
|
@@ -23,7 +24,8 @@ async function asyncFilter(items, predicate) {
|
|
|
23
24
|
const results = await Promise.all(items.map(async (item) => ({ item, keep: await predicate(item) })));
|
|
24
25
|
return results.filter(({ keep }) => keep).map(({ item }) => item);
|
|
25
26
|
}
|
|
26
|
-
function validateConfig(config) {
|
|
27
|
+
function validateConfig(config, logger) {
|
|
28
|
+
const validConfig = config;
|
|
27
29
|
const hookTaskConflicts = (0, conflict_1.findConflicts)(Object.values(config.hookTasks));
|
|
28
30
|
const hookConflicts = (0, conflict_1.findConflicts)(Object.values(config.hooks));
|
|
29
31
|
const taskConflicts = (0, conflict_1.findConflicts)(Object.values(config.tasks));
|
|
@@ -67,6 +69,30 @@ function validateConfig(config) {
|
|
|
67
69
|
shouldThrow = true;
|
|
68
70
|
error.details += (0, messages_1.formatUndefinedHookTasks)(undefinedHookTasks, Array.from(definedHookIds));
|
|
69
71
|
}
|
|
72
|
+
const invalidOptions = [];
|
|
73
|
+
for (const [id, options] of Object.entries(config.options).filter((entry) => {
|
|
74
|
+
const [, options] = entry;
|
|
75
|
+
return !!options && !(0, conflict_1.isConflict)(options);
|
|
76
|
+
})) {
|
|
77
|
+
const pluginId = id;
|
|
78
|
+
const pluginSchema = schema_1.Schemas[pluginId];
|
|
79
|
+
if (!pluginSchema) {
|
|
80
|
+
logger.silly(`skipping validation of ${pluginId} plugin as no schema can be found`);
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
const result = pluginSchema.safeParse(options.options);
|
|
84
|
+
if (result.success) {
|
|
85
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
86
|
+
validConfig.options[pluginId].options = result.data;
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
invalidOptions.push([id, result.error]);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
if (invalidOptions.length > 0) {
|
|
93
|
+
shouldThrow = true;
|
|
94
|
+
error.details += (0, messages_1.formatInvalidOptions)(invalidOptions);
|
|
95
|
+
}
|
|
70
96
|
const unusedOptions = Object.entries(config.options)
|
|
71
97
|
.filter(([, option]) => option && !(0, conflict_1.isConflict)(option) && !option.forPlugin && option.plugin.root === process.cwd())
|
|
72
98
|
.map(([id]) => id);
|
|
@@ -87,6 +113,7 @@ function validateConfig(config) {
|
|
|
87
113
|
if (shouldThrow) {
|
|
88
114
|
throw error;
|
|
89
115
|
}
|
|
116
|
+
return validConfig;
|
|
90
117
|
}
|
|
91
118
|
exports.validateConfig = validateConfig;
|
|
92
119
|
function validatePlugins(config) {
|
|
@@ -125,9 +152,6 @@ async function loadConfig(logger, { validate = true } = {}) {
|
|
|
125
152
|
const validPluginConfig = validatedPluginConfig.value;
|
|
126
153
|
// collate root plugin and descendent hooks, options etc into config
|
|
127
154
|
(0, plugin_1.resolvePlugin)(validRootPlugin, validPluginConfig, logger);
|
|
128
|
-
|
|
129
|
-
validateConfig(validPluginConfig);
|
|
130
|
-
}
|
|
131
|
-
return config;
|
|
155
|
+
return validate ? validateConfig(validPluginConfig, logger) : config;
|
|
132
156
|
}
|
|
133
157
|
exports.loadConfig = loadConfig;
|
package/lib/install.js
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const error_1 = require("@dotcom-tool-kit/error");
|
|
5
5
|
const options_1 = require("@dotcom-tool-kit/options");
|
|
6
|
-
const groupBy_1 =
|
|
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
9
|
// implementation of the Array.some method that supports asynchronous predicates
|
package/lib/messages.d.ts
CHANGED
|
@@ -2,14 +2,17 @@ import type { PluginOptions } from './config';
|
|
|
2
2
|
import type { Conflict } from './conflict';
|
|
3
3
|
import type { HookTask } from './hook';
|
|
4
4
|
import type { Plugin, Hook, TaskClass } from '@dotcom-tool-kit/types';
|
|
5
|
+
import type { z } from 'zod';
|
|
5
6
|
export declare const formatTaskConflicts: (conflicts: Conflict<TaskClass>[]) => string;
|
|
6
7
|
export declare const formatHookConflicts: (conflicts: Conflict<Hook<unknown>>[]) => string;
|
|
7
8
|
export declare const formatHookTaskConflicts: (conflicts: Conflict<HookTask>[]) => string;
|
|
8
9
|
export declare const formatOptionConflicts: (conflicts: Conflict<PluginOptions>[]) => string;
|
|
9
10
|
export declare const formatUndefinedHookTasks: (undefinedHooks: HookTask[], definedHooks: string[]) => string;
|
|
11
|
+
export type InvalidOption = [string, z.ZodError];
|
|
12
|
+
export declare const formatInvalidOptions: (invalidOptions: InvalidOption[]) => string;
|
|
10
13
|
export declare const formatUnusedOptions: (unusedOptions: string[], definedPlugins: string[]) => string;
|
|
11
14
|
export declare const formatUninstalledHooks: (uninstalledHooks: Hook<unknown>[]) => string;
|
|
12
|
-
|
|
15
|
+
type Missing = {
|
|
13
16
|
hook: HookTask;
|
|
14
17
|
tasks: string[];
|
|
15
18
|
};
|
package/lib/messages.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../src/messages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAC7C,OAA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O,CAAC,EAAE,KAChC,MAKF,CAAA;AAED,KAAK,OAAO,GAAG;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE,CAAA;AAOlD,eAAO,MAAM,kBAAkB,iBACf,OAAO,EAAE,SAChB,MAAM,EAAE,KACd,MAOF,CAAA;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAezD"}
|
package/lib/messages.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.formatPluginTree = exports.formatMissingTasks = exports.formatUninstalledHooks = exports.formatUnusedOptions = exports.formatUndefinedHookTasks = exports.formatOptionConflicts = exports.formatHookTaskConflicts = exports.formatHookConflicts = exports.formatTaskConflicts = void 0;
|
|
3
|
+
exports.formatPluginTree = exports.formatMissingTasks = exports.formatUninstalledHooks = exports.formatUnusedOptions = exports.formatInvalidOptions = exports.formatUndefinedHookTasks = exports.formatOptionConflicts = exports.formatHookTaskConflicts = exports.formatHookConflicts = exports.formatTaskConflicts = void 0;
|
|
4
4
|
const logger_1 = require("@dotcom-tool-kit/logger");
|
|
5
|
+
const zod_validation_error_1 = require("zod-validation-error");
|
|
5
6
|
const formatTaskConflict = (conflict) => `- ${logger_1.styles.task(conflict.conflicting[0].id || 'unknown task')} ${logger_1.styles.dim('from plugins')} ${conflict.conflicting
|
|
6
7
|
.map((task) => logger_1.styles.plugin(task.plugin ? task.plugin.id : 'unknown plugin'))
|
|
7
8
|
.join(logger_1.styles.dim(', '))}`;
|
|
@@ -52,6 +53,14 @@ ${definedHooks.length > 0
|
|
|
52
53
|
: `There are no hooks defined by this app's plugins. You probably need to install some plugins to define hooks.`}.
|
|
53
54
|
`;
|
|
54
55
|
exports.formatUndefinedHookTasks = formatUndefinedHookTasks;
|
|
56
|
+
const formatInvalidOptions = (invalidOptions) => `Options are defined in your Tool Kit configuration that are the wrong types:
|
|
57
|
+
|
|
58
|
+
${invalidOptions
|
|
59
|
+
.map(([plugin, error]) => (0, zod_validation_error_1.fromZodError)(error, { prefix: `- ${logger_1.styles.plugin(plugin)} has the issue(s)` }).message)
|
|
60
|
+
.join('\n')}
|
|
61
|
+
|
|
62
|
+
Please update the options so that they are the expected types. You can refer to the README for the plugin for examples and descriptions of the options used.`;
|
|
63
|
+
exports.formatInvalidOptions = formatInvalidOptions;
|
|
55
64
|
const formatUnusedOptions = (unusedOptions, definedPlugins) => `Options are defined in your Tool Kit configuration for plugins that don't exist:
|
|
56
65
|
|
|
57
66
|
${unusedOptions.map((optionName) => `- ${logger_1.styles.plugin(optionName)}`).join('\n')}
|
package/lib/plugin.js
CHANGED
|
@@ -4,8 +4,8 @@ exports.resolvePlugin = exports.loadPlugin = exports.validatePlugin = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const logger_1 = require("@dotcom-tool-kit/logger");
|
|
6
6
|
const types_1 = require("@dotcom-tool-kit/types");
|
|
7
|
-
const isPlainObject_1 =
|
|
8
|
-
const resolve_from_1 =
|
|
7
|
+
const isPlainObject_1 = tslib_1.__importDefault(require("lodash/isPlainObject"));
|
|
8
|
+
const resolve_from_1 = tslib_1.__importDefault(require("resolve-from"));
|
|
9
9
|
const conflict_1 = require("./conflict");
|
|
10
10
|
const rc_file_1 = require("./rc-file");
|
|
11
11
|
function isDescendent(possibleAncestor, possibleDescendent) {
|
|
@@ -60,9 +60,10 @@ function validatePlugin(plugin) {
|
|
|
60
60
|
}
|
|
61
61
|
exports.validatePlugin = validatePlugin;
|
|
62
62
|
async function importPlugin(pluginPath) {
|
|
63
|
+
var _a;
|
|
63
64
|
try {
|
|
64
65
|
// pluginPath is an absolute resolved path to a plugin module as found from its parent
|
|
65
|
-
const pluginModule = (await Promise.resolve().then(() =>
|
|
66
|
+
const pluginModule = (await (_a = pluginPath, Promise.resolve().then(() => tslib_1.__importStar(require(_a)))));
|
|
66
67
|
return validatePlugin(pluginModule);
|
|
67
68
|
}
|
|
68
69
|
catch (e) {
|
package/lib/postInstall.js
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.postInstall = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const path_1 =
|
|
5
|
+
const path_1 = tslib_1.__importDefault(require("path"));
|
|
6
6
|
const fs_1 = require("fs");
|
|
7
7
|
const npm_1 = require("@dotcom-tool-kit/types/lib/npm");
|
|
8
|
-
const YAML =
|
|
9
|
-
const merge_1 =
|
|
8
|
+
const YAML = tslib_1.__importStar(require("yaml"));
|
|
9
|
+
const merge_1 = tslib_1.__importDefault(require("lodash/merge"));
|
|
10
10
|
const circleci_1 = require("@dotcom-tool-kit/types/lib/circleci");
|
|
11
11
|
/**
|
|
12
12
|
* This step adds the tags only filter to rest of the jobs in the workflow if there is a job that contains the semverRegex.
|
package/lib/rc-file.js
CHANGED
|
@@ -4,7 +4,7 @@ exports.loadToolKitRC = exports.explorer = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const logger_1 = require("@dotcom-tool-kit/logger");
|
|
6
6
|
const cosmiconfig_1 = require("cosmiconfig");
|
|
7
|
-
const path =
|
|
7
|
+
const path = tslib_1.__importStar(require("path"));
|
|
8
8
|
exports.explorer = (0, cosmiconfig_1.cosmiconfig)('toolkit', { ignoreEmptySearchPlaces: false });
|
|
9
9
|
const emptyConfig = { plugins: [], hooks: {}, options: {} };
|
|
10
10
|
let rootConfig;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dotcom-tool-kit",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.0",
|
|
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",
|
|
@@ -20,20 +20,20 @@
|
|
|
20
20
|
"test": "cd ../../ ; npx jest --silent --projects core/cli"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
+
"@dotcom-tool-kit/babel": "^2.0.13",
|
|
24
|
+
"@dotcom-tool-kit/backend-heroku-app": "^1.0.1",
|
|
25
|
+
"@dotcom-tool-kit/circleci": "^4.0.0",
|
|
26
|
+
"@dotcom-tool-kit/circleci-deploy": "^2.0.0",
|
|
27
|
+
"@dotcom-tool-kit/eslint": "^2.3.0",
|
|
28
|
+
"@dotcom-tool-kit/frontend-app": "^2.2.1",
|
|
29
|
+
"@dotcom-tool-kit/heroku": "^2.1.4",
|
|
30
|
+
"@dotcom-tool-kit/mocha": "^2.3.0",
|
|
31
|
+
"@dotcom-tool-kit/n-test": "^2.1.8",
|
|
32
|
+
"@dotcom-tool-kit/npm": "^2.0.14",
|
|
33
|
+
"@dotcom-tool-kit/webpack": "^2.1.12",
|
|
23
34
|
"@jest/globals": "^27.4.6",
|
|
24
35
|
"@types/lodash": "^4.14.185",
|
|
25
36
|
"@types/node": "^12.20.24",
|
|
26
|
-
"@dotcom-tool-kit/backend-heroku-app": "^1.0.0",
|
|
27
|
-
"@dotcom-tool-kit/heroku": "^2.1.3",
|
|
28
|
-
"@dotcom-tool-kit/webpack": "^2.1.11",
|
|
29
|
-
"@dotcom-tool-kit/babel": "^2.0.12",
|
|
30
|
-
"@dotcom-tool-kit/circleci": "^3.0.2",
|
|
31
|
-
"@dotcom-tool-kit/npm": "^2.0.13",
|
|
32
|
-
"@dotcom-tool-kit/circleci-deploy": "^1.0.0",
|
|
33
|
-
"@dotcom-tool-kit/frontend-app": "^2.2.0",
|
|
34
|
-
"@dotcom-tool-kit/eslint": "^2.2.5",
|
|
35
|
-
"@dotcom-tool-kit/mocha": "^2.2.1",
|
|
36
|
-
"@dotcom-tool-kit/n-test": "^2.1.7",
|
|
37
37
|
"chai": "^4.3.4",
|
|
38
38
|
"globby": "^10.0.2",
|
|
39
39
|
"ts-node": "^8.10.2",
|
|
@@ -41,16 +41,17 @@
|
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@dotcom-tool-kit/error": "^2.0.1",
|
|
44
|
-
"@dotcom-tool-kit/logger": "^2.2.
|
|
45
|
-
"@dotcom-tool-kit/options": "^2.0.
|
|
46
|
-
"@dotcom-tool-kit/types": "^2.
|
|
44
|
+
"@dotcom-tool-kit/logger": "^2.2.1",
|
|
45
|
+
"@dotcom-tool-kit/options": "^2.0.13",
|
|
46
|
+
"@dotcom-tool-kit/types": "^2.9.0",
|
|
47
47
|
"@dotcom-tool-kit/wait-for-ok": "^2.0.1",
|
|
48
48
|
"cosmiconfig": "^7.0.0",
|
|
49
49
|
"lodash": "^4.17.21",
|
|
50
50
|
"minimist": "^1.2.5",
|
|
51
51
|
"resolve-from": "^5.0.0",
|
|
52
52
|
"tslib": "^2.3.1",
|
|
53
|
-
"yaml": "^1.10.2"
|
|
53
|
+
"yaml": "^1.10.2",
|
|
54
|
+
"zod-validation-error": "^0.3.0"
|
|
54
55
|
},
|
|
55
56
|
"engines": {
|
|
56
57
|
"node": ">=8.0.0"
|