@powerlines/nx 0.13.58 → 0.13.60

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.
@@ -3,12 +3,12 @@ let _stryke_type_checks_is_error = require("@stryke/type-checks/is-error");
3
3
  let _stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
4
4
  let defu = require("defu");
5
5
  defu = require_chunk.__toESM(defu);
6
- let jiti = require("jiti");
7
6
  let _storm_software_config_tools_logger = require("@storm-software/config-tools/logger");
8
7
  let _storm_software_workspace_tools_base_base_executor = require("@storm-software/workspace-tools/base/base-executor");
9
8
  let _stryke_helpers_omit = require("@stryke/helpers/omit");
10
9
  let _stryke_type_checks_is_set = require("@stryke/type-checks/is-set");
11
10
  let _stryke_type_checks_is_set_array = require("@stryke/type-checks/is-set-array");
11
+ let jiti = require("jiti");
12
12
 
13
13
  //#region src/base/base-executor.ts
14
14
  /**
@@ -1,12 +1,12 @@
1
1
  import { isError } from "@stryke/type-checks/is-error";
2
2
  import { isSetObject } from "@stryke/type-checks/is-set-object";
3
3
  import defu from "defu";
4
- import { createJiti } from "jiti";
5
4
  import { writeError } from "@storm-software/config-tools/logger";
6
5
  import { withRunExecutor } from "@storm-software/workspace-tools/base/base-executor";
7
6
  import { omit } from "@stryke/helpers/omit";
8
7
  import { isSet } from "@stryke/type-checks/is-set";
9
8
  import { isSetArray } from "@stryke/type-checks/is-set-array";
9
+ import { createJiti } from "jiti";
10
10
 
11
11
  //#region src/base/base-executor.ts
12
12
  /**
@@ -92,4 +92,4 @@ ${error.stack}` : "Unknown error"}`);
92
92
 
93
93
  //#endregion
94
94
  export { withExecutor as t };
95
- //# sourceMappingURL=base-executor-BGnjamCb.mjs.map
95
+ //# sourceMappingURL=base-executor-QMaDYqZn.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"base-executor-BGnjamCb.mjs","names":[],"sources":["../../src/base/base-executor.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\nimport { ExecutorContext, PromiseExecutor } from \"@nx/devkit\";\nimport { writeError } from \"@storm-software/config-tools/logger\";\nimport { StormWorkspaceConfig } from \"@storm-software/config/types\";\nimport { withRunExecutor } from \"@storm-software/workspace-tools/base/base-executor\";\nimport { BaseExecutorResult } from \"@storm-software/workspace-tools/types\";\nimport { omit } from \"@stryke/helpers/omit\";\nimport { isError } from \"@stryke/type-checks/is-error\";\nimport { isSet } from \"@stryke/type-checks/is-set\";\nimport { isSetArray } from \"@stryke/type-checks/is-set-array\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport defu from \"defu\";\nimport { createJiti } from \"jiti\";\nimport type {\n InlineConfig,\n Mode,\n OutputConfig,\n PowerlinesCommand,\n PowerlinesEngine\n} from \"powerlines\";\nimport { BaseExecutorSchema } from \"./base-executor.schema\";\n\nexport type PowerlinesExecutorContext<\n TCommand extends PowerlinesCommand = PowerlinesCommand,\n TExecutorSchema extends BaseExecutorSchema = BaseExecutorSchema\n> = ExecutorContext & {\n projectName: string;\n command: TCommand;\n options: TExecutorSchema;\n inlineConfig: InlineConfig;\n workspaceConfig: StormWorkspaceConfig;\n};\n\n/**\n * A utility function to create a Powerlines executor that can be used with the `withRunExecutor` function.\n *\n * @remarks\n * This function is designed to simplify the creation of Powerlines executors by providing a consistent interface and error handling.\n *\n * @param command - The command that the executor will handle (e.g., \"new\", \"prepare\", \"build\", etc.).\n * @param executorFn - The function that will be executed when the command is run.\n * @returns A Promise that resolves to the result of the executor function.\n */\nexport function withExecutor<\n TCommand extends PowerlinesCommand = PowerlinesCommand,\n TExecutorSchema extends BaseExecutorSchema = BaseExecutorSchema\n>(\n command: TCommand,\n executorFn: (\n context: PowerlinesExecutorContext<TCommand, TExecutorSchema>,\n api: PowerlinesEngine\n ) =>\n | Promise<BaseExecutorResult | null | undefined>\n | BaseExecutorResult\n | null\n | undefined\n): PromiseExecutor<TExecutorSchema> {\n return withRunExecutor(\n `Powerlines ${command} command executor`,\n async (\n options: TExecutorSchema,\n context: ExecutorContext,\n workspaceConfig: StormWorkspaceConfig\n ): Promise<BaseExecutorResult | null | undefined> => {\n if (!context.projectName) {\n throw new Error(\n \"The executor requires `projectName` on the context object.\"\n );\n }\n\n if (\n !context.projectName ||\n !context.projectsConfigurations?.projects ||\n !context.projectsConfigurations.projects[context.projectName] ||\n !context.projectsConfigurations.projects[context.projectName]?.root\n ) {\n throw new Error(\n \"The executor requires `projectsConfigurations` on the context object.\"\n );\n }\n\n const projectConfig =\n context.projectsConfigurations.projects[context.projectName]!;\n\n const jiti = createJiti(context.root, { cache: false });\n const { createPowerlines } = await jiti.import<{\n createPowerlines: typeof import(\"powerlines\").createPowerlines;\n }>(jiti.esmResolve(\"powerlines\"));\n\n const api = await createPowerlines({\n cwd: context.root,\n root: projectConfig.root\n });\n\n try {\n return await Promise.resolve(\n executorFn(\n defu(\n {\n projectName: context.projectName,\n options,\n workspaceConfig,\n command,\n inlineConfig: defu(\n {\n name: context.projectName,\n command,\n root: projectConfig.root,\n configFile: options.configFile || options.config,\n projectType: projectConfig.projectType,\n mode: options.mode as Mode,\n output: {\n path: options.outputPath,\n copy:\n options.copyPath === false\n ? false\n : {\n path: options.copyPath,\n assets: options.assets\n },\n minify: options.minify,\n sourceMap: options.sourceMap\n } as OutputConfig,\n resolve:\n isSetArray(options.external) ||\n isSetArray(options.noExternal) ||\n isSet(options.skipNodeModulesBundle)\n ? {\n external: isSetArray(options.external)\n ? options.external\n : undefined,\n noExternal: isSetArray(options.noExternal)\n ? options.noExternal\n : undefined,\n skipNodeModulesBundle: isSet(\n options.skipNodeModulesBundle\n )\n ? options.skipNodeModulesBundle\n : undefined\n }\n : undefined,\n define: isSetObject(options.define)\n ? options.define\n : undefined,\n assets: isSetObject(options.assets)\n ? options.assets\n : undefined\n },\n omit(options, [\n \"config\",\n \"configFile\",\n \"outputPath\",\n \"copyPath\",\n \"sourceMap\",\n \"minify\",\n \"format\",\n \"external\",\n \"noExternal\",\n \"skipNodeModulesBundle\",\n \"mode\",\n \"define\",\n \"assets\"\n ])\n ) as InlineConfig\n },\n context\n ),\n api\n )\n );\n } catch (error) {\n writeError(\n `An error occurred while executing the Powerlines ${\n command\n } command executor: ${\n isError(error)\n ? `${error.message}\n\n${error.stack}`\n : \"Unknown error\"\n }`\n );\n\n return { success: false };\n }\n },\n {\n skipReadingConfig: false,\n hooks: {\n applyDefaultOptions: (options: Partial<TExecutorSchema>) => {\n options.copyPath ??= \"dist/{projectRoot}\";\n\n return options as TExecutorSchema;\n }\n }\n }\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA4DA,SAAgB,aAId,SACA,YAQkC;AAClC,QAAO,gBACL,cAAc,QAAQ,oBACtB,OACE,SACA,SACA,oBACmD;AACnD,MAAI,CAAC,QAAQ,YACX,OAAM,IAAI,MACR,6DACD;AAGH,MACE,CAAC,QAAQ,eACT,CAAC,QAAQ,wBAAwB,YACjC,CAAC,QAAQ,uBAAuB,SAAS,QAAQ,gBACjD,CAAC,QAAQ,uBAAuB,SAAS,QAAQ,cAAc,KAE/D,OAAM,IAAI,MACR,wEACD;EAGH,MAAM,gBACJ,QAAQ,uBAAuB,SAAS,QAAQ;EAElD,MAAM,OAAO,WAAW,QAAQ,MAAM,EAAE,OAAO,OAAO,CAAC;EACvD,MAAM,EAAE,qBAAqB,MAAM,KAAK,OAErC,KAAK,WAAW,aAAa,CAAC;EAEjC,MAAM,MAAM,MAAM,iBAAiB;GACjC,KAAK,QAAQ;GACb,MAAM,cAAc;GACrB,CAAC;AAEF,MAAI;AACF,UAAO,MAAM,QAAQ,QACnB,WACE,KACE;IACE,aAAa,QAAQ;IACrB;IACA;IACA;IACA,cAAc,KACZ;KACE,MAAM,QAAQ;KACd;KACA,MAAM,cAAc;KACpB,YAAY,QAAQ,cAAc,QAAQ;KAC1C,aAAa,cAAc;KAC3B,MAAM,QAAQ;KACd,QAAQ;MACN,MAAM,QAAQ;MACd,MACE,QAAQ,aAAa,QACjB,QACA;OACE,MAAM,QAAQ;OACd,QAAQ,QAAQ;OACjB;MACP,QAAQ,QAAQ;MAChB,WAAW,QAAQ;MACpB;KACD,SACE,WAAW,QAAQ,SAAS,IAC5B,WAAW,QAAQ,WAAW,IAC9B,MAAM,QAAQ,sBAAsB,GAChC;MACE,UAAU,WAAW,QAAQ,SAAS,GAClC,QAAQ,WACR;MACJ,YAAY,WAAW,QAAQ,WAAW,GACtC,QAAQ,aACR;MACJ,uBAAuB,MACrB,QAAQ,sBACT,GACG,QAAQ,wBACR;MACL,GACD;KACN,QAAQ,YAAY,QAAQ,OAAO,GAC/B,QAAQ,SACR;KACJ,QAAQ,YAAY,QAAQ,OAAO,GAC/B,QAAQ,SACR;KACL,EACD,KAAK,SAAS;KACZ;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACD,CAAC,CACH;IACF,EACD,QACD,EACD,IACD,CACF;WACM,OAAO;AACd,cACE,oDACE,QACD,qBACC,QAAQ,MAAM,GACV,GAAG,MAAM,QAAQ;;EAE/B,MAAM,UACQ,kBAEP;AAED,UAAO,EAAE,SAAS,OAAO;;IAG7B;EACE,mBAAmB;EACnB,OAAO,EACL,sBAAsB,YAAsC;AAC1D,WAAQ,aAAa;AAErB,UAAO;KAEV;EACF,CACF"}
1
+ {"version":3,"file":"base-executor-QMaDYqZn.mjs","names":[],"sources":["../../src/base/base-executor.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\nimport { ExecutorContext, PromiseExecutor } from \"@nx/devkit\";\nimport { writeError } from \"@storm-software/config-tools/logger\";\nimport { StormWorkspaceConfig } from \"@storm-software/config/types\";\nimport { withRunExecutor } from \"@storm-software/workspace-tools/base/base-executor\";\nimport { BaseExecutorResult } from \"@storm-software/workspace-tools/types\";\nimport { omit } from \"@stryke/helpers/omit\";\nimport { isError } from \"@stryke/type-checks/is-error\";\nimport { isSet } from \"@stryke/type-checks/is-set\";\nimport { isSetArray } from \"@stryke/type-checks/is-set-array\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport defu from \"defu\";\nimport { createJiti } from \"jiti\";\nimport type {\n InlineConfig,\n Mode,\n OutputConfig,\n PowerlinesCommand,\n PowerlinesEngine\n} from \"powerlines\";\nimport { BaseExecutorSchema } from \"./base-executor.schema\";\n\nexport type PowerlinesExecutorContext<\n TCommand extends PowerlinesCommand = PowerlinesCommand,\n TExecutorSchema extends BaseExecutorSchema = BaseExecutorSchema\n> = ExecutorContext & {\n projectName: string;\n command: TCommand;\n options: TExecutorSchema;\n inlineConfig: InlineConfig;\n workspaceConfig: StormWorkspaceConfig;\n};\n\n/**\n * A utility function to create a Powerlines executor that can be used with the `withRunExecutor` function.\n *\n * @remarks\n * This function is designed to simplify the creation of Powerlines executors by providing a consistent interface and error handling.\n *\n * @param command - The command that the executor will handle (e.g., \"new\", \"prepare\", \"build\", etc.).\n * @param executorFn - The function that will be executed when the command is run.\n * @returns A Promise that resolves to the result of the executor function.\n */\nexport function withExecutor<\n TCommand extends PowerlinesCommand = PowerlinesCommand,\n TExecutorSchema extends BaseExecutorSchema = BaseExecutorSchema\n>(\n command: TCommand,\n executorFn: (\n context: PowerlinesExecutorContext<TCommand, TExecutorSchema>,\n api: PowerlinesEngine\n ) =>\n | Promise<BaseExecutorResult | null | undefined>\n | BaseExecutorResult\n | null\n | undefined\n): PromiseExecutor<TExecutorSchema> {\n return withRunExecutor(\n `Powerlines ${command} command executor`,\n async (\n options: TExecutorSchema,\n context: ExecutorContext,\n workspaceConfig: StormWorkspaceConfig\n ): Promise<BaseExecutorResult | null | undefined> => {\n if (!context.projectName) {\n throw new Error(\n \"The executor requires `projectName` on the context object.\"\n );\n }\n\n if (\n !context.projectName ||\n !context.projectsConfigurations?.projects ||\n !context.projectsConfigurations.projects[context.projectName] ||\n !context.projectsConfigurations.projects[context.projectName]?.root\n ) {\n throw new Error(\n \"The executor requires `projectsConfigurations` on the context object.\"\n );\n }\n\n const projectConfig =\n context.projectsConfigurations.projects[context.projectName]!;\n\n const jiti = createJiti(context.root, { cache: false });\n const { createPowerlines } = await jiti.import<{\n createPowerlines: typeof import(\"powerlines\").createPowerlines;\n }>(jiti.esmResolve(\"powerlines\"));\n\n const api = await createPowerlines({\n cwd: context.root,\n root: projectConfig.root\n });\n\n try {\n return await Promise.resolve(\n executorFn(\n defu(\n {\n projectName: context.projectName,\n options,\n workspaceConfig,\n command,\n inlineConfig: defu(\n {\n name: context.projectName,\n command,\n root: projectConfig.root,\n configFile: options.configFile || options.config,\n projectType: projectConfig.projectType,\n mode: options.mode as Mode,\n output: {\n path: options.outputPath,\n copy:\n options.copyPath === false\n ? false\n : {\n path: options.copyPath,\n assets: options.assets\n },\n minify: options.minify,\n sourceMap: options.sourceMap\n } as OutputConfig,\n resolve:\n isSetArray(options.external) ||\n isSetArray(options.noExternal) ||\n isSet(options.skipNodeModulesBundle)\n ? {\n external: isSetArray(options.external)\n ? options.external\n : undefined,\n noExternal: isSetArray(options.noExternal)\n ? options.noExternal\n : undefined,\n skipNodeModulesBundle: isSet(\n options.skipNodeModulesBundle\n )\n ? options.skipNodeModulesBundle\n : undefined\n }\n : undefined,\n define: isSetObject(options.define)\n ? options.define\n : undefined,\n assets: isSetObject(options.assets)\n ? options.assets\n : undefined\n },\n omit(options, [\n \"config\",\n \"configFile\",\n \"outputPath\",\n \"copyPath\",\n \"sourceMap\",\n \"minify\",\n \"format\",\n \"external\",\n \"noExternal\",\n \"skipNodeModulesBundle\",\n \"mode\",\n \"define\",\n \"assets\"\n ])\n ) as InlineConfig\n },\n context\n ),\n api\n )\n );\n } catch (error) {\n writeError(\n `An error occurred while executing the Powerlines ${\n command\n } command executor: ${\n isError(error)\n ? `${error.message}\n\n${error.stack}`\n : \"Unknown error\"\n }`\n );\n\n return { success: false };\n }\n },\n {\n skipReadingConfig: false,\n hooks: {\n applyDefaultOptions: (options: Partial<TExecutorSchema>) => {\n options.copyPath ??= \"dist/{projectRoot}\";\n\n return options as TExecutorSchema;\n }\n }\n }\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA4DA,SAAgB,aAId,SACA,YAQkC;AAClC,QAAO,gBACL,cAAc,QAAQ,oBACtB,OACE,SACA,SACA,oBACmD;AACnD,MAAI,CAAC,QAAQ,YACX,OAAM,IAAI,MACR,6DACD;AAGH,MACE,CAAC,QAAQ,eACT,CAAC,QAAQ,wBAAwB,YACjC,CAAC,QAAQ,uBAAuB,SAAS,QAAQ,gBACjD,CAAC,QAAQ,uBAAuB,SAAS,QAAQ,cAAc,KAE/D,OAAM,IAAI,MACR,wEACD;EAGH,MAAM,gBACJ,QAAQ,uBAAuB,SAAS,QAAQ;EAElD,MAAM,OAAO,WAAW,QAAQ,MAAM,EAAE,OAAO,OAAO,CAAC;EACvD,MAAM,EAAE,qBAAqB,MAAM,KAAK,OAErC,KAAK,WAAW,aAAa,CAAC;EAEjC,MAAM,MAAM,MAAM,iBAAiB;GACjC,KAAK,QAAQ;GACb,MAAM,cAAc;GACrB,CAAC;AAEF,MAAI;AACF,UAAO,MAAM,QAAQ,QACnB,WACE,KACE;IACE,aAAa,QAAQ;IACrB;IACA;IACA;IACA,cAAc,KACZ;KACE,MAAM,QAAQ;KACd;KACA,MAAM,cAAc;KACpB,YAAY,QAAQ,cAAc,QAAQ;KAC1C,aAAa,cAAc;KAC3B,MAAM,QAAQ;KACd,QAAQ;MACN,MAAM,QAAQ;MACd,MACE,QAAQ,aAAa,QACjB,QACA;OACE,MAAM,QAAQ;OACd,QAAQ,QAAQ;OACjB;MACP,QAAQ,QAAQ;MAChB,WAAW,QAAQ;MACpB;KACD,SACE,WAAW,QAAQ,SAAS,IAC5B,WAAW,QAAQ,WAAW,IAC9B,MAAM,QAAQ,sBAAsB,GAChC;MACE,UAAU,WAAW,QAAQ,SAAS,GAClC,QAAQ,WACR;MACJ,YAAY,WAAW,QAAQ,WAAW,GACtC,QAAQ,aACR;MACJ,uBAAuB,MACrB,QAAQ,sBACT,GACG,QAAQ,wBACR;MACL,GACD;KACN,QAAQ,YAAY,QAAQ,OAAO,GAC/B,QAAQ,SACR;KACJ,QAAQ,YAAY,QAAQ,OAAO,GAC/B,QAAQ,SACR;KACL,EACD,KAAK,SAAS;KACZ;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACD,CAAC,CACH;IACF,EACD,QACD,EACD,IACD,CACF;WACM,OAAO;AACd,cACE,oDACE,QACD,qBACC,QAAQ,MAAM,GACV,GAAG,MAAM,QAAQ;;EAE/B,MAAM,UACQ,kBAEP;AAED,UAAO,EAAE,SAAS,OAAO;;IAG7B;EACE,mBAAmB;EACnB,OAAO,EACL,sBAAsB,YAAsC;AAC1D,WAAQ,aAAa;AAErB,UAAO;KAEV;EACF,CACF"}
@@ -1,4 +1,4 @@
1
- const require_base_executor = require('../../base-executor-C0QbzjWv.js');
1
+ const require_base_executor = require('../../base-executor-CYB3QQu6.js');
2
2
 
3
3
  //#region src/executors/build/executor.ts
4
4
  async function executorFn(context, api) {
@@ -1,4 +1,4 @@
1
- import { t as withExecutor } from "../../base-executor-BGnjamCb.mjs";
1
+ import { t as withExecutor } from "../../base-executor-QMaDYqZn.mjs";
2
2
 
3
3
  //#region src/executors/build/executor.ts
4
4
  async function executorFn(context, api) {
@@ -1,4 +1,4 @@
1
- const require_base_executor = require('../../base-executor-C0QbzjWv.js');
1
+ const require_base_executor = require('../../base-executor-CYB3QQu6.js');
2
2
 
3
3
  //#region src/executors/clean/executor.ts
4
4
  async function executorFn(context, api) {
@@ -1,4 +1,4 @@
1
- import { t as withExecutor } from "../../base-executor-BGnjamCb.mjs";
1
+ import { t as withExecutor } from "../../base-executor-QMaDYqZn.mjs";
2
2
 
3
3
  //#region src/executors/clean/executor.ts
4
4
  async function executorFn(context, api) {
@@ -1,4 +1,4 @@
1
- const require_base_executor = require('../../base-executor-C0QbzjWv.js');
1
+ const require_base_executor = require('../../base-executor-CYB3QQu6.js');
2
2
 
3
3
  //#region src/executors/docs/executor.ts
4
4
  async function executorFn(context, api) {
@@ -1,4 +1,4 @@
1
- import { t as withExecutor } from "../../base-executor-BGnjamCb.mjs";
1
+ import { t as withExecutor } from "../../base-executor-QMaDYqZn.mjs";
2
2
 
3
3
  //#region src/executors/docs/executor.ts
4
4
  async function executorFn(context, api) {
@@ -1,4 +1,4 @@
1
- const require_base_executor = require('../../base-executor-C0QbzjWv.js');
1
+ const require_base_executor = require('../../base-executor-CYB3QQu6.js');
2
2
 
3
3
  //#region src/executors/lint/executor.ts
4
4
  async function executorFn(context, api) {
@@ -1,4 +1,4 @@
1
- import { t as withExecutor } from "../../base-executor-BGnjamCb.mjs";
1
+ import { t as withExecutor } from "../../base-executor-QMaDYqZn.mjs";
2
2
 
3
3
  //#region src/executors/lint/executor.ts
4
4
  async function executorFn(context, api) {
@@ -1,4 +1,4 @@
1
- const require_base_executor = require('../../base-executor-C0QbzjWv.js');
1
+ const require_base_executor = require('../../base-executor-CYB3QQu6.js');
2
2
 
3
3
  //#region src/executors/prepare/executor.ts
4
4
  async function executorFn(context, api) {
@@ -1,4 +1,4 @@
1
- import { t as withExecutor } from "../../base-executor-BGnjamCb.mjs";
1
+ import { t as withExecutor } from "../../base-executor-QMaDYqZn.mjs";
2
2
 
3
3
  //#region src/executors/prepare/executor.ts
4
4
  async function executorFn(context, api) {
@@ -1 +1 @@
1
- {"version":3,"file":"plugin-utilities.d.mts","names":[],"sources":["../../../src/helpers/plugin-utilities.ts"],"mappings":";;;;;;AAuEA;;;;iBAAgB,iBAAA,CAAkB,SAAA;AAUlC;;;;;AAMA;AANA,iBAAgB,iBAAA,CAAkB,SAAA;AAAA,UAMjB,qBAAA;EAAqB;;;;;;AA+CtC;;EAtCE,IAAA;EAuCiB;;;;;;;;EA7BjB,eAAA;EA6BmC;;;;;;;;EAnBnC,SAAA;AAAA;;;;;;;iBAkBc,cAAA,kBACG,eAAA,GAAkB,eAAA,CAAA,CACnC,IAAA,GAAO,qBAAA,GAAwB,aAAA,CAAc,QAAA"}
1
+ {"version":3,"file":"plugin-utilities.d.mts","names":[],"sources":["../../../src/helpers/plugin-utilities.ts"],"mappings":";;;;;;AA6DA;;;;iBAAgB,iBAAA,CAAkB,SAAA;AAUlC;;;;;AAMA;AANA,iBAAgB,iBAAA,CAAkB,SAAA;AAAA,UAMjB,qBAAA;EAAqB;;;;;;AA+CtC;;EAtCE,IAAA;EAuCiB;;;;;;;;EA7BjB,eAAA;EA6BmC;;;;;;;;EAnBnC,SAAA;AAAA;;;;;;;iBAkBc,cAAA,kBACG,eAAA,GAAkB,eAAA,CAAA,CACnC,IAAA,GAAO,qBAAA,GAAwB,aAAA,CAAc,QAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"plugin-utilities.d.ts","names":[],"sources":["../../../src/helpers/plugin-utilities.ts"],"mappings":";;;;;;AAuEA;;;;iBAAgB,iBAAA,CAAkB,SAAA;AAUlC;;;;;AAMA;AANA,iBAAgB,iBAAA,CAAkB,SAAA;AAAA,UAMjB,qBAAA;EAAqB;;;;;;AA+CtC;;EAtCE,IAAA;EAuCiB;;;;;;;;EA7BjB,eAAA;EA6BmC;;;;;;;;EAnBnC,SAAA;AAAA;;;;;;;iBAkBc,cAAA,kBACG,eAAA,GAAkB,eAAA,CAAA,CACnC,IAAA,GAAO,qBAAA,GAAwB,aAAA,CAAc,QAAA"}
1
+ {"version":3,"file":"plugin-utilities.d.ts","names":[],"sources":["../../../src/helpers/plugin-utilities.ts"],"mappings":";;;;;;AA6DA;;;;iBAAgB,iBAAA,CAAkB,SAAA;AAUlC;;;;;AAMA;AANA,iBAAgB,iBAAA,CAAkB,SAAA;AAAA,UAMjB,qBAAA;EAAqB;;;;;;AA+CtC;;EAtCE,IAAA;EAuCiB;;;;;;;;EA7BjB,eAAA;EA6BmC;;;;;;;;EAnBnC,SAAA;AAAA;;;;;;;iBAkBc,cAAA,kBACG,eAAA,GAAkB,eAAA,CAAA,CACnC,IAAA,GAAO,qBAAA,GAAwB,aAAA,CAAc,QAAA"}
@@ -5,7 +5,6 @@ let _stryke_type_checks_is_error = require("@stryke/type-checks/is-error");
5
5
  let _stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
6
6
  let defu = require("defu");
7
7
  defu = require_runtime.__toESM(defu);
8
- let jiti = require("jiti");
9
8
  let _nx_devkit = require("@nx/devkit");
10
9
  let _storm_software_workspace_tools_utils_nx_json = require("@storm-software/workspace-tools/utils/nx-json");
11
10
  let _storm_software_workspace_tools_utils_plugin_helpers = require("@storm-software/workspace-tools/utils/plugin-helpers");
@@ -13,9 +12,7 @@ let _storm_software_workspace_tools_utils_project_tags = require("@storm-softwar
13
12
  let _stryke_env_environment_checks = require("@stryke/env/environment-checks");
14
13
  let _stryke_env_get_env_paths = require("@stryke/env/get-env-paths");
15
14
  let _stryke_fs_exists = require("@stryke/fs/exists");
16
- let _stryke_hash = require("@stryke/hash");
17
15
  let _stryke_path_join_paths = require("@stryke/path/join-paths");
18
- let _stryke_string_format_camel_case = require("@stryke/string-format/camel-case");
19
16
  let _stryke_string_format_kebab_case = require("@stryke/string-format/kebab-case");
20
17
  let _stryke_string_format_title_case = require("@stryke/string-format/title-case");
21
18
  let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
@@ -58,25 +55,12 @@ function createNxPlugin(opts) {
58
55
  const pluginInputs = getNxPluginInputs(framework);
59
56
  return [pluginInputs, async (configFiles, options, contextV2) => {
60
57
  if (options?.verboseOutput) console.debug(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Initializing the ${title} for the following inputs: ${pluginInputs}`);
61
- const envPaths = (0, _stryke_env_get_env_paths.getEnvPaths)({
58
+ if (!(0, _stryke_env_get_env_paths.getEnvPaths)({
62
59
  orgId: "storm-software",
63
60
  appId: framework,
64
61
  workspaceRoot: contextV2.workspaceRoot
65
- });
66
- if (!envPaths.cache) throw new Error("The cache directory could not be determined.");
62
+ }).cache) throw new Error("The cache directory could not be determined.");
67
63
  const nxJson = (0, nx_src_config_nx_json_js.readNxJson)(contextV2.workspaceRoot);
68
- const resolver = (0, jiti.createJiti)(contextV2.workspaceRoot, {
69
- debug: !!options?.debug,
70
- interopDefault: true,
71
- fsCache: (0, _stryke_path_join_paths.joinPaths)(envPaths.cache, "nx-plugin", (0, _stryke_hash.murmurhash)(contextV2.workspaceRoot, { maxLength: 45 }), "jiti"),
72
- moduleCache: true
73
- });
74
- let loadUserConfigFile;
75
- try {
76
- loadUserConfigFile = await resolver.import(resolver.esmResolve("powerlines/config")).then((mod) => mod?.loadUserConfigFile);
77
- } catch (error) {
78
- console.warn(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Failed to load user configuration file function: ${(0, _stryke_type_checks_is_error.isError)(error) ? error.message : "Unknown error"}`);
79
- }
80
64
  return (0, _nx_devkit.createNodesFromFiles)(async (configFile, _, context) => {
81
65
  try {
82
66
  const projectRoot = (0, _storm_software_workspace_tools_utils_plugin_helpers.getProjectRoot)(configFile, contextV2.workspaceRoot);
@@ -86,15 +70,6 @@ function createNxPlugin(opts) {
86
70
  }
87
71
  const root = (0, _storm_software_workspace_tools_utils_plugin_helpers.getRoot)(projectRoot, context);
88
72
  if (options?.verboseOutput) console.debug(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Loading ${framework} user configuration for project in root directory ${projectRoot}.`);
89
- let userConfig = {};
90
- try {
91
- if (loadUserConfigFile) {
92
- const parsedConfig = await loadUserConfigFile(contextV2.workspaceRoot, projectRoot, _stryke_env_environment_checks.isDevelopment ? "development" : _stryke_env_environment_checks.isTest ? "test" : "production", "build", { name: framework }, configFile);
93
- if ((0, _stryke_type_checks_is_set_object.isSetObject)(parsedConfig)) userConfig = parsedConfig.config;
94
- }
95
- } catch (error) {
96
- console.warn(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Failed to load user configuration for project in ${projectRoot} - ${(0, _stryke_type_checks_is_error.isError)(error) ? error.message : (0, _stryke_type_checks_is_set_string.isSetString)(error) ? error : "Unknown error"} \n\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.${(0, _stryke_type_checks_is_error.isError)(error) && error.stack ? `\n\nStack trace:\n${error.stack}` : ""}`);
97
- }
98
73
  if (!(0, _stryke_fs_exists.existsSync)((0, _stryke_path_join_paths.joinPaths)(contextV2.workspaceRoot, projectRoot, "package.json"))) {
99
74
  if (options?.verboseOutput) console.warn(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Cannot find \`package.json\` file in the project's root directory (path: "${(0, _stryke_path_join_paths.joinPaths)(contextV2.workspaceRoot, projectRoot)}"). Skipping project configuration.`);
100
75
  return {};
@@ -105,10 +80,6 @@ function createNxPlugin(opts) {
105
80
  return {};
106
81
  }
107
82
  const packageJson = JSON.parse(packageJsonContent);
108
- if (!(userConfig && Object.keys(userConfig).length > 0) && !packageJson?.[(0, _stryke_string_format_camel_case.camelCase)(framework)]) {
109
- if (options?.verboseOutput) console.debug(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Skipping ${projectRoot} - no ${framework} configuration found for project in root directory.`);
110
- return {};
111
- }
112
83
  const projectConfig = (0, _storm_software_workspace_tools_utils_plugin_helpers.getProjectConfigFromProjectRoot)(projectRoot, packageJson);
113
84
  if (!projectConfig) {
114
85
  if (options?.verboseOutput) console.warn(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - No project configuration found for project in root directory ${projectRoot}`);
@@ -164,7 +135,7 @@ function createNxPlugin(opts) {
164
135
  inputs: Array.isArray(options?.build?.inputs) ? options.build.inputs : (0, _storm_software_workspace_tools_utils_nx_json.withNamedInputs)(targetInputs, [options?.build?.inputs || "typescript"]),
165
136
  outputs: options?.build?.outputs ?? ["{options.outputPath}"],
166
137
  executor: options?.build?.executor || `@${framework}/nx:${options?.build?.targetName || "build"}`,
167
- dependsOn: options?.build?.dependsOn ?? [`^${options?.build?.targetName || "build"}`, userConfig.skipCache || _stryke_env_environment_checks.isDevelopment ? void 0 : (0, _stryke_type_checks_is_set_object.isSetObject)(options?.prepare) && options?.prepare?.targetName ? options?.prepare?.targetName : "prepare"].filter(Boolean),
138
+ dependsOn: options?.build?.dependsOn ?? [`^${options?.build?.targetName || "build"}`, _stryke_env_environment_checks.isDevelopment ? void 0 : (0, _stryke_type_checks_is_set_object.isSetObject)(options?.prepare) && options?.prepare?.targetName ? options?.prepare?.targetName : "prepare"].filter(Boolean),
168
139
  defaultConfiguration: options?.build?.defaultConfiguration || "production",
169
140
  options: {
170
141
  projectType: projectConfig.projectType,
@@ -185,7 +156,7 @@ function createNxPlugin(opts) {
185
156
  inputs: Array.isArray(options?.lint?.inputs) ? options.lint.inputs : (0, _storm_software_workspace_tools_utils_nx_json.withNamedInputs)([...targetInputs, artifactsFolder], options?.lint?.inputs ? [options.lint.inputs] : ["linting", "typescript"]),
186
157
  outputs: options?.lint?.outputs ?? ["{options.outputPath}"],
187
158
  executor: options?.lint?.executor || `@${framework}/nx:${options?.lint?.targetName || "lint"}`,
188
- dependsOn: options?.lint?.dependsOn ?? [`^${options?.lint?.targetName || "lint"}`, userConfig.skipCache || _stryke_env_environment_checks.isDevelopment ? void 0 : (0, _stryke_type_checks_is_set_object.isSetObject)(options?.prepare) && options?.prepare?.targetName ? options?.prepare?.targetName : "prepare"].filter(Boolean),
159
+ dependsOn: options?.lint?.dependsOn ?? [`^${options?.lint?.targetName || "lint"}`, _stryke_env_environment_checks.isDevelopment ? void 0 : (0, _stryke_type_checks_is_set_object.isSetObject)(options?.prepare) && options?.prepare?.targetName ? options?.prepare?.targetName : "prepare"].filter(Boolean),
189
160
  defaultConfiguration: options?.lint?.defaultConfiguration || "production",
190
161
  options: {
191
162
  projectType: projectConfig.projectType,
@@ -209,7 +180,7 @@ function createNxPlugin(opts) {
209
180
  dependsOn: options?.docs?.dependsOn ?? [
210
181
  `^${options?.docs?.targetName || "docs"}`,
211
182
  options?.build !== false && `${options?.build?.targetName || "build"}`,
212
- userConfig.skipCache || _stryke_env_environment_checks.isDevelopment ? void 0 : (0, _stryke_type_checks_is_set_object.isSetObject)(options?.prepare) && options?.prepare?.targetName ? options?.prepare?.targetName : "prepare"
183
+ _stryke_env_environment_checks.isDevelopment ? void 0 : (0, _stryke_type_checks_is_set_object.isSetObject)(options?.prepare) && options?.prepare?.targetName ? options?.prepare?.targetName : "prepare"
213
184
  ].filter(Boolean),
214
185
  defaultConfiguration: options?.docs?.defaultConfiguration || "production",
215
186
  options: {
@@ -234,7 +205,7 @@ function createNxPlugin(opts) {
234
205
  dependsOn: options?.deploy?.dependsOn ?? [
235
206
  `^${options?.deploy?.targetName || "deploy"}`,
236
207
  options?.build !== false && `${options?.build?.targetName || "build"}`,
237
- userConfig.skipCache || _stryke_env_environment_checks.isDevelopment ? void 0 : (0, _stryke_type_checks_is_set_object.isSetObject)(options?.prepare) && options?.prepare?.targetName ? options?.prepare?.targetName : "prepare"
208
+ _stryke_env_environment_checks.isDevelopment ? void 0 : (0, _stryke_type_checks_is_set_object.isSetObject)(options?.prepare) && options?.prepare?.targetName ? options?.prepare?.targetName : "prepare"
238
209
  ].filter(Boolean),
239
210
  defaultConfiguration: options?.deploy?.defaultConfiguration || "production",
240
211
  options: {
@@ -255,7 +226,6 @@ function createNxPlugin(opts) {
255
226
  (0, _storm_software_workspace_tools_utils_project_tags.addProjectTag)(projectConfig, framework, projectConfig.projectType || "library", { overwrite: true });
256
227
  if (options?.verboseOutput) console.debug(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Completed preparing Nx configuration for project in root directory ${projectRoot}.`);
257
228
  return { projects: { [root]: (0, defu.default)(projectConfig, {
258
- name: (0, _stryke_string_format_kebab_case.kebabCase)(userConfig.name),
259
229
  projectType: projectConfig.projectType || "library",
260
230
  root,
261
231
  sourceRoot: (0, _stryke_path_join_paths.joinPaths)(root, "src"),
@@ -2,17 +2,14 @@ import { CONFIG_INPUTS } from "./constants.mjs";
2
2
  import { isError } from "@stryke/type-checks/is-error";
3
3
  import { isSetObject } from "@stryke/type-checks/is-set-object";
4
4
  import defu from "defu";
5
- import { createJiti } from "jiti";
6
5
  import { createNodesFromFiles } from "@nx/devkit";
7
6
  import { withNamedInputs } from "@storm-software/workspace-tools/utils/nx-json";
8
7
  import { getProjectConfigFromProjectRoot, getProjectRoot, getRoot } from "@storm-software/workspace-tools/utils/plugin-helpers";
9
8
  import { addProjectTag, setDefaultProjectTags } from "@storm-software/workspace-tools/utils/project-tags";
10
- import { isDevelopment, isTest } from "@stryke/env/environment-checks";
9
+ import { isDevelopment } from "@stryke/env/environment-checks";
11
10
  import { getEnvPaths } from "@stryke/env/get-env-paths";
12
11
  import { existsSync } from "@stryke/fs/exists";
13
- import { murmurhash } from "@stryke/hash";
14
12
  import { joinPaths } from "@stryke/path/join-paths";
15
- import { camelCase } from "@stryke/string-format/camel-case";
16
13
  import { kebabCase } from "@stryke/string-format/kebab-case";
17
14
  import { titleCase } from "@stryke/string-format/title-case";
18
15
  import { isSetString } from "@stryke/type-checks/is-set-string";
@@ -55,25 +52,12 @@ function createNxPlugin(opts) {
55
52
  const pluginInputs = getNxPluginInputs(framework);
56
53
  return [pluginInputs, async (configFiles, options, contextV2) => {
57
54
  if (options?.verboseOutput) console.debug(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Initializing the ${title} for the following inputs: ${pluginInputs}`);
58
- const envPaths = getEnvPaths({
55
+ if (!getEnvPaths({
59
56
  orgId: "storm-software",
60
57
  appId: framework,
61
58
  workspaceRoot: contextV2.workspaceRoot
62
- });
63
- if (!envPaths.cache) throw new Error("The cache directory could not be determined.");
59
+ }).cache) throw new Error("The cache directory could not be determined.");
64
60
  const nxJson = readNxJson(contextV2.workspaceRoot);
65
- const resolver = createJiti(contextV2.workspaceRoot, {
66
- debug: !!options?.debug,
67
- interopDefault: true,
68
- fsCache: joinPaths(envPaths.cache, "nx-plugin", murmurhash(contextV2.workspaceRoot, { maxLength: 45 }), "jiti"),
69
- moduleCache: true
70
- });
71
- let loadUserConfigFile;
72
- try {
73
- loadUserConfigFile = await resolver.import(resolver.esmResolve("powerlines/config")).then((mod) => mod?.loadUserConfigFile);
74
- } catch (error) {
75
- console.warn(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Failed to load user configuration file function: ${isError(error) ? error.message : "Unknown error"}`);
76
- }
77
61
  return createNodesFromFiles(async (configFile, _, context) => {
78
62
  try {
79
63
  const projectRoot = getProjectRoot(configFile, contextV2.workspaceRoot);
@@ -83,15 +67,6 @@ function createNxPlugin(opts) {
83
67
  }
84
68
  const root = getRoot(projectRoot, context);
85
69
  if (options?.verboseOutput) console.debug(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Loading ${framework} user configuration for project in root directory ${projectRoot}.`);
86
- let userConfig = {};
87
- try {
88
- if (loadUserConfigFile) {
89
- const parsedConfig = await loadUserConfigFile(contextV2.workspaceRoot, projectRoot, isDevelopment ? "development" : isTest ? "test" : "production", "build", { name: framework }, configFile);
90
- if (isSetObject(parsedConfig)) userConfig = parsedConfig.config;
91
- }
92
- } catch (error) {
93
- console.warn(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Failed to load user configuration for project in ${projectRoot} - ${isError(error) ? error.message : isSetString(error) ? error : "Unknown error"} \n\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.${isError(error) && error.stack ? `\n\nStack trace:\n${error.stack}` : ""}`);
94
- }
95
70
  if (!existsSync(joinPaths(contextV2.workspaceRoot, projectRoot, "package.json"))) {
96
71
  if (options?.verboseOutput) console.warn(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Cannot find \`package.json\` file in the project's root directory (path: "${joinPaths(contextV2.workspaceRoot, projectRoot)}"). Skipping project configuration.`);
97
72
  return {};
@@ -102,10 +77,6 @@ function createNxPlugin(opts) {
102
77
  return {};
103
78
  }
104
79
  const packageJson = JSON.parse(packageJsonContent);
105
- if (!(userConfig && Object.keys(userConfig).length > 0) && !packageJson?.[camelCase(framework)]) {
106
- if (options?.verboseOutput) console.debug(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Skipping ${projectRoot} - no ${framework} configuration found for project in root directory.`);
107
- return {};
108
- }
109
80
  const projectConfig = getProjectConfigFromProjectRoot(projectRoot, packageJson);
110
81
  if (!projectConfig) {
111
82
  if (options?.verboseOutput) console.warn(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - No project configuration found for project in root directory ${projectRoot}`);
@@ -161,7 +132,7 @@ function createNxPlugin(opts) {
161
132
  inputs: Array.isArray(options?.build?.inputs) ? options.build.inputs : withNamedInputs(targetInputs, [options?.build?.inputs || "typescript"]),
162
133
  outputs: options?.build?.outputs ?? ["{options.outputPath}"],
163
134
  executor: options?.build?.executor || `@${framework}/nx:${options?.build?.targetName || "build"}`,
164
- dependsOn: options?.build?.dependsOn ?? [`^${options?.build?.targetName || "build"}`, userConfig.skipCache || isDevelopment ? void 0 : isSetObject(options?.prepare) && options?.prepare?.targetName ? options?.prepare?.targetName : "prepare"].filter(Boolean),
135
+ dependsOn: options?.build?.dependsOn ?? [`^${options?.build?.targetName || "build"}`, isDevelopment ? void 0 : isSetObject(options?.prepare) && options?.prepare?.targetName ? options?.prepare?.targetName : "prepare"].filter(Boolean),
165
136
  defaultConfiguration: options?.build?.defaultConfiguration || "production",
166
137
  options: {
167
138
  projectType: projectConfig.projectType,
@@ -182,7 +153,7 @@ function createNxPlugin(opts) {
182
153
  inputs: Array.isArray(options?.lint?.inputs) ? options.lint.inputs : withNamedInputs([...targetInputs, artifactsFolder], options?.lint?.inputs ? [options.lint.inputs] : ["linting", "typescript"]),
183
154
  outputs: options?.lint?.outputs ?? ["{options.outputPath}"],
184
155
  executor: options?.lint?.executor || `@${framework}/nx:${options?.lint?.targetName || "lint"}`,
185
- dependsOn: options?.lint?.dependsOn ?? [`^${options?.lint?.targetName || "lint"}`, userConfig.skipCache || isDevelopment ? void 0 : isSetObject(options?.prepare) && options?.prepare?.targetName ? options?.prepare?.targetName : "prepare"].filter(Boolean),
156
+ dependsOn: options?.lint?.dependsOn ?? [`^${options?.lint?.targetName || "lint"}`, isDevelopment ? void 0 : isSetObject(options?.prepare) && options?.prepare?.targetName ? options?.prepare?.targetName : "prepare"].filter(Boolean),
186
157
  defaultConfiguration: options?.lint?.defaultConfiguration || "production",
187
158
  options: {
188
159
  projectType: projectConfig.projectType,
@@ -206,7 +177,7 @@ function createNxPlugin(opts) {
206
177
  dependsOn: options?.docs?.dependsOn ?? [
207
178
  `^${options?.docs?.targetName || "docs"}`,
208
179
  options?.build !== false && `${options?.build?.targetName || "build"}`,
209
- userConfig.skipCache || isDevelopment ? void 0 : isSetObject(options?.prepare) && options?.prepare?.targetName ? options?.prepare?.targetName : "prepare"
180
+ isDevelopment ? void 0 : isSetObject(options?.prepare) && options?.prepare?.targetName ? options?.prepare?.targetName : "prepare"
210
181
  ].filter(Boolean),
211
182
  defaultConfiguration: options?.docs?.defaultConfiguration || "production",
212
183
  options: {
@@ -231,7 +202,7 @@ function createNxPlugin(opts) {
231
202
  dependsOn: options?.deploy?.dependsOn ?? [
232
203
  `^${options?.deploy?.targetName || "deploy"}`,
233
204
  options?.build !== false && `${options?.build?.targetName || "build"}`,
234
- userConfig.skipCache || isDevelopment ? void 0 : isSetObject(options?.prepare) && options?.prepare?.targetName ? options?.prepare?.targetName : "prepare"
205
+ isDevelopment ? void 0 : isSetObject(options?.prepare) && options?.prepare?.targetName ? options?.prepare?.targetName : "prepare"
235
206
  ].filter(Boolean),
236
207
  defaultConfiguration: options?.deploy?.defaultConfiguration || "production",
237
208
  options: {
@@ -252,7 +223,6 @@ function createNxPlugin(opts) {
252
223
  addProjectTag(projectConfig, framework, projectConfig.projectType || "library", { overwrite: true });
253
224
  if (options?.verboseOutput) console.debug(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Completed preparing Nx configuration for project in root directory ${projectRoot}.`);
254
225
  return { projects: { [root]: defu(projectConfig, {
255
- name: kebabCase(userConfig.name),
256
226
  projectType: projectConfig.projectType || "library",
257
227
  root,
258
228
  sourceRoot: joinPaths(root, "src"),
@@ -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, isTest } from \"@stryke/env/environment-checks\";\nimport { getEnvPaths } from \"@stryke/env/get-env-paths\";\nimport { existsSync } from \"@stryke/fs/exists\";\nimport { murmurhash } from \"@stryke/hash\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { camelCase } from \"@stryke/string-format/camel-case\";\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 { PartialKeys } from \"@stryke/types/base\";\nimport type { PackageJson } from \"@stryke/types/package-json\";\nimport defu from \"defu\";\nimport { createJiti } from \"jiti\";\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 {\n FrameworkOptions,\n Mode,\n ParsedUserConfig,\n UserConfig\n} from \"powerlines\";\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\ntype 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 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 ([\n `^${options?.prepare?.targetName || \"build\"}`,\n options?.clean !== false &&\n `${options?.clean?.targetName || \"clean\"}`\n ].filter(Boolean) as string[]),\n defaultConfiguration:\n options?.prepare?.defaultConfiguration || \"production\",\n options: {\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?.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 userConfig.skipCache || 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 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 userConfig.skipCache || 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 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 userConfig.skipCache || 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 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 userConfig.skipCache || 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 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 name: kebabCase(userConfig.name)!,\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuEA,SAAgB,kBAAkB,WAA6B;AAC7D,QAAO,cAAc,KAAI,UAAS,MAAM,QAAQ,eAAe,UAAU,CAAC;;;;;;;;AAS5E,SAAgB,kBAAkB,WAA2B;AAC3D,QAAO,OAAO,kBAAkB,UAAU,CACvC,KAAI,UAAS,MAAM,QAAQ,kBAAkB,GAAG,CAAC,CACjD,KAAK,IAAI,CAAC;;;;;;;;AAkDf,SAAgB,eAEd,MAAuD;CACvD,MAAM,YAAY,UAAU,MAAM,UAAU,IAAI;CAChD,MAAM,QAAQ,GAAG,UAAU,UAAU,CAAC;AAEtC,KAAI;EACF,MAAM,OAAO,MAAM,QAAQ,GAAG,UAAU;EACxC,MAAM,kBACJ,MAAM,mBAAmB,kBAAkB;EAE7C,MAAM,eAAe,kBAAkB,UAAU;EACjD,MAAM,eAAe,kBAAkB,UAAU;AAEjD,SAAO,CACL,cACA,OAAO,aAAa,SAAS,cAA4C;AACvE,OAAI,SAAS,cACX,SAAQ,MACN,IAAI,MAAM,uBAAM,IAAI,MAAM,EAAC,aAAa,CAAC,sBAAsB,MAAM,6BAA6B,eACnG;GAGH,MAAM,WAAW,YAAY;IAC3B,OAAO;IACP,OAAO;IACP,eAAe,UAAU;IAC1B,CAAC;AACF,OAAI,CAAC,SAAS,MACZ,OAAM,IA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;MACA,YAAY,UAAU,MAAM,MAAM;MAClC;MACD,CAAC,EACH,EACF;aACM,OAAO;AACd,aAAQ,MACN,IAAI,MAAM,uBAAM,IAAI,MAAM,EAAC,aAAa,CAAC,2DACvC,WACD,MACC,QAAQ,MAAM,GACV,MAAM,UACN,YAAY,MAAM,GAChB,QACA,wBAET;AAED,YAAO,EAAE;;MAGb,aACA,SACA,UACD;IAEJ;UACM,OAAO;AACd,UAAQ,MACN,IAAI,MAAM,uBAAM,IAAI,MAAM,EAAC,aAAa,CAAC,KACvC,QAAQ,MAAM,GACV,MAAM,UACN,YAAY,MAAM,GAChB,QACA,qDAET;AAED,QAAM,IAAI,MACR,4BAA4B,MAAM,KAChC,QAAQ,MAAM,GACV,MAAM,UACN,YAAY,MAAM,GAChB,QACA,wCAER,EACE,OAAO,iBAAiB,QAAQ,QAAQ,QACzC,CACF"}
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 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 ([\n `^${options?.prepare?.targetName || \"build\"}`,\n options?.clean !== false &&\n `${options?.clean?.targetName || \"clean\"}`\n ].filter(Boolean) as string[]),\n defaultConfiguration:\n options?.prepare?.defaultConfiguration || \"production\",\n options: {\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?.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 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 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 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 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;AAC7D,QAAO,cAAc,KAAI,UAAS,MAAM,QAAQ,eAAe,UAAU,CAAC;;;;;;;;AAS5E,SAAgB,kBAAkB,WAA2B;AAC3D,QAAO,OAAO,kBAAkB,UAAU,CACvC,KAAI,UAAS,MAAM,QAAQ,kBAAkB,GAAG,CAAC,CACjD,KAAK,IAAI,CAAC;;;;;;;;AAkDf,SAAgB,eAEd,MAAuD;CACvD,MAAM,YAAY,UAAU,MAAM,UAAU,IAAI;CAChD,MAAM,QAAQ,GAAG,UAAU,UAAU,CAAC;AAEtC,KAAI;EACF,MAAM,OAAO,MAAM,QAAQ,GAAG,UAAU;EACxC,MAAM,kBACJ,MAAM,mBAAmB,kBAAkB;EAE7C,MAAM,eAAe,kBAAkB,UAAU;EACjD,MAAM,eAAe,kBAAkB,UAAU;AAEjD,SAAO,CACL,cACA,OAAO,aAAa,SAAS,cAA4C;AACvE,OAAI,SAAS,cACX,SAAQ,MACN,IAAI,MAAM,uBAAM,IAAI,MAAM,EAAC,aAAa,CAAC,sBAAsB,MAAM,6BAA6B,eACnG;AAQH,OAAI,CALa,YAAY;IAC3B,OAAO;IACP,OAAO;IACP,eAAe,UAAU;IAC1B,CACY,CAAC,MACZ,OAAM,IAAI,MAAM,+CAA+C;GAGjE,MAAM,SAAS,WAAW,UAAU,cAAc;AA8BlD,UAAO,qBACL,OAAO,YAAY,GAAG,YAAY;AAChC,QAAI;KACF,MAAM,cAAc,eAClB,YACA,UAAU,cACX;AACD,SAAI,CAAC,aAAa;AAChB,cAAQ,MACN,IAAI,MAAM,uBAAM,IAAI,MAAM,EAAC,aAAa,CAAC,sBACvC,UACD,6BACC,UACD,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,MAAM,GAChB,QACA,wBAET;AAED,YAAO,EAAE;;MAGb,aACA,SACA,UACD;IAEJ;UACM,OAAO;AACd,UAAQ,MACN,IAAI,MAAM,uBAAM,IAAI,MAAM,EAAC,aAAa,CAAC,KACvC,QAAQ,MAAM,GACV,MAAM,UACN,YAAY,MAAM,GAChB,QACA,qDAET;AAED,QAAM,IAAI,MACR,4BAA4B,MAAM,KAChC,QAAQ,MAAM,GACV,MAAM,UACN,YAAY,MAAM,GAChB,QACA,wCAER,EACE,OAAO,iBAAiB,QAAQ,QAAQ,QACzC,CACF"}
@@ -7,9 +7,7 @@ let _storm_software_workspace_tools_utils_project_tags = require("@storm-softwar
7
7
  let _stryke_env_environment_checks = require("@stryke/env/environment-checks");
8
8
  let _stryke_env_get_env_paths = require("@stryke/env/get-env-paths");
9
9
  let _stryke_fs_exists = require("@stryke/fs/exists");
10
- let _stryke_hash = require("@stryke/hash");
11
10
  let _stryke_path_join_paths = require("@stryke/path/join-paths");
12
- let _stryke_string_format_camel_case = require("@stryke/string-format/camel-case");
13
11
  let _stryke_string_format_kebab_case = require("@stryke/string-format/kebab-case");
14
12
  let _stryke_string_format_title_case = require("@stryke/string-format/title-case");
15
13
  let _stryke_type_checks_is_error = require("@stryke/type-checks/is-error");
@@ -17,7 +15,6 @@ let _stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-obje
17
15
  let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
18
16
  let defu = require("defu");
19
17
  defu = require_chunk.__toESM(defu);
20
- let jiti = require("jiti");
21
18
  let node_fs_promises = require("node:fs/promises");
22
19
  let nx_src_config_nx_json_js = require("nx/src/config/nx-json.js");
23
20
  let nx_src_utils_package_json_js = require("nx/src/utils/package-json.js");
@@ -89,25 +86,12 @@ function createNxPlugin(opts) {
89
86
  const pluginInputs = getNxPluginInputs(framework);
90
87
  return [pluginInputs, async (configFiles, options, contextV2) => {
91
88
  if (options?.verboseOutput) console.debug(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Initializing the ${title} for the following inputs: ${pluginInputs}`);
92
- const envPaths = (0, _stryke_env_get_env_paths.getEnvPaths)({
89
+ if (!(0, _stryke_env_get_env_paths.getEnvPaths)({
93
90
  orgId: "storm-software",
94
91
  appId: framework,
95
92
  workspaceRoot: contextV2.workspaceRoot
96
- });
97
- if (!envPaths.cache) throw new Error("The cache directory could not be determined.");
93
+ }).cache) throw new Error("The cache directory could not be determined.");
98
94
  const nxJson = (0, nx_src_config_nx_json_js.readNxJson)(contextV2.workspaceRoot);
99
- const resolver = (0, jiti.createJiti)(contextV2.workspaceRoot, {
100
- debug: !!options?.debug,
101
- interopDefault: true,
102
- fsCache: (0, _stryke_path_join_paths.joinPaths)(envPaths.cache, "nx-plugin", (0, _stryke_hash.murmurhash)(contextV2.workspaceRoot, { maxLength: 45 }), "jiti"),
103
- moduleCache: true
104
- });
105
- let loadUserConfigFile;
106
- try {
107
- loadUserConfigFile = await resolver.import(resolver.esmResolve("powerlines/config")).then((mod) => mod?.loadUserConfigFile);
108
- } catch (error) {
109
- console.warn(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Failed to load user configuration file function: ${(0, _stryke_type_checks_is_error.isError)(error) ? error.message : "Unknown error"}`);
110
- }
111
95
  return (0, _nx_devkit.createNodesFromFiles)(async (configFile, _, context) => {
112
96
  try {
113
97
  const projectRoot = (0, _storm_software_workspace_tools_utils_plugin_helpers.getProjectRoot)(configFile, contextV2.workspaceRoot);
@@ -117,15 +101,6 @@ function createNxPlugin(opts) {
117
101
  }
118
102
  const root = (0, _storm_software_workspace_tools_utils_plugin_helpers.getRoot)(projectRoot, context);
119
103
  if (options?.verboseOutput) console.debug(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Loading ${framework} user configuration for project in root directory ${projectRoot}.`);
120
- let userConfig = {};
121
- try {
122
- if (loadUserConfigFile) {
123
- const parsedConfig = await loadUserConfigFile(contextV2.workspaceRoot, projectRoot, _stryke_env_environment_checks.isDevelopment ? "development" : _stryke_env_environment_checks.isTest ? "test" : "production", "build", { name: framework }, configFile);
124
- if ((0, _stryke_type_checks_is_set_object.isSetObject)(parsedConfig)) userConfig = parsedConfig.config;
125
- }
126
- } catch (error) {
127
- console.warn(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Failed to load user configuration for project in ${projectRoot} - ${(0, _stryke_type_checks_is_error.isError)(error) ? error.message : (0, _stryke_type_checks_is_set_string.isSetString)(error) ? error : "Unknown error"} \n\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.${(0, _stryke_type_checks_is_error.isError)(error) && error.stack ? `\n\nStack trace:\n${error.stack}` : ""}`);
128
- }
129
104
  if (!(0, _stryke_fs_exists.existsSync)((0, _stryke_path_join_paths.joinPaths)(contextV2.workspaceRoot, projectRoot, "package.json"))) {
130
105
  if (options?.verboseOutput) console.warn(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Cannot find \`package.json\` file in the project's root directory (path: "${(0, _stryke_path_join_paths.joinPaths)(contextV2.workspaceRoot, projectRoot)}"). Skipping project configuration.`);
131
106
  return {};
@@ -136,10 +111,6 @@ function createNxPlugin(opts) {
136
111
  return {};
137
112
  }
138
113
  const packageJson = JSON.parse(packageJsonContent);
139
- if (!(userConfig && Object.keys(userConfig).length > 0) && !packageJson?.[(0, _stryke_string_format_camel_case.camelCase)(framework)]) {
140
- if (options?.verboseOutput) console.debug(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Skipping ${projectRoot} - no ${framework} configuration found for project in root directory.`);
141
- return {};
142
- }
143
114
  const projectConfig = (0, _storm_software_workspace_tools_utils_plugin_helpers.getProjectConfigFromProjectRoot)(projectRoot, packageJson);
144
115
  if (!projectConfig) {
145
116
  if (options?.verboseOutput) console.warn(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - No project configuration found for project in root directory ${projectRoot}`);
@@ -195,7 +166,7 @@ function createNxPlugin(opts) {
195
166
  inputs: Array.isArray(options?.build?.inputs) ? options.build.inputs : (0, _storm_software_workspace_tools_utils_nx_json.withNamedInputs)(targetInputs, [options?.build?.inputs || "typescript"]),
196
167
  outputs: options?.build?.outputs ?? ["{options.outputPath}"],
197
168
  executor: options?.build?.executor || `@${framework}/nx:${options?.build?.targetName || "build"}`,
198
- dependsOn: options?.build?.dependsOn ?? [`^${options?.build?.targetName || "build"}`, userConfig.skipCache || _stryke_env_environment_checks.isDevelopment ? void 0 : (0, _stryke_type_checks_is_set_object.isSetObject)(options?.prepare) && options?.prepare?.targetName ? options?.prepare?.targetName : "prepare"].filter(Boolean),
169
+ dependsOn: options?.build?.dependsOn ?? [`^${options?.build?.targetName || "build"}`, _stryke_env_environment_checks.isDevelopment ? void 0 : (0, _stryke_type_checks_is_set_object.isSetObject)(options?.prepare) && options?.prepare?.targetName ? options?.prepare?.targetName : "prepare"].filter(Boolean),
199
170
  defaultConfiguration: options?.build?.defaultConfiguration || "production",
200
171
  options: {
201
172
  projectType: projectConfig.projectType,
@@ -216,7 +187,7 @@ function createNxPlugin(opts) {
216
187
  inputs: Array.isArray(options?.lint?.inputs) ? options.lint.inputs : (0, _storm_software_workspace_tools_utils_nx_json.withNamedInputs)([...targetInputs, artifactsFolder], options?.lint?.inputs ? [options.lint.inputs] : ["linting", "typescript"]),
217
188
  outputs: options?.lint?.outputs ?? ["{options.outputPath}"],
218
189
  executor: options?.lint?.executor || `@${framework}/nx:${options?.lint?.targetName || "lint"}`,
219
- dependsOn: options?.lint?.dependsOn ?? [`^${options?.lint?.targetName || "lint"}`, userConfig.skipCache || _stryke_env_environment_checks.isDevelopment ? void 0 : (0, _stryke_type_checks_is_set_object.isSetObject)(options?.prepare) && options?.prepare?.targetName ? options?.prepare?.targetName : "prepare"].filter(Boolean),
190
+ dependsOn: options?.lint?.dependsOn ?? [`^${options?.lint?.targetName || "lint"}`, _stryke_env_environment_checks.isDevelopment ? void 0 : (0, _stryke_type_checks_is_set_object.isSetObject)(options?.prepare) && options?.prepare?.targetName ? options?.prepare?.targetName : "prepare"].filter(Boolean),
220
191
  defaultConfiguration: options?.lint?.defaultConfiguration || "production",
221
192
  options: {
222
193
  projectType: projectConfig.projectType,
@@ -240,7 +211,7 @@ function createNxPlugin(opts) {
240
211
  dependsOn: options?.docs?.dependsOn ?? [
241
212
  `^${options?.docs?.targetName || "docs"}`,
242
213
  options?.build !== false && `${options?.build?.targetName || "build"}`,
243
- userConfig.skipCache || _stryke_env_environment_checks.isDevelopment ? void 0 : (0, _stryke_type_checks_is_set_object.isSetObject)(options?.prepare) && options?.prepare?.targetName ? options?.prepare?.targetName : "prepare"
214
+ _stryke_env_environment_checks.isDevelopment ? void 0 : (0, _stryke_type_checks_is_set_object.isSetObject)(options?.prepare) && options?.prepare?.targetName ? options?.prepare?.targetName : "prepare"
244
215
  ].filter(Boolean),
245
216
  defaultConfiguration: options?.docs?.defaultConfiguration || "production",
246
217
  options: {
@@ -265,7 +236,7 @@ function createNxPlugin(opts) {
265
236
  dependsOn: options?.deploy?.dependsOn ?? [
266
237
  `^${options?.deploy?.targetName || "deploy"}`,
267
238
  options?.build !== false && `${options?.build?.targetName || "build"}`,
268
- userConfig.skipCache || _stryke_env_environment_checks.isDevelopment ? void 0 : (0, _stryke_type_checks_is_set_object.isSetObject)(options?.prepare) && options?.prepare?.targetName ? options?.prepare?.targetName : "prepare"
239
+ _stryke_env_environment_checks.isDevelopment ? void 0 : (0, _stryke_type_checks_is_set_object.isSetObject)(options?.prepare) && options?.prepare?.targetName ? options?.prepare?.targetName : "prepare"
269
240
  ].filter(Boolean),
270
241
  defaultConfiguration: options?.deploy?.defaultConfiguration || "production",
271
242
  options: {
@@ -286,7 +257,6 @@ function createNxPlugin(opts) {
286
257
  (0, _storm_software_workspace_tools_utils_project_tags.addProjectTag)(projectConfig, framework, projectConfig.projectType || "library", { overwrite: true });
287
258
  if (options?.verboseOutput) console.debug(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Completed preparing Nx configuration for project in root directory ${projectRoot}.`);
288
259
  return { projects: { [root]: (0, defu.default)(projectConfig, {
289
- name: (0, _stryke_string_format_kebab_case.kebabCase)(userConfig.name),
290
260
  projectType: projectConfig.projectType || "library",
291
261
  root,
292
262
  sourceRoot: (0, _stryke_path_join_paths.joinPaths)(root, "src"),
@@ -2,19 +2,16 @@ import { createNodesFromFiles } from "@nx/devkit";
2
2
  import { withNamedInputs } from "@storm-software/workspace-tools/utils/nx-json";
3
3
  import { getProjectConfigFromProjectRoot, getProjectRoot, getRoot } from "@storm-software/workspace-tools/utils/plugin-helpers";
4
4
  import { addProjectTag, setDefaultProjectTags } from "@storm-software/workspace-tools/utils/project-tags";
5
- import { isDevelopment, isTest } from "@stryke/env/environment-checks";
5
+ import { isDevelopment } from "@stryke/env/environment-checks";
6
6
  import { getEnvPaths } from "@stryke/env/get-env-paths";
7
7
  import { existsSync } from "@stryke/fs/exists";
8
- import { murmurhash } from "@stryke/hash";
9
8
  import { joinPaths } from "@stryke/path/join-paths";
10
- import { camelCase } from "@stryke/string-format/camel-case";
11
9
  import { kebabCase } from "@stryke/string-format/kebab-case";
12
10
  import { titleCase } from "@stryke/string-format/title-case";
13
11
  import { isError } from "@stryke/type-checks/is-error";
14
12
  import { isSetObject } from "@stryke/type-checks/is-set-object";
15
13
  import { isSetString } from "@stryke/type-checks/is-set-string";
16
14
  import defu from "defu";
17
- import { createJiti } from "jiti";
18
15
  import { readFile } from "node:fs/promises";
19
16
  import { readNxJson as readNxJson$1 } from "nx/src/config/nx-json.js";
20
17
  import { readTargetsFromPackageJson } from "nx/src/utils/package-json.js";
@@ -86,25 +83,12 @@ function createNxPlugin(opts) {
86
83
  const pluginInputs = getNxPluginInputs(framework);
87
84
  return [pluginInputs, async (configFiles, options, contextV2) => {
88
85
  if (options?.verboseOutput) console.debug(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Initializing the ${title} for the following inputs: ${pluginInputs}`);
89
- const envPaths = getEnvPaths({
86
+ if (!getEnvPaths({
90
87
  orgId: "storm-software",
91
88
  appId: framework,
92
89
  workspaceRoot: contextV2.workspaceRoot
93
- });
94
- if (!envPaths.cache) throw new Error("The cache directory could not be determined.");
90
+ }).cache) throw new Error("The cache directory could not be determined.");
95
91
  const nxJson = readNxJson$1(contextV2.workspaceRoot);
96
- const resolver = createJiti(contextV2.workspaceRoot, {
97
- debug: !!options?.debug,
98
- interopDefault: true,
99
- fsCache: joinPaths(envPaths.cache, "nx-plugin", murmurhash(contextV2.workspaceRoot, { maxLength: 45 }), "jiti"),
100
- moduleCache: true
101
- });
102
- let loadUserConfigFile;
103
- try {
104
- loadUserConfigFile = await resolver.import(resolver.esmResolve("powerlines/config")).then((mod) => mod?.loadUserConfigFile);
105
- } catch (error) {
106
- console.warn(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Failed to load user configuration file function: ${isError(error) ? error.message : "Unknown error"}`);
107
- }
108
92
  return createNodesFromFiles(async (configFile, _, context) => {
109
93
  try {
110
94
  const projectRoot = getProjectRoot(configFile, contextV2.workspaceRoot);
@@ -114,15 +98,6 @@ function createNxPlugin(opts) {
114
98
  }
115
99
  const root = getRoot(projectRoot, context);
116
100
  if (options?.verboseOutput) console.debug(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Loading ${framework} user configuration for project in root directory ${projectRoot}.`);
117
- let userConfig = {};
118
- try {
119
- if (loadUserConfigFile) {
120
- const parsedConfig = await loadUserConfigFile(contextV2.workspaceRoot, projectRoot, isDevelopment ? "development" : isTest ? "test" : "production", "build", { name: framework }, configFile);
121
- if (isSetObject(parsedConfig)) userConfig = parsedConfig.config;
122
- }
123
- } catch (error) {
124
- console.warn(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Failed to load user configuration for project in ${projectRoot} - ${isError(error) ? error.message : isSetString(error) ? error : "Unknown error"} \n\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.${isError(error) && error.stack ? `\n\nStack trace:\n${error.stack}` : ""}`);
125
- }
126
101
  if (!existsSync(joinPaths(contextV2.workspaceRoot, projectRoot, "package.json"))) {
127
102
  if (options?.verboseOutput) console.warn(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Cannot find \`package.json\` file in the project's root directory (path: "${joinPaths(contextV2.workspaceRoot, projectRoot)}"). Skipping project configuration.`);
128
103
  return {};
@@ -133,10 +108,6 @@ function createNxPlugin(opts) {
133
108
  return {};
134
109
  }
135
110
  const packageJson = JSON.parse(packageJsonContent);
136
- if (!(userConfig && Object.keys(userConfig).length > 0) && !packageJson?.[camelCase(framework)]) {
137
- if (options?.verboseOutput) console.debug(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Skipping ${projectRoot} - no ${framework} configuration found for project in root directory.`);
138
- return {};
139
- }
140
111
  const projectConfig = getProjectConfigFromProjectRoot(projectRoot, packageJson);
141
112
  if (!projectConfig) {
142
113
  if (options?.verboseOutput) console.warn(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - No project configuration found for project in root directory ${projectRoot}`);
@@ -192,7 +163,7 @@ function createNxPlugin(opts) {
192
163
  inputs: Array.isArray(options?.build?.inputs) ? options.build.inputs : withNamedInputs(targetInputs, [options?.build?.inputs || "typescript"]),
193
164
  outputs: options?.build?.outputs ?? ["{options.outputPath}"],
194
165
  executor: options?.build?.executor || `@${framework}/nx:${options?.build?.targetName || "build"}`,
195
- dependsOn: options?.build?.dependsOn ?? [`^${options?.build?.targetName || "build"}`, userConfig.skipCache || isDevelopment ? void 0 : isSetObject(options?.prepare) && options?.prepare?.targetName ? options?.prepare?.targetName : "prepare"].filter(Boolean),
166
+ dependsOn: options?.build?.dependsOn ?? [`^${options?.build?.targetName || "build"}`, isDevelopment ? void 0 : isSetObject(options?.prepare) && options?.prepare?.targetName ? options?.prepare?.targetName : "prepare"].filter(Boolean),
196
167
  defaultConfiguration: options?.build?.defaultConfiguration || "production",
197
168
  options: {
198
169
  projectType: projectConfig.projectType,
@@ -213,7 +184,7 @@ function createNxPlugin(opts) {
213
184
  inputs: Array.isArray(options?.lint?.inputs) ? options.lint.inputs : withNamedInputs([...targetInputs, artifactsFolder], options?.lint?.inputs ? [options.lint.inputs] : ["linting", "typescript"]),
214
185
  outputs: options?.lint?.outputs ?? ["{options.outputPath}"],
215
186
  executor: options?.lint?.executor || `@${framework}/nx:${options?.lint?.targetName || "lint"}`,
216
- dependsOn: options?.lint?.dependsOn ?? [`^${options?.lint?.targetName || "lint"}`, userConfig.skipCache || isDevelopment ? void 0 : isSetObject(options?.prepare) && options?.prepare?.targetName ? options?.prepare?.targetName : "prepare"].filter(Boolean),
187
+ dependsOn: options?.lint?.dependsOn ?? [`^${options?.lint?.targetName || "lint"}`, isDevelopment ? void 0 : isSetObject(options?.prepare) && options?.prepare?.targetName ? options?.prepare?.targetName : "prepare"].filter(Boolean),
217
188
  defaultConfiguration: options?.lint?.defaultConfiguration || "production",
218
189
  options: {
219
190
  projectType: projectConfig.projectType,
@@ -237,7 +208,7 @@ function createNxPlugin(opts) {
237
208
  dependsOn: options?.docs?.dependsOn ?? [
238
209
  `^${options?.docs?.targetName || "docs"}`,
239
210
  options?.build !== false && `${options?.build?.targetName || "build"}`,
240
- userConfig.skipCache || isDevelopment ? void 0 : isSetObject(options?.prepare) && options?.prepare?.targetName ? options?.prepare?.targetName : "prepare"
211
+ isDevelopment ? void 0 : isSetObject(options?.prepare) && options?.prepare?.targetName ? options?.prepare?.targetName : "prepare"
241
212
  ].filter(Boolean),
242
213
  defaultConfiguration: options?.docs?.defaultConfiguration || "production",
243
214
  options: {
@@ -262,7 +233,7 @@ function createNxPlugin(opts) {
262
233
  dependsOn: options?.deploy?.dependsOn ?? [
263
234
  `^${options?.deploy?.targetName || "deploy"}`,
264
235
  options?.build !== false && `${options?.build?.targetName || "build"}`,
265
- userConfig.skipCache || isDevelopment ? void 0 : isSetObject(options?.prepare) && options?.prepare?.targetName ? options?.prepare?.targetName : "prepare"
236
+ isDevelopment ? void 0 : isSetObject(options?.prepare) && options?.prepare?.targetName ? options?.prepare?.targetName : "prepare"
266
237
  ].filter(Boolean),
267
238
  defaultConfiguration: options?.deploy?.defaultConfiguration || "production",
268
239
  options: {
@@ -283,7 +254,6 @@ function createNxPlugin(opts) {
283
254
  addProjectTag(projectConfig, framework, projectConfig.projectType || "library", { overwrite: true });
284
255
  if (options?.verboseOutput) console.debug(`[${title}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Completed preparing Nx configuration for project in root directory ${projectRoot}.`);
285
256
  return { projects: { [root]: defu(projectConfig, {
286
- name: kebabCase(userConfig.name),
287
257
  projectType: projectConfig.projectType || "library",
288
258
  root,
289
259
  sourceRoot: joinPaths(root, "src"),
@@ -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, isTest } from \"@stryke/env/environment-checks\";\nimport { getEnvPaths } from \"@stryke/env/get-env-paths\";\nimport { existsSync } from \"@stryke/fs/exists\";\nimport { murmurhash } from \"@stryke/hash\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { camelCase } from \"@stryke/string-format/camel-case\";\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 { PartialKeys } from \"@stryke/types/base\";\nimport type { PackageJson } from \"@stryke/types/package-json\";\nimport defu from \"defu\";\nimport { createJiti } from \"jiti\";\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 {\n FrameworkOptions,\n Mode,\n ParsedUserConfig,\n UserConfig\n} from \"powerlines\";\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\ntype 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 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 ([\n `^${options?.prepare?.targetName || \"build\"}`,\n options?.clean !== false &&\n `${options?.clean?.targetName || \"clean\"}`\n ].filter(Boolean) as string[]),\n defaultConfiguration:\n options?.prepare?.defaultConfiguration || \"production\",\n options: {\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?.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 userConfig.skipCache || 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 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 userConfig.skipCache || 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 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 userConfig.skipCache || 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 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 userConfig.skipCache || 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 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 name: kebabCase(userConfig.name)!,\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;CACD;;;;;;;;;;ACyBD,SAAgB,kBAAkB,WAA6B;AAC7D,QAAO,cAAc,KAAI,UAAS,MAAM,QAAQ,eAAe,UAAU,CAAC;;;;;;;;AAS5E,SAAgB,kBAAkB,WAA2B;AAC3D,QAAO,OAAO,kBAAkB,UAAU,CACvC,KAAI,UAAS,MAAM,QAAQ,kBAAkB,GAAG,CAAC,CACjD,KAAK,IAAI,CAAC;;;;;;;;AAkDf,SAAgB,eAEd,MAAuD;CACvD,MAAM,YAAY,UAAU,MAAM,UAAU,IAAI;CAChD,MAAM,QAAQ,GAAG,UAAU,UAAU,CAAC;AAEtC,KAAI;EACF,MAAM,OAAO,MAAM,QAAQ,GAAG,UAAU;EACxC,MAAM,kBACJ,MAAM,mBAAmB,kBAAkB;EAE7C,MAAM,eAAe,kBAAkB,UAAU;EACjD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;MACF;AAGH,2BAAsB,eAAe,KAAK;AAC1C,mBACE,eACA,WACA,cAAc,eAAe,WAC7B,EACE,WAAW,MACZ,CACF;AAED,SAAI,SAAS,cACX,SAAQ,MACN,IACE,MACD,uBAAM,IAAI,MAAM,EAAC,aAAa,CAAC,wEAAwE,YAAY,GACrH;AAGH,YAAO,EACL,UAAU,GACP,OAAO,KAAK,eAAe;MAC1B,MAAM,UAAU,WAAW,KAAK;MAChC,aAAa,cAAc,eAAe;MAC1C;MACA,YAAY,UAAU,MAAM,MAAM;MAClC;MACD,CAAC,EACH,EACF;aACM,OAAO;AACd,aAAQ,MACN,IAAI,MAAM,uBAAM,IAAI,MAAM,EAAC,aAAa,CAAC,2DACvC,WACD,MACC,QAAQ,MAAM,GACV,MAAM,UACN,YAAY,MAAM,GAChB,QACA,wBAET;AAED,YAAO,EAAE;;MAGb,aACA,SACA,UACD;IAEJ;UACM,OAAO;AACd,UAAQ,MACN,IAAI,MAAM,uBAAM,IAAI,MAAM,EAAC,aAAa,CAAC,KACvC,QAAQ,MAAM,GACV,MAAM,UACN,YAAY,MAAM,GAChB,QACA,qDAET;AAED,QAAM,IAAI,MACR,4BAA4B,MAAM,KAChC,QAAQ,MAAM,GACV,MAAM,UACN,YAAY,MAAM,GAChB,QACA,wCAER,EACE,OAAO,iBAAiB,QAAQ,QAAQ,QACzC,CACF;;;;;;ACrrBL,MAAa,gBAAgB,eAAgC,EAC3D,WAAW,cACZ,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","/* -------------------------------------------------------------------\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 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 ([\n `^${options?.prepare?.targetName || \"build\"}`,\n options?.clean !== false &&\n `${options?.clean?.targetName || \"clean\"}`\n ].filter(Boolean) as string[]),\n defaultConfiguration:\n options?.prepare?.defaultConfiguration || \"production\",\n options: {\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?.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 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 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 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 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;CACD;;;;;;;;;;ACeD,SAAgB,kBAAkB,WAA6B;AAC7D,QAAO,cAAc,KAAI,UAAS,MAAM,QAAQ,eAAe,UAAU,CAAC;;;;;;;;AAS5E,SAAgB,kBAAkB,WAA2B;AAC3D,QAAO,OAAO,kBAAkB,UAAU,CACvC,KAAI,UAAS,MAAM,QAAQ,kBAAkB,GAAG,CAAC,CACjD,KAAK,I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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/nx",
3
- "version": "0.13.58",
3
+ "version": "0.13.60",
4
4
  "private": false,
5
5
  "description": "A Nx plugin to support Powerlines development in Nx monorepos.",
6
6
  "repository": {
@@ -185,6 +185,7 @@
185
185
  "@stryke/path": "^0.29.3",
186
186
  "@stryke/string-format": "^0.17.18",
187
187
  "@stryke/type-checks": "^0.6.9",
188
+ "powerlines": "^0.47.23",
188
189
  "defu": "^6.1.7",
189
190
  "jiti": "^2.7.0"
190
191
  },
@@ -197,7 +198,6 @@
197
198
  "eslint-flat-config-utils": "^2.1.4",
198
199
  "jsonc-eslint-parser": "^2.4.2",
199
200
  "nx": "22.7.1",
200
- "powerlines": "^0.47.22",
201
201
  "untyped": "^1.5.2"
202
202
  },
203
203
  "peerDependencies": { "nx": ">=22.7.0", "powerlines": "*" },
@@ -208,5 +208,5 @@
208
208
  "publishConfig": { "access": "public" },
209
209
  "executors": "./executors.json",
210
210
  "generators": "./generators.json",
211
- "gitHead": "c4aaa370bc05ef2f3813ab165af0ae347657c63d"
211
+ "gitHead": "55056ff6a43e73194445fac22586c02b7241e739"
212
212
  }