@powerlines/nx 0.13.38 → 0.13.42

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.
Files changed (68) hide show
  1. package/dist/src/base/base-executor.d.mts.map +1 -1
  2. package/dist/src/base/base-executor.d.ts.map +1 -1
  3. package/dist/src/base/base-executor.js +32 -18
  4. package/dist/src/base/base-executor.mjs +32 -18
  5. package/dist/src/base/base-executor.mjs.map +1 -1
  6. package/dist/src/base/base-executor.untyped.js +5 -1
  7. package/dist/src/base/base-executor.untyped.mjs +5 -1
  8. package/dist/src/base/base-executor.untyped.mjs.map +1 -1
  9. package/dist/src/{base-executor-dweAIT3X.mjs → base-executor-86GBuriJ.mjs} +33 -19
  10. package/dist/src/base-executor-86GBuriJ.mjs.map +1 -0
  11. package/dist/src/{base-executor-CQ18-J8D.js → base-executor-D_JSA5Nd.js} +32 -18
  12. package/dist/src/{base-executor.untyped-C_GfrIWa.js → base-executor.untyped-4feXjo6S.js} +5 -1
  13. package/dist/src/{base-executor.untyped-Kz2OUE_8.mjs → base-executor.untyped-BD9-7XGx.mjs} +6 -2
  14. package/dist/src/base-executor.untyped-BD9-7XGx.mjs.map +1 -0
  15. package/dist/src/executors/build/executor.d.mts +1 -5
  16. package/dist/src/executors/build/executor.d.mts.map +1 -1
  17. package/dist/src/executors/build/executor.d.ts +1 -6
  18. package/dist/src/executors/build/executor.d.ts.map +1 -1
  19. package/dist/src/executors/build/executor.js +3 -12
  20. package/dist/src/executors/build/executor.mjs +3 -8
  21. package/dist/src/executors/build/executor.mjs.map +1 -1
  22. package/dist/src/executors/clean/executor.d.mts +1 -5
  23. package/dist/src/executors/clean/executor.d.mts.map +1 -1
  24. package/dist/src/executors/clean/executor.d.ts +1 -6
  25. package/dist/src/executors/clean/executor.d.ts.map +1 -1
  26. package/dist/src/executors/clean/executor.js +2 -4
  27. package/dist/src/executors/clean/executor.mjs +2 -2
  28. package/dist/src/executors/clean/executor.mjs.map +1 -1
  29. package/dist/src/executors/clean/untyped.js +1 -1
  30. package/dist/src/executors/clean/untyped.mjs +1 -1
  31. package/dist/src/executors/docs/executor.d.mts +1 -5
  32. package/dist/src/executors/docs/executor.d.mts.map +1 -1
  33. package/dist/src/executors/docs/executor.d.ts +1 -6
  34. package/dist/src/executors/docs/executor.d.ts.map +1 -1
  35. package/dist/src/executors/docs/executor.js +2 -4
  36. package/dist/src/executors/docs/executor.mjs +2 -2
  37. package/dist/src/executors/docs/executor.mjs.map +1 -1
  38. package/dist/src/executors/lint/executor.d.mts +1 -5
  39. package/dist/src/executors/lint/executor.d.mts.map +1 -1
  40. package/dist/src/executors/lint/executor.d.ts +1 -6
  41. package/dist/src/executors/lint/executor.d.ts.map +1 -1
  42. package/dist/src/executors/lint/executor.js +2 -4
  43. package/dist/src/executors/lint/executor.mjs +2 -2
  44. package/dist/src/executors/lint/executor.mjs.map +1 -1
  45. package/dist/src/executors/prepare/executor.d.mts +1 -5
  46. package/dist/src/executors/prepare/executor.d.mts.map +1 -1
  47. package/dist/src/executors/prepare/executor.d.ts +1 -6
  48. package/dist/src/executors/prepare/executor.d.ts.map +1 -1
  49. package/dist/src/executors/prepare/executor.js +3 -12
  50. package/dist/src/executors/prepare/executor.mjs +3 -8
  51. package/dist/src/executors/prepare/executor.mjs.map +1 -1
  52. package/dist/src/executors/prepare/untyped.js +1 -1
  53. package/dist/src/executors/prepare/untyped.mjs +1 -1
  54. package/dist/src/helpers/plugin-utilities.d.mts.map +1 -1
  55. package/dist/src/helpers/plugin-utilities.d.ts.map +1 -1
  56. package/dist/src/helpers/plugin-utilities.js +2 -2
  57. package/dist/src/helpers/plugin-utilities.mjs +2 -2
  58. package/dist/src/helpers/plugin-utilities.mjs.map +1 -1
  59. package/dist/src/plugin/index.js +1 -1
  60. package/dist/src/plugin/index.mjs +1 -1
  61. package/dist/src/plugin/index.mjs.map +1 -1
  62. package/package.json +20 -19
  63. package/dist/src/base-executor-CuS2Y2T4.d.ts +0 -173
  64. package/dist/src/base-executor-CuS2Y2T4.d.ts.map +0 -1
  65. package/dist/src/base-executor-TyizQv09.d.mts +0 -173
  66. package/dist/src/base-executor-TyizQv09.d.mts.map +0 -1
  67. package/dist/src/base-executor-dweAIT3X.mjs.map +0 -1
  68. package/dist/src/base-executor.untyped-Kz2OUE_8.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"base-executor.d.mts","names":[],"sources":["../../../src/base/base-executor.ts"],"mappings":";;;;;;;KAmCY,yBAAA,kBACO,iBAAA,GAAoB,iBAAA,0BACb,kBAAA,GAAqB,kBAAA,IAC3C,eAAA;EACF,WAAA;EACA,OAAA,EAAS,QAAA;EACT,OAAA,EAAS,eAAA;EACT,YAAA,EAAc,YAAA;EACd,eAAA,EAAiB,oBAAA;AAAA;;;;;;;;;;;iBAaH,YAAA,kBACG,iBAAA,GAAoB,iBAAA,0BACb,kBAAA,GAAqB,kBAAA,CAAA,CAE7C,OAAA,EAAS,QAAA,EACT,UAAA,GACE,OAAA,EAAS,yBAAA,CAA0B,QAAA,EAAU,eAAA,GAC7C,GAAA,EAAK,gBAAA,KAEH,OAAA,CAAQ,kBAAA,uBACR,kBAAA,sBAGH,eAAA,CAAgB,eAAA"}
1
+ {"version":3,"file":"base-executor.d.mts","names":[],"sources":["../../../src/base/base-executor.ts"],"mappings":";;;;;;;KAuCY,yBAAA,kBACO,iBAAA,GAAoB,iBAAA,0BACb,kBAAA,GAAqB,kBAAA,IAC3C,eAAA;EACF,WAAA;EACA,OAAA,EAAS,QAAA;EACT,OAAA,EAAS,eAAA;EACT,YAAA,EAAc,YAAA;EACd,eAAA,EAAiB,oBAAA;AAAA;;;;;;;;;;;iBAaH,YAAA,kBACG,iBAAA,GAAoB,iBAAA,0BACb,kBAAA,GAAqB,kBAAA,CAAA,CAE7C,OAAA,EAAS,QAAA,EACT,UAAA,GACE,OAAA,EAAS,yBAAA,CAA0B,QAAA,EAAU,eAAA,GAC7C,GAAA,EAAK,gBAAA,KAEH,OAAA,CAAQ,kBAAA,uBACR,kBAAA,sBAGH,eAAA,CAAgB,eAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"base-executor.d.ts","names":[],"sources":["../../../src/base/base-executor.ts"],"mappings":";;;;;;;KAmCY,yBAAA,kBACO,iBAAA,GAAoB,iBAAA,0BACb,kBAAA,GAAqB,kBAAA,IAC3C,eAAA;EACF,WAAA;EACA,OAAA,EAAS,QAAA;EACT,OAAA,EAAS,eAAA;EACT,YAAA,EAAc,YAAA;EACd,eAAA,EAAiB,oBAAA;AAAA;;;;;;;;;;;iBAaH,YAAA,kBACG,iBAAA,GAAoB,iBAAA,0BACb,kBAAA,GAAqB,kBAAA,CAAA,CAE7C,OAAA,EAAS,QAAA,EACT,UAAA,GACE,OAAA,EAAS,yBAAA,CAA0B,QAAA,EAAU,eAAA,GAC7C,GAAA,EAAK,gBAAA,KAEH,OAAA,CAAQ,kBAAA,uBACR,kBAAA,sBAGH,eAAA,CAAgB,eAAA"}
1
+ {"version":3,"file":"base-executor.d.ts","names":[],"sources":["../../../src/base/base-executor.ts"],"mappings":";;;;;;;KAuCY,yBAAA,kBACO,iBAAA,GAAoB,iBAAA,0BACb,kBAAA,GAAqB,kBAAA,IAC3C,eAAA;EACF,WAAA;EACA,OAAA,EAAS,QAAA;EACT,OAAA,EAAS,eAAA;EACT,YAAA,EAAc,YAAA;EACd,eAAA,EAAiB,oBAAA;AAAA;;;;;;;;;;;iBAaH,YAAA,kBACG,iBAAA,GAAoB,iBAAA,0BACb,kBAAA,GAAqB,kBAAA,CAAA,CAE7C,OAAA,EAAS,QAAA,EACT,UAAA,GACE,OAAA,EAAS,yBAAA,CAA0B,QAAA,EAAU,eAAA,GAC7C,GAAA,EAAK,gBAAA,KAEH,OAAA,CAAQ,kBAAA,uBACR,kBAAA,sBAGH,eAAA,CAAgB,eAAA"}
@@ -2,7 +2,11 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_runtime = require('../_virtual/_rolldown/runtime.js');
3
3
  let _storm_software_config_tools_logger = require("@storm-software/config-tools/logger");
4
4
  let _storm_software_workspace_tools_base_base_executor = require("@storm-software/workspace-tools/base/base-executor");
5
+ let _stryke_helpers_omit = require("@stryke/helpers/omit");
5
6
  let _stryke_type_checks_is_error = require("@stryke/type-checks/is-error");
7
+ let _stryke_type_checks_is_set = require("@stryke/type-checks/is-set");
8
+ let _stryke_type_checks_is_set_array = require("@stryke/type-checks/is-set-array");
9
+ let _stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
6
10
  let defu = require("defu");
7
11
  defu = require_runtime.__toESM(defu);
8
12
  let jiti = require("jiti");
@@ -24,14 +28,8 @@ function withExecutor(command, executorFn) {
24
28
  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.");
25
29
  const projectConfig = context.projectsConfigurations.projects[context.projectName];
26
30
  const jiti$1 = (0, jiti.createJiti)(context.root, { cache: false });
27
- const { createEngine } = await jiti$1.import(jiti$1.esmResolve("powerlines"));
28
- const api = await createEngine({
29
- name: context.projectName,
30
- cwd: context.root,
31
- root: projectConfig.root,
32
- configFile: options.configFile || options.config,
33
- mode: options.mode
34
- });
31
+ const { createPowerlines } = await jiti$1.import(jiti$1.esmResolve("powerlines"));
32
+ const api = await createPowerlines({ cwd: context.root });
35
33
  try {
36
34
  return await Promise.resolve(executorFn((0, defu.default)({
37
35
  projectName: context.projectName,
@@ -39,10 +37,12 @@ function withExecutor(command, executorFn) {
39
37
  workspaceConfig,
40
38
  command,
41
39
  inlineConfig: (0, defu.default)({
40
+ name: context.projectName,
42
41
  command,
43
- description: projectConfig.metadata?.description,
42
+ root: projectConfig.root,
43
+ configFile: options.configFile || options.config,
44
44
  projectType: projectConfig.projectType,
45
- additionalArgs: options.additionalArgs,
45
+ mode: options.mode,
46
46
  output: {
47
47
  path: options.outputPath,
48
48
  copy: options.copyPath === false ? false : {
@@ -52,20 +52,34 @@ function withExecutor(command, executorFn) {
52
52
  minify: options.minify,
53
53
  sourceMap: options.sourceMap
54
54
  },
55
- resolve: {
56
- external: options.external,
57
- noExternal: options.noExternal,
58
- skipNodeModulesBundle: options.skipNodeModulesBundle
59
- }
60
- }, options)
55
+ resolve: (0, _stryke_type_checks_is_set_array.isSetArray)(options.external) || (0, _stryke_type_checks_is_set_array.isSetArray)(options.noExternal) || (0, _stryke_type_checks_is_set.isSet)(options.skipNodeModulesBundle) ? {
56
+ external: (0, _stryke_type_checks_is_set_array.isSetArray)(options.external) ? options.external : void 0,
57
+ noExternal: (0, _stryke_type_checks_is_set_array.isSetArray)(options.noExternal) ? options.noExternal : void 0,
58
+ skipNodeModulesBundle: (0, _stryke_type_checks_is_set.isSet)(options.skipNodeModulesBundle) ? options.skipNodeModulesBundle : void 0
59
+ } : void 0,
60
+ define: (0, _stryke_type_checks_is_set_object.isSetObject)(options.define) ? options.define : void 0,
61
+ assets: (0, _stryke_type_checks_is_set_object.isSetObject)(options.assets) ? options.assets : void 0
62
+ }, (0, _stryke_helpers_omit.omit)(options, [
63
+ "config",
64
+ "configFile",
65
+ "outputPath",
66
+ "copyPath",
67
+ "sourceMap",
68
+ "minify",
69
+ "format",
70
+ "external",
71
+ "noExternal",
72
+ "skipNodeModulesBundle",
73
+ "mode",
74
+ "define",
75
+ "assets"
76
+ ]))
61
77
  }, context), api));
62
78
  } catch (error) {
63
79
  (0, _storm_software_config_tools_logger.writeError)(`An error occurred while executing the Powerlines ${command} command executor: ${(0, _stryke_type_checks_is_error.isError)(error) ? `${error.message}
64
80
 
65
81
  ${error.stack}` : "Unknown error"}`);
66
82
  return { success: false };
67
- } finally {
68
- await api.finalize();
69
83
  }
70
84
  }, {
71
85
  skipReadingConfig: false,
@@ -1,6 +1,10 @@
1
1
  import { writeError } from "@storm-software/config-tools/logger";
2
2
  import { withRunExecutor } from "@storm-software/workspace-tools/base/base-executor";
3
+ import { omit } from "@stryke/helpers/omit";
3
4
  import { isError } from "@stryke/type-checks/is-error";
5
+ import { isSet } from "@stryke/type-checks/is-set";
6
+ import { isSetArray } from "@stryke/type-checks/is-set-array";
7
+ import { isSetObject } from "@stryke/type-checks/is-set-object";
4
8
  import defu from "defu";
5
9
  import { createJiti } from "jiti";
6
10
 
@@ -21,14 +25,8 @@ function withExecutor(command, executorFn) {
21
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.");
22
26
  const projectConfig = context.projectsConfigurations.projects[context.projectName];
23
27
  const jiti = createJiti(context.root, { cache: false });
24
- const { createEngine } = await jiti.import(jiti.esmResolve("powerlines"));
25
- const api = await createEngine({
26
- name: context.projectName,
27
- cwd: context.root,
28
- root: projectConfig.root,
29
- configFile: options.configFile || options.config,
30
- mode: options.mode
31
- });
28
+ const { createPowerlines } = await jiti.import(jiti.esmResolve("powerlines"));
29
+ const api = await createPowerlines({ cwd: context.root });
32
30
  try {
33
31
  return await Promise.resolve(executorFn(defu({
34
32
  projectName: context.projectName,
@@ -36,10 +34,12 @@ function withExecutor(command, executorFn) {
36
34
  workspaceConfig,
37
35
  command,
38
36
  inlineConfig: defu({
37
+ name: context.projectName,
39
38
  command,
40
- description: projectConfig.metadata?.description,
39
+ root: projectConfig.root,
40
+ configFile: options.configFile || options.config,
41
41
  projectType: projectConfig.projectType,
42
- additionalArgs: options.additionalArgs,
42
+ mode: options.mode,
43
43
  output: {
44
44
  path: options.outputPath,
45
45
  copy: options.copyPath === false ? false : {
@@ -49,20 +49,34 @@ function withExecutor(command, executorFn) {
49
49
  minify: options.minify,
50
50
  sourceMap: options.sourceMap
51
51
  },
52
- resolve: {
53
- external: options.external,
54
- noExternal: options.noExternal,
55
- skipNodeModulesBundle: options.skipNodeModulesBundle
56
- }
57
- }, options)
52
+ resolve: isSetArray(options.external) || isSetArray(options.noExternal) || isSet(options.skipNodeModulesBundle) ? {
53
+ external: isSetArray(options.external) ? options.external : void 0,
54
+ noExternal: isSetArray(options.noExternal) ? options.noExternal : void 0,
55
+ skipNodeModulesBundle: isSet(options.skipNodeModulesBundle) ? options.skipNodeModulesBundle : void 0
56
+ } : void 0,
57
+ define: isSetObject(options.define) ? options.define : void 0,
58
+ assets: isSetObject(options.assets) ? options.assets : void 0
59
+ }, omit(options, [
60
+ "config",
61
+ "configFile",
62
+ "outputPath",
63
+ "copyPath",
64
+ "sourceMap",
65
+ "minify",
66
+ "format",
67
+ "external",
68
+ "noExternal",
69
+ "skipNodeModulesBundle",
70
+ "mode",
71
+ "define",
72
+ "assets"
73
+ ]))
58
74
  }, context), api));
59
75
  } catch (error) {
60
76
  writeError(`An error occurred while executing the Powerlines ${command} command executor: ${isError(error) ? `${error.message}
61
77
 
62
78
  ${error.stack}` : "Unknown error"}`);
63
79
  return { success: false };
64
- } finally {
65
- await api.finalize();
66
80
  }
67
81
  }, {
68
82
  skipReadingConfig: false,
@@ -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 { 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 { createEngine } = await jiti.import<{\n createEngine: typeof import(\"powerlines\").createEngine;\n }>(jiti.esmResolve(\"powerlines\"));\n\n const api = await createEngine({\n name: context.projectName,\n cwd: context.root,\n root: projectConfig.root,\n configFile: options.configFile || options.config,\n mode: options.mode as Mode\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 command,\n description: projectConfig.metadata?.description,\n projectType: projectConfig.projectType,\n additionalArgs: options.additionalArgs,\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 external: options.external,\n noExternal: options.noExternal,\n skipNodeModulesBundle: options.skipNodeModulesBundle\n }\n },\n options\n )\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 options.copyPath ??= \"dist/{projectRoot}\";\n\n return options as TExecutorSchema;\n }\n }\n }\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAwDA,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,iBAAiB,MAAM,KAAK,OAEjC,KAAK,WAAW,aAAa,CAAC;EAEjC,MAAM,MAAM,MAAM,aAAa;GAC7B,MAAM,QAAQ;GACd,KAAK,QAAQ;GACb,MAAM,cAAc;GACpB,YAAY,QAAQ,cAAc,QAAQ;GAC1C,MAAM,QAAQ;GACf,CAAC;AAEF,MAAI;AACF,UAAO,MAAM,QAAQ,QACnB,WACE,KACE;IACE,aAAa,QAAQ;IACrB;IACA;IACA;IACA,cAAc,KACZ;KACE;KACA,aAAa,cAAc,UAAU;KACrC,aAAa,cAAc;KAC3B,gBAAgB,QAAQ;KACxB,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,SAAS;MACP,UAAU,QAAQ;MAClB,YAAY,QAAQ;MACpB,uBAAuB,QAAQ;MAChC;KACF,EACD,QACD;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;YACjB;AACR,SAAM,IAAI,UAAU;;IAGxB;EACE,mBAAmB;EACnB,OAAO,EACL,sBAAsB,YAAsC;AAC1D,WAAQ,aAAa;AAErB,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 { 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 });\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,EACjC,KAAK,QAAQ,MACd,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"}
@@ -75,7 +75,11 @@ var base_executor_untyped_default = (0, untyped.defineUntypedSchema)({
75
75
  ]
76
76
  }
77
77
  },
78
- $resolve: (val = ["cjs", "esm"]) => [].concat(val)
78
+ $resolve: (val = ["cjs", "esm"]) => val.filter((format) => [
79
+ "cjs",
80
+ "esm",
81
+ "iife"
82
+ ].includes(format))
79
83
  },
80
84
  platform: { $schema: {
81
85
  title: "Platform",
@@ -74,7 +74,11 @@ var base_executor_untyped_default = defineUntypedSchema({
74
74
  ]
75
75
  }
76
76
  },
77
- $resolve: (val = ["cjs", "esm"]) => [].concat(val)
77
+ $resolve: (val = ["cjs", "esm"]) => val.filter((format) => [
78
+ "cjs",
79
+ "esm",
80
+ "iife"
81
+ ].includes(format))
78
82
  },
79
83
  platform: { $schema: {
80
84
  title: "Platform",
@@ -1 +1 @@
1
- {"version":3,"file":"base-executor.untyped.mjs","names":[],"sources":["../../../src/base/base-executor.untyped.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 { defineUntypedSchema } from \"untyped\";\n\nexport default defineUntypedSchema({\n $schema: {\n id: \"BaseExecutorSchema\",\n title: \"Base Executor\",\n description:\n \"A shared/base schema type definition for Powerlines executors\",\n required: []\n },\n config: {\n $schema: {\n title: \"Powerlines Configuration File\",\n type: \"string\",\n format: \"path\",\n description:\n \"The path to the Powerlines configuration file. Alias for `configFile`.\"\n }\n },\n configFile: {\n $schema: {\n title: \"Powerlines Configuration File\",\n type: \"string\",\n format: \"path\",\n description:\n \"The path to the Powerlines configuration file. Alias for `config`.\"\n }\n },\n input: {\n $schema: {\n title: \"Input Entry File(s)\",\n format: \"path\",\n type: \"array\",\n description: \"The entry file(s) that serve as the input for the project\",\n items: { type: \"string\" }\n }\n },\n tsconfig: {\n $schema: {\n title: \"TSConfig Path\",\n type: \"string\",\n format: \"path\",\n description: \"The path to the tsconfig file\"\n }\n },\n outputPath: {\n $schema: {\n title: \"Output Path\",\n type: \"string\",\n format: \"path\",\n description: \"The path to the output directory for the build artifacts\"\n }\n },\n copyPath: {\n $schema: {\n title: \"Copy Path\",\n description: \"A directory path to copy the build artifacts into\",\n oneOf: [\n { type: \"string\", format: \"path\" },\n { type: \"boolean\", enum: [false] }\n ]\n }\n },\n sourceMap: {\n $schema: {\n title: \"Sourcemap\",\n type: \"boolean\",\n description: \"Generate a sourcemap\"\n }\n },\n minify: {\n $schema: {\n title: \"Minify\",\n type: \"boolean\",\n description: \"Minify the output\"\n }\n },\n format: {\n $schema: {\n title: \"Format\",\n type: \"array\",\n description: \"The format to build\",\n items: {\n type: \"string\",\n enum: [\"cjs\", \"esm\", \"iife\"]\n }\n },\n $resolve: (val: string[] = [\"cjs\", \"esm\"]) => ([] as string[]).concat(val)\n },\n platform: {\n $schema: {\n title: \"Platform\",\n type: \"string\",\n description: \"The platform to build\",\n enum: [\"neutral\", \"node\", \"browser\"]\n }\n },\n external: {\n $schema: {\n title: \"External\",\n type: \"array\",\n description: \"The external dependencies\"\n },\n $resolve: (val: string[] = []) => ([] as string[]).concat(val)\n },\n noExternal: {\n $schema: {\n title: \"No External\",\n type: \"array\",\n description: \"The dependencies that should not be treated as external\"\n },\n $resolve: (val: string[] = []) => ([] as string[]).concat(val)\n },\n skipNodeModulesBundle: {\n $schema: {\n title: \"Skip Node Modules Bundle\",\n type: \"boolean\",\n description:\n \"Skip bundling node_modules during the build process (if required)\"\n }\n },\n mode: {\n $schema: {\n title: \"Mode\",\n type: \"string\",\n description: \"The build mode\",\n enum: [\"development\", \"test\", \"production\"]\n }\n },\n logLevel: {\n $schema: {\n title: \"Log Level\",\n type: \"string\",\n description: \"The log level to use for the build process\",\n enum: [\n \"fatal\",\n \"error\",\n \"warn\",\n \"success\",\n \"info\",\n \"debug\",\n \"trace\",\n \"silent\"\n ]\n }\n },\n define: {\n $schema: {\n title: \"Define\",\n type: \"object\",\n tsType: \"Record<string, string>\",\n description: \"The `define` values\"\n },\n $resolve: (val: Record<string, string> = {}) => val,\n $default: {}\n },\n assets: {\n $schema: {\n title: \"Assets\",\n type: \"any\",\n tsType:\n \"Array<{ input?: string; output?: string; glob: string; ignore?: string[]; dot?: boolean; }>\",\n description: \"The `assets` values\"\n }\n },\n additionalArgs: {\n $schema: {\n title: \"Additional Arguments\",\n type: \"object\",\n tsType: \"Record<string, string>\",\n description:\n \"The additional arguments provided during execution of the command\"\n },\n $resolve: (val: Record<string, string> = {}) => val,\n $default: {}\n }\n});\n"],"mappings":";;;AAoBA,oCAAe,oBAAoB;CACjC,SAAS;EACP,IAAI;EACJ,OAAO;EACP,aACE;EACF,UAAU,EAAE;EACb;CACD,QAAQ,EACN,SAAS;EACP,OAAO;EACP,MAAM;EACN,QAAQ;EACR,aACE;EACH,EACF;CACD,YAAY,EACV,SAAS;EACP,OAAO;EACP,MAAM;EACN,QAAQ;EACR,aACE;EACH,EACF;CACD,OAAO,EACL,SAAS;EACP,OAAO;EACP,QAAQ;EACR,MAAM;EACN,aAAa;EACb,OAAO,EAAE,MAAM,UAAU;EAC1B,EACF;CACD,UAAU,EACR,SAAS;EACP,OAAO;EACP,MAAM;EACN,QAAQ;EACR,aAAa;EACd,EACF;CACD,YAAY,EACV,SAAS;EACP,OAAO;EACP,MAAM;EACN,QAAQ;EACR,aAAa;EACd,EACF;CACD,UAAU,EACR,SAAS;EACP,OAAO;EACP,aAAa;EACb,OAAO,CACL;GAAE,MAAM;GAAU,QAAQ;GAAQ,EAClC;GAAE,MAAM;GAAW,MAAM,CAAC,MAAM;GAAE,CACnC;EACF,EACF;CACD,WAAW,EACT,SAAS;EACP,OAAO;EACP,MAAM;EACN,aAAa;EACd,EACF;CACD,QAAQ,EACN,SAAS;EACP,OAAO;EACP,MAAM;EACN,aAAa;EACd,EACF;CACD,QAAQ;EACN,SAAS;GACP,OAAO;GACP,MAAM;GACN,aAAa;GACb,OAAO;IACL,MAAM;IACN,MAAM;KAAC;KAAO;KAAO;KAAO;IAC7B;GACF;EACD,WAAW,MAAgB,CAAC,OAAO,MAAM,KAAM,EAAE,CAAc,OAAO,IAAI;EAC3E;CACD,UAAU,EACR,SAAS;EACP,OAAO;EACP,MAAM;EACN,aAAa;EACb,MAAM;GAAC;GAAW;GAAQ;GAAU;EACrC,EACF;CACD,UAAU;EACR,SAAS;GACP,OAAO;GACP,MAAM;GACN,aAAa;GACd;EACD,WAAW,MAAgB,EAAE,KAAM,EAAE,CAAc,OAAO,IAAI;EAC/D;CACD,YAAY;EACV,SAAS;GACP,OAAO;GACP,MAAM;GACN,aAAa;GACd;EACD,WAAW,MAAgB,EAAE,KAAM,EAAE,CAAc,OAAO,IAAI;EAC/D;CACD,uBAAuB,EACrB,SAAS;EACP,OAAO;EACP,MAAM;EACN,aACE;EACH,EACF;CACD,MAAM,EACJ,SAAS;EACP,OAAO;EACP,MAAM;EACN,aAAa;EACb,MAAM;GAAC;GAAe;GAAQ;GAAa;EAC5C,EACF;CACD,UAAU,EACR,SAAS;EACP,OAAO;EACP,MAAM;EACN,aAAa;EACb,MAAM;GACJ;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD;EACF,EACF;CACD,QAAQ;EACN,SAAS;GACP,OAAO;GACP,MAAM;GACN,QAAQ;GACR,aAAa;GACd;EACD,WAAW,MAA8B,EAAE,KAAK;EAChD,UAAU,EAAE;EACb;CACD,QAAQ,EACN,SAAS;EACP,OAAO;EACP,MAAM;EACN,QACE;EACF,aAAa;EACd,EACF;CACD,gBAAgB;EACd,SAAS;GACP,OAAO;GACP,MAAM;GACN,QAAQ;GACR,aACE;GACH;EACD,WAAW,MAA8B,EAAE,KAAK;EAChD,UAAU,EAAE;EACb;CACF,CAAC"}
1
+ {"version":3,"file":"base-executor.untyped.mjs","names":[],"sources":["../../../src/base/base-executor.untyped.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 { defineUntypedSchema } from \"untyped\";\n\nexport default defineUntypedSchema({\n $schema: {\n id: \"BaseExecutorSchema\",\n title: \"Base Executor\",\n description:\n \"A shared/base schema type definition for Powerlines executors\",\n required: []\n },\n config: {\n $schema: {\n title: \"Powerlines Configuration File\",\n type: \"string\",\n format: \"path\",\n description:\n \"The path to the Powerlines configuration file. Alias for `configFile`.\"\n }\n },\n configFile: {\n $schema: {\n title: \"Powerlines Configuration File\",\n type: \"string\",\n format: \"path\",\n description:\n \"The path to the Powerlines configuration file. Alias for `config`.\"\n }\n },\n input: {\n $schema: {\n title: \"Input Entry File(s)\",\n format: \"path\",\n type: \"array\",\n description: \"The entry file(s) that serve as the input for the project\",\n items: { type: \"string\" }\n }\n },\n tsconfig: {\n $schema: {\n title: \"TSConfig Path\",\n type: \"string\",\n format: \"path\",\n description: \"The path to the tsconfig file\"\n }\n },\n outputPath: {\n $schema: {\n title: \"Output Path\",\n type: \"string\",\n format: \"path\",\n description: \"The path to the output directory for the build artifacts\"\n }\n },\n copyPath: {\n $schema: {\n title: \"Copy Path\",\n description: \"A directory path to copy the build artifacts into\",\n oneOf: [\n { type: \"string\", format: \"path\" },\n { type: \"boolean\", enum: [false] }\n ]\n }\n },\n sourceMap: {\n $schema: {\n title: \"Sourcemap\",\n type: \"boolean\",\n description: \"Generate a sourcemap\"\n }\n },\n minify: {\n $schema: {\n title: \"Minify\",\n type: \"boolean\",\n description: \"Minify the output\"\n }\n },\n format: {\n $schema: {\n title: \"Format\",\n type: \"array\",\n description: \"The format to build\",\n items: {\n type: \"string\",\n enum: [\"cjs\", \"esm\", \"iife\"]\n }\n },\n $resolve: (val: string[] = [\"cjs\", \"esm\"]) =>\n val.filter(format => [\"cjs\", \"esm\", \"iife\"].includes(format))\n },\n platform: {\n $schema: {\n title: \"Platform\",\n type: \"string\",\n description: \"The platform to build\",\n enum: [\"neutral\", \"node\", \"browser\"]\n }\n },\n external: {\n $schema: {\n title: \"External\",\n type: \"array\",\n description: \"The external dependencies\"\n },\n $resolve: (val: string[] = []) => ([] as string[]).concat(val)\n },\n noExternal: {\n $schema: {\n title: \"No External\",\n type: \"array\",\n description: \"The dependencies that should not be treated as external\"\n },\n $resolve: (val: string[] = []) => ([] as string[]).concat(val)\n },\n skipNodeModulesBundle: {\n $schema: {\n title: \"Skip Node Modules Bundle\",\n type: \"boolean\",\n description:\n \"Skip bundling node_modules during the build process (if required)\"\n }\n },\n mode: {\n $schema: {\n title: \"Mode\",\n type: \"string\",\n description: \"The build mode\",\n enum: [\"development\", \"test\", \"production\"]\n }\n },\n logLevel: {\n $schema: {\n title: \"Log Level\",\n type: \"string\",\n description: \"The log level to use for the build process\",\n enum: [\n \"fatal\",\n \"error\",\n \"warn\",\n \"success\",\n \"info\",\n \"debug\",\n \"trace\",\n \"silent\"\n ]\n }\n },\n define: {\n $schema: {\n title: \"Define\",\n type: \"object\",\n tsType: \"Record<string, string>\",\n description: \"The `define` values\"\n },\n $resolve: (val: Record<string, string> = {}) => val,\n $default: {}\n },\n assets: {\n $schema: {\n title: \"Assets\",\n type: \"any\",\n tsType:\n \"Array<{ input?: string; output?: string; glob: string; ignore?: string[]; dot?: boolean; }>\",\n description: \"The `assets` values\"\n }\n },\n additionalArgs: {\n $schema: {\n title: \"Additional Arguments\",\n type: \"object\",\n tsType: \"Record<string, string>\",\n description:\n \"The additional arguments provided during execution of the command\"\n },\n $resolve: (val: Record<string, string> = {}) => val,\n $default: {}\n }\n});\n"],"mappings":";;;AAoBA,oCAAe,oBAAoB;CACjC,SAAS;EACP,IAAI;EACJ,OAAO;EACP,aACE;EACF,UAAU,EAAE;EACb;CACD,QAAQ,EACN,SAAS;EACP,OAAO;EACP,MAAM;EACN,QAAQ;EACR,aACE;EACH,EACF;CACD,YAAY,EACV,SAAS;EACP,OAAO;EACP,MAAM;EACN,QAAQ;EACR,aACE;EACH,EACF;CACD,OAAO,EACL,SAAS;EACP,OAAO;EACP,QAAQ;EACR,MAAM;EACN,aAAa;EACb,OAAO,EAAE,MAAM,UAAU;EAC1B,EACF;CACD,UAAU,EACR,SAAS;EACP,OAAO;EACP,MAAM;EACN,QAAQ;EACR,aAAa;EACd,EACF;CACD,YAAY,EACV,SAAS;EACP,OAAO;EACP,MAAM;EACN,QAAQ;EACR,aAAa;EACd,EACF;CACD,UAAU,EACR,SAAS;EACP,OAAO;EACP,aAAa;EACb,OAAO,CACL;GAAE,MAAM;GAAU,QAAQ;GAAQ,EAClC;GAAE,MAAM;GAAW,MAAM,CAAC,MAAM;GAAE,CACnC;EACF,EACF;CACD,WAAW,EACT,SAAS;EACP,OAAO;EACP,MAAM;EACN,aAAa;EACd,EACF;CACD,QAAQ,EACN,SAAS;EACP,OAAO;EACP,MAAM;EACN,aAAa;EACd,EACF;CACD,QAAQ;EACN,SAAS;GACP,OAAO;GACP,MAAM;GACN,aAAa;GACb,OAAO;IACL,MAAM;IACN,MAAM;KAAC;KAAO;KAAO;KAAO;IAC7B;GACF;EACD,WAAW,MAAgB,CAAC,OAAO,MAAM,KACvC,IAAI,QAAO,WAAU;GAAC;GAAO;GAAO;GAAO,CAAC,SAAS,OAAO,CAAC;EAChE;CACD,UAAU,EACR,SAAS;EACP,OAAO;EACP,MAAM;EACN,aAAa;EACb,MAAM;GAAC;GAAW;GAAQ;GAAU;EACrC,EACF;CACD,UAAU;EACR,SAAS;GACP,OAAO;GACP,MAAM;GACN,aAAa;GACd;EACD,WAAW,MAAgB,EAAE,KAAM,EAAE,CAAc,OAAO,IAAI;EAC/D;CACD,YAAY;EACV,SAAS;GACP,OAAO;GACP,MAAM;GACN,aAAa;GACd;EACD,WAAW,MAAgB,EAAE,KAAM,EAAE,CAAc,OAAO,IAAI;EAC/D;CACD,uBAAuB,EACrB,SAAS;EACP,OAAO;EACP,MAAM;EACN,aACE;EACH,EACF;CACD,MAAM,EACJ,SAAS;EACP,OAAO;EACP,MAAM;EACN,aAAa;EACb,MAAM;GAAC;GAAe;GAAQ;GAAa;EAC5C,EACF;CACD,UAAU,EACR,SAAS;EACP,OAAO;EACP,MAAM;EACN,aAAa;EACb,MAAM;GACJ;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD;EACF,EACF;CACD,QAAQ;EACN,SAAS;GACP,OAAO;GACP,MAAM;GACN,QAAQ;GACR,aAAa;GACd;EACD,WAAW,MAA8B,EAAE,KAAK;EAChD,UAAU,EAAE;EACb;CACD,QAAQ,EACN,SAAS;EACP,OAAO;EACP,MAAM;EACN,QACE;EACF,aAAa;EACd,EACF;CACD,gBAAgB;EACd,SAAS;GACP,OAAO;GACP,MAAM;GACN,QAAQ;GACR,aACE;GACH;EACD,WAAW,MAA8B,EAAE,KAAK;EAChD,UAAU,EAAE;EACb;CACF,CAAC"}
@@ -1,8 +1,12 @@
1
1
  import { isError } from "@stryke/type-checks/is-error";
2
+ import { isSetObject } from "@stryke/type-checks/is-set-object";
2
3
  import defu from "defu";
3
4
  import { createJiti } from "jiti";
4
5
  import { writeError } from "@storm-software/config-tools/logger";
5
6
  import { withRunExecutor } from "@storm-software/workspace-tools/base/base-executor";
7
+ import { omit } from "@stryke/helpers/omit";
8
+ import { isSet } from "@stryke/type-checks/is-set";
9
+ import { isSetArray } from "@stryke/type-checks/is-set-array";
6
10
 
7
11
  //#region src/base/base-executor.ts
8
12
  /**
@@ -21,14 +25,8 @@ function withExecutor(command, executorFn) {
21
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.");
22
26
  const projectConfig = context.projectsConfigurations.projects[context.projectName];
23
27
  const jiti = createJiti(context.root, { cache: false });
24
- const { createEngine } = await jiti.import(jiti.esmResolve("powerlines"));
25
- const api = await createEngine({
26
- name: context.projectName,
27
- cwd: context.root,
28
- root: projectConfig.root,
29
- configFile: options.configFile || options.config,
30
- mode: options.mode
31
- });
28
+ const { createPowerlines } = await jiti.import(jiti.esmResolve("powerlines"));
29
+ const api = await createPowerlines({ cwd: context.root });
32
30
  try {
33
31
  return await Promise.resolve(executorFn(defu({
34
32
  projectName: context.projectName,
@@ -36,10 +34,12 @@ function withExecutor(command, executorFn) {
36
34
  workspaceConfig,
37
35
  command,
38
36
  inlineConfig: defu({
37
+ name: context.projectName,
39
38
  command,
40
- description: projectConfig.metadata?.description,
39
+ root: projectConfig.root,
40
+ configFile: options.configFile || options.config,
41
41
  projectType: projectConfig.projectType,
42
- additionalArgs: options.additionalArgs,
42
+ mode: options.mode,
43
43
  output: {
44
44
  path: options.outputPath,
45
45
  copy: options.copyPath === false ? false : {
@@ -49,20 +49,34 @@ function withExecutor(command, executorFn) {
49
49
  minify: options.minify,
50
50
  sourceMap: options.sourceMap
51
51
  },
52
- resolve: {
53
- external: options.external,
54
- noExternal: options.noExternal,
55
- skipNodeModulesBundle: options.skipNodeModulesBundle
56
- }
57
- }, options)
52
+ resolve: isSetArray(options.external) || isSetArray(options.noExternal) || isSet(options.skipNodeModulesBundle) ? {
53
+ external: isSetArray(options.external) ? options.external : void 0,
54
+ noExternal: isSetArray(options.noExternal) ? options.noExternal : void 0,
55
+ skipNodeModulesBundle: isSet(options.skipNodeModulesBundle) ? options.skipNodeModulesBundle : void 0
56
+ } : void 0,
57
+ define: isSetObject(options.define) ? options.define : void 0,
58
+ assets: isSetObject(options.assets) ? options.assets : void 0
59
+ }, omit(options, [
60
+ "config",
61
+ "configFile",
62
+ "outputPath",
63
+ "copyPath",
64
+ "sourceMap",
65
+ "minify",
66
+ "format",
67
+ "external",
68
+ "noExternal",
69
+ "skipNodeModulesBundle",
70
+ "mode",
71
+ "define",
72
+ "assets"
73
+ ]))
58
74
  }, context), api));
59
75
  } catch (error) {
60
76
  writeError(`An error occurred while executing the Powerlines ${command} command executor: ${isError(error) ? `${error.message}
61
77
 
62
78
  ${error.stack}` : "Unknown error"}`);
63
79
  return { success: false };
64
- } finally {
65
- await api.finalize();
66
80
  }
67
81
  }, {
68
82
  skipReadingConfig: false,
@@ -75,4 +89,4 @@ ${error.stack}` : "Unknown error"}`);
75
89
 
76
90
  //#endregion
77
91
  export { withExecutor as t };
78
- //# sourceMappingURL=base-executor-dweAIT3X.mjs.map
92
+ //# sourceMappingURL=base-executor-86GBuriJ.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base-executor-86GBuriJ.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 });\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,EACjC,KAAK,QAAQ,MACd,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,10 +1,14 @@
1
1
  const require_chunk = require('./chunk-BE-pF4vm.js');
2
2
  let _stryke_type_checks_is_error = require("@stryke/type-checks/is-error");
3
+ let _stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
3
4
  let defu = require("defu");
4
5
  defu = require_chunk.__toESM(defu);
5
6
  let jiti = require("jiti");
6
7
  let _storm_software_config_tools_logger = require("@storm-software/config-tools/logger");
7
8
  let _storm_software_workspace_tools_base_base_executor = require("@storm-software/workspace-tools/base/base-executor");
9
+ let _stryke_helpers_omit = require("@stryke/helpers/omit");
10
+ let _stryke_type_checks_is_set = require("@stryke/type-checks/is-set");
11
+ let _stryke_type_checks_is_set_array = require("@stryke/type-checks/is-set-array");
8
12
 
9
13
  //#region src/base/base-executor.ts
10
14
  /**
@@ -23,14 +27,8 @@ function withExecutor(command, executorFn) {
23
27
  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.");
24
28
  const projectConfig = context.projectsConfigurations.projects[context.projectName];
25
29
  const jiti$1 = (0, jiti.createJiti)(context.root, { cache: false });
26
- const { createEngine } = await jiti$1.import(jiti$1.esmResolve("powerlines"));
27
- const api = await createEngine({
28
- name: context.projectName,
29
- cwd: context.root,
30
- root: projectConfig.root,
31
- configFile: options.configFile || options.config,
32
- mode: options.mode
33
- });
30
+ const { createPowerlines } = await jiti$1.import(jiti$1.esmResolve("powerlines"));
31
+ const api = await createPowerlines({ cwd: context.root });
34
32
  try {
35
33
  return await Promise.resolve(executorFn((0, defu.default)({
36
34
  projectName: context.projectName,
@@ -38,10 +36,12 @@ function withExecutor(command, executorFn) {
38
36
  workspaceConfig,
39
37
  command,
40
38
  inlineConfig: (0, defu.default)({
39
+ name: context.projectName,
41
40
  command,
42
- description: projectConfig.metadata?.description,
41
+ root: projectConfig.root,
42
+ configFile: options.configFile || options.config,
43
43
  projectType: projectConfig.projectType,
44
- additionalArgs: options.additionalArgs,
44
+ mode: options.mode,
45
45
  output: {
46
46
  path: options.outputPath,
47
47
  copy: options.copyPath === false ? false : {
@@ -51,20 +51,34 @@ function withExecutor(command, executorFn) {
51
51
  minify: options.minify,
52
52
  sourceMap: options.sourceMap
53
53
  },
54
- resolve: {
55
- external: options.external,
56
- noExternal: options.noExternal,
57
- skipNodeModulesBundle: options.skipNodeModulesBundle
58
- }
59
- }, options)
54
+ resolve: (0, _stryke_type_checks_is_set_array.isSetArray)(options.external) || (0, _stryke_type_checks_is_set_array.isSetArray)(options.noExternal) || (0, _stryke_type_checks_is_set.isSet)(options.skipNodeModulesBundle) ? {
55
+ external: (0, _stryke_type_checks_is_set_array.isSetArray)(options.external) ? options.external : void 0,
56
+ noExternal: (0, _stryke_type_checks_is_set_array.isSetArray)(options.noExternal) ? options.noExternal : void 0,
57
+ skipNodeModulesBundle: (0, _stryke_type_checks_is_set.isSet)(options.skipNodeModulesBundle) ? options.skipNodeModulesBundle : void 0
58
+ } : void 0,
59
+ define: (0, _stryke_type_checks_is_set_object.isSetObject)(options.define) ? options.define : void 0,
60
+ assets: (0, _stryke_type_checks_is_set_object.isSetObject)(options.assets) ? options.assets : void 0
61
+ }, (0, _stryke_helpers_omit.omit)(options, [
62
+ "config",
63
+ "configFile",
64
+ "outputPath",
65
+ "copyPath",
66
+ "sourceMap",
67
+ "minify",
68
+ "format",
69
+ "external",
70
+ "noExternal",
71
+ "skipNodeModulesBundle",
72
+ "mode",
73
+ "define",
74
+ "assets"
75
+ ]))
60
76
  }, context), api));
61
77
  } catch (error) {
62
78
  (0, _storm_software_config_tools_logger.writeError)(`An error occurred while executing the Powerlines ${command} command executor: ${(0, _stryke_type_checks_is_error.isError)(error) ? `${error.message}
63
79
 
64
80
  ${error.stack}` : "Unknown error"}`);
65
81
  return { success: false };
66
- } finally {
67
- await api.finalize();
68
82
  }
69
83
  }, {
70
84
  skipReadingConfig: false,
@@ -75,7 +75,11 @@ var base_executor_untyped_default = (0, untyped.defineUntypedSchema)({
75
75
  ]
76
76
  }
77
77
  },
78
- $resolve: (val = ["cjs", "esm"]) => [].concat(val)
78
+ $resolve: (val = ["cjs", "esm"]) => val.filter((format) => [
79
+ "cjs",
80
+ "esm",
81
+ "iife"
82
+ ].includes(format))
79
83
  },
80
84
  platform: { $schema: {
81
85
  title: "Platform",
@@ -74,7 +74,11 @@ var base_executor_untyped_default = defineUntypedSchema({
74
74
  ]
75
75
  }
76
76
  },
77
- $resolve: (val = ["cjs", "esm"]) => [].concat(val)
77
+ $resolve: (val = ["cjs", "esm"]) => val.filter((format) => [
78
+ "cjs",
79
+ "esm",
80
+ "iife"
81
+ ].includes(format))
78
82
  },
79
83
  platform: { $schema: {
80
84
  title: "Platform",
@@ -162,4 +166,4 @@ var base_executor_untyped_default = defineUntypedSchema({
162
166
 
163
167
  //#endregion
164
168
  export { base_executor_untyped_default as t };
165
- //# sourceMappingURL=base-executor.untyped-Kz2OUE_8.mjs.map
169
+ //# sourceMappingURL=base-executor.untyped-BD9-7XGx.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base-executor.untyped-BD9-7XGx.mjs","names":[],"sources":["../../src/base/base-executor.untyped.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 { defineUntypedSchema } from \"untyped\";\n\nexport default defineUntypedSchema({\n $schema: {\n id: \"BaseExecutorSchema\",\n title: \"Base Executor\",\n description:\n \"A shared/base schema type definition for Powerlines executors\",\n required: []\n },\n config: {\n $schema: {\n title: \"Powerlines Configuration File\",\n type: \"string\",\n format: \"path\",\n description:\n \"The path to the Powerlines configuration file. Alias for `configFile`.\"\n }\n },\n configFile: {\n $schema: {\n title: \"Powerlines Configuration File\",\n type: \"string\",\n format: \"path\",\n description:\n \"The path to the Powerlines configuration file. Alias for `config`.\"\n }\n },\n input: {\n $schema: {\n title: \"Input Entry File(s)\",\n format: \"path\",\n type: \"array\",\n description: \"The entry file(s) that serve as the input for the project\",\n items: { type: \"string\" }\n }\n },\n tsconfig: {\n $schema: {\n title: \"TSConfig Path\",\n type: \"string\",\n format: \"path\",\n description: \"The path to the tsconfig file\"\n }\n },\n outputPath: {\n $schema: {\n title: \"Output Path\",\n type: \"string\",\n format: \"path\",\n description: \"The path to the output directory for the build artifacts\"\n }\n },\n copyPath: {\n $schema: {\n title: \"Copy Path\",\n description: \"A directory path to copy the build artifacts into\",\n oneOf: [\n { type: \"string\", format: \"path\" },\n { type: \"boolean\", enum: [false] }\n ]\n }\n },\n sourceMap: {\n $schema: {\n title: \"Sourcemap\",\n type: \"boolean\",\n description: \"Generate a sourcemap\"\n }\n },\n minify: {\n $schema: {\n title: \"Minify\",\n type: \"boolean\",\n description: \"Minify the output\"\n }\n },\n format: {\n $schema: {\n title: \"Format\",\n type: \"array\",\n description: \"The format to build\",\n items: {\n type: \"string\",\n enum: [\"cjs\", \"esm\", \"iife\"]\n }\n },\n $resolve: (val: string[] = [\"cjs\", \"esm\"]) =>\n val.filter(format => [\"cjs\", \"esm\", \"iife\"].includes(format))\n },\n platform: {\n $schema: {\n title: \"Platform\",\n type: \"string\",\n description: \"The platform to build\",\n enum: [\"neutral\", \"node\", \"browser\"]\n }\n },\n external: {\n $schema: {\n title: \"External\",\n type: \"array\",\n description: \"The external dependencies\"\n },\n $resolve: (val: string[] = []) => ([] as string[]).concat(val)\n },\n noExternal: {\n $schema: {\n title: \"No External\",\n type: \"array\",\n description: \"The dependencies that should not be treated as external\"\n },\n $resolve: (val: string[] = []) => ([] as string[]).concat(val)\n },\n skipNodeModulesBundle: {\n $schema: {\n title: \"Skip Node Modules Bundle\",\n type: \"boolean\",\n description:\n \"Skip bundling node_modules during the build process (if required)\"\n }\n },\n mode: {\n $schema: {\n title: \"Mode\",\n type: \"string\",\n description: \"The build mode\",\n enum: [\"development\", \"test\", \"production\"]\n }\n },\n logLevel: {\n $schema: {\n title: \"Log Level\",\n type: \"string\",\n description: \"The log level to use for the build process\",\n enum: [\n \"fatal\",\n \"error\",\n \"warn\",\n \"success\",\n \"info\",\n \"debug\",\n \"trace\",\n \"silent\"\n ]\n }\n },\n define: {\n $schema: {\n title: \"Define\",\n type: \"object\",\n tsType: \"Record<string, string>\",\n description: \"The `define` values\"\n },\n $resolve: (val: Record<string, string> = {}) => val,\n $default: {}\n },\n assets: {\n $schema: {\n title: \"Assets\",\n type: \"any\",\n tsType:\n \"Array<{ input?: string; output?: string; glob: string; ignore?: string[]; dot?: boolean; }>\",\n description: \"The `assets` values\"\n }\n },\n additionalArgs: {\n $schema: {\n title: \"Additional Arguments\",\n type: \"object\",\n tsType: \"Record<string, string>\",\n description:\n \"The additional arguments provided during execution of the command\"\n },\n $resolve: (val: Record<string, string> = {}) => val,\n $default: {}\n }\n});\n"],"mappings":";;;AAoBA,oCAAe,oBAAoB;CACjC,SAAS;EACP,IAAI;EACJ,OAAO;EACP,aACE;EACF,UAAU,EAAE;EACb;CACD,QAAQ,EACN,SAAS;EACP,OAAO;EACP,MAAM;EACN,QAAQ;EACR,aACE;EACH,EACF;CACD,YAAY,EACV,SAAS;EACP,OAAO;EACP,MAAM;EACN,QAAQ;EACR,aACE;EACH,EACF;CACD,OAAO,EACL,SAAS;EACP,OAAO;EACP,QAAQ;EACR,MAAM;EACN,aAAa;EACb,OAAO,EAAE,MAAM,UAAU;EAC1B,EACF;CACD,UAAU,EACR,SAAS;EACP,OAAO;EACP,MAAM;EACN,QAAQ;EACR,aAAa;EACd,EACF;CACD,YAAY,EACV,SAAS;EACP,OAAO;EACP,MAAM;EACN,QAAQ;EACR,aAAa;EACd,EACF;CACD,UAAU,EACR,SAAS;EACP,OAAO;EACP,aAAa;EACb,OAAO,CACL;GAAE,MAAM;GAAU,QAAQ;GAAQ,EAClC;GAAE,MAAM;GAAW,MAAM,CAAC,MAAM;GAAE,CACnC;EACF,EACF;CACD,WAAW,EACT,SAAS;EACP,OAAO;EACP,MAAM;EACN,aAAa;EACd,EACF;CACD,QAAQ,EACN,SAAS;EACP,OAAO;EACP,MAAM;EACN,aAAa;EACd,EACF;CACD,QAAQ;EACN,SAAS;GACP,OAAO;GACP,MAAM;GACN,aAAa;GACb,OAAO;IACL,MAAM;IACN,MAAM;KAAC;KAAO;KAAO;KAAO;IAC7B;GACF;EACD,WAAW,MAAgB,CAAC,OAAO,MAAM,KACvC,IAAI,QAAO,WAAU;GAAC;GAAO;GAAO;GAAO,CAAC,SAAS,OAAO,CAAC;EAChE;CACD,UAAU,EACR,SAAS;EACP,OAAO;EACP,MAAM;EACN,aAAa;EACb,MAAM;GAAC;GAAW;GAAQ;GAAU;EACrC,EACF;CACD,UAAU;EACR,SAAS;GACP,OAAO;GACP,MAAM;GACN,aAAa;GACd;EACD,WAAW,MAAgB,EAAE,KAAM,EAAE,CAAc,OAAO,IAAI;EAC/D;CACD,YAAY;EACV,SAAS;GACP,OAAO;GACP,MAAM;GACN,aAAa;GACd;EACD,WAAW,MAAgB,EAAE,KAAM,EAAE,CAAc,OAAO,IAAI;EAC/D;CACD,uBAAuB,EACrB,SAAS;EACP,OAAO;EACP,MAAM;EACN,aACE;EACH,EACF;CACD,MAAM,EACJ,SAAS;EACP,OAAO;EACP,MAAM;EACN,aAAa;EACb,MAAM;GAAC;GAAe;GAAQ;GAAa;EAC5C,EACF;CACD,UAAU,EACR,SAAS;EACP,OAAO;EACP,MAAM;EACN,aAAa;EACb,MAAM;GACJ;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD;EACF,EACF;CACD,QAAQ;EACN,SAAS;GACP,OAAO;GACP,MAAM;GACN,QAAQ;GACR,aAAa;GACd;EACD,WAAW,MAA8B,EAAE,KAAK;EAChD,UAAU,EAAE;EACb;CACD,QAAQ,EACN,SAAS;EACP,OAAO;EACP,MAAM;EACN,QACE;EACF,aAAa;EACd,EACF;CACD,gBAAgB;EACd,SAAS;GACP,OAAO;GACP,MAAM;GACN,QAAQ;GACR,aACE;GACH;EACD,WAAW,MAA8B,EAAE,KAAK;EAChD,UAAU,EAAE;EACb;CACF,CAAC"}
@@ -1,7 +1,4 @@
1
- import { t as PowerlinesExecutorContext } from "../../base-executor-TyizQv09.mjs";
2
1
  import { PromiseExecutor } from "@nx/devkit";
3
- import { BaseExecutorResult } from "@storm-software/workspace-tools/types";
4
- import { PowerlinesEngine } from "powerlines";
5
2
 
6
3
  //#region src/executors/build/schema.d.ts
7
4
  // Generated by @storm-software/untyped
@@ -184,8 +181,7 @@ interface BuildExecutorSchema {
184
181
  }
185
182
  //#endregion
186
183
  //#region src/executors/build/executor.d.ts
187
- declare function executorFn(context: PowerlinesExecutorContext<"build", BuildExecutorSchema>, api: PowerlinesEngine): Promise<BaseExecutorResult>;
188
184
  declare const executor: PromiseExecutor<BuildExecutorSchema>;
189
185
  //#endregion
190
- export { executor as default, executorFn };
186
+ export { executor as default };
191
187
  //# sourceMappingURL=executor.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"executor.d.mts","names":["BuildExecutorSchema","Array","Record","config","configFile","input","tsconfig","outputPath","copyPath","sourceMap","minify","format","platform","external","noExternal","skipNodeModulesBundle","mode","logLevel","define","assets","output","glob","ignore","dot","additionalArgs","autoInstall","skipCache","entry"],"sources":["../../../../src/executors/build/schema.d.ts","../../../../src/executors/build/executor.ts"],"mappings":";;;;;;;;UAIiBA,mBAAAA;;AAAjB;;;;;;;EASCG,MAAAA;;;;;;;;;EAUAC,UAAAA;;;;;;;;;EAUAC,KAAAA,GAAQJ,KAAAA;;;;;;;;;EAURK,QAAAA;;;;;;;;;EAUAC,UAAAA;;ACzBD;;;;;;;EDmCCC,QAAAA;EChCS;;;;;;EDwCTC,SAAAA;;;ACzBA;;;;EDiCAC,MAAAA;;;;;;;;EASAC,MAAAA,GAASV,KAAAA;;;;;;;;;EAUTW,QAAAA;;;;;;;EAQAC,QAAAA,GAAWZ,KAAAA;;;;;;;EAQXa,UAAAA,GAAab,KAAAA;;;;;;;EAQbc,qBAAAA;;;;;;;;;EAUAC,IAAAA;;;;;;;;;EAUAC,QAAAA;;;;;;;EAQAC,MAAAA,GAAShB,MAAAA;;;;;;;EAQTiB,MAAAA,GAASlB,KAAAA;IAAQI,KAAAA;IAAgBe,MAAAA;IAAiBC,IAAAA;IAAcC,MAAAA;IAAmBC,GAAAA;EAAAA;;;;;;;EAQnFC,cAAAA,GAAiBtB,MAAAA;;;;;;;EAQjBuB,WAAAA;;;;;;;EAQAC,SAAAA;;;;;;;;;EAUAC,KAAAA;AAAAA;;;iBCpKqB,UAAA,CACpB,OAAA,EAAS,yBAAA,UAAmC,mBAAA,GAC5C,GAAA,EAAK,gBAAA,GACJ,OAAA,CAAQ,kBAAA;AAAA,cAiBL,QAAA,EAAU,eAAA,CAAgB,mBAAA"}
1
+ {"version":3,"file":"executor.d.mts","names":["BuildExecutorSchema","Array","Record","config","configFile","input","tsconfig","outputPath","copyPath","sourceMap","minify","format","platform","external","noExternal","skipNodeModulesBundle","mode","logLevel","define","assets","output","glob","ignore","dot","additionalArgs","autoInstall","skipCache","entry"],"sources":["../../../../src/executors/build/schema.d.ts","../../../../src/executors/build/executor.ts"],"mappings":";;;;;UAIiBA,mBAAAA;;;;;;;;;EAShBG,MAAAA;;;;;;;;;EAUAC,UAAAA;;;;;;;;;EAUAC,KAAAA,GAAQJ,KAAAA;;;;;;;;;EAURK,QAAAA;;;;;;;;;EAUAC,UAAAA;;;;;;;;;EAUAC,QAAAA;;;;;;;EAQAC,SAAAA;;;;;;;EAQAC,MAAAA;;;;;;;;EASAC,MAAAA,GAASV,KAAAA;;;;;;;;;EAUTW,QAAAA;;;;;;;EAQAC,QAAAA,GAAWZ,KAAAA;;;;;;;EAQXa,UAAAA,GAAab,KAAAA;;;;;;;EAQbc,qBAAAA;;;;;;;;;EAUAC,IAAAA;;;;;;;;;EAUAC,QAAAA;;;;;;;EAQAC,MAAAA,GAAShB,MAAAA;;;;;;;EAQTiB,MAAAA,GAASlB,KAAAA;IAAQI,KAAAA;IAAgBe,MAAAA;IAAiBC,IAAAA;IAAcC,MAAAA;IAAmBC,GAAAA;EAAAA;;;;;;;EAQnFC,cAAAA,GAAiBtB,MAAAA;;;;;;;EAQjBuB,WAAAA;;;;;;;EAQAC,SAAAA;;;;;;;;;EAUAC,KAAAA;AAAAA;;;cC1JK,QAAA,EAAU,eAAA,CAAgB,mBAAA"}
@@ -1,7 +1,4 @@
1
- import { t as PowerlinesExecutorContext } from "../../base-executor-CuS2Y2T4.js";
2
1
  import { PromiseExecutor } from "@nx/devkit";
3
- import { BaseExecutorResult } from "@storm-software/workspace-tools/types";
4
- import { PowerlinesEngine } from "powerlines";
5
2
 
6
3
  //#region src/executors/build/schema.d.ts
7
4
  // Generated by @storm-software/untyped
@@ -184,8 +181,6 @@ interface BuildExecutorSchema {
184
181
  }
185
182
  //#endregion
186
183
  //#region src/executors/build/executor.d.ts
187
- declare function executorFn(context: PowerlinesExecutorContext<"build", BuildExecutorSchema>, api: PowerlinesEngine): Promise<BaseExecutorResult>;
188
184
  declare const executor: PromiseExecutor<BuildExecutorSchema>;
189
- //#endregion
190
- export { executor as default, executorFn };
185
+ export = executor;
191
186
  //# sourceMappingURL=executor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"executor.d.ts","names":["BuildExecutorSchema","Array","Record","config","configFile","input","tsconfig","outputPath","copyPath","sourceMap","minify","format","platform","external","noExternal","skipNodeModulesBundle","mode","logLevel","define","assets","output","glob","ignore","dot","additionalArgs","autoInstall","skipCache","entry"],"sources":["../../../../src/executors/build/schema.d.ts","../../../../src/executors/build/executor.ts"],"mappings":";;;;;;;;UAIiBA,mBAAAA;;AAAjB;;;;;;;EASCG,MAAAA;;;;;;;;;EAUAC,UAAAA;;;;;;;;;EAUAC,KAAAA,GAAQJ,KAAAA;;;;;;;;;EAURK,QAAAA;;;;;;;;;EAUAC,UAAAA;;ACzBD;;;;;;;EDmCCC,QAAAA;EChCS;;;;;;EDwCTC,SAAAA;;;ACzBA;;;;EDiCAC,MAAAA;;;;;;;;EASAC,MAAAA,GAASV,KAAAA;;;;;;;;;EAUTW,QAAAA;;;;;;;EAQAC,QAAAA,GAAWZ,KAAAA;;;;;;;EAQXa,UAAAA,GAAab,KAAAA;;;;;;;EAQbc,qBAAAA;;;;;;;;;EAUAC,IAAAA;;;;;;;;;EAUAC,QAAAA;;;;;;;EAQAC,MAAAA,GAAShB,MAAAA;;;;;;;EAQTiB,MAAAA,GAASlB,KAAAA;IAAQI,KAAAA;IAAgBe,MAAAA;IAAiBC,IAAAA;IAAcC,MAAAA;IAAmBC,GAAAA;EAAAA;;;;;;;EAQnFC,cAAAA,GAAiBtB,MAAAA;;;;;;;EAQjBuB,WAAAA;;;;;;;EAQAC,SAAAA;;;;;;;;;EAUAC,KAAAA;AAAAA;;;iBCpKqB,UAAA,CACpB,OAAA,EAAS,yBAAA,UAAmC,mBAAA,GAC5C,GAAA,EAAK,gBAAA,GACJ,OAAA,CAAQ,kBAAA;AAAA,cAiBL,QAAA,EAAU,eAAA,CAAgB,mBAAA"}
1
+ {"version":3,"file":"executor.d.ts","names":["BuildExecutorSchema","Array","Record","config","configFile","input","tsconfig","outputPath","copyPath","sourceMap","minify","format","platform","external","noExternal","skipNodeModulesBundle","mode","logLevel","define","assets","output","glob","ignore","dot","additionalArgs","autoInstall","skipCache","entry"],"sources":["../../../../src/executors/build/schema.d.ts","../../../../src/executors/build/executor.ts"],"mappings":";;;;;UAIiBA,mBAAAA;;;;;;;;;EAShBG,MAAAA;;;;;;;;;EAUAC,UAAAA;;;;;;;;;EAUAC,KAAAA,GAAQJ,KAAAA;;;;;;;;;EAURK,QAAAA;;;;;;;;;EAUAC,UAAAA;;;;;;;;;EAUAC,QAAAA;;;;;;;EAQAC,SAAAA;;;;;;;EAQAC,MAAAA;;;;;;;;EASAC,MAAAA,GAASV,KAAAA;;;;;;;;;EAUTW,QAAAA;;;;;;;EAQAC,QAAAA,GAAWZ,KAAAA;;;;;;;EAQXa,UAAAA,GAAab,KAAAA;;;;;;;EAQbc,qBAAAA;;;;;;;;;EAUAC,IAAAA;;;;;;;;;EAUAC,QAAAA;;;;;;;EAQAC,MAAAA,GAAShB,MAAAA;;;;;;;EAQTiB,MAAAA,GAASlB,KAAAA;IAAQI,KAAAA;IAAgBe,MAAAA;IAAiBC,IAAAA;IAAcC,MAAAA;IAAmBC,GAAAA;EAAAA;;;;;;;EAQnFC,cAAAA,GAAiBtB,MAAAA;;;;;;;EAQjBuB,WAAAA;;;;;;;EAQAC,SAAAA;;;;;;;;;EAUAC,KAAAA;AAAAA;;;cC1JK,QAAA,EAAU,eAAA,CAAgB,mBAAA;AAAA"}