@powerlines/nx 0.13.236 → 0.13.237
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/dist/src/base/base-executor.js +2 -1
- package/dist/src/base/base-executor.mjs +2 -1
- package/dist/src/base/base-executor.mjs.map +1 -1
- package/dist/src/base/base-executor.schema.d.mts +0 -1
- package/dist/src/base/base-executor.schema.d.mts.map +1 -1
- package/dist/src/base/base-executor.schema.d.ts +0 -1
- package/dist/src/base/base-executor.schema.d.ts.map +1 -1
- package/dist/src/base/base-executor.schema.json +1 -9
- package/dist/src/base/base-executor.untyped.js +1 -1
- package/dist/src/base/base-executor.untyped.mjs +1 -1
- package/dist/src/base/base-executor.untyped.mjs.map +1 -1
- package/dist/src/{base-executor-HCD7M10I.mjs → base-executor-Dq5Z0aZo.mjs} +3 -2
- package/dist/src/{base-executor-HCD7M10I.mjs.map → base-executor-Dq5Z0aZo.mjs.map} +1 -1
- package/dist/src/{base-executor-BTwUZeOz.js → base-executor-DyLFdv1F.js} +2 -1
- package/dist/src/{base-executor.untyped-B9Vk-kJC.mjs → base-executor.untyped-CHRd63Zb.mjs} +2 -2
- package/dist/src/base-executor.untyped-CHRd63Zb.mjs.map +1 -0
- package/dist/src/{base-executor.untyped-DZhWL1zT.js → base-executor.untyped-Y9IuR5eg.js} +1 -1
- package/dist/src/executors/build/executor.d.mts +0 -1
- package/dist/src/executors/build/executor.d.mts.map +1 -1
- package/dist/src/executors/build/executor.d.ts +0 -1
- package/dist/src/executors/build/executor.d.ts.map +1 -1
- package/dist/src/executors/build/executor.js +1 -1
- package/dist/src/executors/build/executor.mjs +1 -1
- package/dist/src/executors/build/schema.d.ts +0 -1
- package/dist/src/executors/build/schema.json +1 -9
- package/dist/src/executors/clean/executor.d.mts +0 -1
- package/dist/src/executors/clean/executor.d.mts.map +1 -1
- package/dist/src/executors/clean/executor.d.ts +0 -1
- package/dist/src/executors/clean/executor.d.ts.map +1 -1
- package/dist/src/executors/clean/executor.js +1 -1
- package/dist/src/executors/clean/executor.mjs +1 -1
- package/dist/src/executors/clean/schema.d.ts +0 -1
- package/dist/src/executors/clean/schema.json +1 -9
- package/dist/src/executors/clean/untyped.js +1 -1
- package/dist/src/executors/clean/untyped.mjs +1 -1
- package/dist/src/executors/docs/executor.d.mts +0 -1
- package/dist/src/executors/docs/executor.d.mts.map +1 -1
- package/dist/src/executors/docs/executor.d.ts +0 -1
- package/dist/src/executors/docs/executor.d.ts.map +1 -1
- package/dist/src/executors/docs/executor.js +1 -1
- package/dist/src/executors/docs/executor.mjs +1 -1
- package/dist/src/executors/docs/schema.d.ts +0 -1
- package/dist/src/executors/docs/schema.json +1 -9
- package/dist/src/executors/lint/executor.d.mts +0 -1
- package/dist/src/executors/lint/executor.d.mts.map +1 -1
- package/dist/src/executors/lint/executor.d.ts +0 -1
- package/dist/src/executors/lint/executor.d.ts.map +1 -1
- package/dist/src/executors/lint/executor.js +1 -1
- package/dist/src/executors/lint/executor.mjs +1 -1
- package/dist/src/executors/lint/schema.d.ts +0 -1
- package/dist/src/executors/lint/schema.json +1 -9
- package/dist/src/executors/prepare/executor.d.mts +0 -1
- package/dist/src/executors/prepare/executor.d.mts.map +1 -1
- package/dist/src/executors/prepare/executor.d.ts +0 -1
- package/dist/src/executors/prepare/executor.d.ts.map +1 -1
- package/dist/src/executors/prepare/executor.js +1 -1
- package/dist/src/executors/prepare/executor.mjs +1 -1
- package/dist/src/executors/prepare/schema.d.ts +0 -1
- package/dist/src/executors/prepare/schema.json +1 -9
- package/dist/src/executors/prepare/untyped.js +1 -1
- package/dist/src/executors/prepare/untyped.mjs +1 -1
- package/dist/src/helpers/plugin-utilities.d.mts.map +1 -1
- package/dist/src/helpers/plugin-utilities.d.ts.map +1 -1
- package/dist/src/helpers/plugin-utilities.js +3 -1
- package/dist/src/helpers/plugin-utilities.mjs +3 -1
- package/dist/src/helpers/plugin-utilities.mjs.map +1 -1
- package/dist/src/plugin/index.js +3 -1
- package/dist/src/plugin/index.mjs +3 -1
- package/dist/src/plugin/index.mjs.map +1 -1
- package/package.json +3 -3
- package/dist/src/base-executor.untyped-B9Vk-kJC.mjs.map +0 -1
|
@@ -92,11 +92,7 @@
|
|
|
92
92
|
"iife"
|
|
93
93
|
]
|
|
94
94
|
},
|
|
95
|
-
"id": "#format"
|
|
96
|
-
"default": [
|
|
97
|
-
"cjs",
|
|
98
|
-
"esm"
|
|
99
|
-
]
|
|
95
|
+
"id": "#format"
|
|
100
96
|
},
|
|
101
97
|
"platform": {
|
|
102
98
|
"title": "Platform",
|
|
@@ -203,10 +199,6 @@
|
|
|
203
199
|
"default": {
|
|
204
200
|
"configIndex": 0,
|
|
205
201
|
"copyPath": {},
|
|
206
|
-
"format": [
|
|
207
|
-
"cjs",
|
|
208
|
-
"esm"
|
|
209
|
-
],
|
|
210
202
|
"external": [],
|
|
211
203
|
"noExternal": [],
|
|
212
204
|
"define": {},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.d.mts","names":[],"sources":["../../../../src/executors/lint/schema.d.ts","../../../../src/executors/lint/executor.ts"],"mappings":";;;;UAIiB;;;;;;;;;EAShB;;;;;;;;;EAUA;;;;;;;;EASA;;;;;;;;;EAUA,QAAQ;;;;;;;;;EAUR;;;;;;;;;EAUA;;;;;;;;;EAUA;;;;;;;EAQA;;;;;;;EAQA
|
|
1
|
+
{"version":3,"file":"executor.d.mts","names":[],"sources":["../../../../src/executors/lint/schema.d.ts","../../../../src/executors/lint/executor.ts"],"mappings":";;;;UAIiB;;;;;;;;;EAShB;;;;;;;;;EAUA;;;;;;;;EASA;;;;;;;;;EAUA,QAAQ;;;;;;;;;EAUR;;;;;;;;;EAUA;;;;;;;;;EAUA;;;;;;;EAQA;;;;;;;EAQA;;;;;;;EAQA,SAAS;;;;;;;;;EAUT;;;;;;;EAQA,WAAW;;;;;;;EAQX,aAAa;;;;;;;EAQb;;;;;;;;;EAUA;;;;;;;;;EAUA;;;;;;;EAQA,SAAS;;;;;;;EAQT,SAAS;IAAQ;IAAgB;IAAiB;IAAc;IAAmB;;;;;;;;EAQnF,iBAAiB;;;;;;;EAQjB;;;;;;;EAQA;;;;cCxJK,UAAU,gBAAgB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.d.ts","names":[],"sources":["../../../../src/executors/lint/schema.d.ts","../../../../src/executors/lint/executor.ts"],"mappings":";;;;UAIiB;;;;;;;;;EAShB;;;;;;;;;EAUA;;;;;;;;EASA;;;;;;;;;EAUA,QAAQ;;;;;;;;;EAUR;;;;;;;;;EAUA;;;;;;;;;EAUA;;;;;;;EAQA;;;;;;;EAQA
|
|
1
|
+
{"version":3,"file":"executor.d.ts","names":[],"sources":["../../../../src/executors/lint/schema.d.ts","../../../../src/executors/lint/executor.ts"],"mappings":";;;;UAIiB;;;;;;;;;EAShB;;;;;;;;;EAUA;;;;;;;;EASA;;;;;;;;;EAUA,QAAQ;;;;;;;;;EAUR;;;;;;;;;EAUA;;;;;;;;;EAUA;;;;;;;EAQA;;;;;;;EAQA;;;;;;;EAQA,SAAS;;;;;;;;;EAUT;;;;;;;EAQA,WAAW;;;;;;;EAQX,aAAa;;;;;;;EAQb;;;;;;;;;EAUA;;;;;;;;;EAUA;;;;;;;EAQA,SAAS;;;;;;;EAQT,SAAS;IAAQ;IAAgB;IAAiB;IAAc;IAAmB;;;;;;;;EAQnF,iBAAiB;;;;;;;EAQjB;;;;;;;EAQA;;;;cCxJK,UAAU,gBAAgB"}
|
|
@@ -92,11 +92,7 @@
|
|
|
92
92
|
"iife"
|
|
93
93
|
]
|
|
94
94
|
},
|
|
95
|
-
"id": "#format"
|
|
96
|
-
"default": [
|
|
97
|
-
"cjs",
|
|
98
|
-
"esm"
|
|
99
|
-
]
|
|
95
|
+
"id": "#format"
|
|
100
96
|
},
|
|
101
97
|
"platform": {
|
|
102
98
|
"title": "Platform",
|
|
@@ -203,10 +199,6 @@
|
|
|
203
199
|
"default": {
|
|
204
200
|
"configIndex": 0,
|
|
205
201
|
"copyPath": {},
|
|
206
|
-
"format": [
|
|
207
|
-
"cjs",
|
|
208
|
-
"esm"
|
|
209
|
-
],
|
|
210
202
|
"external": [],
|
|
211
203
|
"noExternal": [],
|
|
212
204
|
"define": {},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.d.mts","names":[],"sources":["../../../../src/executors/prepare/schema.d.ts","../../../../src/executors/prepare/executor.ts"],"mappings":";;;;UAIiB;;;;;;;;;EAShB;;;;;;;;;EAUA;;;;;;;;EASA;;;;;;;;;EAUA,QAAQ;;;;;;;;;EAUR;;;;;;;;;EAUA;;;;;;;;;EAUA;;;;;;;EAQA;;;;;;;EAQA
|
|
1
|
+
{"version":3,"file":"executor.d.mts","names":[],"sources":["../../../../src/executors/prepare/schema.d.ts","../../../../src/executors/prepare/executor.ts"],"mappings":";;;;UAIiB;;;;;;;;;EAShB;;;;;;;;;EAUA;;;;;;;;EASA;;;;;;;;;EAUA,QAAQ;;;;;;;;;EAUR;;;;;;;;;EAUA;;;;;;;;;EAUA;;;;;;;EAQA;;;;;;;EAQA;;;;;;;EAQA,SAAS;;;;;;;;;EAUT;;;;;;;EAQA,WAAW;;;;;;;EAQX,aAAa;;;;;;;EAQb;;;;;;;;;EAUA;;;;;;;;;EAUA;;;;;;;EAQA,SAAS;;;;;;;EAQT,SAAS;IAAQ;IAAgB;IAAiB;IAAc;IAAmB;;;;;;;;EAQnF,iBAAiB;;;;;;;EAQjB;;;;;;;EAQA;;;;cCxJK,UAAU,gBAAgB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.d.ts","names":[],"sources":["../../../../src/executors/prepare/schema.d.ts","../../../../src/executors/prepare/executor.ts"],"mappings":";;;;UAIiB;;;;;;;;;EAShB;;;;;;;;;EAUA;;;;;;;;EASA;;;;;;;;;EAUA,QAAQ;;;;;;;;;EAUR;;;;;;;;;EAUA;;;;;;;;;EAUA;;;;;;;EAQA;;;;;;;EAQA
|
|
1
|
+
{"version":3,"file":"executor.d.ts","names":[],"sources":["../../../../src/executors/prepare/schema.d.ts","../../../../src/executors/prepare/executor.ts"],"mappings":";;;;UAIiB;;;;;;;;;EAShB;;;;;;;;;EAUA;;;;;;;;EASA;;;;;;;;;EAUA,QAAQ;;;;;;;;;EAUR;;;;;;;;;EAUA;;;;;;;;;EAUA;;;;;;;EAQA;;;;;;;EAQA;;;;;;;EAQA,SAAS;;;;;;;;;EAUT;;;;;;;EAQA,WAAW;;;;;;;EAQX,aAAa;;;;;;;EAQb;;;;;;;;;EAUA;;;;;;;;;EAUA;;;;;;;EAQA,SAAS;;;;;;;EAQT,SAAS;IAAQ;IAAgB;IAAiB;IAAc;IAAmB;;;;;;;;EAQnF,iBAAiB;;;;;;;EAQjB;;;;;;;EAQA;;;;cCxJK,UAAU,gBAAgB"}
|
|
@@ -92,11 +92,7 @@
|
|
|
92
92
|
"iife"
|
|
93
93
|
]
|
|
94
94
|
},
|
|
95
|
-
"id": "#format"
|
|
96
|
-
"default": [
|
|
97
|
-
"cjs",
|
|
98
|
-
"esm"
|
|
99
|
-
]
|
|
95
|
+
"id": "#format"
|
|
100
96
|
},
|
|
101
97
|
"platform": {
|
|
102
98
|
"title": "Platform",
|
|
@@ -203,10 +199,6 @@
|
|
|
203
199
|
"default": {
|
|
204
200
|
"configIndex": 0,
|
|
205
201
|
"copyPath": {},
|
|
206
|
-
"format": [
|
|
207
|
-
"cjs",
|
|
208
|
-
"esm"
|
|
209
|
-
],
|
|
210
202
|
"external": [],
|
|
211
203
|
"noExternal": [],
|
|
212
204
|
"define": {},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as base_executor_untyped_default } from "../../base-executor.untyped-
|
|
1
|
+
import { t as base_executor_untyped_default } from "../../base-executor.untyped-CHRd63Zb.mjs";
|
|
2
2
|
import { defineUntypedSchema } from "untyped";
|
|
3
3
|
|
|
4
4
|
//#region src/executors/prepare/untyped.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-utilities.d.mts","names":[],"sources":["../../../src/helpers/plugin-utilities.ts"],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"plugin-utilities.d.mts","names":[],"sources":["../../../src/helpers/plugin-utilities.ts"],"mappings":";;;;;;;;;iBAgEgB,kBAAkB;;;;;;;iBAUlB,kBAAkB;UAMjB;;;;;;;;;EASf;;;;;;;;;EAUA;;;;;;;;;EAUA;;;;;;;;iBAkBc,eACd,iBAAiB,kBAAkB,iBACnC,OAAO,wBAAwB,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-utilities.d.ts","names":[],"sources":["../../../src/helpers/plugin-utilities.ts"],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"plugin-utilities.d.ts","names":[],"sources":["../../../src/helpers/plugin-utilities.ts"],"mappings":";;;;;;;;;iBAgEgB,kBAAkB;;;;;;;iBAUlB,kBAAkB;UAMjB;;;;;;;;;EASf;;;;;;;;;EAUA;;;;;;;;;EAUA;;;;;;;;iBAkBc,eACd,iBAAiB,kBAAkB,iBACnC,OAAO,wBAAwB,cAAc"}
|
|
@@ -19,6 +19,7 @@ let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-stri
|
|
|
19
19
|
let node_fs_promises = require("node:fs/promises");
|
|
20
20
|
let nx_src_config_nx_json_js = require("nx/src/config/nx-json.js");
|
|
21
21
|
let nx_src_utils_package_json_js = require("nx/src/utils/package-json.js");
|
|
22
|
+
let nx_src_utils_package_manager_js = require("nx/src/utils/package-manager.js");
|
|
22
23
|
|
|
23
24
|
//#region src/helpers/plugin-utilities.ts
|
|
24
25
|
/**
|
|
@@ -61,6 +62,7 @@ function createNxPlugin(opts) {
|
|
|
61
62
|
workspaceRoot: contextV2.workspaceRoot
|
|
62
63
|
}).cache) throw new Error("The cache directory could not be determined.");
|
|
63
64
|
const nxJson = (0, nx_src_config_nx_json_js.readNxJson)(contextV2.workspaceRoot);
|
|
65
|
+
const packageManagerCommand = (0, nx_src_utils_package_manager_js.getPackageManagerCommand)((0, nx_src_utils_package_manager_js.detectPackageManager)(contextV2.workspaceRoot), contextV2.workspaceRoot);
|
|
64
66
|
return (0, _nx_devkit.createNodesFromFiles)(async (configFile, _, context) => {
|
|
65
67
|
try {
|
|
66
68
|
const projectRoot = (0, _storm_software_workspace_tools_utils_plugin_helpers.getProjectRoot)(configFile, contextV2.workspaceRoot);
|
|
@@ -85,7 +87,7 @@ function createNxPlugin(opts) {
|
|
|
85
87
|
if (options?.verboseOutput) console.warn(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - No project configuration found for project in root directory ${projectRoot}`);
|
|
86
88
|
return {};
|
|
87
89
|
}
|
|
88
|
-
const targets = (0, nx_src_utils_package_json_js.readTargetsFromPackageJson)(packageJson, nxJson, projectRoot, context.workspaceRoot);
|
|
90
|
+
const targets = (0, nx_src_utils_package_json_js.readTargetsFromPackageJson)(packageJson, nxJson, projectRoot, context.workspaceRoot, packageManagerCommand);
|
|
89
91
|
if (options?.verboseOutput) console.debug(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Preparing Nx targets for project in root directory ${projectRoot}.`);
|
|
90
92
|
if (options?.clean !== false && !targets[options?.clean?.targetName || "clean"]) targets[options?.clean?.targetName || "clean"] = {
|
|
91
93
|
cache: options?.clean?.cache ?? options?.cache ?? true,
|
|
@@ -16,6 +16,7 @@ import { isSetString } from "@stryke/type-checks/is-set-string";
|
|
|
16
16
|
import { readFile } from "node:fs/promises";
|
|
17
17
|
import { readNxJson } from "nx/src/config/nx-json.js";
|
|
18
18
|
import { readTargetsFromPackageJson } from "nx/src/utils/package-json.js";
|
|
19
|
+
import { detectPackageManager, getPackageManagerCommand } from "nx/src/utils/package-manager.js";
|
|
19
20
|
|
|
20
21
|
//#region src/helpers/plugin-utilities.ts
|
|
21
22
|
/**
|
|
@@ -58,6 +59,7 @@ function createNxPlugin(opts) {
|
|
|
58
59
|
workspaceRoot: contextV2.workspaceRoot
|
|
59
60
|
}).cache) throw new Error("The cache directory could not be determined.");
|
|
60
61
|
const nxJson = readNxJson(contextV2.workspaceRoot);
|
|
62
|
+
const packageManagerCommand = getPackageManagerCommand(detectPackageManager(contextV2.workspaceRoot), contextV2.workspaceRoot);
|
|
61
63
|
return createNodesFromFiles(async (configFile, _, context) => {
|
|
62
64
|
try {
|
|
63
65
|
const projectRoot = getProjectRoot(configFile, contextV2.workspaceRoot);
|
|
@@ -82,7 +84,7 @@ function createNxPlugin(opts) {
|
|
|
82
84
|
if (options?.verboseOutput) console.warn(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - No project configuration found for project in root directory ${projectRoot}`);
|
|
83
85
|
return {};
|
|
84
86
|
}
|
|
85
|
-
const targets = readTargetsFromPackageJson(packageJson, nxJson, projectRoot, context.workspaceRoot);
|
|
87
|
+
const targets = readTargetsFromPackageJson(packageJson, nxJson, projectRoot, context.workspaceRoot, packageManagerCommand);
|
|
86
88
|
if (options?.verboseOutput) console.debug(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Preparing Nx targets for project in root directory ${projectRoot}.`);
|
|
87
89
|
if (options?.clean !== false && !targets[options?.clean?.targetName || "clean"]) targets[options?.clean?.targetName || "clean"] = {
|
|
88
90
|
cache: options?.clean?.cache ?? options?.cache ?? true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-utilities.mjs","names":[],"sources":["../../../src/helpers/plugin-utilities.ts"],"sourcesContent":["// @ts-nocheck\n/* -------------------------------------------------------------------\n\n 🗲 Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\n/* eslint-disable no-console */\n\nimport type { CreateNodesResultV2, CreateNodesV2 } from \"@nx/devkit\";\nimport { createNodesFromFiles } from \"@nx/devkit\";\nimport type { ProjectTagVariant } from \"@storm-software/workspace-tools/types\";\nimport { withNamedInputs } from \"@storm-software/workspace-tools/utils/nx-json\";\nimport {\n getProjectConfigFromProjectRoot,\n getProjectRoot,\n getRoot\n} from \"@storm-software/workspace-tools/utils/plugin-helpers\";\nimport {\n addProjectTag,\n setDefaultProjectTags\n} from \"@storm-software/workspace-tools/utils/project-tags\";\nimport { isDevelopment } from \"@stryke/env/environment-checks\";\nimport { getEnvPaths } from \"@stryke/env/get-env-paths\";\nimport { existsSync } from \"@stryke/fs/exists\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { isError } from \"@stryke/type-checks/is-error\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport type { PackageJson } from \"@stryke/types/package-json\";\nimport defu from \"defu\";\nimport { readFile } from \"node:fs/promises\";\nimport { readNxJson } from \"nx/src/config/nx-json.js\";\nimport type {\n ProjectConfiguration,\n TargetConfiguration\n} from \"nx/src/config/workspace-json-project-json.js\";\nimport type { PackageJson as PackageJsonNx } from \"nx/src/utils/package-json.js\";\nimport { readTargetsFromPackageJson } from \"nx/src/utils/package-json.js\";\nimport type { NxPluginOptions } from \"../types/plugin\";\nimport { CONFIG_INPUTS } from \"./constants\";\n\n/**\n * Generates Nx input strings for the Powerlines configuration file, replacing the `{framework}` placeholder with the specified framework name.\n *\n * @param framework - The framework name to use in the input strings\n * @returns An array of Nx input strings for the configuration file\n */\nexport function getNxTargetInputs(framework: string): string[] {\n return CONFIG_INPUTS.map(input => input.replace(\"{framework}\", framework));\n}\n\n/**\n * Generates Nx input strings for the Powerlines configuration file, replacing the `{framework}` placeholder with the specified framework name.\n *\n * @param framework - The framework name to use in the input strings\n * @returns An array of Nx input strings for the configuration file\n */\nexport function getNxPluginInputs(framework: string): string {\n return `**/{${getNxTargetInputs(framework)\n .map(input => input.replace(\"{projectRoot}/\", \"\"))\n .join(\",\")}}`;\n}\n\nexport interface CreateNxPluginOptions {\n /**\n * The name of the Nx plugin to create\n *\n * @remarks\n * This will be used in logging and project tagging.\n *\n * @defaultValue \"\\{framework\\}/plugin/nx\"\n */\n name?: string;\n\n /**\n * The folder where the generated runtime artifacts will be located\n *\n * @remarks\n * This folder will contain all runtime artifacts and builtins generated during the \"prepare\" phase.\n *\n * @defaultValue \"\\{projectRoot\\}/.powerlines\"\n */\n artifactsFolder?: string;\n\n /**\n * A string identifier that allows a child framework or tool to identify itself when using Powerlines.\n *\n * @remarks\n * If no values are provided for {@link OutputConfig.dts | output.dts} or {@link OutputConfig.artifactsFolder | output.artifactsFolder}, this value will be used as the default.\n *\n * @defaultValue \"powerlines\"\n */\n framework?: string;\n}\n\n// type LoadUserConfigFileFunction = (\n// cwd: string,\n// root: string,\n// mode: Mode,\n// command: string,\n// framework?: PartialKeys<FrameworkOptions, \"orgId\">,\n// configFile?: string\n// ) => Promise<ParsedUserConfig>;\n\n/**\n * Creates an Nx plugin that integrates Powerlines into the Nx build process.\n *\n * @param opts - Options for creating the Nx plugin\n * @returns A CreateNodesV2 function that can be used as an Nx plugin\n */\nexport function createNxPlugin<\n TOptions extends NxPluginOptions = NxPluginOptions\n>(opts?: CreateNxPluginOptions): CreateNodesV2<TOptions> {\n const framework = kebabCase(opts?.framework) || \"powerlines\";\n const title = `${titleCase(framework)} Nx Plugin`;\n\n try {\n const name = opts?.name || `${framework}/nx/plugin`;\n const artifactsFolder =\n opts?.artifactsFolder || `{projectRoot}/.${framework}`;\n\n const targetInputs = getNxTargetInputs(framework);\n const pluginInputs = getNxPluginInputs(framework);\n\n return [\n pluginInputs,\n async (configFiles, options, contextV2): Promise<CreateNodesResultV2> => {\n if (options?.verboseOutput) {\n console.debug(\n `[${title}] - ${new Date().toISOString()} - Initializing the ${title} for the following inputs: ${pluginInputs}`\n );\n }\n\n const envPaths = getEnvPaths({\n orgId: \"storm-software\",\n appId: framework,\n workspaceRoot: contextV2.workspaceRoot\n });\n if (!envPaths.cache) {\n throw new Error(\"The cache directory could not be determined.\");\n }\n\n const nxJson = readNxJson(contextV2.workspaceRoot);\n // const resolver = createJiti(contextV2.workspaceRoot, {\n // debug: !!options?.debug,\n // interopDefault: true,\n // fsCache: joinPaths(\n // envPaths.cache,\n // \"nx-plugin\",\n // murmurhash(contextV2.workspaceRoot, {\n // maxLength: 45\n // }),\n // \"jiti\"\n // ),\n // moduleCache: true\n // });\n\n // let loadUserConfigFile: LoadUserConfigFileFunction | undefined;\n // try {\n // loadUserConfigFile = await resolver\n // .import<{\n // loadUserConfigFile: LoadUserConfigFileFunction;\n // }>(resolver.esmResolve(\"powerlines/config\"))\n // .then(mod => mod?.loadUserConfigFile);\n // } catch (error) {\n // console.warn(\n // `[${title}] - ${new Date().toISOString()} - Failed to load user configuration file function: ${\n // isError(error) ? error.message : \"Unknown error\"\n // }`\n // );\n // }\n\n return createNodesFromFiles(\n async (configFile, _, context) => {\n try {\n const projectRoot = getProjectRoot(\n configFile,\n contextV2.workspaceRoot\n );\n if (!projectRoot) {\n console.error(\n `[${title}] - ${new Date().toISOString()} - package.json and ${\n framework\n } configuration files (i.e. ${\n framework\n }.config.ts) must be located in the project root directory: ${\n configFile\n }`\n );\n\n return {};\n }\n\n const root = getRoot(projectRoot, context);\n\n if (options?.verboseOutput) {\n console.debug(\n `[${title}] - ${new Date().toISOString()} - Loading ${\n framework\n } user configuration for project in root directory ${\n projectRoot\n }.`\n );\n }\n\n // let userConfig = {} as UserConfig;\n // try {\n // if (loadUserConfigFile) {\n // const parsedConfig = await loadUserConfigFile(\n // contextV2.workspaceRoot,\n // projectRoot,\n // isDevelopment\n // ? \"development\"\n // : isTest\n // ? \"test\"\n // : \"production\",\n // \"build\",\n // { name: framework },\n // configFile\n // );\n // if (isSetObject(parsedConfig)) {\n // userConfig = parsedConfig.config as UserConfig;\n // }\n // }\n // } catch (error) {\n // console.warn(\n // `[${title}] - ${new Date().toISOString()} - Failed to load user configuration for project in ${\n // projectRoot\n // } - ${\n // isError(error)\n // ? error.message\n // : isSetString(error)\n // ? error\n // : \"Unknown error\"\n // } \\n\\nPlease note: This 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.${\n // isError(error) && error.stack\n // ? `\\n\\nStack trace:\\n${error.stack}`\n // : \"\"\n // }`\n // );\n // }\n\n if (\n !existsSync(\n joinPaths(\n contextV2.workspaceRoot,\n projectRoot,\n \"package.json\"\n )\n )\n ) {\n if (options?.verboseOutput) {\n console.warn(\n `[${\n title\n }] - ${new Date().toISOString()} - Cannot find \\`package.json\\` file in the project's root directory (path: \"${joinPaths(\n contextV2.workspaceRoot,\n projectRoot\n )}\"). Skipping project configuration.`\n );\n }\n\n return {};\n }\n\n const packageJsonContent = await readFile(\n joinPaths(contextV2.workspaceRoot, projectRoot, \"package.json\"),\n \"utf8\"\n );\n if (!packageJsonContent) {\n if (options?.verboseOutput) {\n console.warn(\n `[${title}] - ${new Date().toISOString()} - No package.json file found for project in root directory ${projectRoot}`\n );\n }\n\n return {};\n }\n\n const packageJson: PackageJson = JSON.parse(packageJsonContent);\n // if (\n // !(userConfig && Object.keys(userConfig).length > 0) &&\n // !packageJson?.[camelCase(framework)]\n // ) {\n // if (options?.verboseOutput) {\n // console.debug(\n // `[${title}] - ${new Date().toISOString()} - Skipping ${projectRoot} - no ${\n // framework\n // } configuration found for project in root directory.`\n // );\n // }\n\n // return {};\n // }\n\n const projectConfig = getProjectConfigFromProjectRoot(\n projectRoot,\n packageJson\n );\n if (!projectConfig) {\n if (options?.verboseOutput) {\n console.warn(\n `[${title}] - ${new Date().toISOString()} - No project configuration found for project in root directory ${\n projectRoot\n }`\n );\n }\n\n return {};\n }\n\n const targets: ProjectConfiguration[\"targets\"] =\n readTargetsFromPackageJson(\n packageJson as PackageJsonNx,\n nxJson,\n projectRoot,\n context.workspaceRoot\n );\n\n if (options?.verboseOutput) {\n console.debug(\n `[${title}] - ${new Date().toISOString()} - Preparing Nx targets for project in root directory ${\n projectRoot\n }.`\n );\n }\n\n if (\n options?.clean !== false &&\n !targets[options?.clean?.targetName || \"clean\"]\n ) {\n targets[options?.clean?.targetName || \"clean\"] = {\n cache: options?.clean?.cache ?? options?.cache ?? true,\n inputs: Array.isArray(options?.clean?.inputs)\n ? options.clean.inputs\n : withNamedInputs(targetInputs, [\n options?.clean?.inputs || \"typescript\"\n ]),\n outputs: options?.clean?.outputs,\n executor:\n options?.clean?.executor ||\n `@${framework}/nx:${options?.clean?.targetName || \"clean\"}`,\n dependsOn: options?.clean?.dependsOn ?? [\n `^${options?.clean?.targetName || \"clean\"}`\n ],\n defaultConfiguration:\n options?.clean?.defaultConfiguration || \"production\",\n options: {\n root: projectRoot,\n configFile,\n projectType: projectConfig.projectType,\n outputPath: `{workspaceRoot}/${projectRoot}/dist`,\n copyPath: `{workspaceRoot}/dist/${projectRoot}`\n },\n configurations: {\n production: {\n mode: \"production\"\n },\n test: {\n mode: \"test\"\n },\n development: {\n mode: \"development\",\n skipCache: true\n }\n }\n };\n }\n\n if (\n options?.prepare !== false &&\n !targets[options?.prepare?.targetName || \"prepare\"]\n ) {\n targets[options?.prepare?.targetName || \"prepare\"] = {\n cache: options?.prepare?.cache ?? options?.cache ?? true,\n inputs: Array.isArray(options?.prepare?.inputs)\n ? options.prepare.inputs\n : withNamedInputs(targetInputs, [\n options?.prepare?.inputs || \"typescript\"\n ]),\n outputs: options?.prepare?.outputs ?? [artifactsFolder],\n executor:\n options?.prepare?.executor ||\n `@${framework}/nx:${options?.prepare?.targetName || \"prepare\"}`,\n dependsOn:\n options?.prepare?.dependsOn ??\n [`^${options?.prepare?.targetName || \"build\"}`].filter(\n Boolean\n ),\n defaultConfiguration:\n options?.prepare?.defaultConfiguration || \"production\",\n options: {\n projectType: projectConfig.projectType,\n configFile,\n outputPath: `{workspaceRoot}/${projectRoot}/dist`,\n copyPath: `{workspaceRoot}/dist/${projectRoot}`\n },\n configurations: {\n production: {\n mode: \"production\"\n },\n test: {\n mode: \"test\"\n },\n development: {\n mode: \"development\",\n skipCache: true\n }\n }\n };\n }\n\n if (\n options?.build !== false &&\n !targets[options?.build?.targetName || \"build\"]\n ) {\n targets[options?.build?.targetName || \"build\"] = {\n cache: options?.build?.cache ?? options?.cache ?? true,\n inputs: Array.isArray(options?.build?.inputs)\n ? options.build.inputs\n : withNamedInputs(targetInputs, [\n options?.build?.inputs || \"typescript\"\n ]),\n outputs: options?.build?.outputs ?? [\"{options.outputPath}\"],\n executor:\n options?.build?.executor ||\n `@${framework}/nx:${options?.build?.targetName || \"build\"}`,\n dependsOn:\n options?.build?.dependsOn ??\n ([\n `^${options?.build?.targetName || \"build\"}`,\n isDevelopment\n ? undefined\n : isSetObject(options?.prepare) &&\n options?.prepare?.targetName\n ? options?.prepare?.targetName\n : \"prepare\"\n ].filter(Boolean) as TargetConfiguration[\"dependsOn\"]),\n defaultConfiguration:\n options?.build?.defaultConfiguration || \"production\",\n options: {\n projectType: projectConfig.projectType,\n configFile,\n outputPath: `{workspaceRoot}/${projectRoot}/dist`,\n copyPath: `{workspaceRoot}/dist/${projectRoot}`\n },\n configurations: {\n production: {\n mode: \"production\"\n },\n test: {\n mode: \"test\"\n },\n development: {\n mode: \"development\",\n skipCache: true\n }\n }\n };\n }\n\n if (\n options?.lint !== false &&\n !targets[options?.lint?.targetName || \"lint\"]\n ) {\n targets[options?.lint?.targetName || \"lint\"] = {\n cache: options?.lint?.cache ?? options?.cache ?? true,\n inputs: Array.isArray(options?.lint?.inputs)\n ? options.lint.inputs\n : withNamedInputs(\n [...targetInputs, artifactsFolder],\n options?.lint?.inputs\n ? [options.lint.inputs]\n : [\"linting\", \"typescript\"]\n ),\n outputs: options?.lint?.outputs ?? [\"{options.outputPath}\"],\n executor:\n options?.lint?.executor ||\n `@${framework}/nx:${options?.lint?.targetName || \"lint\"}`,\n dependsOn:\n options?.lint?.dependsOn ??\n ([\n `^${options?.lint?.targetName || \"lint\"}`,\n isDevelopment\n ? undefined\n : isSetObject(options?.prepare) &&\n options?.prepare?.targetName\n ? options?.prepare?.targetName\n : \"prepare\"\n ].filter(Boolean) as TargetConfiguration[\"dependsOn\"]),\n defaultConfiguration:\n options?.lint?.defaultConfiguration || \"production\",\n options: {\n projectType: projectConfig.projectType,\n configFile,\n outputPath: `{workspaceRoot}/${projectRoot}/dist`,\n copyPath: `{workspaceRoot}/dist/${projectRoot}`\n },\n configurations: {\n production: {\n mode: \"production\"\n },\n test: {\n mode: \"test\"\n },\n development: {\n mode: \"development\",\n skipCache: true\n }\n }\n };\n }\n\n if (\n options?.docs !== false &&\n !targets[options?.docs?.targetName || \"docs\"]\n ) {\n targets[options?.docs?.targetName || \"docs\"] = {\n cache: options?.docs?.cache ?? options?.cache ?? true,\n inputs: Array.isArray(options?.docs?.inputs)\n ? options.docs.inputs\n : withNamedInputs(\n [...targetInputs, artifactsFolder],\n options?.docs?.inputs\n ? [options.docs.inputs]\n : [\"documentation\", \"typescript\"]\n ),\n outputs: options?.docs?.outputs ?? [\"{options.outputPath}\"],\n executor:\n options?.docs?.executor ||\n `@${framework}/nx:${options?.docs?.targetName || \"docs\"}`,\n dependsOn:\n options?.docs?.dependsOn ??\n ([\n `^${options?.docs?.targetName || \"docs\"}`,\n options?.build !== false &&\n `${options?.build?.targetName || \"build\"}`,\n isDevelopment\n ? undefined\n : isSetObject(options?.prepare) &&\n options?.prepare?.targetName\n ? options?.prepare?.targetName\n : \"prepare\"\n ].filter(Boolean) as TargetConfiguration[\"dependsOn\"]),\n defaultConfiguration:\n options?.docs?.defaultConfiguration || \"production\",\n options: {\n projectType: projectConfig.projectType,\n configFile,\n outputPath: `{workspaceRoot}/${projectRoot}/dist`,\n copyPath: `{workspaceRoot}/dist/${projectRoot}`\n },\n configurations: {\n production: {\n mode: \"production\"\n },\n test: {\n mode: \"test\"\n },\n development: {\n mode: \"development\",\n skipCache: true\n }\n }\n };\n }\n\n if (\n options?.deploy !== false &&\n !targets[options?.deploy?.targetName || \"deploy\"]\n ) {\n targets[options?.deploy?.targetName || \"deploy\"] = {\n cache: options?.deploy?.cache ?? false,\n inputs: Array.isArray(options?.deploy?.inputs)\n ? options.deploy.inputs\n : withNamedInputs(\n [...targetInputs, artifactsFolder],\n options?.deploy?.inputs\n ? [options.deploy.inputs]\n : [\"documentation\", \"typescript\"]\n ),\n outputs: options?.deploy?.outputs ?? [\"{options.outputPath}\"],\n executor:\n options?.deploy?.executor ||\n `@${framework}/nx:${options?.deploy?.targetName || \"deploy\"}`,\n dependsOn:\n options?.deploy?.dependsOn ??\n ([\n `^${options?.deploy?.targetName || \"deploy\"}`,\n options?.build !== false &&\n `${options?.build?.targetName || \"build\"}`,\n isDevelopment\n ? undefined\n : isSetObject(options?.prepare) &&\n options?.prepare?.targetName\n ? options?.prepare?.targetName\n : \"prepare\"\n ].filter(Boolean) as TargetConfiguration[\"dependsOn\"]),\n defaultConfiguration:\n options?.deploy?.defaultConfiguration || \"production\",\n options: {\n projectType: projectConfig.projectType,\n configFile,\n outputPath: `{workspaceRoot}/${projectRoot}/dist`,\n copyPath: `{workspaceRoot}/dist/${projectRoot}`\n },\n configurations: {\n production: {\n mode: \"production\"\n },\n test: {\n mode: \"test\"\n },\n development: {\n mode: \"development\",\n skipCache: true\n }\n }\n };\n }\n\n setDefaultProjectTags(projectConfig, name);\n addProjectTag(\n projectConfig,\n framework as ProjectTagVariant,\n projectConfig.projectType || \"library\",\n {\n overwrite: true\n }\n );\n\n if (options?.verboseOutput) {\n console.debug(\n `[${\n title\n }] - ${new Date().toISOString()} - Completed preparing Nx configuration for project in root directory ${projectRoot}.`\n );\n }\n\n return {\n projects: {\n [root]: defu(projectConfig, {\n projectType: projectConfig.projectType || \"library\",\n root,\n sourceRoot: joinPaths(root, \"src\"),\n targets\n })\n }\n };\n } catch (error) {\n console.error(\n `[${title}] - ${new Date().toISOString()} - Failed to process the project configuration for file \"${\n configFile\n }\" - ${\n isError(error)\n ? error.message\n : isSetString(error)\n ? error\n : \"Unknown fatal error\"\n }`\n );\n\n return {};\n }\n },\n configFiles,\n options,\n contextV2\n );\n }\n ];\n } catch (error) {\n console.error(\n `[${title}] - ${new Date().toISOString()} - ${\n isError(error)\n ? error.message\n : isSetString(error)\n ? error\n : \"Unknown fatal error during plugin initialization\"\n }`\n );\n\n throw new Error(\n `Failed to initialize the ${title} - ${\n isError(error)\n ? error.message\n : isSetString(error)\n ? error\n : \"See previous logs for more details\"\n }`,\n {\n cause: error instanceof Error ? error : undefined\n }\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA8DA,SAAgB,kBAAkB,WAA6B;CAC7D,OAAO,cAAc,KAAI,UAAS,MAAM,QAAQ,eAAe,SAAS,CAAC;AAC3E;;;;;;;AAQA,SAAgB,kBAAkB,WAA2B;CAC3D,OAAO,OAAO,kBAAkB,SAAS,CAAC,CACvC,KAAI,UAAS,MAAM,QAAQ,kBAAkB,EAAE,CAAC,CAAC,CACjD,KAAK,GAAG,EAAE;AACf;;;;;;;AAiDA,SAAgB,eAEd,MAAuD;CACvD,MAAM,YAAY,UAAU,MAAM,SAAS,KAAK;CAChD,MAAM,QAAQ,GAAG,UAAU,SAAS,EAAE;CAEtC,IAAI;EACF,MAAM,OAAO,MAAM,QAAQ,GAAG,UAAU;EACxC,MAAM,kBACJ,MAAM,mBAAmB,kBAAkB;EAE7C,MAAM,eAAe,kBAAkB,SAAS;EAChD,MAAM,eAAe,kBAAkB,SAAS;EAEhD,OAAO,CACL,cACA,OAAO,aAAa,SAAS,cAA4C;GACvE,IAAI,SAAS,eACX,QAAQ,MACN,IAAI,MAAM,uBAAM,IAAI,KAAK,EAAC,CAAC,YAAY,EAAE,sBAAsB,MAAM,6BAA6B,cACpG;GAQF,IAAI,CAL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AC7B,EACE,WAAW,KACb,CACF;KAEA,IAAI,SAAS,eACX,QAAQ,MACN,IACE,MACD,uBAAM,IAAI,KAAK,EAAC,CAAC,YAAY,EAAE,wEAAwE,YAAY,EACtH;KAGF,OAAO,EACL,UAAU,GACP,OAAO,KAAK,eAAe;MAC1B,aAAa,cAAc,eAAe;MAC1C;MACA,YAAY,UAAU,MAAM,KAAK;MACjC;KACF,CAAC,EACH,EACF;IACF,SAAS,OAAO;KACd,QAAQ,MACN,IAAI,MAAM,uBAAM,IAAI,KAAK,EAAC,CAAC,YAAY,EAAE,2DACvC,WACD,MACC,QAAQ,KAAK,IACT,MAAM,UACN,YAAY,KAAK,IACf,QACA,uBAEV;KAEA,OAAO,CAAC;IACV;GACF,GACA,aACA,SACA,SACF;EACF,CACF;CACF,SAAS,OAAO;EACd,QAAQ,MACN,IAAI,MAAM,uBAAM,IAAI,KAAK,EAAC,CAAC,YAAY,EAAE,KACvC,QAAQ,KAAK,IACT,MAAM,UACN,YAAY,KAAK,IACf,QACA,oDAEV;EAEA,MAAM,IAAI,MACR,4BAA4B,MAAM,KAChC,QAAQ,KAAK,IACT,MAAM,UACN,YAAY,KAAK,IACf,QACA,wCAER,EACE,OAAO,iBAAiB,QAAQ,QAAQ,OAC1C,CACF;CACF;AACF"}
|
|
1
|
+
{"version":3,"file":"plugin-utilities.mjs","names":[],"sources":["../../../src/helpers/plugin-utilities.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n 🗲 Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\n/* eslint-disable no-console */\n\nimport type { CreateNodesResultV2, CreateNodesV2 } from \"@nx/devkit\";\nimport { createNodesFromFiles } from \"@nx/devkit\";\nimport type { ProjectTagVariant } from \"@storm-software/workspace-tools/types\";\nimport { withNamedInputs } from \"@storm-software/workspace-tools/utils/nx-json\";\nimport {\n getProjectConfigFromProjectRoot,\n getProjectRoot,\n getRoot\n} from \"@storm-software/workspace-tools/utils/plugin-helpers\";\nimport {\n addProjectTag,\n setDefaultProjectTags\n} from \"@storm-software/workspace-tools/utils/project-tags\";\nimport { isDevelopment } from \"@stryke/env/environment-checks\";\nimport { getEnvPaths } from \"@stryke/env/get-env-paths\";\nimport { existsSync } from \"@stryke/fs/exists\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { isError } from \"@stryke/type-checks/is-error\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport defu from \"defu\";\nimport { readFile } from \"node:fs/promises\";\nimport { readNxJson } from \"nx/src/config/nx-json.js\";\nimport type {\n ProjectConfiguration,\n TargetConfiguration\n} from \"nx/src/config/workspace-json-project-json.js\";\nimport type { PackageJson as PackageJsonNx } from \"nx/src/utils/package-json.js\";\nimport { readTargetsFromPackageJson } from \"nx/src/utils/package-json.js\";\nimport {\n detectPackageManager,\n getPackageManagerCommand\n} from \"nx/src/utils/package-manager.js\";\nimport type { NxPluginOptions } from \"../types/plugin\";\nimport { CONFIG_INPUTS } from \"./constants\";\n\n/**\n * Generates Nx input strings for the Powerlines configuration file, replacing the `{framework}` placeholder with the specified framework name.\n *\n * @param framework - The framework name to use in the input strings\n * @returns An array of Nx input strings for the configuration file\n */\nexport function getNxTargetInputs(framework: string): string[] {\n return CONFIG_INPUTS.map(input => input.replace(\"{framework}\", framework));\n}\n\n/**\n * Generates Nx input strings for the Powerlines configuration file, replacing the `{framework}` placeholder with the specified framework name.\n *\n * @param framework - The framework name to use in the input strings\n * @returns An array of Nx input strings for the configuration file\n */\nexport function getNxPluginInputs(framework: string): string {\n return `**/{${getNxTargetInputs(framework)\n .map(input => input.replace(\"{projectRoot}/\", \"\"))\n .join(\",\")}}`;\n}\n\nexport interface CreateNxPluginOptions {\n /**\n * The name of the Nx plugin to create\n *\n * @remarks\n * This will be used in logging and project tagging.\n *\n * @defaultValue \"\\{framework\\}/plugin/nx\"\n */\n name?: string;\n\n /**\n * The folder where the generated runtime artifacts will be located\n *\n * @remarks\n * This folder will contain all runtime artifacts and builtins generated during the \"prepare\" phase.\n *\n * @defaultValue \"\\{projectRoot\\}/.powerlines\"\n */\n artifactsFolder?: string;\n\n /**\n * A string identifier that allows a child framework or tool to identify itself when using Powerlines.\n *\n * @remarks\n * If no values are provided for {@link OutputConfig.dts | output.dts} or {@link OutputConfig.artifactsFolder | output.artifactsFolder}, this value will be used as the default.\n *\n * @defaultValue \"powerlines\"\n */\n framework?: string;\n}\n\n// type LoadUserConfigFileFunction = (\n// cwd: string,\n// root: string,\n// mode: Mode,\n// command: string,\n// framework?: PartialKeys<FrameworkOptions, \"orgId\">,\n// configFile?: string\n// ) => Promise<ParsedUserConfig>;\n\n/**\n * Creates an Nx plugin that integrates Powerlines into the Nx build process.\n *\n * @param opts - Options for creating the Nx plugin\n * @returns A CreateNodesV2 function that can be used as an Nx plugin\n */\nexport function createNxPlugin<\n TOptions extends NxPluginOptions = NxPluginOptions\n>(opts?: CreateNxPluginOptions): CreateNodesV2<TOptions> {\n const framework = kebabCase(opts?.framework) || \"powerlines\";\n const title = `${titleCase(framework)} Nx Plugin`;\n\n try {\n const name = opts?.name || `${framework}/nx/plugin`;\n const artifactsFolder =\n opts?.artifactsFolder || `{projectRoot}/.${framework}`;\n\n const targetInputs = getNxTargetInputs(framework);\n const pluginInputs = getNxPluginInputs(framework);\n\n return [\n pluginInputs,\n async (configFiles, options, contextV2): Promise<CreateNodesResultV2> => {\n if (options?.verboseOutput) {\n console.debug(\n `[${title}] - ${new Date().toISOString()} - Initializing the ${title} for the following inputs: ${pluginInputs}`\n );\n }\n\n const envPaths = getEnvPaths({\n orgId: \"storm-software\",\n appId: framework,\n workspaceRoot: contextV2.workspaceRoot\n });\n if (!envPaths.cache) {\n throw new Error(\"The cache directory could not be determined.\");\n }\n\n const nxJson = readNxJson(contextV2.workspaceRoot);\n const packageManagerCommand = getPackageManagerCommand(\n detectPackageManager(contextV2.workspaceRoot),\n contextV2.workspaceRoot\n );\n // const resolver = createJiti(contextV2.workspaceRoot, {\n // debug: !!options?.debug,\n // interopDefault: true,\n // fsCache: joinPaths(\n // envPaths.cache,\n // \"nx-plugin\",\n // murmurhash(contextV2.workspaceRoot, {\n // maxLength: 45\n // }),\n // \"jiti\"\n // ),\n // moduleCache: true\n // });\n\n // let loadUserConfigFile: LoadUserConfigFileFunction | undefined;\n // try {\n // loadUserConfigFile = await resolver\n // .import<{\n // loadUserConfigFile: LoadUserConfigFileFunction;\n // }>(resolver.esmResolve(\"powerlines/config\"))\n // .then(mod => mod?.loadUserConfigFile);\n // } catch (error) {\n // console.warn(\n // `[${title}] - ${new Date().toISOString()} - Failed to load user configuration file function: ${\n // isError(error) ? error.message : \"Unknown error\"\n // }`\n // );\n // }\n\n return createNodesFromFiles(\n async (configFile, _, context) => {\n try {\n const projectRoot = getProjectRoot(\n configFile,\n contextV2.workspaceRoot\n );\n if (!projectRoot) {\n console.error(\n `[${title}] - ${new Date().toISOString()} - package.json and ${\n framework\n } configuration files (i.e. ${\n framework\n }.config.ts) must be located in the project root directory: ${\n configFile\n }`\n );\n\n return {};\n }\n\n const root = getRoot(projectRoot, context);\n\n if (options?.verboseOutput) {\n console.debug(\n `[${title}] - ${new Date().toISOString()} - Loading ${\n framework\n } user configuration for project in root directory ${\n projectRoot\n }.`\n );\n }\n\n // let userConfig = {} as UserConfig;\n // try {\n // if (loadUserConfigFile) {\n // const parsedConfig = await loadUserConfigFile(\n // contextV2.workspaceRoot,\n // projectRoot,\n // isDevelopment\n // ? \"development\"\n // : isTest\n // ? \"test\"\n // : \"production\",\n // \"build\",\n // { name: framework },\n // configFile\n // );\n // if (isSetObject(parsedConfig)) {\n // userConfig = parsedConfig.config as UserConfig;\n // }\n // }\n // } catch (error) {\n // console.warn(\n // `[${title}] - ${new Date().toISOString()} - Failed to load user configuration for project in ${\n // projectRoot\n // } - ${\n // isError(error)\n // ? error.message\n // : isSetString(error)\n // ? error\n // : \"Unknown error\"\n // } \\n\\nPlease note: This 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.${\n // isError(error) && error.stack\n // ? `\\n\\nStack trace:\\n${error.stack}`\n // : \"\"\n // }`\n // );\n // }\n\n if (\n !existsSync(\n joinPaths(\n contextV2.workspaceRoot,\n projectRoot,\n \"package.json\"\n )\n )\n ) {\n if (options?.verboseOutput) {\n console.warn(\n `[${\n title\n }] - ${new Date().toISOString()} - Cannot find \\`package.json\\` file in the project's root directory (path: \"${joinPaths(\n contextV2.workspaceRoot,\n projectRoot\n )}\"). Skipping project configuration.`\n );\n }\n\n return {};\n }\n\n const packageJsonContent = await readFile(\n joinPaths(contextV2.workspaceRoot, projectRoot, \"package.json\"),\n \"utf8\"\n );\n if (!packageJsonContent) {\n if (options?.verboseOutput) {\n console.warn(\n `[${title}] - ${new Date().toISOString()} - No package.json file found for project in root directory ${projectRoot}`\n );\n }\n\n return {};\n }\n\n const packageJson = JSON.parse(\n packageJsonContent\n ) as PackageJsonNx;\n // if (\n // !(userConfig && Object.keys(userConfig).length > 0) &&\n // !packageJson?.[camelCase(framework)]\n // ) {\n // if (options?.verboseOutput) {\n // console.debug(\n // `[${title}] - ${new Date().toISOString()} - Skipping ${projectRoot} - no ${\n // framework\n // } configuration found for project in root directory.`\n // );\n // }\n\n // return {};\n // }\n\n const projectConfig = getProjectConfigFromProjectRoot(\n projectRoot,\n packageJson as Parameters<\n typeof getProjectConfigFromProjectRoot\n >[1]\n );\n if (!projectConfig) {\n if (options?.verboseOutput) {\n console.warn(\n `[${title}] - ${new Date().toISOString()} - No project configuration found for project in root directory ${\n projectRoot\n }`\n );\n }\n\n return {};\n }\n\n const targets: ProjectConfiguration[\"targets\"] =\n readTargetsFromPackageJson(\n packageJson,\n nxJson,\n projectRoot,\n context.workspaceRoot,\n packageManagerCommand\n );\n\n if (options?.verboseOutput) {\n console.debug(\n `[${title}] - ${new Date().toISOString()} - Preparing Nx targets for project in root directory ${\n projectRoot\n }.`\n );\n }\n\n if (\n options?.clean !== false &&\n !targets[options?.clean?.targetName || \"clean\"]\n ) {\n targets[options?.clean?.targetName || \"clean\"] = {\n cache: options?.clean?.cache ?? options?.cache ?? true,\n inputs: Array.isArray(options?.clean?.inputs)\n ? options.clean.inputs\n : withNamedInputs(targetInputs, [\n options?.clean?.inputs || \"typescript\"\n ]),\n outputs: options?.clean?.outputs,\n executor:\n options?.clean?.executor ||\n `@${framework}/nx:${options?.clean?.targetName || \"clean\"}`,\n dependsOn: options?.clean?.dependsOn ?? [\n `^${options?.clean?.targetName || \"clean\"}`\n ],\n defaultConfiguration:\n options?.clean?.defaultConfiguration || \"production\",\n options: {\n root: projectRoot,\n configFile,\n projectType: projectConfig.projectType,\n outputPath: `{workspaceRoot}/${projectRoot}/dist`,\n copyPath: `{workspaceRoot}/dist/${projectRoot}`\n },\n configurations: {\n production: {\n mode: \"production\"\n },\n test: {\n mode: \"test\"\n },\n development: {\n mode: \"development\",\n skipCache: true\n }\n }\n };\n }\n\n if (\n options?.prepare !== false &&\n !targets[options?.prepare?.targetName || \"prepare\"]\n ) {\n targets[options?.prepare?.targetName || \"prepare\"] = {\n cache: options?.prepare?.cache ?? options?.cache ?? true,\n inputs: Array.isArray(options?.prepare?.inputs)\n ? options.prepare.inputs\n : withNamedInputs(targetInputs, [\n options?.prepare?.inputs || \"typescript\"\n ]),\n outputs: options?.prepare?.outputs ?? [artifactsFolder],\n executor:\n options?.prepare?.executor ||\n `@${framework}/nx:${options?.prepare?.targetName || \"prepare\"}`,\n dependsOn:\n options?.prepare?.dependsOn ??\n [`^${options?.prepare?.targetName || \"build\"}`].filter(\n Boolean\n ),\n defaultConfiguration:\n options?.prepare?.defaultConfiguration || \"production\",\n options: {\n projectType: projectConfig.projectType,\n configFile,\n outputPath: `{workspaceRoot}/${projectRoot}/dist`,\n copyPath: `{workspaceRoot}/dist/${projectRoot}`\n },\n configurations: {\n production: {\n mode: \"production\"\n },\n test: {\n mode: \"test\"\n },\n development: {\n mode: \"development\",\n skipCache: true\n }\n }\n };\n }\n\n if (\n options?.build !== false &&\n !targets[options?.build?.targetName || \"build\"]\n ) {\n targets[options?.build?.targetName || \"build\"] = {\n cache: options?.build?.cache ?? options?.cache ?? true,\n inputs: Array.isArray(options?.build?.inputs)\n ? options.build.inputs\n : withNamedInputs(targetInputs, [\n options?.build?.inputs || \"typescript\"\n ]),\n outputs: options?.build?.outputs ?? [\"{options.outputPath}\"],\n executor:\n options?.build?.executor ||\n `@${framework}/nx:${options?.build?.targetName || \"build\"}`,\n dependsOn:\n options?.build?.dependsOn ??\n ([\n `^${options?.build?.targetName || \"build\"}`,\n isDevelopment\n ? undefined\n : isSetObject(options?.prepare) &&\n options?.prepare?.targetName\n ? options?.prepare?.targetName\n : \"prepare\"\n ].filter(Boolean) as TargetConfiguration[\"dependsOn\"]),\n defaultConfiguration:\n options?.build?.defaultConfiguration || \"production\",\n options: {\n projectType: projectConfig.projectType,\n configFile,\n outputPath: `{workspaceRoot}/${projectRoot}/dist`,\n copyPath: `{workspaceRoot}/dist/${projectRoot}`\n },\n configurations: {\n production: {\n mode: \"production\"\n },\n test: {\n mode: \"test\"\n },\n development: {\n mode: \"development\",\n skipCache: true\n }\n }\n };\n }\n\n if (\n options?.lint !== false &&\n !targets[options?.lint?.targetName || \"lint\"]\n ) {\n targets[options?.lint?.targetName || \"lint\"] = {\n cache: options?.lint?.cache ?? options?.cache ?? true,\n inputs: Array.isArray(options?.lint?.inputs)\n ? options.lint.inputs\n : withNamedInputs(\n [...targetInputs, artifactsFolder],\n options?.lint?.inputs\n ? [options.lint.inputs]\n : [\"linting\", \"typescript\"]\n ),\n outputs: options?.lint?.outputs ?? [\"{options.outputPath}\"],\n executor:\n options?.lint?.executor ||\n `@${framework}/nx:${options?.lint?.targetName || \"lint\"}`,\n dependsOn:\n options?.lint?.dependsOn ??\n ([\n `^${options?.lint?.targetName || \"lint\"}`,\n isDevelopment\n ? undefined\n : isSetObject(options?.prepare) &&\n options?.prepare?.targetName\n ? options?.prepare?.targetName\n : \"prepare\"\n ].filter(Boolean) as TargetConfiguration[\"dependsOn\"]),\n defaultConfiguration:\n options?.lint?.defaultConfiguration || \"production\",\n options: {\n projectType: projectConfig.projectType,\n configFile,\n outputPath: `{workspaceRoot}/${projectRoot}/dist`,\n copyPath: `{workspaceRoot}/dist/${projectRoot}`\n },\n configurations: {\n production: {\n mode: \"production\"\n },\n test: {\n mode: \"test\"\n },\n development: {\n mode: \"development\",\n skipCache: true\n }\n }\n };\n }\n\n if (\n options?.docs !== false &&\n !targets[options?.docs?.targetName || \"docs\"]\n ) {\n targets[options?.docs?.targetName || \"docs\"] = {\n cache: options?.docs?.cache ?? options?.cache ?? true,\n inputs: Array.isArray(options?.docs?.inputs)\n ? options.docs.inputs\n : withNamedInputs(\n [...targetInputs, artifactsFolder],\n options?.docs?.inputs\n ? [options.docs.inputs]\n : [\"documentation\", \"typescript\"]\n ),\n outputs: options?.docs?.outputs ?? [\"{options.outputPath}\"],\n executor:\n options?.docs?.executor ||\n `@${framework}/nx:${options?.docs?.targetName || \"docs\"}`,\n dependsOn:\n options?.docs?.dependsOn ??\n ([\n `^${options?.docs?.targetName || \"docs\"}`,\n options?.build !== false &&\n `${options?.build?.targetName || \"build\"}`,\n isDevelopment\n ? undefined\n : isSetObject(options?.prepare) &&\n options?.prepare?.targetName\n ? options?.prepare?.targetName\n : \"prepare\"\n ].filter(Boolean) as TargetConfiguration[\"dependsOn\"]),\n defaultConfiguration:\n options?.docs?.defaultConfiguration || \"production\",\n options: {\n projectType: projectConfig.projectType,\n configFile,\n outputPath: `{workspaceRoot}/${projectRoot}/dist`,\n copyPath: `{workspaceRoot}/dist/${projectRoot}`\n },\n configurations: {\n production: {\n mode: \"production\"\n },\n test: {\n mode: \"test\"\n },\n development: {\n mode: \"development\",\n skipCache: true\n }\n }\n };\n }\n\n if (\n options?.deploy !== false &&\n !targets[options?.deploy?.targetName || \"deploy\"]\n ) {\n targets[options?.deploy?.targetName || \"deploy\"] = {\n cache: options?.deploy?.cache ?? false,\n inputs: Array.isArray(options?.deploy?.inputs)\n ? options.deploy.inputs\n : withNamedInputs(\n [...targetInputs, artifactsFolder],\n options?.deploy?.inputs\n ? [options.deploy.inputs]\n : [\"documentation\", \"typescript\"]\n ),\n outputs: options?.deploy?.outputs ?? [\"{options.outputPath}\"],\n executor:\n options?.deploy?.executor ||\n `@${framework}/nx:${options?.deploy?.targetName || \"deploy\"}`,\n dependsOn:\n options?.deploy?.dependsOn ??\n ([\n `^${options?.deploy?.targetName || \"deploy\"}`,\n options?.build !== false &&\n `${options?.build?.targetName || \"build\"}`,\n isDevelopment\n ? undefined\n : isSetObject(options?.prepare) &&\n options?.prepare?.targetName\n ? options?.prepare?.targetName\n : \"prepare\"\n ].filter(Boolean) as TargetConfiguration[\"dependsOn\"]),\n defaultConfiguration:\n options?.deploy?.defaultConfiguration || \"production\",\n options: {\n projectType: projectConfig.projectType,\n configFile,\n outputPath: `{workspaceRoot}/${projectRoot}/dist`,\n copyPath: `{workspaceRoot}/dist/${projectRoot}`\n },\n configurations: {\n production: {\n mode: \"production\"\n },\n test: {\n mode: \"test\"\n },\n development: {\n mode: \"development\",\n skipCache: true\n }\n }\n };\n }\n\n setDefaultProjectTags(projectConfig, name);\n addProjectTag(\n projectConfig,\n framework as ProjectTagVariant,\n projectConfig.projectType || \"library\",\n {\n overwrite: true\n }\n );\n\n if (options?.verboseOutput) {\n console.debug(\n `[${\n title\n }] - ${new Date().toISOString()} - Completed preparing Nx configuration for project in root directory ${projectRoot}.`\n );\n }\n\n return {\n projects: {\n [root]: defu(projectConfig, {\n projectType: projectConfig.projectType || \"library\",\n root,\n sourceRoot: joinPaths(root, \"src\"),\n targets\n })\n }\n };\n } catch (error) {\n console.error(\n `[${title}] - ${new Date().toISOString()} - Failed to process the project configuration for file \"${\n configFile\n }\" - ${\n isError(error)\n ? error.message\n : isSetString(error)\n ? error\n : \"Unknown fatal error\"\n }`\n );\n\n return {};\n }\n },\n configFiles,\n options,\n contextV2\n );\n }\n ];\n } catch (error) {\n console.error(\n `[${title}] - ${new Date().toISOString()} - ${\n isError(error)\n ? error.message\n : isSetString(error)\n ? error\n : \"Unknown fatal error during plugin initialization\"\n }`\n );\n\n throw new Error(\n `Failed to initialize the ${title} - ${\n isError(error)\n ? error.message\n : isSetString(error)\n ? error\n : \"See previous logs for more details\"\n }`,\n {\n cause: error instanceof Error ? error : undefined\n }\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAgEA,SAAgB,kBAAkB,WAA6B;CAC7D,OAAO,cAAc,KAAI,UAAS,MAAM,QAAQ,eAAe,SAAS,CAAC;AAC3E;;;;;;;AAQA,SAAgB,kBAAkB,WAA2B;CAC3D,OAAO,OAAO,kBAAkB,SAAS,CAAC,CACvC,KAAI,UAAS,MAAM,QAAQ,kBAAkB,EAAE,CAAC,CAAC,CACjD,KAAK,GAAG,EAAE;AACf;;;;;;;AAiDA,SAAgB,eAEd,MAAuD;CACvD,MAAM,YAAY,UAAU,MAAM,SAAS,KAAK;CAChD,MAAM,QAAQ,GAAG,UAAU,SAAS,EAAE;CAEtC,IAAI;EACF,MAAM,OAAO,MAAM,QAAQ,GAAG,UAAU;EACxC,MAAM,kBACJ,MAAM,mBAAmB,kBAAkB;EAE7C,MAAM,eAAe,kBAAkB,SAAS;EAChD,MAAM,eAAe,kBAAkB,SAAS;EAEhD,OAAO,CACL,cACA,OAAO,aAAa,SAAS,cAA4C;GACvE,IAAI,SAAS,eACX,QAAQ,MACN,IAAI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B;OACd,YAAY,EACV,MAAM,aACR;OACA,MAAM,EACJ,MAAM,OACR;OACA,aAAa;QACX,MAAM;QACN,WAAW;OACb;MACF;KACF;KAGF,sBAAsB,eAAe,IAAI;KACzC,cACE,eACA,WACA,cAAc,eAAe,WAC7B,EACE,WAAW,KACb,CACF;KAEA,IAAI,SAAS,eACX,QAAQ,MACN,IACE,MACD,uBAAM,IAAI,KAAK,EAAC,CAAC,YAAY,EAAE,wEAAwE,YAAY,EACtH;KAGF,OAAO,EACL,UAAU,GACP,OAAO,KAAK,eAAe;MAC1B,aAAa,cAAc,eAAe;MAC1C;MACA,YAAY,UAAU,MAAM,KAAK;MACjC;KACF,CAAC,EACH,EACF;IACF,SAAS,OAAO;KACd,QAAQ,MACN,IAAI,MAAM,uBAAM,IAAI,KAAK,EAAC,CAAC,YAAY,EAAE,2DACvC,WACD,MACC,QAAQ,KAAK,IACT,MAAM,UACN,YAAY,KAAK,IACf,QACA,uBAEV;KAEA,OAAO,CAAC;IACV;GACF,GACA,aACA,SACA,SACF;EACF,CACF;CACF,SAAS,OAAO;EACd,QAAQ,MACN,IAAI,MAAM,uBAAM,IAAI,KAAK,EAAC,CAAC,YAAY,EAAE,KACvC,QAAQ,KAAK,IACT,MAAM,UACN,YAAY,KAAK,IACf,QACA,oDAEV;EAEA,MAAM,IAAI,MACR,4BAA4B,MAAM,KAChC,QAAQ,KAAK,IACT,MAAM,UACN,YAAY,KAAK,IACf,QACA,wCAER,EACE,OAAO,iBAAiB,QAAQ,QAAQ,OAC1C,CACF;CACF;AACF"}
|
package/dist/src/plugin/index.js
CHANGED
|
@@ -18,6 +18,7 @@ defu = require_rolldown_runtime.__toESM(defu);
|
|
|
18
18
|
let node_fs_promises = require("node:fs/promises");
|
|
19
19
|
let nx_src_config_nx_json_js = require("nx/src/config/nx-json.js");
|
|
20
20
|
let nx_src_utils_package_json_js = require("nx/src/utils/package-json.js");
|
|
21
|
+
let nx_src_utils_package_manager_js = require("nx/src/utils/package-manager.js");
|
|
21
22
|
|
|
22
23
|
//#region src/helpers/constants.ts
|
|
23
24
|
/**
|
|
@@ -92,6 +93,7 @@ function createNxPlugin(opts) {
|
|
|
92
93
|
workspaceRoot: contextV2.workspaceRoot
|
|
93
94
|
}).cache) throw new Error("The cache directory could not be determined.");
|
|
94
95
|
const nxJson = (0, nx_src_config_nx_json_js.readNxJson)(contextV2.workspaceRoot);
|
|
96
|
+
const packageManagerCommand = (0, nx_src_utils_package_manager_js.getPackageManagerCommand)((0, nx_src_utils_package_manager_js.detectPackageManager)(contextV2.workspaceRoot), contextV2.workspaceRoot);
|
|
95
97
|
return (0, _nx_devkit.createNodesFromFiles)(async (configFile, _, context) => {
|
|
96
98
|
try {
|
|
97
99
|
const projectRoot = (0, _storm_software_workspace_tools_utils_plugin_helpers.getProjectRoot)(configFile, contextV2.workspaceRoot);
|
|
@@ -116,7 +118,7 @@ function createNxPlugin(opts) {
|
|
|
116
118
|
if (options?.verboseOutput) console.warn(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - No project configuration found for project in root directory ${projectRoot}`);
|
|
117
119
|
return {};
|
|
118
120
|
}
|
|
119
|
-
const targets = (0, nx_src_utils_package_json_js.readTargetsFromPackageJson)(packageJson, nxJson, projectRoot, context.workspaceRoot);
|
|
121
|
+
const targets = (0, nx_src_utils_package_json_js.readTargetsFromPackageJson)(packageJson, nxJson, projectRoot, context.workspaceRoot, packageManagerCommand);
|
|
120
122
|
if (options?.verboseOutput) console.debug(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Preparing Nx targets for project in root directory ${projectRoot}.`);
|
|
121
123
|
if (options?.clean !== false && !targets[options?.clean?.targetName || "clean"]) targets[options?.clean?.targetName || "clean"] = {
|
|
122
124
|
cache: options?.clean?.cache ?? options?.cache ?? true,
|
|
@@ -15,6 +15,7 @@ import defu from "defu";
|
|
|
15
15
|
import { readFile } from "node:fs/promises";
|
|
16
16
|
import { readNxJson as readNxJson$1 } from "nx/src/config/nx-json.js";
|
|
17
17
|
import { readTargetsFromPackageJson } from "nx/src/utils/package-json.js";
|
|
18
|
+
import { detectPackageManager, getPackageManagerCommand } from "nx/src/utils/package-manager.js";
|
|
18
19
|
|
|
19
20
|
//#region src/helpers/constants.ts
|
|
20
21
|
/**
|
|
@@ -89,6 +90,7 @@ function createNxPlugin(opts) {
|
|
|
89
90
|
workspaceRoot: contextV2.workspaceRoot
|
|
90
91
|
}).cache) throw new Error("The cache directory could not be determined.");
|
|
91
92
|
const nxJson = readNxJson$1(contextV2.workspaceRoot);
|
|
93
|
+
const packageManagerCommand = getPackageManagerCommand(detectPackageManager(contextV2.workspaceRoot), contextV2.workspaceRoot);
|
|
92
94
|
return createNodesFromFiles(async (configFile, _, context) => {
|
|
93
95
|
try {
|
|
94
96
|
const projectRoot = getProjectRoot(configFile, contextV2.workspaceRoot);
|
|
@@ -113,7 +115,7 @@ function createNxPlugin(opts) {
|
|
|
113
115
|
if (options?.verboseOutput) console.warn(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - No project configuration found for project in root directory ${projectRoot}`);
|
|
114
116
|
return {};
|
|
115
117
|
}
|
|
116
|
-
const targets = readTargetsFromPackageJson(packageJson, nxJson, projectRoot, context.workspaceRoot);
|
|
118
|
+
const targets = readTargetsFromPackageJson(packageJson, nxJson, projectRoot, context.workspaceRoot, packageManagerCommand);
|
|
117
119
|
if (options?.verboseOutput) console.debug(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Preparing Nx targets for project in root directory ${projectRoot}.`);
|
|
118
120
|
if (options?.clean !== false && !targets[options?.clean?.targetName || "clean"]) targets[options?.clean?.targetName || "clean"] = {
|
|
119
121
|
cache: options?.clean?.cache ?? options?.cache ?? true,
|