@powerlines/nx 0.13.232 → 0.13.234

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 +1 @@
1
- {"version":3,"file":"plugin-utilities.d.mts","names":[],"sources":["../../../src/helpers/plugin-utilities.ts"],"mappings":";;;;;;;;;iBA6DgB,kBAAkB;;;;;;;iBAUlB,kBAAkB;UAMjB;;;;;;;;;EASf;;;;;;;;;EAUA;;;;;;;;;EAUA;;;;;;;;iBAkBc,eACd,iBAAiB,kBAAkB,iBACnC,OAAO,wBAAwB,cAAc"}
1
+ {"version":3,"file":"plugin-utilities.d.mts","names":[],"sources":["../../../src/helpers/plugin-utilities.ts"],"mappings":";;;;;;;;;iBA8DgB,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":";;;;;;;;;iBA6DgB,kBAAkB;;;;;;;iBAUlB,kBAAkB;UAMjB;;;;;;;;;EASf;;;;;;;;;EAUA;;;;;;;;;EAUA;;;;;;;;iBAkBc,eACd,iBAAiB,kBAAkB,iBACnC,OAAO,wBAAwB,cAAc"}
1
+ {"version":3,"file":"plugin-utilities.d.ts","names":[],"sources":["../../../src/helpers/plugin-utilities.ts"],"mappings":";;;;;;;;;iBA8DgB,kBAAkB;;;;;;;iBAUlB,kBAAkB;UAMjB;;;;;;;;;EASf;;;;;;;;;EAUA;;;;;;;;;EAUA;;;;;;;;iBAkBc,eACd,iBAAiB,kBAAkB,iBACnC,OAAO,wBAAwB,cAAc"}
@@ -1 +1 @@
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 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":";;;;;;;;;;;;;;;;;;;;;;;;;;AA6DA,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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AAQ,wBAAwB;MAC3C,SAAS;OACP,aAAa,cAAc;OAC3B;OACA,YAAY,mBAAmB,YAAY;OAC3C,UAAU,wBAAwB;MACpC;MACA,gBAAgB;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"}
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,kBAA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,YAAY,mBAAmB,YAAY;OAC3C,UAAU,wBAAwB;MACpC;MACA,gBAAgB;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"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["readNxJson"],"sources":["../../../src/helpers/constants.ts","../../../src/helpers/plugin-utilities.ts","../../../src/plugin/index.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/**\n * A list of Nx input strings that describe the Powerlines configuration file\n */\nexport const CONFIG_INPUTS = [\n \"{projectRoot}/{framework}.json\",\n \"{projectRoot}/{framework}.*.json\",\n \"{projectRoot}/{framework}.jsonc\",\n \"{projectRoot}/{framework}.*.jsonc\",\n \"{projectRoot}/{framework}.json5\",\n \"{projectRoot}/{framework}.*.json5\",\n \"{projectRoot}/{framework}.yaml\",\n \"{projectRoot}/{framework}.*.yaml\",\n \"{projectRoot}/{framework}.yml\",\n \"{projectRoot}/{framework}.*.yml\",\n \"{projectRoot}/{framework}.toml\",\n \"{projectRoot}/{framework}.*.toml\",\n \"{projectRoot}/{framework}.config.js\",\n \"{projectRoot}/{framework}.*.config.js\",\n \"{projectRoot}/{framework}.config.cjs\",\n \"{projectRoot}/{framework}.*.config.cjs\",\n \"{projectRoot}/{framework}.config.mjs\",\n \"{projectRoot}/{framework}.*.config.mjs\",\n \"{projectRoot}/{framework}.config.ts\",\n \"{projectRoot}/{framework}.*.config.ts\",\n \"{projectRoot}/{framework}.config.cts\",\n \"{projectRoot}/{framework}.*.config.cts\",\n \"{projectRoot}/{framework}.config.mts\",\n \"{projectRoot}/{framework}.*.config.mts\"\n] as const;\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","/* -------------------------------------------------------------------\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\nimport { createNxPlugin } from \"../helpers/plugin-utilities\";\nimport { NxPluginOptions } from \"../types/plugin\";\n\nexport const createNodesV2 = createNxPlugin<NxPluginOptions>({\n framework: \"powerlines\"\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAqBA,MAAa,gBAAgB;CAC3B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;;;;;;;;;;ACeA,SAAgB,kBAAkB,WAA6B;CAC7D,OAAO,cAAc,KAAI,UAAS,MAAM,QAAQ,eAAe,SAAS,CAAC;AAC3E;;;;;;;A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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;;;;AChrBA,MAAa,gBAAgB,eAAgC,EAC3D,WAAW,aACb,CAAC"}
1
+ {"version":3,"file":"index.mjs","names":["readNxJson"],"sources":["../../../src/helpers/constants.ts","../../../src/helpers/plugin-utilities.ts","../../../src/plugin/index.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/**\n * A list of Nx input strings that describe the Powerlines configuration file\n */\nexport const CONFIG_INPUTS = [\n \"{projectRoot}/{framework}.json\",\n \"{projectRoot}/{framework}.*.json\",\n \"{projectRoot}/{framework}.jsonc\",\n \"{projectRoot}/{framework}.*.jsonc\",\n \"{projectRoot}/{framework}.json5\",\n \"{projectRoot}/{framework}.*.json5\",\n \"{projectRoot}/{framework}.yaml\",\n \"{projectRoot}/{framework}.*.yaml\",\n \"{projectRoot}/{framework}.yml\",\n \"{projectRoot}/{framework}.*.yml\",\n \"{projectRoot}/{framework}.toml\",\n \"{projectRoot}/{framework}.*.toml\",\n \"{projectRoot}/{framework}.config.js\",\n \"{projectRoot}/{framework}.*.config.js\",\n \"{projectRoot}/{framework}.config.cjs\",\n \"{projectRoot}/{framework}.*.config.cjs\",\n \"{projectRoot}/{framework}.config.mjs\",\n \"{projectRoot}/{framework}.*.config.mjs\",\n \"{projectRoot}/{framework}.config.ts\",\n \"{projectRoot}/{framework}.*.config.ts\",\n \"{projectRoot}/{framework}.config.cts\",\n \"{projectRoot}/{framework}.*.config.cts\",\n \"{projectRoot}/{framework}.config.mts\",\n \"{projectRoot}/{framework}.*.config.mts\"\n] as const;\n","// @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","/* -------------------------------------------------------------------\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\nimport { createNxPlugin } from \"../helpers/plugin-utilities\";\nimport { NxPluginOptions } from \"../types/plugin\";\n\nexport const createNodesV2 = createNxPlugin<NxPluginOptions>({\n framework: \"powerlines\"\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAqBA,MAAa,gBAAgB;CAC3B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;;;;;;;;;;ACgBA,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,CALa,YAAY;IAC3B,OAAO;IACP,OAAO;IACP,eAAe,UAAU;GAC3B,CACY,CAAC,CAAC,OACZ,MAAM,IAAI,MAAM,8CAA8C;GAGhE,MAAM,SAASA,aAAW,UAAU,aAAa;GA8BjD,OAAO,q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ACP,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;;;;ACjrBA,MAAa,gBAAgB,eAAgC,EAC3D,WAAW,aACb,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/nx",
3
- "version": "0.13.232",
3
+ "version": "0.13.234",
4
4
  "private": false,
5
5
  "description": "A Nx plugin to support Powerlines development in Nx monorepos.",
6
6
  "repository": {
@@ -8,7 +8,6 @@
8
8
  "url": "https://github.com/storm-software/powerlines.git",
9
9
  "directory": "packages/devkit/nx"
10
10
  },
11
- "type": "commonjs",
12
11
  "exports": {
13
12
  "./package.json": "./package.json",
14
13
  "./docs/*": "./docs/*",
@@ -18,6 +17,7 @@
18
17
  "./generators.json": "./generators.json",
19
18
  "./generators/*/schema.json": "./dist/src/generators/*/schema.json",
20
19
  ".": {
20
+ "types": "./src/index.ts",
21
21
  "import": {
22
22
  "types": "./dist/src/index.d.mts",
23
23
  "default": "./dist/src/index.mjs"
@@ -32,6 +32,7 @@
32
32
  }
33
33
  },
34
34
  "./index": {
35
+ "types": "./src/index.ts",
35
36
  "import": {
36
37
  "types": "./dist/src/index.d.mts",
37
38
  "default": "./dist/src/index.mjs"
@@ -46,6 +47,7 @@
46
47
  }
47
48
  },
48
49
  "./base/*": {
50
+ "types": "./src/base/*/index.ts",
49
51
  "import": {
50
52
  "types": "./dist/src/base/*.d.mts",
51
53
  "default": "./dist/src/base/*.mjs"
@@ -60,6 +62,7 @@
60
62
  }
61
63
  },
62
64
  "./types/*": {
65
+ "types": "./src/types/*/index.ts",
63
66
  "import": {
64
67
  "types": "./dist/src/types/*.d.mts",
65
68
  "default": "./dist/src/types/*.mjs"
@@ -74,6 +77,7 @@
74
77
  }
75
78
  },
76
79
  "./helpers/*": {
80
+ "types": "./src/helpers/*/index.ts",
77
81
  "import": {
78
82
  "types": "./dist/src/helpers/*.d.mts",
79
83
  "default": "./dist/src/helpers/*.mjs"
@@ -88,6 +92,7 @@
88
92
  }
89
93
  },
90
94
  "./plugin": {
95
+ "types": "./src/plugin/index.ts",
91
96
  "import": {
92
97
  "types": "./dist/src/plugin/index.d.mts",
93
98
  "default": "./dist/src/plugin/index.mjs"
@@ -102,6 +107,7 @@
102
107
  }
103
108
  },
104
109
  "./executors/*/untyped": {
110
+ "types": "./src/executors/*/untyped/index.ts",
105
111
  "import": {
106
112
  "types": "./dist/src/executors/*/untyped.d.mts",
107
113
  "default": "./dist/src/executors/*/untyped.mjs"
@@ -116,6 +122,7 @@
116
122
  }
117
123
  },
118
124
  "./generators/*/untyped": {
125
+ "types": "./src/generators/*/untyped/index.ts",
119
126
  "import": {
120
127
  "types": "./dist/src/generators/*/untyped.d.mts",
121
128
  "default": "./dist/src/generators/*/untyped.mjs"
@@ -130,6 +137,7 @@
130
137
  }
131
138
  },
132
139
  "./executors/*/executor": {
140
+ "types": "./src/executors/*/executor/index.ts",
133
141
  "import": {
134
142
  "types": "./dist/src/executors/*/executor.d.mts",
135
143
  "default": "./dist/src/executors/*/executor.mjs"
@@ -144,6 +152,7 @@
144
152
  }
145
153
  },
146
154
  "./generators/*/generator": {
155
+ "types": "./src/generators/*/generator/index.ts",
147
156
  "import": {
148
157
  "types": "./dist/src/generators/*/generator.d.mts",
149
158
  "default": "./dist/src/generators/*/generator.mjs"
@@ -174,27 +183,27 @@
174
183
  ],
175
184
  "dependencies": {
176
185
  "@nx/devkit": "^23.1.1",
177
- "@storm-software/build-tools": "^0.158.275",
178
- "@storm-software/config": "^1.138.52",
179
- "@storm-software/config-tools": "^1.190.115",
180
- "@storm-software/workspace-tools": "^1.296.95",
181
- "@stryke/env": "^0.20.120",
182
- "@stryke/fs": "^0.33.103",
183
- "@stryke/hash": "^0.13.56",
184
- "@stryke/helpers": "^0.10.42",
185
- "@stryke/path": "^0.29.29",
186
- "@stryke/string-format": "^0.17.44",
187
- "@stryke/type-checks": "^0.6.35",
186
+ "@storm-software/build-tools": "^0.158.290",
187
+ "@storm-software/config": "^1.138.66",
188
+ "@storm-software/config-tools": "^1.190.130",
189
+ "@storm-software/workspace-tools": "^1.296.115",
190
+ "@stryke/env": "^0.20.126",
191
+ "@stryke/fs": "^0.33.109",
192
+ "@stryke/hash": "^0.13.62",
193
+ "@stryke/helpers": "^0.10.47",
194
+ "@stryke/path": "^0.29.34",
195
+ "@stryke/string-format": "^0.17.49",
196
+ "@stryke/type-checks": "^0.6.40",
188
197
  "defu": "^6.1.7",
189
198
  "jiti": "^2.7.0",
190
- "powerlines": "^0.47.193"
199
+ "powerlines": "0.47.195"
191
200
  },
192
201
  "devDependencies": {
193
202
  "@nx/workspace": "23.1.0",
194
- "@storm-software/testing-tools": "^1.119.268",
195
- "@storm-software/tsup": "^0.2.273",
196
- "@storm-software/untyped": "^0.24.257",
197
- "@stryke/types": "^0.12.30",
203
+ "@storm-software/testing-tools": "^1.119.282",
204
+ "@storm-software/tsup": "^0.2.288",
205
+ "@storm-software/untyped": "^0.24.272",
206
+ "@stryke/types": "^0.12.35",
198
207
  "@types/node": "^25.9.5",
199
208
  "eslint-flat-config-utils": "^2.1.4",
200
209
  "jsonc-eslint-parser": "^2.4.2",
@@ -207,5 +216,5 @@
207
216
  "publishConfig": { "access": "public" },
208
217
  "executors": "./executors.json",
209
218
  "generators": "./generators.json",
210
- "gitHead": "1589a2d83936bacf34aa90ffae4119df0b1b6bc6"
219
+ "gitHead": "770742e702f4ff47b874db33b184c1c9e66238fd"
211
220
  }