dotcom-tool-kit 1.2.0 → 1.3.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 +4 -5
- package/lib/config.d.ts.map +1 -1
- package/lib/config.js +5 -2
- package/lib/conflict.d.ts +1 -1
- package/lib/conflict.d.ts.map +1 -1
- package/lib/help.d.ts.map +1 -1
- package/lib/help.js +3 -1
- package/lib/hook.d.ts +1 -11
- package/lib/hook.d.ts.map +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/install.d.ts.map +1 -1
- package/lib/install.js +1 -2
- package/lib/messages.d.ts +4 -4
- package/lib/messages.d.ts.map +1 -1
- package/lib/plugin.d.ts +1 -11
- package/lib/plugin.d.ts.map +1 -1
- package/lib/plugin.js +14 -1
- package/package.json +9 -8
package/lib/config.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { HookTask, HookClass } from './hook';
|
|
3
|
-
import { Plugin } from './plugin';
|
|
1
|
+
import type { HookTask } from './hook';
|
|
4
2
|
import { Conflict } from './conflict';
|
|
3
|
+
import type { TaskClass, Hook, Plugin } from '@dotcom-tool-kit/types';
|
|
5
4
|
export interface PluginOptions {
|
|
6
5
|
options: Record<string, unknown>;
|
|
7
6
|
plugin: Plugin;
|
|
@@ -22,7 +21,7 @@ export interface Config {
|
|
|
22
21
|
[id: string]: PluginOptions | Conflict<PluginOptions> | undefined;
|
|
23
22
|
};
|
|
24
23
|
hooks: {
|
|
25
|
-
[id: string]:
|
|
24
|
+
[id: string]: Hook | Conflict<Hook>;
|
|
26
25
|
};
|
|
27
26
|
}
|
|
28
27
|
export interface ValidConfig extends Config {
|
|
@@ -36,7 +35,7 @@ export interface ValidConfig extends Config {
|
|
|
36
35
|
[id: string]: PluginOptions;
|
|
37
36
|
};
|
|
38
37
|
hooks: {
|
|
39
|
-
[id: string]:
|
|
38
|
+
[id: string]: Hook;
|
|
40
39
|
};
|
|
41
40
|
}
|
|
42
41
|
export declare function validateConfig(config: Config): Promise<ValidConfig>;
|
package/lib/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AAEtC,OAAO,EAAE,QAAQ,EAA+C,MAAM,YAAY,CAAA;AAElF,OAAO,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAYrE,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAChC,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE;QAAE,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAA;IACjC,KAAK,EAAE;QAAE,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAA;KAAE,CAAA;IACxD,SAAS,EAAE;QAAE,CAAC,EAAE,EAAE,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAA;KAAE,CAAA;IAC1D,OAAO,EAAE;QAAE,CAAC,EAAE,EAAE,MAAM,GAAG,aAAa,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,SAAS,CAAA;KAAE,CAAA;IAC9E,KAAK,EAAE;QAAE,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAA;KAAE,CAAA;CAC/C;AAED,MAAM,WAAW,WAAY,SAAQ,MAAM;IACzC,KAAK,EAAE;QAAE,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,CAAA;IAClC,SAAS,EAAE;QAAE,CAAC,EAAE,EAAE,MAAM,GAAG,QAAQ,CAAA;KAAE,CAAA;IACrC,OAAO,EAAE;QAAE,CAAC,EAAE,EAAE,MAAM,GAAG,aAAa,CAAA;KAAE,CAAA;IACxC,KAAK,EAAE;QAAE,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAA;CAC9B;AAmBD,wBAAsB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAyFzE;AAED,wBAAsB,YAAY,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAWrE;AAED,wBAAgB,UAAU,CAAC,OAAO,CAAC,EAAE;IAAE,QAAQ,CAAC,EAAE,IAAI,CAAA;CAAE,GAAG,OAAO,CAAC,WAAW,CAAC,CAAA;AAC/E,wBAAgB,UAAU,CAAC,OAAO,CAAC,EAAE;IAAE,QAAQ,CAAC,EAAE,KAAK,CAAA;CAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA"}
|
package/lib/config.js
CHANGED
|
@@ -89,8 +89,7 @@ async function validateConfig(config) {
|
|
|
89
89
|
exports.validateConfig = validateConfig;
|
|
90
90
|
async function checkInstall(config) {
|
|
91
91
|
const definedHooks = (0, conflict_1.withoutConflicts)(Object.values(config.hooks));
|
|
92
|
-
const uninstalledHooks = await asyncFilter(definedHooks, async (
|
|
93
|
-
const hook = new Hook();
|
|
92
|
+
const uninstalledHooks = await asyncFilter(definedHooks, async (hook) => {
|
|
94
93
|
return !(await hook.check());
|
|
95
94
|
});
|
|
96
95
|
if (uninstalledHooks.length > 0) {
|
|
@@ -109,3 +108,7 @@ async function loadConfig({ validate = true } = {}) {
|
|
|
109
108
|
return validate ? validateConfig(config) : config;
|
|
110
109
|
}
|
|
111
110
|
exports.loadConfig = loadConfig;
|
|
111
|
+
// abstract class TestBase {}
|
|
112
|
+
// class Test extends TestBase {}
|
|
113
|
+
// const testBase = TestBase
|
|
114
|
+
// const test = new testBase()
|
package/lib/conflict.d.ts
CHANGED
package/lib/conflict.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conflict.d.ts","sourceRoot":"","sources":["../src/conflict.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"conflict.d.ts","sourceRoot":"","sources":["../src/conflict.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAEpD,MAAM,WAAW,QAAQ,CAAC,CAAC;IACzB,MAAM,EAAE,MAAM,CAAA;IACd,WAAW,EAAE,CAAC,EAAE,CAAA;CACjB;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,QAAQ,CAAC,CAAC,CAAC,CAElE;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,QAAQ,CAAC,CAAC,CAAC,EAAE,CAU7E;AAED,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAUtE"}
|
package/lib/help.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../src/help.ts"],"names":[],"mappings":"AAIA,wBAA8B,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../src/help.ts"],"names":[],"mappings":"AAIA,wBAA8B,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAmErE"}
|
package/lib/help.js
CHANGED
|
@@ -33,8 +33,9 @@ ${Object.keys(config.hooks).length === 0
|
|
|
33
33
|
const Hook = config.hooks[hook];
|
|
34
34
|
if (Hook) {
|
|
35
35
|
const tasks = config.hookTasks[hook];
|
|
36
|
+
/* eslint-disable @typescript-eslint/no-explicit-any -- Object.constructor does not consider static properties */
|
|
36
37
|
console.log(`${messages_1.styles.heading(hook)}
|
|
37
|
-
${Hook.description ? Hook.description + '\n' : ''}
|
|
38
|
+
${Hook.constructor.description ? Hook.constructor.description + '\n' : ''}
|
|
38
39
|
${tasks && tasks.tasks.length
|
|
39
40
|
? `runs ${tasks.tasks.length > 1 ? 'these tasks' : 'this task'}:
|
|
40
41
|
${tasks.tasks
|
|
@@ -43,6 +44,7 @@ ${tasks.tasks
|
|
|
43
44
|
: messages_1.styles.dim('no tasks configured to run on this hook.')}
|
|
44
45
|
${messages_1.styles.ruler()}
|
|
45
46
|
`);
|
|
47
|
+
/*eslint-enable @typescript-eslint/no-explicit-any */
|
|
46
48
|
}
|
|
47
49
|
}
|
|
48
50
|
if (missingHooks.length) {
|
package/lib/hook.d.ts
CHANGED
|
@@ -1,17 +1,7 @@
|
|
|
1
|
-
import type { Plugin } from '
|
|
1
|
+
import type { Plugin } from '@dotcom-tool-kit/types';
|
|
2
2
|
export interface HookTask {
|
|
3
3
|
id: string;
|
|
4
4
|
plugin: Plugin;
|
|
5
5
|
tasks: string[];
|
|
6
6
|
}
|
|
7
|
-
export interface HookClass {
|
|
8
|
-
id?: string;
|
|
9
|
-
plugin?: Plugin;
|
|
10
|
-
description?: string;
|
|
11
|
-
new (): Hook;
|
|
12
|
-
}
|
|
13
|
-
export interface Hook {
|
|
14
|
-
check(): Promise<boolean>;
|
|
15
|
-
install(): Promise<void>;
|
|
16
|
-
}
|
|
17
7
|
//# sourceMappingURL=hook.d.ts.map
|
package/lib/hook.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hook.d.ts","sourceRoot":"","sources":["../src/hook.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"hook.d.ts","sourceRoot":"","sources":["../src/hook.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAEpD,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,MAAM,EAAE,CAAA;CAChB"}
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAYA,wBAAsB,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA8E/E;AAED,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,QAAQ,CAAA;AAC5C,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,WAAW,CAAA"}
|
package/lib/install.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../src/install.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAc,MAAM,UAAU,CAAA;AAE7C,wBAA8B,YAAY,IAAI,OAAO,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../src/install.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAc,MAAM,UAAU,CAAA;AAE7C,wBAA8B,YAAY,IAAI,OAAO,CAAC,MAAM,CAAC,CAmC5D"}
|
package/lib/install.js
CHANGED
|
@@ -5,8 +5,7 @@ const options_1 = require("@dotcom-tool-kit/options");
|
|
|
5
5
|
const config_1 = require("./config");
|
|
6
6
|
async function installHooks() {
|
|
7
7
|
const config = await (0, config_1.loadConfig)();
|
|
8
|
-
const tasks = Object.values(config.hooks).map((
|
|
9
|
-
const hook = new Hook();
|
|
8
|
+
const tasks = Object.values(config.hooks).map((hook) => async () => {
|
|
10
9
|
if (!(await hook.check())) {
|
|
11
10
|
await hook.install();
|
|
12
11
|
}
|
package/lib/messages.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import colours from 'ansi-colors';
|
|
2
2
|
import type { PluginOptions } from './config';
|
|
3
3
|
import type { Conflict } from './conflict';
|
|
4
|
-
import type { HookTask
|
|
5
|
-
import type { TaskClass } from '@dotcom-tool-kit/
|
|
4
|
+
import type { HookTask } from './hook';
|
|
5
|
+
import type { Hook, TaskClass } from '@dotcom-tool-kit/types';
|
|
6
6
|
declare const s: {
|
|
7
7
|
hook: colours.StyleFunction;
|
|
8
8
|
task: colours.StyleFunction;
|
|
@@ -21,12 +21,12 @@ declare const s: {
|
|
|
21
21
|
};
|
|
22
22
|
export { s as styles };
|
|
23
23
|
export declare const formatTaskConflicts: (conflicts: Conflict<TaskClass>[]) => string;
|
|
24
|
-
export declare const formatHookConflicts: (conflicts: Conflict<
|
|
24
|
+
export declare const formatHookConflicts: (conflicts: Conflict<Hook>[]) => string;
|
|
25
25
|
export declare const formatHookTaskConflicts: (conflicts: Conflict<HookTask>[]) => string;
|
|
26
26
|
export declare const formatOptionConflicts: (conflicts: Conflict<PluginOptions>[]) => string;
|
|
27
27
|
export declare const formatUndefinedHookTasks: (undefinedHooks: HookTask[], definedHooks: string[]) => string;
|
|
28
28
|
export declare const formatUnusedOptions: (unusedOptions: string[], definedPlugins: string[]) => string;
|
|
29
|
-
export declare const formatUninstalledHooks: (uninstalledHooks:
|
|
29
|
+
export declare const formatUninstalledHooks: (uninstalledHooks: Hook[]) => string;
|
|
30
30
|
declare type Missing = {
|
|
31
31
|
hook: HookTask;
|
|
32
32
|
tasks: string[];
|
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,OAAO,MAAM,aAAa,CAAA;AAEjC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAC7C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAC1C,OAAO,KAAK,EAAE,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../src/messages.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,aAAa,CAAA;AAEjC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAC7C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAC1C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AACtC,OAAO,KAAK,EAAU,IAAI,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAIrE,QAAA,MAAM,CAAC;;;;;;;;;;;;oBAYW,MAAM,KAAG,MAAM;sBACb,MAAM,KAAG,MAAM;iBACtB,MAAM;CAClB,CAAA;AAED,OAAO,EAAE,CAAC,IAAI,MAAM,EAAE,CAAA;AAStB,eAAO,MAAM,mBAAmB,cAAe,SAAS,SAAS,CAAC,EAAE,KAAG,MAKE,CAAA;AASzE,eAAO,MAAM,mBAAmB,cAAe,SAAS,IAAI,CAAC,EAAE,KAAG,MAKO,CAAA;AAazE,eAAO,MAAM,uBAAuB,cAAe,SAAS,QAAQ,CAAC,EAAE,KAAG,MAQzE,CAAA;AAOD,eAAO,MAAM,qBAAqB,cAAe,SAAS,aAAa,CAAC,EAAE,KAAG,MAU5E,CAAA;AAMD,eAAO,MAAM,wBAAwB,mBACnB,QAAQ,EAAE,gBACZ,MAAM,EAAE,KACrB,MAWF,CAAA;AAED,eAAO,MAAM,mBAAmB,kBACf,MAAM,EAAE,kBACP,MAAM,EAAE,KACvB,MAWF,CAAA;AAED,eAAO,MAAM,sBAAsB,qBACf,IAAI,EAAE,KACvB,MAKF,CAAA;AAED,aAAK,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"}
|
package/lib/plugin.d.ts
CHANGED
|
@@ -1,15 +1,5 @@
|
|
|
1
|
-
import type { TaskClass } from '@dotcom-tool-kit/task';
|
|
2
|
-
import type { HookClass } from './hook';
|
|
3
1
|
import { Config } from './config';
|
|
4
|
-
|
|
5
|
-
id: string;
|
|
6
|
-
root: string;
|
|
7
|
-
parent?: Plugin;
|
|
8
|
-
tasks?: TaskClass[];
|
|
9
|
-
hooks?: {
|
|
10
|
-
[id: string]: HookClass;
|
|
11
|
-
};
|
|
12
|
-
}
|
|
2
|
+
import { Plugin } from '@dotcom-tool-kit/types';
|
|
13
3
|
export declare function loadPluginConfig(plugin: Plugin, config: Config): Promise<Config>;
|
|
14
4
|
export declare function loadPlugin(id: string, config: Config, parent?: Plugin): Promise<Plugin>;
|
|
15
5
|
export declare function loadPlugins(plugins: string[], config: Config, parent?: Plugin): Promise<Plugin[]>;
|
package/lib/plugin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAiB,MAAM,UAAU,CAAA;AAKhD,OAAO,EAA2B,MAAM,EAAa,MAAM,wBAAwB,CAAA;AAEnF,wBAAsB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA6FtF;AAED,wBAAsB,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAkF7F;AAED,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAEjG"}
|
package/lib/plugin.js
CHANGED
|
@@ -6,7 +6,10 @@ const import_from_1 = (0, tslib_1.__importDefault)(require("import-from"));
|
|
|
6
6
|
const resolve_from_1 = (0, tslib_1.__importDefault)(require("resolve-from"));
|
|
7
7
|
const lodash_mergewith_1 = (0, tslib_1.__importDefault)(require("lodash.mergewith"));
|
|
8
8
|
const conflict_1 = require("./conflict");
|
|
9
|
+
const messages_1 = require("./messages");
|
|
9
10
|
const rc_file_1 = require("./rc-file");
|
|
11
|
+
const error_1 = require("@dotcom-tool-kit/error");
|
|
12
|
+
const types_1 = require("@dotcom-tool-kit/types");
|
|
10
13
|
async function loadPluginConfig(plugin, config) {
|
|
11
14
|
const { plugins = [], hooks = {}, options = {} } = await (0, rc_file_1.loadToolKitRC)(plugin.root);
|
|
12
15
|
// load any plugins requested by this plugin
|
|
@@ -80,7 +83,17 @@ async function loadPlugin(id, config, parent) {
|
|
|
80
83
|
const root = parent ? parent.root : process.cwd();
|
|
81
84
|
// load plugin relative to the parent plugin
|
|
82
85
|
const pluginRoot = (0, resolve_from_1.default)(root, id);
|
|
83
|
-
const
|
|
86
|
+
const rawPlugin = (0, import_from_1.default)(root, id);
|
|
87
|
+
let basePlugin;
|
|
88
|
+
try {
|
|
89
|
+
basePlugin = (0, types_1.instantiatePlugin)(rawPlugin);
|
|
90
|
+
}
|
|
91
|
+
catch (error) {
|
|
92
|
+
if (error instanceof error_1.ToolKitError) {
|
|
93
|
+
error.details = `the package ${messages_1.styles.plugin(id)} at ${messages_1.styles.filepath(pluginRoot)} is not a valid plugin`;
|
|
94
|
+
}
|
|
95
|
+
throw error;
|
|
96
|
+
}
|
|
84
97
|
const plugin = {
|
|
85
98
|
...basePlugin,
|
|
86
99
|
id,
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dotcom-tool-kit",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.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",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
9
|
"url": "https://github.com/financial-times/dotcom-tool-kit.git",
|
|
10
|
-
"directory": "
|
|
10
|
+
"directory": "core/cli"
|
|
11
11
|
},
|
|
12
12
|
"homepage": "https://github.com/financial-times/dotcom-tool-kit",
|
|
13
13
|
"bugs": "https://github.com/financial-times/dotcom-tool-kit/issues",
|
|
@@ -17,11 +17,10 @@
|
|
|
17
17
|
"dotcom-tool-kit": "./bin/run"
|
|
18
18
|
},
|
|
19
19
|
"scripts": {
|
|
20
|
-
"test": "cd ../../ ; npx jest --silent --projects
|
|
20
|
+
"test": "cd ../../ ; npx jest --silent --projects core/cli"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@
|
|
24
|
-
"@jest/globals": "^26.6.2",
|
|
23
|
+
"@jest/globals": "^27.4.6",
|
|
25
24
|
"@types/lodash.mergewith": "^4.6.6",
|
|
26
25
|
"@types/node": "^12.20.24",
|
|
27
26
|
"chai": "^4.3.4",
|
|
@@ -29,9 +28,11 @@
|
|
|
29
28
|
"ts-node": "^8.10.2"
|
|
30
29
|
},
|
|
31
30
|
"dependencies": {
|
|
32
|
-
"@dotcom-tool-kit/error": "^1.
|
|
33
|
-
"@dotcom-tool-kit/
|
|
34
|
-
"@dotcom-tool-kit/
|
|
31
|
+
"@dotcom-tool-kit/error": "^1.3.0",
|
|
32
|
+
"@dotcom-tool-kit/hook": "^1.3.0",
|
|
33
|
+
"@dotcom-tool-kit/options": "^1.3.0",
|
|
34
|
+
"@dotcom-tool-kit/types": "^1.3.0",
|
|
35
|
+
"@dotcom-tool-kit/wait-for-ok": "^1.3.0",
|
|
35
36
|
"ansi-colors": "^4.1.1",
|
|
36
37
|
"cosmiconfig": "^7.0.0",
|
|
37
38
|
"import-from": "^3.0.0",
|