dotcom-tool-kit 4.5.0 → 4.7.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/help.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../src/help.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AA4ErC,wBAA8B,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAsCxF"}
1
+ {"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../src/help.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AA6ErC,wBAA8B,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAwCxF"}
package/lib/help.js CHANGED
@@ -5,6 +5,7 @@ const config_1 = require("./config");
5
5
  const logger_1 = require("@dotcom-tool-kit/logger");
6
6
  const yaml_1 = tslib_1.__importDefault(require("yaml"));
7
7
  const endent_1 = tslib_1.__importDefault(require("endent"));
8
+ const init_1 = require("./init");
8
9
  const toolKitIntro = logger_1.styles.box((0, endent_1.default) `
9
10
  Tool Kit is modern, maintainable & modular developer tooling for FT.com projects.
10
11
  ${logger_1.styles.URL('https://github.com/financial-times/dotcom-tool-kit')}
@@ -55,6 +56,7 @@ async function showHelp(logger, commands) {
55
56
  if (printAllCommands) {
56
57
  commands = Object.keys(config.commandTasks).sort();
57
58
  }
59
+ await (0, init_1.runInit)(logger, config);
58
60
  logger.info(toolKitIntro);
59
61
  const definedCommands = commands.filter((command) => config.commandTasks[command]);
60
62
  const missingCommands = commands.filter((command) => !config.commandTasks[command]);
package/lib/init.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAG1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAarC,wBAAsB,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAKhF"}
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAG1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAarC,wBAAsB,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAOhF"}
package/lib/init.js CHANGED
@@ -11,6 +11,8 @@ const loadInitEntrypoints = async (logger, config) => {
11
11
  async function runInit(logger, config) {
12
12
  const initResults = await loadInitEntrypoints(logger, config);
13
13
  const inits = initResults.unwrap('plugin initialisation classes were invalid!');
14
- await Promise.all(inits.map(async (init) => init.init()));
14
+ await Promise.all(inits.map(async (init) => init.init({
15
+ cwd: config.root
16
+ })));
15
17
  }
16
18
  exports.runInit = runInit;
@@ -1 +1 @@
1
- {"version":3,"file":"reduce-installations.d.ts","sourceRoot":"","sources":["../../src/plugin/reduce-installations.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AACrC,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAExB,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACxE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,EAAE,QAAQ,EAAc,MAAM,2BAA2B,CAAA;AAEhE,OAAO,KAAK,EAAE,MAAM,EAAE,M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BAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,CAsEvE"}
@@ -49,8 +49,8 @@ async function reducePluginHookInstallations(logger, config, hookModules, plugin
49
49
  if (plugin.rcFile.options.hooks.length === 0) {
50
50
  return (0, validated_1.valid)(childInstallations);
51
51
  }
52
- const unusedHookOptions = plugin.rcFile.options.hooks
53
- .flatMap(Object.keys)
52
+ const pluginHookIds = plugin.rcFile.options.hooks.flatMap(Object.keys);
53
+ const unusedHookOptions = pluginHookIds
54
54
  .filter((hookId) => !(hookId in hookModules))
55
55
  .map((hookId) => logger_1.styles.hook(hookId));
56
56
  if (unusedHookOptions.length > 0) {
@@ -71,6 +71,9 @@ async function reducePluginHookInstallations(logger, config, hookModules, plugin
71
71
  const childInstallationsForHook = childInstallations.filter((childInstallation) => id === extractForHook(childInstallation));
72
72
  return (0, validated_1.valid)(hookModule.hookClass.overrideChildInstallations(plugin, installation, childInstallationsForHook));
73
73
  }));
74
- return (0, validated_1.reduceValidated)(validatedInstallations).map((installations) => installations.flat());
74
+ return (0, validated_1.reduceValidated)(validatedInstallations).map((installations) => [
75
+ ...installations.flat(),
76
+ ...childInstallations.filter((childInstallation) => !pluginHookIds.includes(extractForHook(childInstallation)))
77
+ ]);
75
78
  }
76
79
  exports.reducePluginHookInstallations = reducePluginHookInstallations;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dotcom-tool-kit",
3
- "version": "4.5.0",
3
+ "version": "4.7.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",
@@ -30,7 +30,7 @@
30
30
  "zod": "^3.22.4"
31
31
  },
32
32
  "dependencies": {
33
- "@dotcom-tool-kit/base": "^1.1.10",
33
+ "@dotcom-tool-kit/base": "^1.2.0",
34
34
  "@dotcom-tool-kit/config": "^1.1.0",
35
35
  "@dotcom-tool-kit/conflict": "^1.0.1",
36
36
  "@dotcom-tool-kit/error": "^4.1.0",