@powerlines/nx 0.11.286 → 0.11.288

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.
@@ -25,13 +25,12 @@ function withExecutor(command, executorFn) {
25
25
  if (!context.projectName || !context.projectsConfigurations?.projects || !context.projectsConfigurations.projects[context.projectName] || !context.projectsConfigurations.projects[context.projectName]?.root) throw new Error("The executor requires `projectsConfigurations` on the context object.");
26
26
  const projectConfig = context.projectsConfigurations.projects[context.projectName];
27
27
  const api = await powerlines.default.from(workspaceConfig.workspaceRoot, (0, defu.default)({
28
- input: options.input,
28
+ configFile: options.configFile ?? options.config,
29
29
  output: {
30
30
  path: options.outputPath,
31
31
  publishPath: options.publishPath,
32
32
  format: options.format,
33
- sourceMap: options.sourceMap,
34
- configFile: options.configFile ?? options.config
33
+ sourceMap: options.sourceMap
35
34
  },
36
35
  resolve: {
37
36
  external: options.external,
@@ -40,13 +39,8 @@ function withExecutor(command, executorFn) {
40
39
  },
41
40
  root: projectConfig.root,
42
41
  projectType: projectConfig.projectType,
43
- sourceRoot: projectConfig.sourceRoot,
44
- tsconfig: options.tsconfig,
45
- platform: options.platform,
46
- define: options.define,
47
- logLevel: options.logLevel,
48
- mode: options.mode
49
- }, options));
42
+ sourceRoot: projectConfig.sourceRoot
43
+ }, options, { name: context.projectName }));
50
44
  try {
51
45
  return await Promise.resolve(executorFn((0, defu.default)({
52
46
  projectName: context.projectName,
@@ -21,13 +21,12 @@ function withExecutor(command, executorFn) {
21
21
  if (!context.projectName || !context.projectsConfigurations?.projects || !context.projectsConfigurations.projects[context.projectName] || !context.projectsConfigurations.projects[context.projectName]?.root) throw new Error("The executor requires `projectsConfigurations` on the context object.");
22
22
  const projectConfig = context.projectsConfigurations.projects[context.projectName];
23
23
  const api = await PowerlinesAPI.from(workspaceConfig.workspaceRoot, defu({
24
- input: options.input,
24
+ configFile: options.configFile ?? options.config,
25
25
  output: {
26
26
  path: options.outputPath,
27
27
  publishPath: options.publishPath,
28
28
  format: options.format,
29
- sourceMap: options.sourceMap,
30
- configFile: options.configFile ?? options.config
29
+ sourceMap: options.sourceMap
31
30
  },
32
31
  resolve: {
33
32
  external: options.external,
@@ -36,13 +35,8 @@ function withExecutor(command, executorFn) {
36
35
  },
37
36
  root: projectConfig.root,
38
37
  projectType: projectConfig.projectType,
39
- sourceRoot: projectConfig.sourceRoot,
40
- tsconfig: options.tsconfig,
41
- platform: options.platform,
42
- define: options.define,
43
- logLevel: options.logLevel,
44
- mode: options.mode
45
- }, options));
38
+ sourceRoot: projectConfig.sourceRoot
39
+ }, options, { name: context.projectName }));
46
40
  try {
47
41
  return await Promise.resolve(executorFn(defu({
48
42
  projectName: context.projectName,
@@ -1 +1 @@
1
- {"version":3,"file":"base-executor.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 { isError } from \"@stryke/type-checks/is-error\";\nimport defu from \"defu\";\nimport type {\n InitialUserConfig,\n InlineConfig,\n PowerlinesCommand\n} from \"powerlines\";\nimport PowerlinesAPI 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: PowerlinesAPI\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 api = await PowerlinesAPI.from(\n workspaceConfig.workspaceRoot,\n defu(\n {\n input: options.input,\n output: {\n path: options.outputPath,\n publishPath: options.publishPath,\n format: options.format,\n sourceMap: options.sourceMap,\n configFile: options.configFile ?? options.config\n },\n resolve: {\n external: options.external,\n noExternal: options.noExternal,\n skipNodeModulesBundle: options.skipNodeModulesBundle\n },\n root: projectConfig.root,\n projectType: projectConfig.projectType,\n sourceRoot: projectConfig.sourceRoot,\n tsconfig: options.tsconfig,\n platform: options.platform,\n define: options.define,\n logLevel: options.logLevel,\n mode: options.mode\n },\n options\n ) as InitialUserConfig\n );\n\n try {\n return await Promise.resolve(\n executorFn(\n defu(\n {\n projectName: context.projectName,\n options,\n workspaceConfig,\n inlineConfig: {\n command,\n configFile: options.configFile || options.config\n },\n command\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 } finally {\n await api.finalize();\n }\n },\n {\n skipReadingConfig: false,\n hooks: {\n applyDefaultOptions: (options: Partial<TExecutorSchema>) => {\n return options as TExecutorSchema;\n }\n }\n }\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAsDA,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,MAAM,MAAM,cAAc,KAC9B,gBAAgB,eAChB,KACE;GACE,OAAO,QAAQ;GACf,QAAQ;IACN,MAAM,QAAQ;IACd,aAAa,QAAQ;IACrB,QAAQ,QAAQ;IAChB,WAAW,QAAQ;IACnB,YAAY,QAAQ,cAAc,QAAQ;IAC3C;GACD,SAAS;IACP,UAAU,QAAQ;IAClB,YAAY,QAAQ;IACpB,uBAAuB,QAAQ;IAChC;GACD,MAAM,cAAc;GACpB,aAAa,cAAc;GAC3B,YAAY,cAAc;GAC1B,UAAU,QAAQ;GAClB,UAAU,QAAQ;GAClB,QAAQ,QAAQ;GAChB,UAAU,QAAQ;GAClB,MAAM,QAAQ;GACf,EACD,QACD,CACF;AAED,MAAI;AACF,UAAO,MAAM,QAAQ,QACnB,WACE,KACE;IACE,aAAa,QAAQ;IACrB;IACA;IACA,cAAc;KACZ;KACA,YAAY,QAAQ,cAAc,QAAQ;KAC3C;IACD;IACD,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;YACjB;AACR,SAAM,IAAI,UAAU;;IAGxB;EACE,mBAAmB;EACnB,OAAO,EACL,sBAAsB,YAAsC;AAC1D,UAAO;KAEV;EACF,CACF"}
1
+ {"version":3,"file":"base-executor.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 { isError } from \"@stryke/type-checks/is-error\";\nimport defu from \"defu\";\nimport type {\n InitialUserConfig,\n InlineConfig,\n PowerlinesCommand\n} from \"powerlines\";\nimport PowerlinesAPI 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: PowerlinesAPI\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 api = await PowerlinesAPI.from(\n workspaceConfig.workspaceRoot,\n defu(\n {\n configFile: options.configFile ?? options.config,\n output: {\n path: options.outputPath,\n publishPath: options.publishPath,\n format: options.format,\n sourceMap: options.sourceMap\n },\n resolve: {\n external: options.external,\n noExternal: options.noExternal,\n skipNodeModulesBundle: options.skipNodeModulesBundle\n },\n root: projectConfig.root,\n projectType: projectConfig.projectType,\n sourceRoot: projectConfig.sourceRoot\n },\n options,\n {\n name: context.projectName\n }\n ) as InitialUserConfig\n );\n\n try {\n return await Promise.resolve(\n executorFn(\n defu(\n {\n projectName: context.projectName,\n options,\n workspaceConfig,\n inlineConfig: {\n command,\n configFile: options.configFile || options.config\n },\n command\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 } finally {\n await api.finalize();\n }\n },\n {\n skipReadingConfig: false,\n hooks: {\n applyDefaultOptions: (options: Partial<TExecutorSchema>) => {\n return options as TExecutorSchema;\n }\n }\n }\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAsDA,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,MAAM,MAAM,cAAc,KAC9B,gBAAgB,eAChB,KACE;GACE,YAAY,QAAQ,cAAc,QAAQ;GAC1C,QAAQ;IACN,MAAM,QAAQ;IACd,aAAa,QAAQ;IACrB,QAAQ,QAAQ;IAChB,WAAW,QAAQ;IACpB;GACD,SAAS;IACP,UAAU,QAAQ;IAClB,YAAY,QAAQ;IACpB,uBAAuB,QAAQ;IAChC;GACD,MAAM,cAAc;GACpB,aAAa,cAAc;GAC3B,YAAY,cAAc;GAC3B,EACD,SACA,EACE,MAAM,QAAQ,aACf,CACF,CACF;AAED,MAAI;AACF,UAAO,MAAM,QAAQ,QACnB,WACE,KACE;IACE,aAAa,QAAQ;IACrB;IACA;IACA,cAAc;KACZ;KACA,YAAY,QAAQ,cAAc,QAAQ;KAC3C;IACD;IACD,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;YACjB;AACR,SAAM,IAAI,UAAU;;IAGxB;EACE,mBAAmB;EACnB,OAAO,EACL,sBAAsB,YAAsC;AAC1D,UAAO;KAEV;EACF,CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/nx",
3
- "version": "0.11.286",
3
+ "version": "0.11.288",
4
4
  "private": false,
5
5
  "type": "commonjs",
6
6
  "description": "A Nx plugin to support Powerlines development in Nx monorepos.",
@@ -196,7 +196,7 @@
196
196
  "eslint-flat-config-utils": "^2.1.4",
197
197
  "jsonc-eslint-parser": "^2.4.2",
198
198
  "nx": "22.5.2",
199
- "powerlines": "^0.41.23",
199
+ "powerlines": "^0.42.1",
200
200
  "untyped": "^1.5.2"
201
201
  },
202
202
  "peerDependencies": { "nx": ">=22.5.0", "powerlines": ">=0.39.2" },
@@ -207,5 +207,5 @@
207
207
  "publishConfig": { "access": "public" },
208
208
  "executors": "./executors.json",
209
209
  "generators": "./generators.json",
210
- "gitHead": "c6ab4089999ed8b1f08214f9358d527de33dfa5e"
210
+ "gitHead": "b5648a6f230600a4f99ab425034a18e912ad95eb"
211
211
  }