@shell-shock/nx 0.0.83 → 0.0.84

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.
@@ -1,8 +1,501 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- let _powerlines_nx_helpers_plugin_utilities = require("@powerlines/nx/helpers/plugin-utilities");
2
+ //#region \0rolldown/runtime.js
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
12
+ key = keys[i];
13
+ if (!__hasOwnProp.call(to, key) && key !== except) {
14
+ __defProp(to, key, {
15
+ get: ((k) => from[k]).bind(null, key),
16
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
+ });
18
+ }
19
+ }
20
+ }
21
+ return to;
22
+ };
23
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
24
+ value: mod,
25
+ enumerable: true
26
+ }) : target, mod));
3
27
 
28
+ //#endregion
29
+ let _stryke_string_format_kebab_case = require("@stryke/string-format/kebab-case");
30
+ let _stryke_string_format_title_case = require("@stryke/string-format/title-case");
31
+ let _stryke_type_checks_is_error = require("@stryke/type-checks/is-error");
32
+ let _stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
33
+ let defu = require("defu");
34
+ defu = __toESM(defu, 1);
35
+ let _nx_devkit = require("@nx/devkit");
36
+ let _storm_software_workspace_tools_utils_nx_json = require("@storm-software/workspace-tools/utils/nx-json");
37
+ let _storm_software_workspace_tools_utils_plugin_helpers = require("@storm-software/workspace-tools/utils/plugin-helpers");
38
+ let _storm_software_workspace_tools_utils_project_tags = require("@storm-software/workspace-tools/utils/project-tags");
39
+ let _stryke_path_join_paths = require("@stryke/path/join-paths");
40
+ let node_os = require("node:os");
41
+ node_os = __toESM(node_os, 1);
42
+ let node_path = require("node:path");
43
+ node_path = __toESM(node_path, 1);
44
+ let node_fs = require("node:fs");
45
+ let node_fs_promises = require("node:fs/promises");
46
+ let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
47
+ let nx_src_config_nx_json_js = require("nx/src/config/nx-json.js");
48
+ let nx_src_utils_package_json_js = require("nx/src/utils/package-json.js");
49
+
50
+ //#region ../../node_modules/.pnpm/@powerlines+nx@0.13.163_9456f17d791dfffcdb67c022b29fb589/node_modules/@powerlines/nx/dist/src/helpers/constants.mjs
51
+ /**
52
+ * A list of Nx input strings that describe the Powerlines configuration file
53
+ */
54
+ const CONFIG_INPUTS = [
55
+ "{projectRoot}/{framework}.json",
56
+ "{projectRoot}/{framework}.*.json",
57
+ "{projectRoot}/{framework}.jsonc",
58
+ "{projectRoot}/{framework}.*.jsonc",
59
+ "{projectRoot}/{framework}.json5",
60
+ "{projectRoot}/{framework}.*.json5",
61
+ "{projectRoot}/{framework}.yaml",
62
+ "{projectRoot}/{framework}.*.yaml",
63
+ "{projectRoot}/{framework}.yml",
64
+ "{projectRoot}/{framework}.*.yml",
65
+ "{projectRoot}/{framework}.toml",
66
+ "{projectRoot}/{framework}.*.toml",
67
+ "{projectRoot}/{framework}.config.js",
68
+ "{projectRoot}/{framework}.*.config.js",
69
+ "{projectRoot}/{framework}.config.cjs",
70
+ "{projectRoot}/{framework}.*.config.cjs",
71
+ "{projectRoot}/{framework}.config.mjs",
72
+ "{projectRoot}/{framework}.*.config.mjs",
73
+ "{projectRoot}/{framework}.config.ts",
74
+ "{projectRoot}/{framework}.*.config.ts",
75
+ "{projectRoot}/{framework}.config.cts",
76
+ "{projectRoot}/{framework}.*.config.cts",
77
+ "{projectRoot}/{framework}.config.mts",
78
+ "{projectRoot}/{framework}.*.config.mts"
79
+ ];
80
+
81
+ //#endregion
82
+ //#region ../../node_modules/.pnpm/@stryke+env@0.20.102_@nx+jest@22.7.5_@babel+traverse@7.29.7_@swc-node+register@1.11.1_@_506406da618bb04e125369d0dfadeb01/node_modules/@stryke/env/dist/ci-checks.mjs
83
+ /**
84
+ * Returns true if the current environment is a CI environment.
85
+ *
86
+ * @returns True if the current environment is a CI environment.
87
+ */
88
+ const isCI = (env = process.env) => {
89
+ return Boolean(env.STORM_CI || env.CI || env.CONTINUOUS_INTEGRATION || env.BUILD_NUMBER || env.RUN_ID || env.AGOLA_GIT_REF || env.AC_APPCIRCLE || env.APPVEYOR || env.CODEBUILD || env.TF_BUILD || env.bamboo_planKey || env.BITBUCKET_COMMIT || env.BITRISE_IO || env.BUDDY_WORKSPACE_ID || env.BUILDKITE || env.CIRCLECI || env.CIRRUS_CI || env.CF_BUILD_ID || env.CM_BUILD_ID || env.CI_NAME || env.DRONE || env.DSARI || env.EARTHLY_CI || env.EAS_BUILD || env.GERRIT_PROJECT || env.GITEA_ACTIONS || env.GITHUB_ACTIONS || env.GITLAB_CI || env.GOCD || env.BUILDER_OUTPUT || env.HARNESS_BUILD_ID || env.JENKINS_URL || env.BUILD_ID || env.LAYERCI || env.MAGNUM || env.NETLIFY || env.NEVERCODE || env.PROW_JOB_ID || env.RELEASE_BUILD_ID || env.RENDER || env.SAILCI || env.HUDSON || env.JENKINS_URL || env.BUILD_ID || env.SCREWDRIVER || env.SEMAPHORE || env.SOURCEHUT || env.STRIDER || env.TASK_ID || env.RUN_ID || env.TEAMCITY_VERSION || env.TRAVIS || env.VELA || env.NOW_BUILDER || env.APPCENTER_BUILD_ID || env.CI_XCODE_PROJECT || env.XCS || false);
90
+ };
91
+
92
+ //#endregion
93
+ //#region ../../node_modules/.pnpm/@stryke+env@0.20.102_@nx+jest@22.7.5_@babel+traverse@7.29.7_@swc-node+register@1.11.1_@_506406da618bb04e125369d0dfadeb01/node_modules/@stryke/env/dist/environment-checks.mjs
94
+ /** Value of process.platform */
95
+ const platform = process?.platform || "";
96
+ /** Detect if stdout.TTY is available */
97
+ const hasTTY = Boolean(process?.stdout && process?.stdout.isTTY);
98
+ /** Detect if `DEBUG` environment variable is set */
99
+ const isDebug = Boolean(process.env.DEBUG);
100
+ /** Detect the `NODE_ENV` environment variable */
101
+ const mode = process.env.STORM_MODE || process.env.NEXT_PUBLIC_VERCEL_ENV || process.env.NODE_ENV || "production";
102
+ /** Detect if the application is running in a staging environment */
103
+ const isStaging = [
104
+ "stg",
105
+ "stage",
106
+ "staging"
107
+ ].includes(mode?.toLowerCase());
108
+ /**
109
+ * Check if the current environment is production.
110
+ *
111
+ * @param mode - The mode string to check.
112
+ * @returns Whether the environment is production
113
+ */
114
+ function isProductionMode(mode) {
115
+ return [
116
+ "prd",
117
+ "prod",
118
+ "production",
119
+ "preprod",
120
+ "preproduction",
121
+ "uat"
122
+ ].includes(mode?.toLowerCase()?.replace(/[\s\-_]/g, ""));
123
+ }
124
+ /** Detect if `NODE_ENV` environment variable is `production` */
125
+ const isProduction = isProductionMode(mode);
126
+ /**
127
+ * Check if the current environment is test.
128
+ *
129
+ * @param mode - The mode string to check.
130
+ * @returns Whether the environment is test
131
+ */
132
+ function isTestMode(mode) {
133
+ return [
134
+ "tst",
135
+ "test",
136
+ "testing",
137
+ "stg",
138
+ "stage",
139
+ "staging",
140
+ "qa",
141
+ "qualityassurance"
142
+ ].includes(mode?.toLowerCase()?.replace(/[\s\-_]/g, ""));
143
+ }
144
+ /** Detect if `NODE_ENV` environment variable is `test` */
145
+ const isTest = isTestMode(mode) || isStaging || Boolean(process.env.TEST);
146
+ /**
147
+ * Check if the current environment is development.
148
+ *
149
+ * @param mode - The mode string to check.
150
+ * @returns Whether the environment is development
151
+ */
152
+ function isDevelopmentMode(mode) {
153
+ return [
154
+ "dev",
155
+ "development",
156
+ "int",
157
+ "integration"
158
+ ].includes(mode?.toLowerCase()?.replace(/[\s\-_]/g, ""));
159
+ }
160
+ /** Detect if `NODE_ENV` environment variable is `dev` or `development` */
161
+ const isDevelopment = isDevelopmentMode(mode) || isDebug;
162
+ /** Detect if MINIMAL environment variable is set, running in CI or test or TTY is unavailable */
163
+ const isMinimal = Boolean(process.env.MINIMAL) || isCI() || isTest || !hasTTY;
164
+ /** Detect if process.platform is Windows */
165
+ const isWindows = /^win/i.test(platform);
166
+ /** Detect if process.platform is Linux */
167
+ const isLinux = /^linux/i.test(platform);
168
+ /** Detect if process.platform is macOS (darwin kernel) */
169
+ const isMacOS = /^darwin/i.test(platform);
170
+ /** Color Support */
171
+ const isColorSupported = !process.env.NO_COLOR && (Boolean(process.env.FORCE_COLOR) || (hasTTY || isWindows) && process.env.TERM !== "dumb" || isCI());
172
+ /** Node.js versions */
173
+ const nodeVersion = (process?.versions?.node || "").replace(/^v/, "") || null;
174
+ const nodeMajorVersion = Number(nodeVersion?.split(".")[0]) || null;
175
+
176
+ //#endregion
177
+ //#region ../../node_modules/.pnpm/@stryke+env@0.20.102_@nx+jest@22.7.5_@babel+traverse@7.29.7_@swc-node+register@1.11.1_@_506406da618bb04e125369d0dfadeb01/node_modules/@stryke/env/dist/get-env-paths.mjs
178
+ const homedir = node_os.default.homedir();
179
+ const tmpdir = node_os.default.tmpdir();
180
+ const macos = (orgId) => {
181
+ const library = (0, _stryke_path_join_paths.joinPaths)(homedir, "Library");
182
+ return {
183
+ data: (0, _stryke_path_join_paths.joinPaths)(library, "Application Support", orgId),
184
+ config: (0, _stryke_path_join_paths.joinPaths)(library, "Preferences", orgId),
185
+ cache: (0, _stryke_path_join_paths.joinPaths)(library, "Caches", orgId),
186
+ log: (0, _stryke_path_join_paths.joinPaths)(library, "Logs", orgId),
187
+ temp: (0, _stryke_path_join_paths.joinPaths)(tmpdir, orgId)
188
+ };
189
+ };
190
+ const windows = (orgId) => {
191
+ const appData = process.env.APPDATA || (0, _stryke_path_join_paths.joinPaths)(homedir, "AppData", "Roaming");
192
+ const localAppData = process.env.LOCALAPPDATA || (0, _stryke_path_join_paths.joinPaths)(homedir, "AppData", "Local");
193
+ const windowsFormattedOrgId = (0, _stryke_string_format_title_case.titleCase)(orgId).trim().replace(/\s+/g, "");
194
+ return {
195
+ data: (0, _stryke_path_join_paths.joinPaths)(localAppData, windowsFormattedOrgId, "Data"),
196
+ config: (0, _stryke_path_join_paths.joinPaths)(appData, windowsFormattedOrgId, "Config"),
197
+ cache: (0, _stryke_path_join_paths.joinPaths)(localAppData, "Cache", orgId),
198
+ log: (0, _stryke_path_join_paths.joinPaths)(localAppData, windowsFormattedOrgId, "Log"),
199
+ temp: (0, _stryke_path_join_paths.joinPaths)(tmpdir, orgId)
200
+ };
201
+ };
202
+ const linux = (orgId) => {
203
+ const username = node_path.default.basename(homedir);
204
+ return {
205
+ data: (0, _stryke_path_join_paths.joinPaths)(process.env.XDG_DATA_HOME || (0, _stryke_path_join_paths.joinPaths)(homedir, ".local", "share"), orgId),
206
+ config: (0, _stryke_path_join_paths.joinPaths)(process.env.XDG_CONFIG_HOME || (0, _stryke_path_join_paths.joinPaths)(homedir, ".config"), orgId),
207
+ cache: (0, _stryke_path_join_paths.joinPaths)(process.env.XDG_CACHE_HOME || (0, _stryke_path_join_paths.joinPaths)(homedir, ".cache"), orgId),
208
+ log: (0, _stryke_path_join_paths.joinPaths)(process.env.XDG_STATE_HOME || (0, _stryke_path_join_paths.joinPaths)(homedir, ".local", "state"), orgId),
209
+ temp: process.env.DEVENV_RUNTIME || process.env.XDG_RUNTIME_DIR ? (0, _stryke_path_join_paths.joinPaths)(process.env.DEVENV_RUNTIME || process.env.XDG_RUNTIME_DIR, orgId) : (0, _stryke_path_join_paths.joinPaths)(tmpdir, username, orgId)
210
+ };
211
+ };
212
+ /**
213
+ * Get paths for storing things like data, config, logs, and cache in the current runtime environment.
214
+ *
215
+ * @remarks
216
+ * On macOS, directories are generally created in `~/Library/Application Support/<name>`.
217
+ * On Windows, directories are generally created in `%AppData%/<name>`.
218
+ * On Linux, directories are generally created in `~/.config/<name>` - this is determined via the [XDG Base Directory spec](https://specifications.freedesktop.org/basedir-spec/latest/).
219
+ *
220
+ * If the `STORM_DATA_DIR`, `STORM_CONFIG_DIR`, `STORM_CACHE_DIR`, `STORM_LOG_DIR`, or `STORM_TEMP_DIR` environment variables are set, they will be used instead of the default paths.
221
+ *
222
+ * @param options - Parameters used to determine the specific paths for the current project/runtime environment
223
+ * @returns An object containing the various paths for the runtime environment
224
+ */
225
+ function getEnvPaths(options = {}) {
226
+ let orgId = options.orgId || "storm-software";
227
+ if (!orgId) throw new Error("You need to provide an orgId to the `getEnvPaths` function");
228
+ if (options.suffix) orgId += `-${typeof options.suffix === "string" ? options.suffix : "nodejs"}`;
229
+ let result = {};
230
+ if (process.platform === "darwin") result = macos(orgId);
231
+ else if (process.platform === "win32") result = windows(orgId);
232
+ else result = linux(orgId);
233
+ if (process.env.STORM_DATA_DIR) result.data = process.env.STORM_DATA_DIR;
234
+ else if (process.env.STORM_CONFIG_DIR) result.config = process.env.STORM_CONFIG_DIR;
235
+ else if (process.env.STORM_CACHE_DIR) result.cache = process.env.STORM_CACHE_DIR;
236
+ else if (process.env.STORM_LOG_DIR) result.log = process.env.STORM_LOG_DIR;
237
+ else if (process.env.STORM_TEMP_DIR) result.temp = process.env.STORM_TEMP_DIR;
238
+ if (options.workspaceRoot) {
239
+ result.cache ??= (0, _stryke_path_join_paths.joinPaths)(options.workspaceRoot, "node_modules", ".cache", orgId);
240
+ result.temp ??= (0, _stryke_path_join_paths.joinPaths)(options.workspaceRoot, "tmp", orgId);
241
+ result.log ??= (0, _stryke_path_join_paths.joinPaths)(result.temp, "logs");
242
+ result.config ??= (0, _stryke_path_join_paths.joinPaths)(options.workspaceRoot, ".config", orgId);
243
+ }
244
+ return Object.keys(result).reduce((ret, key) => {
245
+ if (result[key]) {
246
+ const filePath = result[key];
247
+ ret[key] = options.appId && options.appId !== options.orgId && options.appId !== options.nestedDir ? (0, _stryke_path_join_paths.joinPaths)(filePath, options.appId) : filePath;
248
+ if (options.nestedDir && options.nestedDir !== options.orgId && options.nestedDir !== options.appId) ret[key] = (0, _stryke_path_join_paths.joinPaths)(ret[key], options.nestedDir);
249
+ }
250
+ return ret;
251
+ }, {});
252
+ }
253
+
254
+ //#endregion
255
+ //#region ../../node_modules/.pnpm/@stryke+fs@0.33.85_@nx+jest@22.7.5_@babel+traverse@7.29.7_@swc-node+register@1.11.1_@sw_877f1a6d15b15de58e6bb8cae69ca90b/node_modules/@stryke/fs/dist/exists.mjs
256
+ /**
257
+ * Check if a file exists
258
+ *
259
+ * @param filePath - The file path to check
260
+ * @returns An indicator specifying if the file exists
261
+ */
262
+ function existsSync(filePath) {
263
+ return (0, node_fs.existsSync)(filePath);
264
+ }
265
+
266
+ //#endregion
267
+ //#region ../../node_modules/.pnpm/@powerlines+nx@0.13.163_9456f17d791dfffcdb67c022b29fb589/node_modules/@powerlines/nx/dist/src/helpers/plugin-utilities.mjs
268
+ /**
269
+ * Generates Nx input strings for the Powerlines configuration file, replacing the `{framework}` placeholder with the specified framework name.
270
+ *
271
+ * @param framework - The framework name to use in the input strings
272
+ * @returns An array of Nx input strings for the configuration file
273
+ */
274
+ function getNxTargetInputs(framework) {
275
+ return CONFIG_INPUTS.map((input) => input.replace("{framework}", framework));
276
+ }
277
+ /**
278
+ * Generates Nx input strings for the Powerlines configuration file, replacing the `{framework}` placeholder with the specified framework name.
279
+ *
280
+ * @param framework - The framework name to use in the input strings
281
+ * @returns An array of Nx input strings for the configuration file
282
+ */
283
+ function getNxPluginInputs(framework) {
284
+ return `**/{${getNxTargetInputs(framework).map((input) => input.replace("{projectRoot}/", "")).join(",")}}`;
285
+ }
286
+ /**
287
+ * Creates an Nx plugin that integrates Powerlines into the Nx build process.
288
+ *
289
+ * @param opts - Options for creating the Nx plugin
290
+ * @returns A CreateNodesV2 function that can be used as an Nx plugin
291
+ */
292
+ function createNxPlugin(opts) {
293
+ const framework = (0, _stryke_string_format_kebab_case.kebabCase)(opts?.framework) || "powerlines";
294
+ const title = `${(0, _stryke_string_format_title_case.titleCase)(framework)} Nx Plugin`;
295
+ try {
296
+ const name = opts?.name || `${framework}/nx/plugin`;
297
+ const artifactsFolder = opts?.artifactsFolder || `{projectRoot}/.${framework}`;
298
+ const targetInputs = getNxTargetInputs(framework);
299
+ const pluginInputs = getNxPluginInputs(framework);
300
+ return [pluginInputs, async (configFiles, options, contextV2) => {
301
+ if (options?.verboseOutput) console.debug(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Initializing the ${title} for the following inputs: ${pluginInputs}`);
302
+ if (!getEnvPaths({
303
+ orgId: "storm-software",
304
+ appId: framework,
305
+ workspaceRoot: contextV2.workspaceRoot
306
+ }).cache) throw new Error("The cache directory could not be determined.");
307
+ const nxJson = (0, nx_src_config_nx_json_js.readNxJson)(contextV2.workspaceRoot);
308
+ return (0, _nx_devkit.createNodesFromFiles)(async (configFile, _, context) => {
309
+ try {
310
+ const projectRoot = (0, _storm_software_workspace_tools_utils_plugin_helpers.getProjectRoot)(configFile, contextV2.workspaceRoot);
311
+ if (!projectRoot) {
312
+ 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}`);
313
+ return {};
314
+ }
315
+ const root = (0, _storm_software_workspace_tools_utils_plugin_helpers.getRoot)(projectRoot, context);
316
+ if (options?.verboseOutput) console.debug(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Loading ${framework} user configuration for project in root directory ${projectRoot}.`);
317
+ if (!existsSync((0, _stryke_path_join_paths.joinPaths)(contextV2.workspaceRoot, projectRoot, "package.json"))) {
318
+ 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.`);
319
+ return {};
320
+ }
321
+ const packageJsonContent = await (0, node_fs_promises.readFile)((0, _stryke_path_join_paths.joinPaths)(contextV2.workspaceRoot, projectRoot, "package.json"), "utf8");
322
+ if (!packageJsonContent) {
323
+ if (options?.verboseOutput) console.warn(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - No package.json file found for project in root directory ${projectRoot}`);
324
+ return {};
325
+ }
326
+ const packageJson = JSON.parse(packageJsonContent);
327
+ const projectConfig = (0, _storm_software_workspace_tools_utils_plugin_helpers.getProjectConfigFromProjectRoot)(projectRoot, packageJson);
328
+ if (!projectConfig) {
329
+ if (options?.verboseOutput) console.warn(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - No project configuration found for project in root directory ${projectRoot}`);
330
+ return {};
331
+ }
332
+ const targets = (0, nx_src_utils_package_json_js.readTargetsFromPackageJson)(packageJson, nxJson, projectRoot, context.workspaceRoot);
333
+ if (options?.verboseOutput) console.debug(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Preparing Nx targets for project in root directory ${projectRoot}.`);
334
+ if (options?.clean !== false && !targets[options?.clean?.targetName || "clean"]) targets[options?.clean?.targetName || "clean"] = {
335
+ cache: options?.clean?.cache ?? options?.cache ?? true,
336
+ inputs: Array.isArray(options?.clean?.inputs) ? options.clean.inputs : (0, _storm_software_workspace_tools_utils_nx_json.withNamedInputs)(targetInputs, [options?.clean?.inputs || "typescript"]),
337
+ outputs: options?.clean?.outputs,
338
+ executor: options?.clean?.executor || `@${framework}/nx:${options?.clean?.targetName || "clean"}`,
339
+ dependsOn: options?.clean?.dependsOn ?? [`^${options?.clean?.targetName || "clean"}`],
340
+ defaultConfiguration: options?.clean?.defaultConfiguration || "production",
341
+ options: {
342
+ root: projectRoot,
343
+ configFile,
344
+ projectType: projectConfig.projectType,
345
+ outputPath: `{workspaceRoot}/${projectRoot}/dist`,
346
+ copyPath: `{workspaceRoot}/dist/${projectRoot}`
347
+ },
348
+ configurations: {
349
+ production: { mode: "production" },
350
+ test: { mode: "test" },
351
+ development: {
352
+ mode: "development",
353
+ skipCache: true
354
+ }
355
+ }
356
+ };
357
+ if (options?.prepare !== false && !targets[options?.prepare?.targetName || "prepare"]) targets[options?.prepare?.targetName || "prepare"] = {
358
+ cache: options?.prepare?.cache ?? options?.cache ?? true,
359
+ inputs: Array.isArray(options?.prepare?.inputs) ? options.prepare.inputs : (0, _storm_software_workspace_tools_utils_nx_json.withNamedInputs)(targetInputs, [options?.prepare?.inputs || "typescript"]),
360
+ outputs: options?.prepare?.outputs ?? [artifactsFolder],
361
+ executor: options?.prepare?.executor || `@${framework}/nx:${options?.prepare?.targetName || "prepare"}`,
362
+ dependsOn: options?.prepare?.dependsOn ?? [`^${options?.prepare?.targetName || "build"}`].filter(Boolean),
363
+ defaultConfiguration: options?.prepare?.defaultConfiguration || "production",
364
+ options: {
365
+ projectType: projectConfig.projectType,
366
+ configFile,
367
+ outputPath: `{workspaceRoot}/${projectRoot}/dist`,
368
+ copyPath: `{workspaceRoot}/dist/${projectRoot}`
369
+ },
370
+ configurations: {
371
+ production: { mode: "production" },
372
+ test: { mode: "test" },
373
+ development: {
374
+ mode: "development",
375
+ skipCache: true
376
+ }
377
+ }
378
+ };
379
+ if (options?.build !== false && !targets[options?.build?.targetName || "build"]) targets[options?.build?.targetName || "build"] = {
380
+ cache: options?.build?.cache ?? options?.cache ?? true,
381
+ inputs: Array.isArray(options?.build?.inputs) ? options.build.inputs : (0, _storm_software_workspace_tools_utils_nx_json.withNamedInputs)(targetInputs, [options?.build?.inputs || "typescript"]),
382
+ outputs: options?.build?.outputs ?? ["{options.outputPath}"],
383
+ executor: options?.build?.executor || `@${framework}/nx:${options?.build?.targetName || "build"}`,
384
+ dependsOn: options?.build?.dependsOn ?? [`^${options?.build?.targetName || "build"}`, isDevelopment ? void 0 : (0, _stryke_type_checks_is_set_object.isSetObject)(options?.prepare) && options?.prepare?.targetName ? options?.prepare?.targetName : "prepare"].filter(Boolean),
385
+ defaultConfiguration: options?.build?.defaultConfiguration || "production",
386
+ options: {
387
+ projectType: projectConfig.projectType,
388
+ configFile,
389
+ outputPath: `{workspaceRoot}/${projectRoot}/dist`,
390
+ copyPath: `{workspaceRoot}/dist/${projectRoot}`
391
+ },
392
+ configurations: {
393
+ production: { mode: "production" },
394
+ test: { mode: "test" },
395
+ development: {
396
+ mode: "development",
397
+ skipCache: true
398
+ }
399
+ }
400
+ };
401
+ if (options?.lint !== false && !targets[options?.lint?.targetName || "lint"]) targets[options?.lint?.targetName || "lint"] = {
402
+ cache: options?.lint?.cache ?? options?.cache ?? true,
403
+ 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"]),
404
+ outputs: options?.lint?.outputs ?? ["{options.outputPath}"],
405
+ executor: options?.lint?.executor || `@${framework}/nx:${options?.lint?.targetName || "lint"}`,
406
+ dependsOn: options?.lint?.dependsOn ?? [`^${options?.lint?.targetName || "lint"}`, isDevelopment ? void 0 : (0, _stryke_type_checks_is_set_object.isSetObject)(options?.prepare) && options?.prepare?.targetName ? options?.prepare?.targetName : "prepare"].filter(Boolean),
407
+ defaultConfiguration: options?.lint?.defaultConfiguration || "production",
408
+ options: {
409
+ projectType: projectConfig.projectType,
410
+ configFile,
411
+ outputPath: `{workspaceRoot}/${projectRoot}/dist`,
412
+ copyPath: `{workspaceRoot}/dist/${projectRoot}`
413
+ },
414
+ configurations: {
415
+ production: { mode: "production" },
416
+ test: { mode: "test" },
417
+ development: {
418
+ mode: "development",
419
+ skipCache: true
420
+ }
421
+ }
422
+ };
423
+ if (options?.docs !== false && !targets[options?.docs?.targetName || "docs"]) targets[options?.docs?.targetName || "docs"] = {
424
+ cache: options?.docs?.cache ?? options?.cache ?? true,
425
+ 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"]),
426
+ outputs: options?.docs?.outputs ?? ["{options.outputPath}"],
427
+ executor: options?.docs?.executor || `@${framework}/nx:${options?.docs?.targetName || "docs"}`,
428
+ dependsOn: options?.docs?.dependsOn ?? [
429
+ `^${options?.docs?.targetName || "docs"}`,
430
+ options?.build !== false && `${options?.build?.targetName || "build"}`,
431
+ isDevelopment ? void 0 : (0, _stryke_type_checks_is_set_object.isSetObject)(options?.prepare) && options?.prepare?.targetName ? options?.prepare?.targetName : "prepare"
432
+ ].filter(Boolean),
433
+ defaultConfiguration: options?.docs?.defaultConfiguration || "production",
434
+ options: {
435
+ projectType: projectConfig.projectType,
436
+ configFile,
437
+ outputPath: `{workspaceRoot}/${projectRoot}/dist`,
438
+ copyPath: `{workspaceRoot}/dist/${projectRoot}`
439
+ },
440
+ configurations: {
441
+ production: { mode: "production" },
442
+ test: { mode: "test" },
443
+ development: {
444
+ mode: "development",
445
+ skipCache: true
446
+ }
447
+ }
448
+ };
449
+ if (options?.deploy !== false && !targets[options?.deploy?.targetName || "deploy"]) targets[options?.deploy?.targetName || "deploy"] = {
450
+ cache: options?.deploy?.cache ?? false,
451
+ 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"]),
452
+ outputs: options?.deploy?.outputs ?? ["{options.outputPath}"],
453
+ executor: options?.deploy?.executor || `@${framework}/nx:${options?.deploy?.targetName || "deploy"}`,
454
+ dependsOn: options?.deploy?.dependsOn ?? [
455
+ `^${options?.deploy?.targetName || "deploy"}`,
456
+ options?.build !== false && `${options?.build?.targetName || "build"}`,
457
+ isDevelopment ? void 0 : (0, _stryke_type_checks_is_set_object.isSetObject)(options?.prepare) && options?.prepare?.targetName ? options?.prepare?.targetName : "prepare"
458
+ ].filter(Boolean),
459
+ defaultConfiguration: options?.deploy?.defaultConfiguration || "production",
460
+ options: {
461
+ projectType: projectConfig.projectType,
462
+ configFile,
463
+ outputPath: `{workspaceRoot}/${projectRoot}/dist`,
464
+ copyPath: `{workspaceRoot}/dist/${projectRoot}`
465
+ },
466
+ configurations: {
467
+ production: { mode: "production" },
468
+ test: { mode: "test" },
469
+ development: {
470
+ mode: "development",
471
+ skipCache: true
472
+ }
473
+ }
474
+ };
475
+ (0, _storm_software_workspace_tools_utils_project_tags.setDefaultProjectTags)(projectConfig, name);
476
+ (0, _storm_software_workspace_tools_utils_project_tags.addProjectTag)(projectConfig, framework, projectConfig.projectType || "library", { overwrite: true });
477
+ if (options?.verboseOutput) console.debug(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Completed preparing Nx configuration for project in root directory ${projectRoot}.`);
478
+ return { projects: { [root]: (0, defu.default)(projectConfig, {
479
+ projectType: projectConfig.projectType || "library",
480
+ root,
481
+ sourceRoot: (0, _stryke_path_join_paths.joinPaths)(root, "src"),
482
+ targets
483
+ }) } };
484
+ } catch (error) {
485
+ 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"}`);
486
+ return {};
487
+ }
488
+ }, configFiles, options, contextV2);
489
+ }];
490
+ } catch (error) {
491
+ 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"}`);
492
+ 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 });
493
+ }
494
+ }
495
+
496
+ //#endregion
4
497
  //#region src/plugin/index.ts
5
- const createNodesV2 = (0, _powerlines_nx_helpers_plugin_utilities.createNxPlugin)({ framework: "shell-shock" });
498
+ const createNodesV2 = createNxPlugin({ framework: "shell-shock" });
6
499
 
7
500
  //#endregion
8
501
  exports.createNodesV2 = createNodesV2;