dotcom-tool-kit 4.0.0 → 4.0.2
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.map +1 -1
- package/lib/config.js +3 -6
- package/lib/install.d.ts.map +1 -1
- package/lib/install.js +7 -5
- package/lib/messages.d.ts.map +1 -1
- package/lib/messages.js +7 -3
- package/lib/plugin.d.ts.map +1 -1
- package/lib/plugin.js +1 -1
- package/lib/rc-file.d.ts.map +1 -1
- package/lib/rc-file.js +4 -3
- package/lib/tasks.d.ts +2 -0
- package/lib/tasks.d.ts.map +1 -1
- package/lib/tasks.js +7 -3
- package/package.json +3 -3
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;AAUrC,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAiBpF,eAAO,MAAM,YAAY,QAAO,SAgB9B,CAAA;AAEF,wBAAgB,cAAc,CAAC,MAAM,EAAE,kBAAkB,GAAG,WAAW,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAUrC,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAiBpF,eAAO,MAAM,YAAY,QAAO,SAgB9B,CAAA;AAEF,wBAAgB,cAAc,CAAC,MAAM,EAAE,kBAAkB,GAAG,WAAW,CA6FtE;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;IAAE,QAAQ,CAAC,EAAE,IAAI,CAAA;CAAE,GAAG,OAAO,CAAC,WAAW,CAAC,CAAA;AAC/F,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;IAAE,QAAQ,CAAC,EAAE,KAAK,CAAA;CAAE,GAAG,OAAO,CAAC,SAAS,CAAC,CAAA"}
|
package/lib/config.js
CHANGED
|
@@ -35,9 +35,6 @@ function validateConfig(config) {
|
|
|
35
35
|
const taskConflicts = (0, conflict_1.findConflictingEntries)(config.tasks);
|
|
36
36
|
const pluginOptionConflicts = (0, conflict_1.findConflicts)(Object.values(config.pluginOptions));
|
|
37
37
|
const taskOptionConflicts = (0, conflict_1.findConflicts)(Object.values(config.taskOptions));
|
|
38
|
-
const definedCommandTaskConflicts = commandTaskConflicts.filter((conflict) => {
|
|
39
|
-
return conflict.conflicting[0].id in config.hooks;
|
|
40
|
-
});
|
|
41
38
|
let shouldThrow = false;
|
|
42
39
|
const error = new error_1.ToolKitConflictError('There are problems with your Tool Kit configuration.', commandTaskConflicts.map((conflict) => ({
|
|
43
40
|
command: conflict.conflicting[0].id,
|
|
@@ -45,7 +42,7 @@ function validateConfig(config) {
|
|
|
45
42
|
})));
|
|
46
43
|
error.details = '';
|
|
47
44
|
if (hookConflicts.length > 0 ||
|
|
48
|
-
|
|
45
|
+
commandTaskConflicts.length > 0 ||
|
|
49
46
|
taskConflicts.length > 0 ||
|
|
50
47
|
pluginOptionConflicts.length > 0 ||
|
|
51
48
|
taskOptionConflicts.length > 0) {
|
|
@@ -53,8 +50,8 @@ function validateConfig(config) {
|
|
|
53
50
|
if (hookConflicts.length) {
|
|
54
51
|
error.details += (0, messages_1.formatHookConflicts)(hookConflicts);
|
|
55
52
|
}
|
|
56
|
-
if (
|
|
57
|
-
error.details += (0, messages_1.formatCommandTaskConflicts)(
|
|
53
|
+
if (commandTaskConflicts.length) {
|
|
54
|
+
error.details += (0, messages_1.formatCommandTaskConflicts)(commandTaskConflicts);
|
|
58
55
|
}
|
|
59
56
|
if (taskConflicts.length) {
|
|
60
57
|
error.details += (0, messages_1.formatTaskConflicts)(taskConflicts);
|
package/lib/install.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../src/install.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../src/install.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAK5B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAGrC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,EAAE,IAAI,EAAa,MAAM,uBAAuB,CAAA;AACvD,OAAO,EAAE,SAAS,EAAmC,MAAM,4BAA4B,CAAA;AAyCvF,eAAO,MAAM,qBAAqB,WACxB,MAAM,UACN,WAAW,KAClB,QAAQ,UAAU,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,CAAC,CAqC/C,CAAA;AAED,wBAAsB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAoBrF;AAED,wBAA8B,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAyD/E"}
|
package/lib/install.js
CHANGED
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.checkInstall = exports.loadHookInstallations = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
+
const path = tslib_1.__importStar(require("path"));
|
|
5
6
|
const error_1 = require("@dotcom-tool-kit/error");
|
|
7
|
+
const logger_1 = require("@dotcom-tool-kit/logger");
|
|
6
8
|
const options_1 = require("@dotcom-tool-kit/options");
|
|
7
9
|
const groupBy_1 = tslib_1.__importDefault(require("lodash/groupBy"));
|
|
8
10
|
const config_1 = require("./config");
|
|
@@ -44,9 +46,9 @@ const loadHookInstallations = async (logger, config) => {
|
|
|
44
46
|
const installationsWithoutConflicts = installationResults.flatMap((installations) => {
|
|
45
47
|
const conflicts = (0, conflict_1.findConflicts)(installations);
|
|
46
48
|
if (conflicts.length) {
|
|
47
|
-
return (0, validated_1.invalid)(conflicts.map(
|
|
48
|
-
|
|
49
|
-
|
|
49
|
+
return (0, validated_1.invalid)(conflicts.map((conflict) => `hooks installation conflicts between ${conflict.conflicting
|
|
50
|
+
.map((installation, i, array) => `${i === array.length - 1 ? 'and ' : ''}the ${logger_1.styles.hook(installation.forHook)} hook from ${logger_1.styles.filepath(path.relative('', installation.plugin.root))}`)
|
|
51
|
+
.join(', ')}`));
|
|
50
52
|
}
|
|
51
53
|
return (0, validated_1.valid)((0, conflict_1.withoutConflicts)(installations));
|
|
52
54
|
});
|
|
@@ -63,7 +65,7 @@ async function checkInstall(logger, config) {
|
|
|
63
65
|
if (!(await (0, hash_1.hasConfigChanged)(logger, config))) {
|
|
64
66
|
return;
|
|
65
67
|
}
|
|
66
|
-
const hooks = (await (0, exports.loadHookInstallations)(logger, config)).unwrap('hooks
|
|
68
|
+
const hooks = (await (0, exports.loadHookInstallations)(logger, config)).unwrap('hooks were found to be invalid when checking install');
|
|
67
69
|
const uninstalledHooks = await asyncFilter(hooks, async (hook) => {
|
|
68
70
|
return !(await hook.isInstalled());
|
|
69
71
|
});
|
|
@@ -84,7 +86,7 @@ async function installHooks(logger) {
|
|
|
84
86
|
}
|
|
85
87
|
await (0, init_1.runInit)(logger, config);
|
|
86
88
|
const errors = [];
|
|
87
|
-
const hooks = (await (0, exports.loadHookInstallations)(logger, config)).unwrap('hooks
|
|
89
|
+
const hooks = (await (0, exports.loadHookInstallations)(logger, config)).unwrap('hooks were found to be invalid when installing');
|
|
88
90
|
// group hooks without an installGroup separately so that their check()
|
|
89
91
|
// method runs independently
|
|
90
92
|
const groups = (0, groupBy_1.default)(hooks, (hook) => hook.installGroup ?? '__' + hook.id);
|
package/lib/messages.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../src/messages.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAA;AACjD,OAAO,KAAK,EACV,WAAW,EACX,UAAU,EACV,MAAM,EACN,gBAAgB,EAChB,cAAc,EACf,MAAM,yBAAyB,CAAA;AAChC,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAE5B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAA;AAOzD,eAAO,MAAM,mBAAmB,cAAe,CAAC,MAAM,EAAE,SAAS,UAAU,CAAC,CAAC,EAAE,KAAG,MAKT,CAAA;AAOzE,eAAO,MAAM,mBAAmB,cAAe,CAAC,MAAM,EAAE,SAAS,UAAU,CAAC,CAAC,EAAE,KAAG,MAKT,CAAA;AAezE,eAAO,MAAM,0BAA0B,cAAe,SAAS,WAAW,CAAC,EAAE,KAAG,MAQ/E,CAAA;AAOD,eAAO,MAAM,2BAA2B,cAAe,SAAS,gBAAgB,CAAC,EAAE,KAAG,MAUrF,CAAA;AAOD,eAAO,MAAM,yBAAyB,cAAe,SAAS,cAAc,CAAC,EAAE,KAAG,MAUjF,CAAA;AAKD,MAAM,MAAM,aAAa,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAA;AAEhD,eAAO,MAAM,mBAAmB,kCAAiC,MACI,CAAA;AAErE,eAAO,MAAM,0BAA0B,mBACrB,aAAa,EAAE,KAC9B,MAKF,CAAA;AAED,eAAO,MAAM,yBAAyB,kBACrB,MAAM,EAAE,kBACP,MAAM,EAAE,KACvB,
|
|
1
|
+
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../src/messages.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAA;AACjD,OAAO,KAAK,EACV,WAAW,EACX,UAAU,EACV,MAAM,EACN,gBAAgB,EAChB,cAAc,EACf,MAAM,yBAAyB,CAAA;AAChC,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAE5B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAA;AAOzD,eAAO,MAAM,mBAAmB,cAAe,CAAC,MAAM,EAAE,SAAS,UAAU,CAAC,CAAC,EAAE,KAAG,MAKT,CAAA;AAOzE,eAAO,MAAM,mBAAmB,cAAe,CAAC,MAAM,EAAE,SAAS,UAAU,CAAC,CAAC,EAAE,KAAG,MAKT,CAAA;AAezE,eAAO,MAAM,0BAA0B,cAAe,SAAS,WAAW,CAAC,EAAE,KAAG,MAQ/E,CAAA;AAOD,eAAO,MAAM,2BAA2B,cAAe,SAAS,gBAAgB,CAAC,EAAE,KAAG,MAUrF,CAAA;AAOD,eAAO,MAAM,yBAAyB,cAAe,SAAS,cAAc,CAAC,EAAE,KAAG,MAUjF,CAAA;AAKD,MAAM,MAAM,aAAa,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAA;AAEhD,eAAO,MAAM,mBAAmB,kCAAiC,MACI,CAAA;AAErE,eAAO,MAAM,0BAA0B,mBACrB,aAAa,EAAE,KAC9B,MAKF,CAAA;AAED,eAAO,MAAM,yBAAyB,kBACrB,MAAM,EAAE,kBACP,MAAM,EAAE,KACvB,MAaF,CAAA;AAED,eAAO,MAAM,uBAAuB,kBACnB,MAAM,EAAE,gBACT,MAAM,EAAE,KACrB,MAaF,CAAA;AAED,eAAO,MAAM,sBAAsB,qBACf,KAAK,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,KAC9C,MAKF,CAAA;AAED,KAAK,OAAO,GAAG;IAAE,OAAO,EAAE,WAAW,CAAC;IAAC,KAAK,EAAE,cAAc,EAAE,CAAA;CAAE,CAAA;AAOhE,eAAO,MAAM,kBAAkB,iBACf,OAAO,EAAE,SAChB,MAAM,EAAE,KACd,MAOF,CAAA;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAezD;AAED,eAAO,MAAM,aAAa,YAAa,MAAM,KAAG,MAAwC,CAAA"}
|
package/lib/messages.js
CHANGED
|
@@ -67,7 +67,9 @@ ${unusedOptions.map((optionName) => `- ${logger_1.styles.plugin(optionName)}`).j
|
|
|
67
67
|
They could be misspelt, or defined by a Tool Kit plugin that isn't installed in this app.
|
|
68
68
|
|
|
69
69
|
${definedPlugins.length > 0
|
|
70
|
-
? `Plugins that are defined and can have options set are: ${definedPlugins
|
|
70
|
+
? `Plugins that are defined and can have options set are: ${definedPlugins
|
|
71
|
+
.map((plugin) => logger_1.styles.plugin(plugin))
|
|
72
|
+
.join(', ')}`
|
|
71
73
|
: `There are no plugins installed currently. You'll need to install some plugins before options can be set.`}.
|
|
72
74
|
`;
|
|
73
75
|
exports.formatUnusedPluginOptions = formatUnusedPluginOptions;
|
|
@@ -78,7 +80,9 @@ ${unusedOptions.map((optionName) => `- ${logger_1.styles.task(optionName)}`).joi
|
|
|
78
80
|
They could be misspelt, or defined by a Tool Kit plugin that isn't installed in this app.
|
|
79
81
|
|
|
80
82
|
${definedTasks.length > 0
|
|
81
|
-
? `Task that are defined and can have options set are: ${definedTasks
|
|
83
|
+
? `Task that are defined and can have options set are: ${definedTasks
|
|
84
|
+
.map((task) => logger_1.styles.task(task))
|
|
85
|
+
.join(', ')}`
|
|
82
86
|
: `You don't have currently any plugins installed that provide tasks. You'll need to install some plugins before options can be set.`}.
|
|
83
87
|
`;
|
|
84
88
|
exports.formatUnusedTaskOptions = formatUnusedTaskOptions;
|
|
@@ -96,7 +100,7 @@ ${missingTasks.map(formatMissingTask).join('\n')}
|
|
|
96
100
|
|
|
97
101
|
They could be misspelt, or defined by a Tool Kit plugin that isn't used by this app.
|
|
98
102
|
|
|
99
|
-
Available tasks are: ${tasks.map(logger_1.styles.task).join(', ')}.
|
|
103
|
+
Available tasks are: ${tasks.map((task) => logger_1.styles.task(task)).join(', ')}.
|
|
100
104
|
`;
|
|
101
105
|
exports.formatMissingTasks = formatMissingTasks;
|
|
102
106
|
function formatPluginTree(plugin) {
|
package/lib/plugin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AACA,OAAO,EAA2B,KAAK,MAAM,EAAE,MAAM,yBAAyB,CAAA;AAC9E,OAAO,KAAK,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAC5E,OAAO,EAAmC,SAAS,EAAE,MAAM,4BAA4B,CAAA;AAEvF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAoBrC,wBAAsB,UAAU,CAC9B,EAAE,EAAE,MAAM,EACV,MAAM,EAAE,SAAS,EACjB,MAAM,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AACA,OAAO,EAA2B,KAAK,MAAM,EAAE,MAAM,yBAAyB,CAAA;AAC9E,OAAO,KAAK,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAC5E,OAAO,EAAmC,SAAS,EAAE,MAAM,4BAA4B,CAAA;AAEvF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAoBrC,wBAAsB,UAAU,CAC9B,EAAE,EAAE,MAAM,EACV,MAAM,EAAE,SAAS,EACjB,MAAM,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAqD5B;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,kBAAkB,GAAG,IAAI,CAiBrF;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAqB9F"}
|
package/lib/plugin.js
CHANGED
|
@@ -44,7 +44,7 @@ async function loadPlugin(id, config, logger, parent) {
|
|
|
44
44
|
};
|
|
45
45
|
if (!isAppRoot && plugin.rcFile.version !== plugin_1.CURRENT_RC_FILE_VERSION) {
|
|
46
46
|
return (0, validated_1.invalid)([
|
|
47
|
-
`plugin ${logger_1.styles.plugin(id)} has a
|
|
47
|
+
`plugin ${logger_1.styles.plugin(id)} has a ${logger_1.styles.code('v' + (plugin.rcFile.version ?? 1).toString())} ${logger_1.styles.filepath('.toolkitrc.yml')}, but this version of Tool Kit can only load ${logger_1.styles.code('v' + plugin_1.CURRENT_RC_FILE_VERSION.toString())} configs. please update this plugin. if it's your own custom plugin you can do this be adding ${logger_1.styles.code('version: 2')} to the top of its ${logger_1.styles.filepath('.toolkitrc.yml')}.`
|
|
48
48
|
]);
|
|
49
49
|
}
|
|
50
50
|
// ESlint disable explanation: erroring due to a possible race condition but is a false positive since the config variable isn't from another scope and can't be written to concurrently.
|
package/lib/rc-file.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rc-file.d.ts","sourceRoot":"","sources":["../src/rc-file.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAA;AAErD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AA0BrC,eAAO,MAAM,kBAAkB,uBAAuB,CAAA;AACtD,eAAO,MAAM,qBAAqB,2BAA2B,CAAA;AAoB7D,wBAAsB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"rc-file.d.ts","sourceRoot":"","sources":["../src/rc-file.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAA;AAErD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AA0BrC,eAAO,MAAM,kBAAkB,uBAAuB,CAAA;AACtD,eAAO,MAAM,qBAAqB,2BAA2B,CAAA;AAoB7D,wBAAsB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAqEjF"}
|
package/lib/rc-file.js
CHANGED
|
@@ -36,9 +36,10 @@ const toolKitIfDefined = {
|
|
|
36
36
|
resolve: (value) => value
|
|
37
37
|
};
|
|
38
38
|
async function loadToolKitRC(logger, root) {
|
|
39
|
+
const configPath = path.join(root, '.toolkitrc.yml');
|
|
39
40
|
let rawConfig;
|
|
40
41
|
try {
|
|
41
|
-
rawConfig = await promises_1.default.readFile(
|
|
42
|
+
rawConfig = await promises_1.default.readFile(configPath, 'utf8');
|
|
42
43
|
}
|
|
43
44
|
catch (err) {
|
|
44
45
|
if (err.code === 'ENOENT') {
|
|
@@ -63,7 +64,7 @@ async function loadToolKitRC(logger, root) {
|
|
|
63
64
|
});
|
|
64
65
|
const config = configDoc.toJS() ?? {};
|
|
65
66
|
// if a toolkitrc contains a non-empty options field, but not options.{plugins,tasks,hooks},
|
|
66
|
-
// assume it's an old-style, plugins-only options field.
|
|
67
|
+
// assume it's an old-style, (hopefully) plugins-only options field.
|
|
67
68
|
// TODO:KB:20240410 remove this legacy options field handling in a future major version
|
|
68
69
|
if (config.options &&
|
|
69
70
|
Object.keys(config.options).length > 0 &&
|
|
@@ -71,7 +72,7 @@ async function loadToolKitRC(logger, root) {
|
|
|
71
72
|
config.options = {
|
|
72
73
|
plugins: config.options
|
|
73
74
|
};
|
|
74
|
-
logger.warn(`
|
|
75
|
+
logger.warn(`config at ${logger_1.styles.filepath(configPath)} has an ${logger_1.styles.code('options')} field, but it isn't specified whether the options are for ${logger_1.styles.plugin('plugins')}, ${logger_1.styles.task('tasks')}, or ${logger_1.styles.hook('hooks')}. we'll assume these options are for plugins (which may be incorrect!), but this is deprecated and these options should be moved to ${logger_1.styles.code('options.plugins')}, ${logger_1.styles.code('options.tasks')}, and ${logger_1.styles.code('options.hooks')} as appropriate.\n`);
|
|
75
76
|
}
|
|
76
77
|
return {
|
|
77
78
|
version: config.version ?? undefined,
|
package/lib/tasks.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { ValidConfig } from '@dotcom-tool-kit/config';
|
|
1
2
|
import type { Logger } from 'winston';
|
|
3
|
+
export declare function runTasksFromConfig(logger: Logger, config: ValidConfig, commands: string[], files?: string[]): Promise<void>;
|
|
2
4
|
export declare function runTasks(logger: Logger, commands: string[], files?: string[]): Promise<void>;
|
|
3
5
|
//# sourceMappingURL=tasks.d.ts.map
|
package/lib/tasks.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tasks.d.ts","sourceRoot":"","sources":["../src/tasks.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tasks.d.ts","sourceRoot":"","sources":["../src/tasks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAG1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAuDrC,wBAAsB,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAwEjI;AAED,wBAAsB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAIlG"}
|
package/lib/tasks.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.runTasks = void 0;
|
|
3
|
+
exports.runTasks = exports.runTasksFromConfig = void 0;
|
|
4
4
|
const base_1 = require("@dotcom-tool-kit/base");
|
|
5
5
|
const validated_1 = require("@dotcom-tool-kit/validated");
|
|
6
6
|
const entry_point_1 = require("./plugin/entry-point");
|
|
@@ -36,8 +36,7 @@ const loadTasks = async (logger, tasks, config) => {
|
|
|
36
36
|
}));
|
|
37
37
|
return (0, validated_1.reduceValidated)(taskResults);
|
|
38
38
|
};
|
|
39
|
-
async function
|
|
40
|
-
const config = await (0, config_1.loadConfig)(logger);
|
|
39
|
+
async function runTasksFromConfig(logger, config, commands, files) {
|
|
41
40
|
for (const pluginOptions of Object.values(config.pluginOptions)) {
|
|
42
41
|
if (pluginOptions.forPlugin) {
|
|
43
42
|
(0, options_1.setOptions)(pluginOptions.forPlugin.id, pluginOptions.options);
|
|
@@ -92,4 +91,9 @@ ${error.details}`
|
|
|
92
91
|
}
|
|
93
92
|
}
|
|
94
93
|
}
|
|
94
|
+
exports.runTasksFromConfig = runTasksFromConfig;
|
|
95
|
+
async function runTasks(logger, commands, files) {
|
|
96
|
+
const config = await (0, config_1.loadConfig)(logger);
|
|
97
|
+
return runTasksFromConfig(logger, config, commands, files);
|
|
98
|
+
}
|
|
95
99
|
exports.runTasks = runTasks;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dotcom-tool-kit",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.2",
|
|
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",
|
|
@@ -31,11 +31,11 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@dotcom-tool-kit/base": "^1.0.0",
|
|
34
|
-
"@dotcom-tool-kit/config": "^1.0.
|
|
34
|
+
"@dotcom-tool-kit/config": "^1.0.2",
|
|
35
35
|
"@dotcom-tool-kit/conflict": "^1.0.0",
|
|
36
36
|
"@dotcom-tool-kit/error": "^4.0.0",
|
|
37
37
|
"@dotcom-tool-kit/logger": "^4.0.0",
|
|
38
|
-
"@dotcom-tool-kit/options": "^4.0.
|
|
38
|
+
"@dotcom-tool-kit/options": "^4.0.2",
|
|
39
39
|
"@dotcom-tool-kit/plugin": "^1.0.0",
|
|
40
40
|
"@dotcom-tool-kit/validated": "^1.0.0",
|
|
41
41
|
"@dotcom-tool-kit/wait-for-ok": "^4.0.0",
|