@powerlines/nx 0.11.269 → 0.11.270

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.
Files changed (204) hide show
  1. package/README.md +29 -31
  2. package/dist/src/base/base-executor.d.mts +1 -1
  3. package/dist/src/base/base-executor.d.ts +1 -1
  4. package/dist/src/base/base-executor.js +78 -3
  5. package/dist/src/base/base-executor.mjs +75 -3
  6. package/dist/src/base/base-executor.mjs.map +1 -0
  7. package/dist/src/base/base-executor.schema.d.mts +117 -2
  8. package/dist/src/base/base-executor.schema.d.mts.map +1 -0
  9. package/dist/src/base/base-executor.schema.d.ts +117 -2
  10. package/dist/src/base/base-executor.schema.d.ts.map +1 -0
  11. package/dist/src/base/base-executor.untyped.d.mts +1 -1
  12. package/dist/src/base/base-executor.untyped.d.ts +1 -1
  13. package/dist/src/base/base-executor.untyped.js +135 -2
  14. package/dist/src/base/base-executor.untyped.mjs +135 -2
  15. package/dist/src/base/base-executor.untyped.mjs.map +1 -0
  16. package/dist/src/base/index.d.mts +1 -3
  17. package/dist/src/base/index.d.ts +1 -1
  18. package/dist/src/base/index.js +4 -5
  19. package/dist/src/base/index.mjs +2 -4
  20. package/dist/src/base-executor-Bj63x9OE.d.ts +28 -0
  21. package/dist/src/base-executor-Bj63x9OE.d.ts.map +1 -0
  22. package/dist/src/base-executor-D6POztG2.d.mts +28 -0
  23. package/dist/src/base-executor-D6POztG2.d.mts.map +1 -0
  24. package/dist/src/base-executor.untyped-D4R6pki2.d.ts +7 -0
  25. package/dist/src/base-executor.untyped-D4R6pki2.d.ts.map +1 -0
  26. package/dist/src/base-executor.untyped-hmlG6oyC.d.mts +7 -0
  27. package/dist/src/base-executor.untyped-hmlG6oyC.d.mts.map +1 -0
  28. package/dist/src/chunk-BE-pF4vm.js +34 -0
  29. package/dist/src/{constants-BvODbBl8.d.ts → constants-CbG11Mby.d.ts} +1 -1
  30. package/dist/src/constants-CbG11Mby.d.ts.map +1 -0
  31. package/dist/src/{constants-ByputsG8.d.mts → constants-VDvVnoLC.d.mts} +1 -1
  32. package/dist/src/constants-VDvVnoLC.d.mts.map +1 -0
  33. package/dist/src/executors/build/executor.d.mts +2 -16
  34. package/dist/src/executors/build/executor.d.mts.map +1 -1
  35. package/dist/src/executors/build/executor.d.ts +2 -16
  36. package/dist/src/executors/build/executor.d.ts.map +1 -1
  37. package/dist/src/executors/build/executor.js +6 -7
  38. package/dist/src/executors/build/executor.mjs +4 -6
  39. package/dist/src/executors/build/executor.mjs.map +1 -1
  40. package/dist/src/executors/build/untyped.d.mts +2 -2
  41. package/dist/src/executors/build/untyped.d.mts.map +1 -1
  42. package/dist/src/executors/build/untyped.d.ts +2 -2
  43. package/dist/src/executors/build/untyped.d.ts.map +1 -1
  44. package/dist/src/executors/build/untyped.js +3 -4
  45. package/dist/src/executors/build/untyped.mjs +1 -2
  46. package/dist/src/executors/build/untyped.mjs.map +1 -1
  47. package/dist/src/executors/clean/executor.d.mts +2 -13
  48. package/dist/src/executors/clean/executor.d.mts.map +1 -1
  49. package/dist/src/executors/clean/executor.d.ts +2 -13
  50. package/dist/src/executors/clean/executor.d.ts.map +1 -1
  51. package/dist/src/executors/clean/executor.js +4 -6
  52. package/dist/src/executors/clean/executor.mjs +2 -4
  53. package/dist/src/executors/clean/executor.mjs.map +1 -1
  54. package/dist/src/executors/clean/untyped.d.mts +2 -2
  55. package/dist/src/executors/clean/untyped.d.mts.map +1 -1
  56. package/dist/src/executors/clean/untyped.d.ts +2 -2
  57. package/dist/src/executors/clean/untyped.d.ts.map +1 -1
  58. package/dist/src/executors/clean/untyped.js +3 -3
  59. package/dist/src/executors/clean/untyped.mjs +1 -1
  60. package/dist/src/executors/docs/executor.d.mts +2 -15
  61. package/dist/src/executors/docs/executor.d.mts.map +1 -1
  62. package/dist/src/executors/docs/executor.d.ts +2 -15
  63. package/dist/src/executors/docs/executor.d.ts.map +1 -1
  64. package/dist/src/executors/docs/executor.js +4 -6
  65. package/dist/src/executors/docs/executor.mjs +2 -4
  66. package/dist/src/executors/docs/executor.mjs.map +1 -1
  67. package/dist/src/executors/docs/untyped.d.mts +2 -2
  68. package/dist/src/executors/docs/untyped.d.mts.map +1 -1
  69. package/dist/src/executors/docs/untyped.d.ts +2 -2
  70. package/dist/src/executors/docs/untyped.d.ts.map +1 -1
  71. package/dist/src/executors/docs/untyped.js +3 -4
  72. package/dist/src/executors/docs/untyped.mjs +1 -2
  73. package/dist/src/executors/docs/untyped.mjs.map +1 -1
  74. package/dist/src/executors/lint/executor.d.mts +2 -15
  75. package/dist/src/executors/lint/executor.d.mts.map +1 -1
  76. package/dist/src/executors/lint/executor.d.ts +2 -15
  77. package/dist/src/executors/lint/executor.d.ts.map +1 -1
  78. package/dist/src/executors/lint/executor.js +4 -6
  79. package/dist/src/executors/lint/executor.mjs +2 -4
  80. package/dist/src/executors/lint/executor.mjs.map +1 -1
  81. package/dist/src/executors/lint/untyped.d.mts +2 -2
  82. package/dist/src/executors/lint/untyped.d.mts.map +1 -1
  83. package/dist/src/executors/lint/untyped.d.ts +2 -2
  84. package/dist/src/executors/lint/untyped.d.ts.map +1 -1
  85. package/dist/src/executors/lint/untyped.js +3 -4
  86. package/dist/src/executors/lint/untyped.mjs +1 -2
  87. package/dist/src/executors/lint/untyped.mjs.map +1 -1
  88. package/dist/src/executors/prepare/executor.d.mts +2 -15
  89. package/dist/src/executors/prepare/executor.d.mts.map +1 -1
  90. package/dist/src/executors/prepare/executor.d.ts +2 -15
  91. package/dist/src/executors/prepare/executor.d.ts.map +1 -1
  92. package/dist/src/executors/prepare/executor.js +6 -7
  93. package/dist/src/executors/prepare/executor.mjs +4 -6
  94. package/dist/src/executors/prepare/executor.mjs.map +1 -1
  95. package/dist/src/executors/prepare/untyped.d.mts +2 -2
  96. package/dist/src/executors/prepare/untyped.d.mts.map +1 -1
  97. package/dist/src/executors/prepare/untyped.d.ts +2 -2
  98. package/dist/src/executors/prepare/untyped.d.ts.map +1 -1
  99. package/dist/src/executors/prepare/untyped.js +26 -3
  100. package/dist/src/executors/prepare/untyped.mjs +26 -3
  101. package/dist/src/executors/prepare/untyped.mjs.map +1 -0
  102. package/dist/src/generators/sync/generator.d.mts.map +1 -1
  103. package/dist/src/generators/sync/generator.d.ts.map +1 -1
  104. package/dist/src/generators/sync/generator.js +5 -6
  105. package/dist/src/generators/sync/generator.mjs +1 -2
  106. package/dist/src/generators/sync/generator.mjs.map +1 -1
  107. package/dist/src/generators/sync/untyped.d.mts +2 -2
  108. package/dist/src/generators/sync/untyped.d.mts.map +1 -1
  109. package/dist/src/generators/sync/untyped.d.ts +2 -2
  110. package/dist/src/generators/sync/untyped.d.ts.map +1 -1
  111. package/dist/src/generators/sync/untyped.js +1 -1
  112. package/dist/src/helpers/constants.d.mts +1 -1
  113. package/dist/src/helpers/constants.d.ts +1 -1
  114. package/dist/src/helpers/constants.js +34 -2
  115. package/dist/src/helpers/constants.mjs +33 -2
  116. package/dist/src/helpers/constants.mjs.map +1 -0
  117. package/dist/src/helpers/index.d.mts +2 -3
  118. package/dist/src/helpers/index.d.ts +2 -2
  119. package/dist/src/helpers/index.js +7 -8
  120. package/dist/src/helpers/index.mjs +2 -4
  121. package/dist/src/helpers/plugin-utilities.d.mts +1 -1
  122. package/dist/src/helpers/plugin-utilities.d.ts +1 -1
  123. package/dist/src/helpers/plugin-utilities.js +274 -5
  124. package/dist/src/helpers/plugin-utilities.mjs +270 -3
  125. package/dist/src/helpers/plugin-utilities.mjs.map +1 -0
  126. package/dist/src/index.d.mts +4 -7
  127. package/dist/src/index.d.ts +4 -4
  128. package/dist/src/index.js +11 -12
  129. package/dist/src/index.mjs +5 -7
  130. package/dist/src/plugin/index.d.mts +1 -1
  131. package/dist/src/plugin/index.d.mts.map +1 -1
  132. package/dist/src/plugin/index.d.ts +1 -1
  133. package/dist/src/plugin/index.d.ts.map +1 -1
  134. package/dist/src/plugin/index.js +3 -3
  135. package/dist/src/plugin/index.mjs +1 -2
  136. package/dist/src/plugin/index.mjs.map +1 -1
  137. package/dist/src/{plugin-DIj3oU64.d.mts → plugin-B_ZGdX7U.d.mts} +1 -1
  138. package/dist/src/plugin-B_ZGdX7U.d.mts.map +1 -0
  139. package/dist/src/{plugin-DN475itb.d.ts → plugin-DpyutMl2.d.ts} +1 -1
  140. package/dist/src/plugin-DpyutMl2.d.ts.map +1 -0
  141. package/dist/src/{plugin-utilities-Bz3Muyag.d.mts → plugin-utilities-Cg-Ccp4C.d.mts} +2 -3
  142. package/dist/src/plugin-utilities-Cg-Ccp4C.d.mts.map +1 -0
  143. package/dist/src/{plugin-utilities-CeMy-9YQ.d.ts → plugin-utilities-CmfuC3TZ.d.ts} +2 -3
  144. package/dist/src/plugin-utilities-CmfuC3TZ.d.ts.map +1 -0
  145. package/dist/src/types/index.d.mts +1 -1
  146. package/dist/src/types/index.d.ts +1 -1
  147. package/dist/src/types/plugin.d.mts +1 -1
  148. package/dist/src/types/plugin.d.ts +1 -1
  149. package/package.json +4 -4
  150. package/dist/src/base-B7jekb-W.js +0 -0
  151. package/dist/src/base-BRSa-clf.mjs +0 -1
  152. package/dist/src/base-executor-CWToCKgJ.d.ts +0 -2195
  153. package/dist/src/base-executor-CWToCKgJ.d.ts.map +0 -1
  154. package/dist/src/base-executor-Cc27ehGx.js +0 -4881
  155. package/dist/src/base-executor-DPB5qlkm.mjs +0 -4863
  156. package/dist/src/base-executor-DPB5qlkm.mjs.map +0 -1
  157. package/dist/src/base-executor-PhChSWwR.mjs +0 -4863
  158. package/dist/src/base-executor-PhChSWwR.mjs.map +0 -1
  159. package/dist/src/base-executor-tG-B1UsT.js +0 -4881
  160. package/dist/src/base-executor-xsZuLKpp.d.mts +0 -2197
  161. package/dist/src/base-executor-xsZuLKpp.d.mts.map +0 -1
  162. package/dist/src/base-executor.schema-BaaDD_VU.d.ts +0 -130
  163. package/dist/src/base-executor.schema-BaaDD_VU.d.ts.map +0 -1
  164. package/dist/src/base-executor.schema-CYPLsYvI.d.mts +0 -130
  165. package/dist/src/base-executor.schema-CYPLsYvI.d.mts.map +0 -1
  166. package/dist/src/base-executor.untyped-7SvGKXcO.d.mts +0 -7
  167. package/dist/src/base-executor.untyped-7SvGKXcO.d.mts.map +0 -1
  168. package/dist/src/base-executor.untyped-C1pQETnQ.mjs +0 -136
  169. package/dist/src/base-executor.untyped-C1pQETnQ.mjs.map +0 -1
  170. package/dist/src/base-executor.untyped-Cz1Zw_02.js +0 -141
  171. package/dist/src/base-executor.untyped-DBccuF6E.d.ts +0 -7
  172. package/dist/src/base-executor.untyped-DBccuF6E.d.ts.map +0 -1
  173. package/dist/src/base-executor.untyped-DCiPQvRf.d.ts +0 -7
  174. package/dist/src/base-executor.untyped-DCiPQvRf.d.ts.map +0 -1
  175. package/dist/src/base-executor.untyped-imww7Gm9.d.mts +0 -7
  176. package/dist/src/base-executor.untyped-imww7Gm9.d.mts.map +0 -1
  177. package/dist/src/config-CGQhS8tm.js +0 -239
  178. package/dist/src/config-LoR-NIJg.mjs +0 -147
  179. package/dist/src/config-LoR-NIJg.mjs.map +0 -1
  180. package/dist/src/constants-BvODbBl8.d.ts.map +0 -1
  181. package/dist/src/constants-ByputsG8.d.mts.map +0 -1
  182. package/dist/src/constants-CKuImMYn.js +0 -39
  183. package/dist/src/constants-DzvoYj5w.mjs +0 -34
  184. package/dist/src/constants-DzvoYj5w.mjs.map +0 -1
  185. package/dist/src/helpers-B78f0Oey.js +0 -0
  186. package/dist/src/helpers-j01T2doK.mjs +0 -1
  187. package/dist/src/index-7rWKHdox.d.mts +0 -1
  188. package/dist/src/index-CB5PSF-Q.d.ts +0 -1
  189. package/dist/src/index-CDDzqahH.d.ts +0 -1
  190. package/dist/src/index-CsuikFeJ.d.mts +0 -1
  191. package/dist/src/index-LhFpnU-f.d.mts +0 -1
  192. package/dist/src/index-g0mugXoV.d.ts +0 -1
  193. package/dist/src/plugin-BnaFlFmT.js +0 -0
  194. package/dist/src/plugin-DIj3oU64.d.mts.map +0 -1
  195. package/dist/src/plugin-DN475itb.d.ts.map +0 -1
  196. package/dist/src/plugin-DRjpXVSI.mjs +0 -1
  197. package/dist/src/plugin-utilities-ByTgFCEW.js +0 -287
  198. package/dist/src/plugin-utilities-Bz3Muyag.d.mts.map +0 -1
  199. package/dist/src/plugin-utilities-CeMy-9YQ.d.ts.map +0 -1
  200. package/dist/src/plugin-utilities-DamtoOxO.mjs +0 -270
  201. package/dist/src/plugin-utilities-DamtoOxO.mjs.map +0 -1
  202. package/dist/src/untyped-BzuygGwJ.mjs +0 -27
  203. package/dist/src/untyped-BzuygGwJ.mjs.map +0 -1
  204. package/dist/src/untyped-CB-jtwm-.js +0 -32
@@ -1,287 +0,0 @@
1
- const require_config = require('./config-CGQhS8tm.js');
2
- const require_constants = require('./constants-CKuImMYn.js');
3
- let __stryke_type_checks_is_error = require("@stryke/type-checks/is-error");
4
- let defu = require("defu");
5
- defu = require_config.__toESM(defu);
6
- let __stryke_path_join_paths = require("@stryke/path/join-paths");
7
- let __stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
8
- let __stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
9
- let __stryke_fs_exists = require("@stryke/fs/exists");
10
- let __stryke_string_format_kebab_case = require("@stryke/string-format/kebab-case");
11
- let __stryke_string_format_title_case = require("@stryke/string-format/title-case");
12
- let __stryke_string_format_camel_case = require("@stryke/string-format/camel-case");
13
- let __stryke_env_get_env_paths = require("@stryke/env/get-env-paths");
14
- let __stryke_hash = require("@stryke/hash");
15
- let jiti = require("jiti");
16
- let node_fs_promises = require("node:fs/promises");
17
- let __nx_devkit = require("@nx/devkit");
18
- let __storm_software_workspace_tools_utils_nx_json = require("@storm-software/workspace-tools/utils/nx-json");
19
- let __storm_software_workspace_tools_utils_plugin_helpers = require("@storm-software/workspace-tools/utils/plugin-helpers");
20
- let __storm_software_workspace_tools_utils_project_tags = require("@storm-software/workspace-tools/utils/project-tags");
21
- let nx_src_config_nx_json_js = require("nx/src/config/nx-json.js");
22
- let nx_src_utils_package_json_js = require("nx/src/utils/package-json.js");
23
-
24
- //#region src/helpers/plugin-utilities.ts
25
- /**
26
- * Generates Nx input strings for the Powerlines configuration file, replacing the `{framework}` placeholder with the specified framework name.
27
- *
28
- * @param framework - The framework name to use in the input strings
29
- * @returns An array of Nx input strings for the configuration file
30
- */
31
- function getNxTargetInputs(framework) {
32
- return require_constants.CONFIG_INPUTS.map((input) => input.replace("{framework}", framework));
33
- }
34
- /**
35
- * Generates Nx input strings for the Powerlines configuration file, replacing the `{framework}` placeholder with the specified framework name.
36
- *
37
- * @param framework - The framework name to use in the input strings
38
- * @returns An array of Nx input strings for the configuration file
39
- */
40
- function getNxPluginInputs(framework) {
41
- return `**/{${getNxTargetInputs(framework).map((input) => input.replace("{projectRoot}/", "")).join(",")}}`;
42
- }
43
- /**
44
- * Creates an Nx plugin that integrates Powerlines into the Nx build process.
45
- *
46
- * @param opts - Options for creating the Nx plugin
47
- * @returns A CreateNodesV2 function that can be used as an Nx plugin
48
- */
49
- function createNxPlugin(opts) {
50
- const framework = opts?.framework || "powerlines";
51
- const title = `${(0, __stryke_string_format_title_case.titleCase)(framework)} Nx Plugin`;
52
- try {
53
- const name = opts?.name || `${framework}/nx/plugin`;
54
- const artifactsFolder = opts?.artifactsFolder || `{projectRoot}/.${framework}`;
55
- const targetInputs = getNxTargetInputs(framework);
56
- const pluginInputs = getNxPluginInputs(framework);
57
- return [pluginInputs, async (configFiles, options, contextV2) => {
58
- if (options?.verboseOutput) console.debug(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Initializing the ${title} for the following inputs: ${pluginInputs}`);
59
- const envPaths = (0, __stryke_env_get_env_paths.getEnvPaths)({
60
- orgId: "storm-software",
61
- appId: framework,
62
- workspaceRoot: contextV2.workspaceRoot
63
- });
64
- if (!envPaths.cache) throw new Error("The cache directory could not be determined.");
65
- const nxJson = (0, nx_src_config_nx_json_js.readNxJson)(contextV2.workspaceRoot);
66
- const resolver = (0, jiti.createJiti)(contextV2.workspaceRoot, {
67
- debug: !!options?.debug,
68
- interopDefault: true,
69
- fsCache: (0, __stryke_path_join_paths.joinPaths)(envPaths.cache, "nx-plugin", (0, __stryke_hash.murmurhash)(contextV2.workspaceRoot, { maxLength: require_config.ROOT_HASH_LENGTH }), "jiti"),
70
- moduleCache: true
71
- });
72
- return (0, __nx_devkit.createNodesFromFiles)(async (configFile, _, context) => {
73
- try {
74
- const projectRoot = (0, __storm_software_workspace_tools_utils_plugin_helpers.getProjectRoot)(configFile, contextV2.workspaceRoot);
75
- if (!projectRoot) {
76
- console.error(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - package.json and ${framework} configuration files (i.e. ${framework}.config.ts) must be located in the project root directory: ${configFile}`);
77
- return {};
78
- }
79
- const root = (0, __storm_software_workspace_tools_utils_plugin_helpers.getRoot)(projectRoot, context);
80
- if (options?.verboseOutput) console.debug(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Loading ${framework} user configuration for project in root directory ${projectRoot}.`);
81
- let userConfig = {};
82
- try {
83
- userConfig = await require_config.loadUserConfigFile(projectRoot, contextV2.workspaceRoot, resolver, "build", "development", configFile, framework);
84
- } catch (error) {
85
- console.warn(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Failed to load user configuration for project in ${projectRoot} - ${(0, __stryke_type_checks_is_error.isError)(error) ? error.message : (0, __stryke_type_checks_is_set_string.isSetString)(error) ? error : "Unknown error"} \n\nThis error can occur if the project depends on another package in the workspace and the dependent package has not been built yet. To resolve this issue, please ensure that all dependent packages have been built successfully.`);
86
- }
87
- if (!(0, __stryke_fs_exists.existsSync)((0, __stryke_path_join_paths.joinPaths)(contextV2.workspaceRoot, projectRoot, "package.json"))) {
88
- if (options?.verboseOutput) console.warn(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Cannot find \`package.json\` file in the project's root directory (path: "${(0, __stryke_path_join_paths.joinPaths)(contextV2.workspaceRoot, projectRoot)}"). Skipping project configuration.`);
89
- return {};
90
- }
91
- const packageJsonContent = await (0, node_fs_promises.readFile)((0, __stryke_path_join_paths.joinPaths)(contextV2.workspaceRoot, projectRoot, "package.json"), "utf8");
92
- if (!packageJsonContent) {
93
- if (options?.verboseOutput) console.warn(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - No package.json file found for project in root directory ${projectRoot}`);
94
- return {};
95
- }
96
- const packageJson = JSON.parse(packageJsonContent);
97
- if (!userConfig.configFile && !packageJson?.[(0, __stryke_string_format_camel_case.camelCase)(framework)]) {
98
- if (options?.verboseOutput) console.debug(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Skipping ${projectRoot} - no ${framework} configuration found for project in root directory.`);
99
- return {};
100
- }
101
- const projectConfig = (0, __storm_software_workspace_tools_utils_plugin_helpers.getProjectConfigFromProjectRoot)(projectRoot, packageJson);
102
- if (!projectConfig) {
103
- if (options?.verboseOutput) console.warn(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - No project configuration found for project in root directory ${projectRoot}`);
104
- return {};
105
- }
106
- const targets = (0, nx_src_utils_package_json_js.readTargetsFromPackageJson)(packageJson, nxJson, projectRoot, context.workspaceRoot);
107
- if (options?.verboseOutput) console.debug(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Preparing Nx targets for project in root directory ${projectRoot}.`);
108
- if (options?.clean !== false && !targets[options?.clean?.targetName || "clean"]) targets[options?.clean?.targetName || "clean"] = {
109
- cache: true,
110
- inputs: Array.isArray(options?.clean?.inputs) ? options.clean.inputs : (0, __storm_software_workspace_tools_utils_nx_json.withNamedInputs)(targetInputs, [options?.clean?.inputs || "typescript"]),
111
- outputs: options?.clean?.outputs,
112
- executor: options?.clean?.executor || `@${framework}/nx:${options?.clean?.targetName || "clean"}`,
113
- dependsOn: options?.clean?.dependsOn ?? [`^${options?.clean?.targetName || "clean"}`],
114
- defaultConfiguration: options?.clean?.defaultConfiguration || "production",
115
- options: {
116
- outputPath: userConfig.output?.outputPath,
117
- projectType: userConfig.projectType || projectConfig.projectType,
118
- autoInstall: userConfig.autoInstall
119
- },
120
- configurations: {
121
- production: { mode: "production" },
122
- test: { mode: "test" },
123
- development: {
124
- mode: "development",
125
- skipCache: true
126
- }
127
- }
128
- };
129
- if (options?.prepare !== false && !targets[options?.prepare?.targetName || "prepare"]) targets[options?.prepare?.targetName || "prepare"] = {
130
- cache: true,
131
- inputs: Array.isArray(options?.prepare?.inputs) ? options.prepare.inputs : (0, __storm_software_workspace_tools_utils_nx_json.withNamedInputs)(targetInputs, [options?.prepare?.inputs || "typescript"]),
132
- outputs: options?.prepare?.outputs ?? [artifactsFolder],
133
- executor: options?.prepare?.executor || `@${framework}/nx:${options?.prepare?.targetName || "prepare"}`,
134
- dependsOn: options?.prepare?.dependsOn ?? [`^${options?.prepare?.targetName || "build"}`, options?.clean !== false && `${options?.clean?.targetName || "clean"}`].filter(Boolean),
135
- defaultConfiguration: options?.prepare?.defaultConfiguration || "production",
136
- options: {
137
- input: userConfig.input,
138
- projectType: userConfig.projectType || projectConfig.projectType,
139
- autoInstall: userConfig.autoInstall,
140
- skipCache: userConfig.skipCache
141
- },
142
- configurations: {
143
- production: { mode: "production" },
144
- test: { mode: "test" },
145
- development: {
146
- mode: "development",
147
- skipCache: true
148
- }
149
- }
150
- };
151
- if (options?.build !== false && !targets[options?.build?.targetName || "build"]) targets[options?.build?.targetName || "build"] = {
152
- cache: true,
153
- inputs: Array.isArray(options?.build?.inputs) ? options.build.inputs : (0, __storm_software_workspace_tools_utils_nx_json.withNamedInputs)(targetInputs, [options?.build?.inputs || "typescript"]),
154
- outputs: options?.build?.outputs ?? ["{options.outputPath}"],
155
- executor: options?.build?.executor || `@${framework}/nx:${options?.build?.targetName || "build"}`,
156
- dependsOn: options?.build?.dependsOn ?? [`^${options?.build?.targetName || "build"}`, userConfig.skipCache ? void 0 : (0, __stryke_type_checks_is_set_object.isSetObject)(options?.prepare) && options?.prepare?.targetName ? options?.prepare?.targetName : "prepare"].filter(Boolean),
157
- defaultConfiguration: options?.build?.defaultConfiguration || "production",
158
- options: {
159
- input: userConfig.input,
160
- outputPath: userConfig.output?.outputPath,
161
- projectType: userConfig.projectType || projectConfig.projectType,
162
- autoInstall: userConfig.autoInstall,
163
- skipCache: userConfig.skipCache
164
- },
165
- configurations: {
166
- production: { mode: "production" },
167
- test: { mode: "test" },
168
- development: {
169
- mode: "development",
170
- skipCache: true
171
- }
172
- }
173
- };
174
- if (options?.lint !== false && !targets[options?.lint?.targetName || "lint"]) targets[options?.lint?.targetName || "lint"] = {
175
- cache: true,
176
- inputs: Array.isArray(options?.lint?.inputs) ? options.lint.inputs : (0, __storm_software_workspace_tools_utils_nx_json.withNamedInputs)([...targetInputs, artifactsFolder], options?.lint?.inputs ? [options.lint.inputs] : ["linting", "typescript"]),
177
- outputs: options?.lint?.outputs ?? ["{options.outputPath}"],
178
- executor: options?.lint?.executor || `@${framework}/nx:${options?.lint?.targetName || "lint"}`,
179
- dependsOn: options?.lint?.dependsOn ?? [`^${options?.lint?.targetName || "lint"}`, userConfig.skipCache ? void 0 : (0, __stryke_type_checks_is_set_object.isSetObject)(options?.prepare) && options?.prepare?.targetName ? options?.prepare?.targetName : "prepare"].filter(Boolean),
180
- defaultConfiguration: options?.lint?.defaultConfiguration || "production",
181
- options: {
182
- input: userConfig.input,
183
- projectType: userConfig.projectType || projectConfig.projectType,
184
- autoInstall: userConfig.autoInstall,
185
- skipCache: userConfig.skipCache
186
- },
187
- configurations: {
188
- production: { mode: "production" },
189
- test: { mode: "test" },
190
- development: {
191
- mode: "development",
192
- skipCache: true
193
- }
194
- }
195
- };
196
- if (options?.docs !== false && !targets[options?.docs?.targetName || "docs"]) targets[options?.docs?.targetName || "docs"] = {
197
- cache: true,
198
- inputs: Array.isArray(options?.docs?.inputs) ? options.docs.inputs : (0, __storm_software_workspace_tools_utils_nx_json.withNamedInputs)([...targetInputs, artifactsFolder], options?.docs?.inputs ? [options.docs.inputs] : ["documentation", "typescript"]),
199
- outputs: options?.docs?.outputs ?? ["{options.outputPath}"],
200
- executor: options?.docs?.executor || `@${framework}/nx:${options?.docs?.targetName || "docs"}`,
201
- dependsOn: options?.docs?.dependsOn ?? [
202
- `^${options?.docs?.targetName || "docs"}`,
203
- options?.build !== false && `${options?.build?.targetName || "build"}`,
204
- userConfig.skipCache ? void 0 : (0, __stryke_type_checks_is_set_object.isSetObject)(options?.prepare) && options?.prepare?.targetName ? options?.prepare?.targetName : "prepare"
205
- ].filter(Boolean),
206
- defaultConfiguration: options?.docs?.defaultConfiguration || "production",
207
- options: {
208
- input: userConfig.input,
209
- projectType: userConfig.projectType || projectConfig.projectType,
210
- autoInstall: userConfig.autoInstall,
211
- skipCache: userConfig.skipCache
212
- },
213
- configurations: {
214
- production: { mode: "production" },
215
- test: { mode: "test" },
216
- development: {
217
- mode: "development",
218
- skipCache: true
219
- }
220
- }
221
- };
222
- if (options?.deploy !== false && !targets[options?.deploy?.targetName || "deploy"]) targets[options?.deploy?.targetName || "deploy"] = {
223
- inputs: Array.isArray(options?.deploy?.inputs) ? options.deploy.inputs : (0, __storm_software_workspace_tools_utils_nx_json.withNamedInputs)([...targetInputs, artifactsFolder], options?.deploy?.inputs ? [options.deploy.inputs] : ["documentation", "typescript"]),
224
- outputs: options?.deploy?.outputs ?? ["{options.outputPath}"],
225
- executor: options?.deploy?.executor || `@${framework}/nx:${options?.deploy?.targetName || "deploy"}`,
226
- dependsOn: options?.deploy?.dependsOn ?? [
227
- `^${options?.deploy?.targetName || "deploy"}`,
228
- options?.build !== false && `${options?.build?.targetName || "build"}`,
229
- userConfig.skipCache ? void 0 : (0, __stryke_type_checks_is_set_object.isSetObject)(options?.prepare) && options?.prepare?.targetName ? options?.prepare?.targetName : "prepare"
230
- ].filter(Boolean),
231
- defaultConfiguration: options?.deploy?.defaultConfiguration || "production",
232
- options: {
233
- input: userConfig.input,
234
- projectType: userConfig.projectType || projectConfig.projectType,
235
- autoInstall: userConfig.autoInstall,
236
- skipCache: userConfig.skipCache
237
- },
238
- configurations: {
239
- production: { mode: "production" },
240
- test: { mode: "test" },
241
- development: {
242
- mode: "development",
243
- skipCache: true
244
- }
245
- }
246
- };
247
- (0, __storm_software_workspace_tools_utils_project_tags.setDefaultProjectTags)(projectConfig, name);
248
- (0, __storm_software_workspace_tools_utils_project_tags.addProjectTag)(projectConfig, framework, userConfig.projectType || projectConfig.projectType || "library", { overwrite: true });
249
- if (options?.verboseOutput) console.debug(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Completed preparing Nx configuration for project in root directory ${projectRoot}.`);
250
- return { projects: { [root]: (0, defu.default)(projectConfig, {
251
- name: (0, __stryke_string_format_kebab_case.kebabCase)(userConfig.name),
252
- projectType: userConfig.projectType || "library",
253
- root,
254
- sourceRoot: (0, __stryke_path_join_paths.joinPaths)(root, "src"),
255
- targets
256
- }) } };
257
- } catch (error) {
258
- console.error(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Failed to process the project configuration for file "${configFile}" - ${(0, __stryke_type_checks_is_error.isError)(error) ? error.message : (0, __stryke_type_checks_is_set_string.isSetString)(error) ? error : "Unknown fatal error"}`);
259
- return {};
260
- }
261
- }, configFiles, options, contextV2);
262
- }];
263
- } catch (error) {
264
- console.error(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - ${(0, __stryke_type_checks_is_error.isError)(error) ? error.message : (0, __stryke_type_checks_is_set_string.isSetString)(error) ? error : "Unknown fatal error during plugin initialization"}`);
265
- throw new Error(`Failed to initialize the ${title} - ${(0, __stryke_type_checks_is_error.isError)(error) ? error.message : (0, __stryke_type_checks_is_set_string.isSetString)(error) ? error : "See previous logs for more details"}`, { cause: error instanceof Error ? error : void 0 });
266
- }
267
- }
268
-
269
- //#endregion
270
- Object.defineProperty(exports, 'createNxPlugin', {
271
- enumerable: true,
272
- get: function () {
273
- return createNxPlugin;
274
- }
275
- });
276
- Object.defineProperty(exports, 'getNxPluginInputs', {
277
- enumerable: true,
278
- get: function () {
279
- return getNxPluginInputs;
280
- }
281
- });
282
- Object.defineProperty(exports, 'getNxTargetInputs', {
283
- enumerable: true,
284
- get: function () {
285
- return getNxTargetInputs;
286
- }
287
- });
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin-utilities-Bz3Muyag.d.mts","names":[],"sources":["../../src/helpers/plugin-utilities.ts"],"sourcesContent":[],"mappings":";;;;;;;AAkEA;AAUA;AAMA;AAsCA;AACmB,iBAvDH,iBAAA,CAuDG,SAAA,EAAA,MAAA,CAAA,EAAA,MAAA,EAAA;;;;;;;iBA7CH,iBAAA;UAMC,qBAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAsCD,gCACG,kBAAkB,wBAC5B,wBAAwB,cAAc"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin-utilities-CeMy-9YQ.d.ts","names":[],"sources":["../../src/helpers/plugin-utilities.ts"],"sourcesContent":[],"mappings":";;;;;;;AAkEA;AAUA;AAMA;AAsCA;AACmB,iBAvDH,iBAAA,CAuDG,SAAA,EAAA,MAAA,CAAA,EAAA,MAAA,EAAA;;;;;;;iBA7CH,iBAAA;UAMC,qBAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAsCD,gCACG,kBAAkB,wBAC5B,wBAAwB,cAAc"}
@@ -1,270 +0,0 @@
1
- import { i as ROOT_HASH_LENGTH, t as loadUserConfigFile } from "./config-LoR-NIJg.mjs";
2
- import { t as CONFIG_INPUTS } from "./constants-DzvoYj5w.mjs";
3
- import { isError } from "@stryke/type-checks/is-error";
4
- import defu$1 from "defu";
5
- import { joinPaths } from "@stryke/path/join-paths";
6
- import { isSetObject } from "@stryke/type-checks/is-set-object";
7
- import { isSetString } from "@stryke/type-checks/is-set-string";
8
- import { existsSync } from "@stryke/fs/exists";
9
- import { kebabCase } from "@stryke/string-format/kebab-case";
10
- import { titleCase } from "@stryke/string-format/title-case";
11
- import { camelCase } from "@stryke/string-format/camel-case";
12
- import { getEnvPaths } from "@stryke/env/get-env-paths";
13
- import { murmurhash } from "@stryke/hash";
14
- import { createJiti } from "jiti";
15
- import { readFile } from "node:fs/promises";
16
- import { createNodesFromFiles } from "@nx/devkit";
17
- import { withNamedInputs } from "@storm-software/workspace-tools/utils/nx-json";
18
- import { getProjectConfigFromProjectRoot, getProjectRoot, getRoot } from "@storm-software/workspace-tools/utils/plugin-helpers";
19
- import { addProjectTag, setDefaultProjectTags } from "@storm-software/workspace-tools/utils/project-tags";
20
- import { readNxJson as readNxJson$1 } from "nx/src/config/nx-json.js";
21
- import { readTargetsFromPackageJson } from "nx/src/utils/package-json.js";
22
-
23
- //#region src/helpers/plugin-utilities.ts
24
- /**
25
- * Generates Nx input strings for the Powerlines configuration file, replacing the `{framework}` placeholder with the specified framework name.
26
- *
27
- * @param framework - The framework name to use in the input strings
28
- * @returns An array of Nx input strings for the configuration file
29
- */
30
- function getNxTargetInputs(framework) {
31
- return CONFIG_INPUTS.map((input) => input.replace("{framework}", framework));
32
- }
33
- /**
34
- * Generates Nx input strings for the Powerlines configuration file, replacing the `{framework}` placeholder with the specified framework name.
35
- *
36
- * @param framework - The framework name to use in the input strings
37
- * @returns An array of Nx input strings for the configuration file
38
- */
39
- function getNxPluginInputs(framework) {
40
- return `**/{${getNxTargetInputs(framework).map((input) => input.replace("{projectRoot}/", "")).join(",")}}`;
41
- }
42
- /**
43
- * Creates an Nx plugin that integrates Powerlines into the Nx build process.
44
- *
45
- * @param opts - Options for creating the Nx plugin
46
- * @returns A CreateNodesV2 function that can be used as an Nx plugin
47
- */
48
- function createNxPlugin(opts) {
49
- const framework = opts?.framework || "powerlines";
50
- const title = `${titleCase(framework)} Nx Plugin`;
51
- try {
52
- const name = opts?.name || `${framework}/nx/plugin`;
53
- const artifactsFolder = opts?.artifactsFolder || `{projectRoot}/.${framework}`;
54
- const targetInputs = getNxTargetInputs(framework);
55
- const pluginInputs = getNxPluginInputs(framework);
56
- return [pluginInputs, async (configFiles, options, contextV2) => {
57
- if (options?.verboseOutput) console.debug(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Initializing the ${title} for the following inputs: ${pluginInputs}`);
58
- const envPaths = getEnvPaths({
59
- orgId: "storm-software",
60
- appId: framework,
61
- workspaceRoot: contextV2.workspaceRoot
62
- });
63
- if (!envPaths.cache) throw new Error("The cache directory could not be determined.");
64
- const nxJson = readNxJson$1(contextV2.workspaceRoot);
65
- const resolver = createJiti(contextV2.workspaceRoot, {
66
- debug: !!options?.debug,
67
- interopDefault: true,
68
- fsCache: joinPaths(envPaths.cache, "nx-plugin", murmurhash(contextV2.workspaceRoot, { maxLength: ROOT_HASH_LENGTH }), "jiti"),
69
- moduleCache: true
70
- });
71
- return createNodesFromFiles(async (configFile, _, context) => {
72
- try {
73
- const projectRoot = getProjectRoot(configFile, contextV2.workspaceRoot);
74
- if (!projectRoot) {
75
- console.error(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - package.json and ${framework} configuration files (i.e. ${framework}.config.ts) must be located in the project root directory: ${configFile}`);
76
- return {};
77
- }
78
- const root = getRoot(projectRoot, context);
79
- if (options?.verboseOutput) console.debug(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Loading ${framework} user configuration for project in root directory ${projectRoot}.`);
80
- let userConfig = {};
81
- try {
82
- userConfig = await loadUserConfigFile(projectRoot, contextV2.workspaceRoot, resolver, "build", "development", configFile, framework);
83
- } catch (error) {
84
- console.warn(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Failed to load user configuration for project in ${projectRoot} - ${isError(error) ? error.message : isSetString(error) ? error : "Unknown error"} \n\nThis error can occur if the project depends on another package in the workspace and the dependent package has not been built yet. To resolve this issue, please ensure that all dependent packages have been built successfully.`);
85
- }
86
- if (!existsSync(joinPaths(contextV2.workspaceRoot, projectRoot, "package.json"))) {
87
- if (options?.verboseOutput) console.warn(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Cannot find \`package.json\` file in the project's root directory (path: "${joinPaths(contextV2.workspaceRoot, projectRoot)}"). Skipping project configuration.`);
88
- return {};
89
- }
90
- const packageJsonContent = await readFile(joinPaths(contextV2.workspaceRoot, projectRoot, "package.json"), "utf8");
91
- if (!packageJsonContent) {
92
- if (options?.verboseOutput) console.warn(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - No package.json file found for project in root directory ${projectRoot}`);
93
- return {};
94
- }
95
- const packageJson = JSON.parse(packageJsonContent);
96
- if (!userConfig.configFile && !packageJson?.[camelCase(framework)]) {
97
- if (options?.verboseOutput) console.debug(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Skipping ${projectRoot} - no ${framework} configuration found for project in root directory.`);
98
- return {};
99
- }
100
- const projectConfig = getProjectConfigFromProjectRoot(projectRoot, packageJson);
101
- if (!projectConfig) {
102
- if (options?.verboseOutput) console.warn(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - No project configuration found for project in root directory ${projectRoot}`);
103
- return {};
104
- }
105
- const targets = readTargetsFromPackageJson(packageJson, nxJson, projectRoot, context.workspaceRoot);
106
- if (options?.verboseOutput) console.debug(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Preparing Nx targets for project in root directory ${projectRoot}.`);
107
- if (options?.clean !== false && !targets[options?.clean?.targetName || "clean"]) targets[options?.clean?.targetName || "clean"] = {
108
- cache: true,
109
- inputs: Array.isArray(options?.clean?.inputs) ? options.clean.inputs : withNamedInputs(targetInputs, [options?.clean?.inputs || "typescript"]),
110
- outputs: options?.clean?.outputs,
111
- executor: options?.clean?.executor || `@${framework}/nx:${options?.clean?.targetName || "clean"}`,
112
- dependsOn: options?.clean?.dependsOn ?? [`^${options?.clean?.targetName || "clean"}`],
113
- defaultConfiguration: options?.clean?.defaultConfiguration || "production",
114
- options: {
115
- outputPath: userConfig.output?.outputPath,
116
- projectType: userConfig.projectType || projectConfig.projectType,
117
- autoInstall: userConfig.autoInstall
118
- },
119
- configurations: {
120
- production: { mode: "production" },
121
- test: { mode: "test" },
122
- development: {
123
- mode: "development",
124
- skipCache: true
125
- }
126
- }
127
- };
128
- if (options?.prepare !== false && !targets[options?.prepare?.targetName || "prepare"]) targets[options?.prepare?.targetName || "prepare"] = {
129
- cache: true,
130
- inputs: Array.isArray(options?.prepare?.inputs) ? options.prepare.inputs : withNamedInputs(targetInputs, [options?.prepare?.inputs || "typescript"]),
131
- outputs: options?.prepare?.outputs ?? [artifactsFolder],
132
- executor: options?.prepare?.executor || `@${framework}/nx:${options?.prepare?.targetName || "prepare"}`,
133
- dependsOn: options?.prepare?.dependsOn ?? [`^${options?.prepare?.targetName || "build"}`, options?.clean !== false && `${options?.clean?.targetName || "clean"}`].filter(Boolean),
134
- defaultConfiguration: options?.prepare?.defaultConfiguration || "production",
135
- options: {
136
- input: userConfig.input,
137
- projectType: userConfig.projectType || projectConfig.projectType,
138
- autoInstall: userConfig.autoInstall,
139
- skipCache: userConfig.skipCache
140
- },
141
- configurations: {
142
- production: { mode: "production" },
143
- test: { mode: "test" },
144
- development: {
145
- mode: "development",
146
- skipCache: true
147
- }
148
- }
149
- };
150
- if (options?.build !== false && !targets[options?.build?.targetName || "build"]) targets[options?.build?.targetName || "build"] = {
151
- cache: true,
152
- inputs: Array.isArray(options?.build?.inputs) ? options.build.inputs : withNamedInputs(targetInputs, [options?.build?.inputs || "typescript"]),
153
- outputs: options?.build?.outputs ?? ["{options.outputPath}"],
154
- executor: options?.build?.executor || `@${framework}/nx:${options?.build?.targetName || "build"}`,
155
- dependsOn: options?.build?.dependsOn ?? [`^${options?.build?.targetName || "build"}`, userConfig.skipCache ? void 0 : isSetObject(options?.prepare) && options?.prepare?.targetName ? options?.prepare?.targetName : "prepare"].filter(Boolean),
156
- defaultConfiguration: options?.build?.defaultConfiguration || "production",
157
- options: {
158
- input: userConfig.input,
159
- outputPath: userConfig.output?.outputPath,
160
- projectType: userConfig.projectType || projectConfig.projectType,
161
- autoInstall: userConfig.autoInstall,
162
- skipCache: userConfig.skipCache
163
- },
164
- configurations: {
165
- production: { mode: "production" },
166
- test: { mode: "test" },
167
- development: {
168
- mode: "development",
169
- skipCache: true
170
- }
171
- }
172
- };
173
- if (options?.lint !== false && !targets[options?.lint?.targetName || "lint"]) targets[options?.lint?.targetName || "lint"] = {
174
- cache: true,
175
- inputs: Array.isArray(options?.lint?.inputs) ? options.lint.inputs : withNamedInputs([...targetInputs, artifactsFolder], options?.lint?.inputs ? [options.lint.inputs] : ["linting", "typescript"]),
176
- outputs: options?.lint?.outputs ?? ["{options.outputPath}"],
177
- executor: options?.lint?.executor || `@${framework}/nx:${options?.lint?.targetName || "lint"}`,
178
- dependsOn: options?.lint?.dependsOn ?? [`^${options?.lint?.targetName || "lint"}`, userConfig.skipCache ? void 0 : isSetObject(options?.prepare) && options?.prepare?.targetName ? options?.prepare?.targetName : "prepare"].filter(Boolean),
179
- defaultConfiguration: options?.lint?.defaultConfiguration || "production",
180
- options: {
181
- input: userConfig.input,
182
- projectType: userConfig.projectType || projectConfig.projectType,
183
- autoInstall: userConfig.autoInstall,
184
- skipCache: userConfig.skipCache
185
- },
186
- configurations: {
187
- production: { mode: "production" },
188
- test: { mode: "test" },
189
- development: {
190
- mode: "development",
191
- skipCache: true
192
- }
193
- }
194
- };
195
- if (options?.docs !== false && !targets[options?.docs?.targetName || "docs"]) targets[options?.docs?.targetName || "docs"] = {
196
- cache: true,
197
- inputs: Array.isArray(options?.docs?.inputs) ? options.docs.inputs : withNamedInputs([...targetInputs, artifactsFolder], options?.docs?.inputs ? [options.docs.inputs] : ["documentation", "typescript"]),
198
- outputs: options?.docs?.outputs ?? ["{options.outputPath}"],
199
- executor: options?.docs?.executor || `@${framework}/nx:${options?.docs?.targetName || "docs"}`,
200
- dependsOn: options?.docs?.dependsOn ?? [
201
- `^${options?.docs?.targetName || "docs"}`,
202
- options?.build !== false && `${options?.build?.targetName || "build"}`,
203
- userConfig.skipCache ? void 0 : isSetObject(options?.prepare) && options?.prepare?.targetName ? options?.prepare?.targetName : "prepare"
204
- ].filter(Boolean),
205
- defaultConfiguration: options?.docs?.defaultConfiguration || "production",
206
- options: {
207
- input: userConfig.input,
208
- projectType: userConfig.projectType || projectConfig.projectType,
209
- autoInstall: userConfig.autoInstall,
210
- skipCache: userConfig.skipCache
211
- },
212
- configurations: {
213
- production: { mode: "production" },
214
- test: { mode: "test" },
215
- development: {
216
- mode: "development",
217
- skipCache: true
218
- }
219
- }
220
- };
221
- if (options?.deploy !== false && !targets[options?.deploy?.targetName || "deploy"]) targets[options?.deploy?.targetName || "deploy"] = {
222
- inputs: Array.isArray(options?.deploy?.inputs) ? options.deploy.inputs : withNamedInputs([...targetInputs, artifactsFolder], options?.deploy?.inputs ? [options.deploy.inputs] : ["documentation", "typescript"]),
223
- outputs: options?.deploy?.outputs ?? ["{options.outputPath}"],
224
- executor: options?.deploy?.executor || `@${framework}/nx:${options?.deploy?.targetName || "deploy"}`,
225
- dependsOn: options?.deploy?.dependsOn ?? [
226
- `^${options?.deploy?.targetName || "deploy"}`,
227
- options?.build !== false && `${options?.build?.targetName || "build"}`,
228
- userConfig.skipCache ? void 0 : isSetObject(options?.prepare) && options?.prepare?.targetName ? options?.prepare?.targetName : "prepare"
229
- ].filter(Boolean),
230
- defaultConfiguration: options?.deploy?.defaultConfiguration || "production",
231
- options: {
232
- input: userConfig.input,
233
- projectType: userConfig.projectType || projectConfig.projectType,
234
- autoInstall: userConfig.autoInstall,
235
- skipCache: userConfig.skipCache
236
- },
237
- configurations: {
238
- production: { mode: "production" },
239
- test: { mode: "test" },
240
- development: {
241
- mode: "development",
242
- skipCache: true
243
- }
244
- }
245
- };
246
- setDefaultProjectTags(projectConfig, name);
247
- addProjectTag(projectConfig, framework, userConfig.projectType || projectConfig.projectType || "library", { overwrite: true });
248
- if (options?.verboseOutput) console.debug(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Completed preparing Nx configuration for project in root directory ${projectRoot}.`);
249
- return { projects: { [root]: defu$1(projectConfig, {
250
- name: kebabCase(userConfig.name),
251
- projectType: userConfig.projectType || "library",
252
- root,
253
- sourceRoot: joinPaths(root, "src"),
254
- targets
255
- }) } };
256
- } catch (error) {
257
- console.error(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Failed to process the project configuration for file "${configFile}" - ${isError(error) ? error.message : isSetString(error) ? error : "Unknown fatal error"}`);
258
- return {};
259
- }
260
- }, configFiles, options, contextV2);
261
- }];
262
- } catch (error) {
263
- console.error(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - ${isError(error) ? error.message : isSetString(error) ? error : "Unknown fatal error during plugin initialization"}`);
264
- throw new Error(`Failed to initialize the ${title} - ${isError(error) ? error.message : isSetString(error) ? error : "See previous logs for more details"}`, { cause: error instanceof Error ? error : void 0 });
265
- }
266
- }
267
-
268
- //#endregion
269
- export { getNxPluginInputs as n, getNxTargetInputs as r, createNxPlugin as t };
270
- //# sourceMappingURL=plugin-utilities-DamtoOxO.mjs.map