@powerlines/engine 0.49.48 โ†’ 0.49.49

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 (35) hide show
  1. package/README.md +4 -10
  2. package/dist/_internal/execution-api-worker.d.cts +3 -2
  3. package/dist/_internal/execution-api-worker.d.cts.map +1 -1
  4. package/dist/_internal/execution-api-worker.d.mts +3 -2
  5. package/dist/_internal/execution-api-worker.d.mts.map +1 -1
  6. package/dist/_internal/execution-api-worker.mjs.map +1 -1
  7. package/dist/api/prepare.cjs +2 -1
  8. package/dist/api/prepare.d.cts.map +1 -1
  9. package/dist/api/prepare.d.mts.map +1 -1
  10. package/dist/api/prepare.mjs +2 -1
  11. package/dist/api/prepare.mjs.map +1 -1
  12. package/dist/api/types.cjs +2 -1
  13. package/dist/api/types.d.cts.map +1 -1
  14. package/dist/api/types.d.mts.map +1 -1
  15. package/dist/api/types.mjs +2 -1
  16. package/dist/api/types.mjs.map +1 -1
  17. package/dist/context/engine-context.cjs +6 -2
  18. package/dist/context/engine-context.d.cts +2 -1
  19. package/dist/context/engine-context.d.cts.map +1 -1
  20. package/dist/context/engine-context.d.mts +2 -1
  21. package/dist/context/engine-context.d.mts.map +1 -1
  22. package/dist/context/engine-context.mjs +6 -2
  23. package/dist/context/engine-context.mjs.map +1 -1
  24. package/dist/engine.d.cts +11 -10
  25. package/dist/engine.d.cts.map +1 -1
  26. package/dist/engine.d.mts +11 -10
  27. package/dist/engine.d.mts.map +1 -1
  28. package/dist/engine.mjs.map +1 -1
  29. package/dist/helpers/create-api.cjs +1 -1
  30. package/dist/helpers/create-api.mjs +1 -1
  31. package/dist/types/context.d.cts +2 -1
  32. package/dist/types/context.d.cts.map +1 -1
  33. package/dist/types/context.d.mts +2 -1
  34. package/dist/types/context.d.mts.map +1 -1
  35. package/package.json +3 -3
package/README.md CHANGED
@@ -27,7 +27,7 @@ This package is part of the <b>๐Ÿ”Œ Powerlines</b> monorepo. Powerlines is the "
27
27
 
28
28
  <h3 align="center">๐Ÿ’ป Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
29
29
 
30
- [![Version](https://img.shields.io/badge/version-0.42.23-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://stormsoftware.com/projects/powerlines)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/powerlines/release.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
30
+ [![Version](https://img.shields.io/badge/version-0.49.48-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://stormsoftware.com/projects/powerlines)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/powerlines/release.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
31
31
 
32
32
  <!-- prettier-ignore-start -->
33
33
  <!-- markdownlint-disable -->
@@ -276,21 +276,15 @@ one where anyone can create software without years of prior development
276
276
  experience serving as a barrier to entry. We hope to achieve this via LLMs,
277
277
  Generative AI, and intuitive, high-level data modeling/programming languages.
278
278
 
279
- Join us on [Discord](https://discord.gg/MQ6YVzakM5) to chat with the team,
280
- receive release notifications, ask questions, and get involved.
279
+ Join us on [**Discord**](https://discord.gg/MQ6YVzakM5) to chat with the team, receive release notifications, ask questions, and get involved.
281
280
 
282
- If this sounds interesting, and you would like to help us in creating the next
283
- generation of development tools, please reach out on our
284
- [website](https://stormsoftware.com/contact) or join our
285
- [Slack channel](https://join.slack.com/t/storm-software/shared_invite/zt-2gsmk04hs-i6yhK_r6urq0dkZYAwq2pA)!
281
+ If this sounds interesting, and you would like to help us in creating the next generation of development tools, please reach out on our [**website**](https://stormsoftware.com/contact) or join our [**Slack**](https://join.slack.com/t/storm-software/shared_invite/zt-2gsmk04hs-i6yhK_r6urq0dkZYAwq2pA) channel! If you plan on publishing content that incorporates the Storm Software brand in anyway, please take a quick look at our [**brand guidelines**](https://github.com/storm-software/media-kit).
286
282
 
287
283
  <br />
288
284
 
289
285
  <div align="center"><a href="https://stormsoftware.com" target="_blank"><img src="https://public.storm-cdn.com/storm-software/icon-circle-fill-dark.png" alt="Storm Software" width="200px"/></a></div>
290
286
  <br />
291
- <div align="center"><a href="https://stormsoftware.com" target="_blank"><img src="https://public.storm-cdn.com/visit-us-text.svg" alt="Visit us at stormsoftware.com" height="90px"/></a></div>
292
-
293
- <br />
287
+ <div align="center"><a href="https://stormsoftware.com" target="_blank"><picture><source media="(prefers-color-scheme: dark)" srcset="https://public.storm-cdn.com/misc/text/visit-us-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://public.storm-cdn.com/misc/text/visit-us-light.png"><img src="https://public.storm-cdn.com/misc/text/visit-us-dark.png" height="90px" alt="Visit us at stormsoftware.com" /></picture></a></div>
294
288
 
295
289
  <div align="right">[ <a href="#table-of-contents">Back to top โ–ฒ</a> ]</div>
296
290
  <br />
@@ -2,6 +2,7 @@ import { EngineExecutionOptions } from "../types/config.cjs";
2
2
  import { EngineContext } from "../types/context.cjs";
3
3
  import { ExecutionApiWorkerInterface } from "../types/api.cjs";
4
4
  import { InlineConfig, Mode } from "@powerlines/core";
5
+ import { PartialKeys } from "@stryke/types/base";
5
6
 
6
7
  //#region src/_internal/execution-api-worker.d.ts
7
8
  declare const RESTARTED: unique symbol;
@@ -50,14 +51,14 @@ declare class ExecutionApiWorker implements ExecutionApiWorkerInterface {
50
51
  * @param options - The options for the worker, including exposed commands, timeout, and hooks for activity and restart.
51
52
  */
52
53
  protected constructor(executionApiPath: string, options: ExecutionApiWorkerOptions);
53
- execute(command: string, options: Omit<EngineExecutionOptions, "channel">, inlineConfig: InlineConfig): Promise<void>;
54
+ execute(command: string, options: Omit<EngineExecutionOptions, "channel">, inlineConfig: PartialKeys<InlineConfig, "command">): Promise<void>;
54
55
  /**
55
56
  * Closes the worker process, terminating it if it's still running. This method should be called when the worker is no longer needed, to free up system resources and ensure a clean shutdown. If the worker has already been terminated, this method will have no effect.
56
57
  */
57
58
  finalize(): Promise<void>;
58
59
  protected onHanging(): void;
59
60
  protected onActivity(): void;
60
- protected innerExecute(command: string, options: Omit<EngineExecutionOptions, "channel">, inlineConfig: InlineConfig): Promise<void>;
61
+ protected innerExecute(command: string, options: Omit<EngineExecutionOptions, "channel">, inlineConfig: PartialKeys<InlineConfig, "command">): Promise<void>;
61
62
  }
62
63
  //#endregion
63
64
  export { ExecutionApiWorker };
@@ -1 +1 @@
1
- {"version":3,"file":"execution-api-worker.d.cts","names":[],"sources":["../../src/_internal/execution-api-worker.ts"],"mappings":";;;;;;cAwCM,SAAA;AAAA,UA8DW,yBAAA;EA9DX;;;;AAAiD;EA8ErD,OAAA;EAhBwC;;;EAqBxC,cAAA;EAAA;;;EAKA,IAAA,GAAO,IAAA;EAUP;;;EALA,IAAA;EAQW;;;EAHX,OAAA,EAAS,aAAa;AAAA;AAAA,cAGX,kBAAA,YAA8B,2BAAA;EAAA;YAsE7B,gBAAA;EAAA,UACA,OAAA,EAAS,yBAAA;EAAA,cAxDP,cAAA,IAAc,OAAA,QAAA,SAAA;EAAA,UASlB,qBAAA;EAuWC;;;;;;;EAAA,OAxVS,IAAA,CAClB,OAAA,UACA,OAAA,EAAS,yBAAA,GAAyB,OAAA,CAAA,kBAAA;EAzCK;;;;;;EAAA,UAqEhC,WAAA,CACG,gBAAA,UACA,OAAA,EAAS,yBAAA;EAsTR,OAAA,CACX,OAAA,UACA,OAAA,EAAS,IAAA,CAAK,sBAAA,cACd,YAAA,EAAc,YAAA,GAAY,OAAA;EAjXd;;;EAoZD,QAAA,IAAY,OAAA;EAAA,UAUf,SAAA;EAAA,UAoBA,UAAA;EAAA,UAUM,YAAA,CACd,OAAA,UACA,OAAA,EAAS,IAAA,CAAK,sBAAA,cACd,YAAA,EAAc,YAAA,GAAY,OAAA;AAAA"}
1
+ {"version":3,"file":"execution-api-worker.d.cts","names":[],"sources":["../../src/_internal/execution-api-worker.ts"],"mappings":";;;;;;;cAyCM,SAAA;AAAA,UA8DW,yBAAA;EA9DX;;;;AAAiD;EA8ErD,OAAA;EAhBwC;;;EAqBxC,cAAA;EAAA;;;EAKA,IAAA,GAAO,IAAA;EAUP;;;EALA,IAAA;EAQW;;;EAHX,OAAA,EAAS,aAAa;AAAA;AAAA,cAGX,kBAAA,YAA8B,2BAAA;EAAA;YAsE7B,gBAAA;EAAA,UACA,OAAA,EAAS,yBAAA;EAAA,cAxDP,cAAA,IAAc,OAAA,QAAA,SAAA;EAAA,UASlB,qBAAA;EAuWC;;;;;;;EAAA,OAxVS,IAAA,CAClB,OAAA,UACA,OAAA,EAAS,yBAAA,GAAyB,OAAA,CAAA,kBAAA;EAqapB;;;;;;EAAA,UAzYP,WAAA,CACG,gBAAA,UACA,OAAA,EAAS,yBAAA;EAsTR,OAAA,CACX,OAAA,UACA,OAAA,EAAS,IAAA,CAAK,sBAAA,cACd,YAAA,EAAc,WAAA,CAAY,YAAA,eAAwB,OAAA;EAzTxC;;;EA4VC,QAAA,IAAY,OAAA;EAAA,UAUf,SAAA;EAAA,UAoBA,UAAA;EAAA,UAUM,YAAA,CACd,OAAA,UACA,OAAA,EAAS,IAAA,CAAK,sBAAA,cACd,YAAA,EAAc,WAAA,CAAY,YAAA,eAAwB,OAAA;AAAA"}
@@ -2,6 +2,7 @@ import { EngineExecutionOptions } from "../types/config.mjs";
2
2
  import { EngineContext } from "../types/context.mjs";
3
3
  import { ExecutionApiWorkerInterface } from "../types/api.mjs";
4
4
  import { InlineConfig, Mode } from "@powerlines/core";
5
+ import { PartialKeys } from "@stryke/types/base";
5
6
 
6
7
  //#region src/_internal/execution-api-worker.d.ts
7
8
  declare const RESTARTED: unique symbol;
@@ -50,14 +51,14 @@ declare class ExecutionApiWorker implements ExecutionApiWorkerInterface {
50
51
  * @param options - The options for the worker, including exposed commands, timeout, and hooks for activity and restart.
51
52
  */
52
53
  protected constructor(executionApiPath: string, options: ExecutionApiWorkerOptions);
53
- execute(command: string, options: Omit<EngineExecutionOptions, "channel">, inlineConfig: InlineConfig): Promise<void>;
54
+ execute(command: string, options: Omit<EngineExecutionOptions, "channel">, inlineConfig: PartialKeys<InlineConfig, "command">): Promise<void>;
54
55
  /**
55
56
  * Closes the worker process, terminating it if it's still running. This method should be called when the worker is no longer needed, to free up system resources and ensure a clean shutdown. If the worker has already been terminated, this method will have no effect.
56
57
  */
57
58
  finalize(): Promise<void>;
58
59
  protected onHanging(): void;
59
60
  protected onActivity(): void;
60
- protected innerExecute(command: string, options: Omit<EngineExecutionOptions, "channel">, inlineConfig: InlineConfig): Promise<void>;
61
+ protected innerExecute(command: string, options: Omit<EngineExecutionOptions, "channel">, inlineConfig: PartialKeys<InlineConfig, "command">): Promise<void>;
61
62
  }
62
63
  //#endregion
63
64
  export { ExecutionApiWorker };
@@ -1 +1 @@
1
- {"version":3,"file":"execution-api-worker.d.mts","names":[],"sources":["../../src/_internal/execution-api-worker.ts"],"mappings":";;;;;;cAwCM,SAAA;AAAA,UA8DW,yBAAA;EA9DX;;;;AAAiD;EA8ErD,OAAA;EAhBwC;;;EAqBxC,cAAA;EAAA;;;EAKA,IAAA,GAAO,IAAA;EAUP;;;EALA,IAAA;EAQW;;;EAHX,OAAA,EAAS,aAAa;AAAA;AAAA,cAGX,kBAAA,YAA8B,2BAAA;EAAA;YAsE7B,gBAAA;EAAA,UACA,OAAA,EAAS,yB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AA,UAUf,SAAA;EAAA,UAoBA,UAAA;EAAA,UAUM,YAAA,CACd,OAAA,UACA,OAAA,EAAS,IAAA,CAAK,sBAAA,cACd,YAAA,EAAc,WAAA,CAAY,YAAA,eAAwB,OAAA;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"execution-api-worker.mjs","names":["#restartPromise","#resolveRestartPromise","#logger","#worker","#createWorker","#activeTasks","#hangingTimer"],"sources":["../../src/_internal/execution-api-worker.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 type { InlineConfig, Logger, Mode } from \"@powerlines/core\";\nimport { getDefaultMode } from \"@powerlines/core/lib/config\";\nimport { isDebug } from \"@stryke/env/environment-checks\";\nimport { resolve } from \"@stryke/fs/resolve\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { isNumber } from \"@stryke/type-checks/is-number\";\nimport { isSet } from \"@stryke/type-checks/is-set\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport { formatDuration } from \"date-fns/formatDuration\";\nimport { pipeline } from \"node:stream\";\nimport { parseArgs } from \"node:util\";\nimport {\n MessageChannel,\n StructuredSerializeOptions\n} from \"node:worker_threads\";\nimport Tinypool from \"tinypool\";\nimport { MessagePortDuplex } from \"../helpers/stream\";\nimport { ExecutionApiWorkerInterface } from \"../types\";\nimport { EngineExecutionOptions } from \"../types/config\";\nimport { EngineContext } from \"../types/context\";\n\nconst RESTARTED = Symbol(\"powerlines-worker:restarted\");\n\n/**\n * The debug address is in the form of `[host:]port`. The host is optional.\n */\ninterface DebugAddress {\n host?: string;\n port: number;\n}\n\n/**\n * Formats the debug address into a string.\n */\nconst formatDebugAddress = ({ host, port }: DebugAddress): string => {\n return host ? `${host}:${port}` : `${port}`;\n};\n\nexport type NodeOptions = Record<string, string | boolean | undefined>;\n\n/**\n * Get's the debug address from the `NODE_OPTIONS` environment variable. If the\n * address is not found, it returns the default host (`undefined`) and port\n * (`9229`).\n *\n * @returns An object with the host and port of the debug address.\n */\nconst getParsedDebugAddress = (\n address: string | boolean | undefined\n): DebugAddress => {\n if (!address || !isString(address)) {\n return { host: undefined, port: 9229 };\n }\n\n // The address is in the form of `[host:]port`. Let's parse the address.\n if (address.includes(\":\")) {\n const [host, port] = address.split(\":\");\n if (!host || !port) {\n throw new Error(`Invalid debug address: ${address}`);\n }\n\n return { host, port: Number.parseInt(port, 10) };\n }\n\n return { host: undefined, port: Number.parseInt(address, 10) };\n};\n\ntype NodeInspectType = \"inspect\" | \"inspect-brk\" | undefined;\n\n/**\n * Get the debug type from the `NODE_OPTIONS` environment variable.\n */\nfunction getNodeDebugType(nodeOptions: NodeOptions): NodeInspectType {\n if (nodeOptions.inspect) {\n return \"inspect\";\n }\n if (nodeOptions[\"inspect-brk\"] || nodeOptions.inspect_brk) {\n return \"inspect-brk\";\n }\n\n return undefined;\n}\n\nexport interface ExecutionApiWorkerOptions {\n // /**\n // * `-1` if not inspectable\n // */\n // debuggerPortOffset?: number;\n\n // /**\n // * Whether to enable source maps support in the worker, which can improve the quality of stack traces at the cost of increased memory usage and slower performance. Defaults to `false`.\n // */\n // enableSourceMaps?: boolean;\n\n /**\n * The maximum time in milliseconds a worker can run before being terminated.\n *\n * @defaultValue 900000 (15 minutes)\n */\n timeout?: number;\n\n /**\n * True if `--max-old-space-size` should not be forwarded to the worker.\n */\n isolatedMemory?: boolean;\n\n /**\n * The mode to run the worker in, which can affect how the worker is initialized and how it behaves. This is determined based on the resolved configuration of the engine, and can be used to optimize the worker for different environments (e.g., development, production, etc.).\n */\n mode?: Mode;\n\n /**\n * An optional root to resolve the execution host path from, which can be used to specify a custom root directory for the worker to use when resolving paths and loading configuration files. If this option is not provided, the worker will use the current working directory as the root directory by default.\n */\n root?: string;\n\n /**\n * The context of the {@link @powerlines/engine#Engine | Engine instance}, which can be used to access the engine's state and services within the worker.\n */\n context: EngineContext;\n}\n\nexport class ExecutionApiWorker implements ExecutionApiWorkerInterface {\n #worker: Tinypool | undefined;\n\n #logger: Logger;\n\n #activeTasks = 0;\n\n #restartPromise: Promise<typeof RESTARTED> | null = null;\n\n #resolveRestartPromise: ((arg: typeof RESTARTED) => void) | null = null;\n\n #hangingTimer: NodeJS.Timeout | false = false;\n\n #createWorker: () => void;\n\n protected get restartPromise() {\n if (!this.#restartPromise) {\n this.#restartPromise = new Promise(resolve => {\n this.#resolveRestartPromise = resolve;\n });\n }\n return this.#restartPromise;\n }\n\n protected resolveRestartPromise() {\n if (this.#resolveRestartPromise) {\n this.#resolveRestartPromise(RESTARTED);\n this.#restartPromise = null;\n this.#resolveRestartPromise = null;\n }\n }\n\n /**\n * Creates a new instance of the Execution API Worker class, which manages a worker process for executing tasks related to the Powerlines Engine. The worker is initialized with the specified options and can be used to run tasks in an isolated environment, with support for automatic restarts and activity monitoring.\n *\n * @param apiPath - The path to the Execution API file.\n * @param options - The options for configuring the worker, including the execution context, exposed methods, timeout, and mode.\n * @returns A promise that resolves to an instance of the ExecutionApiWorker class.\n */\n public static async from(\n apiPath: string,\n options: ExecutionApiWorkerOptions\n ) {\n const mode = await getDefaultMode(options.context.cwd);\n\n const resolvedPath = await resolve(apiPath, {\n paths: [\n options.context.cwd,\n options.root ? appendPath(options.root, options.context.cwd) : undefined\n ].filter(Boolean) as string[]\n });\n if (!resolvedPath) {\n throw new Error(\n `Could not resolve the provided Execution API path: \\`${apiPath}\\`.`\n );\n }\n\n return new ExecutionApiWorker(resolvedPath, {\n mode,\n ...options\n });\n }\n\n /**\n * Create a new API worker instance.\n *\n * @param executionApiPath - The path to the worker file.\n * @param options - The options for the worker, including exposed commands, timeout, and hooks for activity and restart.\n */\n protected constructor(\n protected executionApiPath: string,\n protected options: ExecutionApiWorkerOptions\n ) {\n const {\n isolatedMemory = false,\n mode = \"production\",\n context\n } = this.options;\n\n this.options.timeout ??= 900_000;\n\n this.#logger = context.extendLogger({ category: \"communication\" });\n this.#worker = undefined;\n\n // ensure we end workers if they weren't before exit\n process.on(\"exit\", () => {\n void this.finalize();\n });\n\n let nodeOptions = {} as {\n [longOption: string]: string | boolean | undefined;\n };\n\n const args: string[] = [...process.execArgv];\n if (process.env.NODE_OPTIONS) {\n let isInString = false;\n let willStartNewArg = true;\n\n const stringifiedNodeOptions = process.env.NODE_OPTIONS.split(\" \").filter(\n part =>\n ((part.startsWith('\"') && part.endsWith('\"')) ||\n (part.startsWith(\"'\") && part.endsWith(\"'\"))) &&\n part\n .replace(/^['\"]|['\"]$/g, \"\")\n .split(\" \")\n .filter(isSetString).length > 0 &&\n part\n .replace(/^['\"]|['\"]$/g, \"\")\n .split(\" \")\n .filter(isSetString)\n .every(p => p.startsWith(\"--\"))\n );\n args.push(\n ...stringifiedNodeOptions.map(part => part.replace(/^['\"]|['\"]$/g, \"\"))\n );\n\n const inputNodeModules = stringifiedNodeOptions.reduce((acc, part) => {\n return acc.replace(part, \"\").trim();\n }, process.env.NODE_OPTIONS);\n for (let i = 0; i < inputNodeModules.length; i++) {\n let char = inputNodeModules[i];\n if (char) {\n // Skip any escaped characters in strings.\n if (char === \"\\\\\" && isInString) {\n // Ensure we don't have an escape character at the end.\n if (inputNodeModules.length === i + 1) {\n throw new Error(\"Invalid escape character at the end.\");\n }\n\n // Skip the next character.\n char = inputNodeModules[++i];\n if (!char) {\n continue;\n }\n }\n // If we find a space outside of a string, we should start a new argument.\n else if (char === \" \" && !isInString) {\n willStartNewArg = true;\n continue;\n }\n\n // If we find a quote, we should toggle the string flag.\n else if (char === '\"') {\n isInString = !isInString;\n continue;\n }\n\n // If we're starting a new argument, we should add it to the array.\n if (willStartNewArg) {\n args.push(char);\n willStartNewArg = false;\n }\n // Otherwise, add it to the last argument.\n else {\n args[args.length - 1] += char;\n }\n }\n }\n\n if (isInString) {\n throw new Error(\"Unterminated string\");\n }\n }\n\n if (args.length > 0) {\n const { values, tokens } = parseArgs({\n args,\n strict: false,\n tokens: true\n });\n nodeOptions = values;\n\n // For the `NODE_OPTIONS`, we support arguments with values without the `=`\n // sign. We need to parse them manually.\n let orphan = null;\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i];\n if (!token) continue;\n\n if (token.kind === \"option-terminator\") {\n break;\n }\n\n // When we encounter an option, if it's value is undefined, we should check\n // to see if the following tokens are positional parameters. If they are,\n // then the option is orphaned, and we can assign it.\n if (token.kind === \"option\") {\n orphan = !isSet(token.value) ? token : null;\n continue;\n }\n\n // If the token isn't a positional one, then we can't assign it to the found\n // orphaned option.\n if (token.kind !== \"positional\") {\n orphan = null;\n continue;\n }\n\n // If we don't have an orphan, then we can skip this token.\n if (!orphan) {\n continue;\n }\n\n // If the token is a positional one, and it has a value, so add it to the\n // values object. If it already exists, append it with a space.\n if (orphan.name in nodeOptions && isString(nodeOptions[orphan.name])) {\n nodeOptions[orphan.name] += ` ${token.value}`;\n } else {\n nodeOptions[orphan.name] = token.value;\n }\n }\n }\n\n const originalOptions = { ...nodeOptions };\n\n delete nodeOptions.inspect;\n delete nodeOptions[\"inspect-brk\"];\n delete nodeOptions.inspect_brk;\n\n if (isDebug) {\n const nodeDebugType = getNodeDebugType(originalOptions);\n if (nodeDebugType) {\n const debuggerAddress = getParsedDebugAddress(\n originalOptions[nodeDebugType]\n );\n const address: DebugAddress = {\n host: debuggerAddress.host,\n // current process runs on `address.port`\n port: debuggerAddress.port === 0 ? 0 : debuggerAddress.port + 1 + 1\n };\n nodeOptions[nodeDebugType] = formatDebugAddress(address);\n\n this.#logger.info(\n `Node.js debugger listening on ${nodeOptions[nodeDebugType]}`\n );\n }\n\n nodeOptions[\"enable-source-maps\"] = true;\n }\n\n if (isolatedMemory) {\n delete nodeOptions[\"max-old-space-size\"];\n delete nodeOptions.max_old_space_size;\n }\n\n const execArgv: string[] = [];\n const nodeOptionsParts: string[] = [];\n for (const [key, value] of Object.entries(nodeOptions)) {\n let formatted: string | null = null;\n if (value === true) {\n formatted = `--${key}`;\n } else if (value) {\n formatted = `--${key}=${\n // Values with spaces need to be quoted. We use JSON.stringify to\n // also escape any nested quotes.\n value.includes(\" \") && !value.startsWith('\"')\n ? JSON.stringify(value)\n : value\n }`;\n }\n\n if (formatted === null) {\n continue;\n }\n\n if (\n [\n \"experimental-network-inspection\",\n \"experimental-storage-inspection\",\n \"experimental-worker-inspection\",\n \"experimental-inspector-network-resource\"\n ].includes(key)\n ) {\n execArgv.push(formatted);\n } else {\n nodeOptionsParts.push(formatted);\n }\n }\n\n // // Issue: https://github.com/nodejs/node/issues/59706\n // if (!nodeOptionsParts.includes(\"--no-experimental-strip-types\")) {\n // nodeOptionsParts.push(\"--no-experimental-strip-types\");\n // }\n\n this.#createWorker = () => {\n const env: Record<string, string> = {\n ...process.env,\n NODE_ENV: mode,\n NODE_OPTIONS: nodeOptionsParts.join(\" \"),\n POWERLINES_EXECUTION_WORKER: \"true\"\n };\n\n // Mirror the enablement heuristic from picocolors (see https://github.com/vercel/next.js/blob/6a40da0345939fe4f7b1ae519b296a86dd103432/packages/next/src/lib/picocolors.ts#L21-L24).\n // Picocolors snapshots `process.env`/`stdout.isTTY` at module load time, so when the worker\n // process bootstraps with piped stdio its own check would disable colors. Re-evaluating the\n // same conditions here lets us opt the worker into color output only when the parent would\n // have seen colors, while still respecting explicit opt-outs like NO_COLOR.\n if (\n env.FORCE_COLOR === undefined &&\n !env.NO_COLOR &&\n !env.CI &&\n env.TERM !== \"dumb\" &&\n (process.stdout.isTTY || process.stderr?.isTTY)\n ) {\n env.FORCE_COLOR = \"1\";\n }\n\n this.#logger.debug(\n `Creating worker from file ${\n executionApiPath\n } with execution arguments: ${JSON.stringify(execArgv, null, 2)}`\n );\n\n this.#worker = new Tinypool({\n terminateTimeout: 5000,\n filename: executionApiPath,\n execArgv,\n env\n });\n\n this.#restartPromise = new Promise(resolve => {\n this.#resolveRestartPromise = resolve;\n });\n\n this.#worker.on(\"exit\", (code, signal) => {\n this.#logger.debug(\n `Worker process exited with code ${code} and signal ${signal}`\n );\n\n if ((code || (signal && signal !== \"SIGINT\")) && this.#worker) {\n const error = new Error(\n `Execution Host Worker exited unexpectedly with code ${\n code\n } and signal ${signal}`\n );\n this.#logger.error(error);\n\n void this.finalize().then(() => {\n throw error;\n });\n }\n });\n\n this.#worker.on(\"error\", error => {\n this.#logger.error({\n meta: { category: \"communication\" },\n message: `Worker process emitted an error: ${error.message}`,\n error\n });\n });\n\n // if a child process emits a particular message, we track that as activity\n // so the parent process can keep track of progress\n this.#worker.on(\"message\", data => {\n this.onActivity();\n\n if (Array.isArray(data) && data.length > 1 && isNumber(data[0])) {\n if (data[0] === 0) {\n this.#logger.trace(\n `Received message from worker: ${JSON.stringify(data.slice(1), null, 2)}`\n );\n } else {\n this.#logger.debug(\n `Received error message from worker: ${JSON.stringify(\n data.slice(1),\n null,\n 2\n )}`\n );\n }\n }\n\n this.#logger.trace(\n `Received message from worker: ${JSON.stringify(data, null, 2)}`\n );\n });\n };\n\n this.#createWorker();\n }\n\n public async execute(\n command: string,\n options: Omit<EngineExecutionOptions, \"channel\">,\n inlineConfig: InlineConfig\n ) {\n if (this.options.timeout) {\n this.#activeTasks++;\n try {\n let attempts = 0;\n for (;;) {\n this.onActivity();\n\n const result = await Promise.race([\n this.innerExecute(command, options, inlineConfig),\n this.#restartPromise\n ]);\n if (result !== RESTARTED) {\n return;\n }\n\n this.#logger.warn(\n `Execution Host Worker was restarted while calling method \"${\n command\n }\" (attempt ${attempts++}). Retrying the call...`\n );\n }\n } finally {\n this.#activeTasks--;\n this.onActivity();\n }\n } else {\n await this.innerExecute(command, options, inlineConfig);\n }\n }\n\n /**\n * Closes the worker process, terminating it if it's still running. This method should be called when the worker is no longer needed, to free up system resources and ensure a clean shutdown. If the worker has already been terminated, this method will have no effect.\n */\n public async finalize(): Promise<void> {\n const worker = this.#worker;\n if (!worker) {\n return;\n }\n\n await worker.destroy();\n this.#worker = undefined;\n }\n\n protected onHanging() {\n if (!this.#worker) {\n return;\n }\n\n this.#createWorker();\n\n this.#logger.warn(\n `Sending SIGTERM signal to worker due to timeout${\n this.options.timeout\n ? ` of ${formatDuration({ seconds: this.options.timeout / 1000 })}`\n : \"\"\n }. Subsequent errors may be a result of the worker exiting.`\n );\n\n void this.finalize().then(() => {\n this.#resolveRestartPromise?.(RESTARTED);\n });\n }\n\n protected onActivity() {\n if (this.#hangingTimer) {\n clearTimeout(this.#hangingTimer);\n }\n\n this.#hangingTimer =\n this.#activeTasks > 0 &&\n setTimeout(() => this.onHanging(), this.options.timeout);\n }\n\n protected async innerExecute(\n command: string,\n options: Omit<EngineExecutionOptions, \"channel\">,\n inlineConfig: InlineConfig\n ) {\n if (!this.#worker) {\n throw new Error(\"Execution Host Worker is not initialized\");\n }\n\n const { port1, port2 } = new MessageChannel();\n const promise = this.#worker.run(\n { command, options: { ...options, channel: port2 }, inlineConfig },\n {\n transferList: [port2] as StructuredSerializeOptions\n }\n );\n\n let aborted = false;\n const onActivityAbort = () => {\n if (!aborted) {\n aborted = true;\n }\n };\n const duplex = new MessagePortDuplex(port1, { onActivityAbort });\n\n pipeline(duplex, process.stdout, (err: NodeJS.ErrnoException | null) => {\n if (err) {\n this.#logger.debug(\n `Received exception message from worker: ${JSON.stringify(\n err,\n null,\n 2\n )}`\n );\n\n throw err;\n }\n });\n\n await promise;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAwCA,MAAM,YAAY,OAAO,6BAA6B;;;;AAatD,MAAM,sBAAsB,EAAE,MAAM,WAAiC;CACnE,OAAO,OAAO,GAAG,KAAK,GAAG,SAAS,GAAG;AACvC;;;;;;;;AAWA,MAAM,yBACJ,YACiB;CACjB,IAAI,CAAC,WA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,SAAS,KAAKF;EACpB,IAAI,CAAC,QACH;EAGF,MAAM,OAAO,QAAQ;EACrB,KAAKA,UAAU;CACjB;CAEA,AAAU,YAAY;EACpB,IAAI,CAAC,KAAKA,SACR;EAGF,KAAKC,cAAc;EAEnB,KAAKF,QAAQ,KACX,kDACE,KAAK,QAAQ,UACT,OAAO,eAAe,EAAE,SAAS,KAAK,QAAQ,UAAU,IAAK,CAAC,MAC9D,GACL,2DACH;EAEA,AAAK,KAAK,SAAS,CAAC,CAAC,WAAW;GAC9B,KAAKD,yBAAyB,SAAS;EACzC,CAAC;CACH;CAEA,AAAU,aAAa;EACrB,IAAI,KAAKK,eACP,aAAa,KAAKA,aAAa;EAGjC,KAAKA,gBACH,KAAKD,eAAe,KACpB,iBAAiB,KAAK,UAAU,GAAG,KAAK,QAAQ,OAAO;CAC3D;CAEA,MAAgB,aACd,SACA,SACA,cACA;EACA,IAAI,CAAC,KAAKF,SACR,MAAM,IAAI,MAAM,0CAA0C;EAG5D,MAAM,EAAE,OAAO,UAAU,IAAI,eAAe;EAC5C,MAAM,UAAU,KAAKA,QAAQ,IAC3B;GAAE;GAAS,SAAS;IAAE,GAAG;IAAS,SAAS;GAAM;GAAG;EAAa,GACjE,EACE,cAAc,CAAC,KAAK,EACtB,CACF;EAEA,IAAI,UAAU;EACd,MAAM,wBAAwB;GAC5B,IAAI,CAAC,SACH,UAAU;EAEd;EAGA,SAAS,IAFU,kBAAkB,OAAO,EAAE,gBAAgB,CAEhD,GAAG,QAAQ,SAAS,QAAsC;GACtE,IAAI,KAAK;IACP,KAAKD,QAAQ,MACX,2CAA2C,KAAK,UAC9C,KACA,MACA,CACF,GACF;IAEA,MAAM;GACR;EACF,CAAC;EAED,MAAM;CACR;AACF"}
1
+ {"version":3,"file":"execution-api-worker.mjs","names":["#restartPromise","#resolveRestartPromise","#logger","#worker","#createWorker","#activeTasks","#hangingTimer"],"sources":["../../src/_internal/execution-api-worker.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 type { InlineConfig, Logger, Mode } from \"@powerlines/core\";\nimport { getDefaultMode } from \"@powerlines/core/lib/config\";\nimport { isDebug } from \"@stryke/env/environment-checks\";\nimport { resolve } from \"@stryke/fs/resolve\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { isNumber } from \"@stryke/type-checks/is-number\";\nimport { isSet } from \"@stryke/type-checks/is-set\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport { PartialKeys } from \"@stryke/types/base\";\nimport { formatDuration } from \"date-fns/formatDuration\";\nimport { pipeline } from \"node:stream\";\nimport { parseArgs } from \"node:util\";\nimport {\n MessageChannel,\n StructuredSerializeOptions\n} from \"node:worker_threads\";\nimport Tinypool from \"tinypool\";\nimport { MessagePortDuplex } from \"../helpers/stream\";\nimport { ExecutionApiWorkerInterface } from \"../types\";\nimport { EngineExecutionOptions } from \"../types/config\";\nimport { EngineContext } from \"../types/context\";\n\nconst RESTARTED = Symbol(\"powerlines-worker:restarted\");\n\n/**\n * The debug address is in the form of `[host:]port`. The host is optional.\n */\ninterface DebugAddress {\n host?: string;\n port: number;\n}\n\n/**\n * Formats the debug address into a string.\n */\nconst formatDebugAddress = ({ host, port }: DebugAddress): string => {\n return host ? `${host}:${port}` : `${port}`;\n};\n\nexport type NodeOptions = Record<string, string | boolean | undefined>;\n\n/**\n * Get's the debug address from the `NODE_OPTIONS` environment variable. If the\n * address is not found, it returns the default host (`undefined`) and port\n * (`9229`).\n *\n * @returns An object with the host and port of the debug address.\n */\nconst getParsedDebugAddress = (\n address: string | boolean | undefined\n): DebugAddress => {\n if (!address || !isString(address)) {\n return { host: undefined, port: 9229 };\n }\n\n // The address is in the form of `[host:]port`. Let's parse the address.\n if (address.includes(\":\")) {\n const [host, port] = address.split(\":\");\n if (!host || !port) {\n throw new Error(`Invalid debug address: ${address}`);\n }\n\n return { host, port: Number.parseInt(port, 10) };\n }\n\n return { host: undefined, port: Number.parseInt(address, 10) };\n};\n\ntype NodeInspectType = \"inspect\" | \"inspect-brk\" | undefined;\n\n/**\n * Get the debug type from the `NODE_OPTIONS` environment variable.\n */\nfunction getNodeDebugType(nodeOptions: NodeOptions): NodeInspectType {\n if (nodeOptions.inspect) {\n return \"inspect\";\n }\n if (nodeOptions[\"inspect-brk\"] || nodeOptions.inspect_brk) {\n return \"inspect-brk\";\n }\n\n return undefined;\n}\n\nexport interface ExecutionApiWorkerOptions {\n // /**\n // * `-1` if not inspectable\n // */\n // debuggerPortOffset?: number;\n\n // /**\n // * Whether to enable source maps support in the worker, which can improve the quality of stack traces at the cost of increased memory usage and slower performance. Defaults to `false`.\n // */\n // enableSourceMaps?: boolean;\n\n /**\n * The maximum time in milliseconds a worker can run before being terminated.\n *\n * @defaultValue 900000 (15 minutes)\n */\n timeout?: number;\n\n /**\n * True if `--max-old-space-size` should not be forwarded to the worker.\n */\n isolatedMemory?: boolean;\n\n /**\n * The mode to run the worker in, which can affect how the worker is initialized and how it behaves. This is determined based on the resolved configuration of the engine, and can be used to optimize the worker for different environments (e.g., development, production, etc.).\n */\n mode?: Mode;\n\n /**\n * An optional root to resolve the execution host path from, which can be used to specify a custom root directory for the worker to use when resolving paths and loading configuration files. If this option is not provided, the worker will use the current working directory as the root directory by default.\n */\n root?: string;\n\n /**\n * The context of the {@link @powerlines/engine#Engine | Engine instance}, which can be used to access the engine's state and services within the worker.\n */\n context: EngineContext;\n}\n\nexport class ExecutionApiWorker implements ExecutionApiWorkerInterface {\n #worker: Tinypool | undefined;\n\n #logger: Logger;\n\n #activeTasks = 0;\n\n #restartPromise: Promise<typeof RESTARTED> | null = null;\n\n #resolveRestartPromise: ((arg: typeof RESTARTED) => void) | null = null;\n\n #hangingTimer: NodeJS.Timeout | false = false;\n\n #createWorker: () => void;\n\n protected get restartPromise() {\n if (!this.#restartPromise) {\n this.#restartPromise = new Promise(resolve => {\n this.#resolveRestartPromise = resolve;\n });\n }\n return this.#restartPromise;\n }\n\n protected resolveRestartPromise() {\n if (this.#resolveRestartPromise) {\n this.#resolveRestartPromise(RESTARTED);\n this.#restartPromise = null;\n this.#resolveRestartPromise = null;\n }\n }\n\n /**\n * Creates a new instance of the Execution API Worker class, which manages a worker process for executing tasks related to the Powerlines Engine. The worker is initialized with the specified options and can be used to run tasks in an isolated environment, with support for automatic restarts and activity monitoring.\n *\n * @param apiPath - The path to the Execution API file.\n * @param options - The options for configuring the worker, including the execution context, exposed methods, timeout, and mode.\n * @returns A promise that resolves to an instance of the ExecutionApiWorker class.\n */\n public static async from(\n apiPath: string,\n options: ExecutionApiWorkerOptions\n ) {\n const mode = await getDefaultMode(options.context.cwd);\n\n const resolvedPath = await resolve(apiPath, {\n paths: [\n options.context.cwd,\n options.root ? appendPath(options.root, options.context.cwd) : undefined\n ].filter(Boolean) as string[]\n });\n if (!resolvedPath) {\n throw new Error(\n `Could not resolve the provided Execution API path: \\`${apiPath}\\`.`\n );\n }\n\n return new ExecutionApiWorker(resolvedPath, {\n mode,\n ...options\n });\n }\n\n /**\n * Create a new API worker instance.\n *\n * @param executionApiPath - The path to the worker file.\n * @param options - The options for the worker, including exposed commands, timeout, and hooks for activity and restart.\n */\n protected constructor(\n protected executionApiPath: string,\n protected options: ExecutionApiWorkerOptions\n ) {\n const {\n isolatedMemory = false,\n mode = \"production\",\n context\n } = this.options;\n\n this.options.timeout ??= 900_000;\n\n this.#logger = context.extendLogger({ category: \"communication\" });\n this.#worker = undefined;\n\n // ensure we end workers if they weren't before exit\n process.on(\"exit\", () => {\n void this.finalize();\n });\n\n let nodeOptions = {} as {\n [longOption: string]: string | boolean | undefined;\n };\n\n const args: string[] = [...process.execArgv];\n if (process.env.NODE_OPTIONS) {\n let isInString = false;\n let willStartNewArg = true;\n\n const stringifiedNodeOptions = process.env.NODE_OPTIONS.split(\" \").filter(\n part =>\n ((part.startsWith('\"') && part.endsWith('\"')) ||\n (part.startsWith(\"'\") && part.endsWith(\"'\"))) &&\n part\n .replace(/^['\"]|['\"]$/g, \"\")\n .split(\" \")\n .filter(isSetString).length > 0 &&\n part\n .replace(/^['\"]|['\"]$/g, \"\")\n .split(\" \")\n .filter(isSetString)\n .every(p => p.startsWith(\"--\"))\n );\n args.push(\n ...stringifiedNodeOptions.map(part => part.replace(/^['\"]|['\"]$/g, \"\"))\n );\n\n const inputNodeModules = stringifiedNodeOptions.reduce((acc, part) => {\n return acc.replace(part, \"\").trim();\n }, process.env.NODE_OPTIONS);\n for (let i = 0; i < inputNodeModules.length; i++) {\n let char = inputNodeModules[i];\n if (char) {\n // Skip any escaped characters in strings.\n if (char === \"\\\\\" && isInString) {\n // Ensure we don't have an escape character at the end.\n if (inputNodeModules.length === i + 1) {\n throw new Error(\"Invalid escape character at the end.\");\n }\n\n // Skip the next character.\n char = inputNodeModules[++i];\n if (!char) {\n continue;\n }\n }\n // If we find a space outside of a string, we should start a new argument.\n else if (char === \" \" && !isInString) {\n willStartNewArg = true;\n continue;\n }\n\n // If we find a quote, we should toggle the string flag.\n else if (char === '\"') {\n isInString = !isInString;\n continue;\n }\n\n // If we're starting a new argument, we should add it to the array.\n if (willStartNewArg) {\n args.push(char);\n willStartNewArg = false;\n }\n // Otherwise, add it to the last argument.\n else {\n args[args.length - 1] += char;\n }\n }\n }\n\n if (isInString) {\n throw new Error(\"Unterminated string\");\n }\n }\n\n if (args.length > 0) {\n const { values, tokens } = parseArgs({\n args,\n strict: false,\n tokens: true\n });\n nodeOptions = values;\n\n // For the `NODE_OPTIONS`, we support arguments with values without the `=`\n // sign. We need to parse them manually.\n let orphan = null;\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i];\n if (!token) continue;\n\n if (token.kind === \"option-terminator\") {\n break;\n }\n\n // When we encounter an option, if it's value is undefined, we should check\n // to see if the following tokens are positional parameters. If they are,\n // then the option is orphaned, and we can assign it.\n if (token.kind === \"option\") {\n orphan = !isSet(token.value) ? token : null;\n continue;\n }\n\n // If the token isn't a positional one, then we can't assign it to the found\n // orphaned option.\n if (token.kind !== \"positional\") {\n orphan = null;\n continue;\n }\n\n // If we don't have an orphan, then we can skip this token.\n if (!orphan) {\n continue;\n }\n\n // If the token is a positional one, and it has a value, so add it to the\n // values object. If it already exists, append it with a space.\n if (orphan.name in nodeOptions && isString(nodeOptions[orphan.name])) {\n nodeOptions[orphan.name] += ` ${token.value}`;\n } else {\n nodeOptions[orphan.name] = token.value;\n }\n }\n }\n\n const originalOptions = { ...nodeOptions };\n\n delete nodeOptions.inspect;\n delete nodeOptions[\"inspect-brk\"];\n delete nodeOptions.inspect_brk;\n\n if (isDebug) {\n const nodeDebugType = getNodeDebugType(originalOptions);\n if (nodeDebugType) {\n const debuggerAddress = getParsedDebugAddress(\n originalOptions[nodeDebugType]\n );\n const address: DebugAddress = {\n host: debuggerAddress.host,\n // current process runs on `address.port`\n port: debuggerAddress.port === 0 ? 0 : debuggerAddress.port + 1 + 1\n };\n nodeOptions[nodeDebugType] = formatDebugAddress(address);\n\n this.#logger.info(\n `Node.js debugger listening on ${nodeOptions[nodeDebugType]}`\n );\n }\n\n nodeOptions[\"enable-source-maps\"] = true;\n }\n\n if (isolatedMemory) {\n delete nodeOptions[\"max-old-space-size\"];\n delete nodeOptions.max_old_space_size;\n }\n\n const execArgv: string[] = [];\n const nodeOptionsParts: string[] = [];\n for (const [key, value] of Object.entries(nodeOptions)) {\n let formatted: string | null = null;\n if (value === true) {\n formatted = `--${key}`;\n } else if (value) {\n formatted = `--${key}=${\n // Values with spaces need to be quoted. We use JSON.stringify to\n // also escape any nested quotes.\n value.includes(\" \") && !value.startsWith('\"')\n ? JSON.stringify(value)\n : value\n }`;\n }\n\n if (formatted === null) {\n continue;\n }\n\n if (\n [\n \"experimental-network-inspection\",\n \"experimental-storage-inspection\",\n \"experimental-worker-inspection\",\n \"experimental-inspector-network-resource\"\n ].includes(key)\n ) {\n execArgv.push(formatted);\n } else {\n nodeOptionsParts.push(formatted);\n }\n }\n\n // // Issue: https://github.com/nodejs/node/issues/59706\n // if (!nodeOptionsParts.includes(\"--no-experimental-strip-types\")) {\n // nodeOptionsParts.push(\"--no-experimental-strip-types\");\n // }\n\n this.#createWorker = () => {\n const env: Record<string, string> = {\n ...process.env,\n NODE_ENV: mode,\n NODE_OPTIONS: nodeOptionsParts.join(\" \"),\n POWERLINES_EXECUTION_WORKER: \"true\"\n };\n\n // Mirror the enablement heuristic from picocolors (see https://github.com/vercel/next.js/blob/6a40da0345939fe4f7b1ae519b296a86dd103432/packages/next/src/lib/picocolors.ts#L21-L24).\n // Picocolors snapshots `process.env`/`stdout.isTTY` at module load time, so when the worker\n // process bootstraps with piped stdio its own check would disable colors. Re-evaluating the\n // same conditions here lets us opt the worker into color output only when the parent would\n // have seen colors, while still respecting explicit opt-outs like NO_COLOR.\n if (\n env.FORCE_COLOR === undefined &&\n !env.NO_COLOR &&\n !env.CI &&\n env.TERM !== \"dumb\" &&\n (process.stdout.isTTY || process.stderr?.isTTY)\n ) {\n env.FORCE_COLOR = \"1\";\n }\n\n this.#logger.debug(\n `Creating worker from file ${\n executionApiPath\n } with execution arguments: ${JSON.stringify(execArgv, null, 2)}`\n );\n\n this.#worker = new Tinypool({\n terminateTimeout: 5000,\n filename: executionApiPath,\n execArgv,\n env\n });\n\n this.#restartPromise = new Promise(resolve => {\n this.#resolveRestartPromise = resolve;\n });\n\n this.#worker.on(\"exit\", (code, signal) => {\n this.#logger.debug(\n `Worker process exited with code ${code} and signal ${signal}`\n );\n\n if ((code || (signal && signal !== \"SIGINT\")) && this.#worker) {\n const error = new Error(\n `Execution Host Worker exited unexpectedly with code ${\n code\n } and signal ${signal}`\n );\n this.#logger.error(error);\n\n void this.finalize().then(() => {\n throw error;\n });\n }\n });\n\n this.#worker.on(\"error\", error => {\n this.#logger.error({\n meta: { category: \"communication\" },\n message: `Worker process emitted an error: ${error.message}`,\n error\n });\n });\n\n // if a child process emits a particular message, we track that as activity\n // so the parent process can keep track of progress\n this.#worker.on(\"message\", data => {\n this.onActivity();\n\n if (Array.isArray(data) && data.length > 1 && isNumber(data[0])) {\n if (data[0] === 0) {\n this.#logger.trace(\n `Received message from worker: ${JSON.stringify(data.slice(1), null, 2)}`\n );\n } else {\n this.#logger.debug(\n `Received error message from worker: ${JSON.stringify(\n data.slice(1),\n null,\n 2\n )}`\n );\n }\n }\n\n this.#logger.trace(\n `Received message from worker: ${JSON.stringify(data, null, 2)}`\n );\n });\n };\n\n this.#createWorker();\n }\n\n public async execute(\n command: string,\n options: Omit<EngineExecutionOptions, \"channel\">,\n inlineConfig: PartialKeys<InlineConfig, \"command\">\n ) {\n if (this.options.timeout) {\n this.#activeTasks++;\n try {\n let attempts = 0;\n for (;;) {\n this.onActivity();\n\n const result = await Promise.race([\n this.innerExecute(command, options, inlineConfig),\n this.#restartPromise\n ]);\n if (result !== RESTARTED) {\n return;\n }\n\n this.#logger.warn(\n `Execution Host Worker was restarted while calling method \"${\n command\n }\" (attempt ${attempts++}). Retrying the call...`\n );\n }\n } finally {\n this.#activeTasks--;\n this.onActivity();\n }\n } else {\n await this.innerExecute(command, options, inlineConfig);\n }\n }\n\n /**\n * Closes the worker process, terminating it if it's still running. This method should be called when the worker is no longer needed, to free up system resources and ensure a clean shutdown. If the worker has already been terminated, this method will have no effect.\n */\n public async finalize(): Promise<void> {\n const worker = this.#worker;\n if (!worker) {\n return;\n }\n\n await worker.destroy();\n this.#worker = undefined;\n }\n\n protected onHanging() {\n if (!this.#worker) {\n return;\n }\n\n this.#createWorker();\n\n this.#logger.warn(\n `Sending SIGTERM signal to worker due to timeout${\n this.options.timeout\n ? ` of ${formatDuration({ seconds: this.options.timeout / 1000 })}`\n : \"\"\n }. Subsequent errors may be a result of the worker exiting.`\n );\n\n void this.finalize().then(() => {\n this.#resolveRestartPromise?.(RESTARTED);\n });\n }\n\n protected onActivity() {\n if (this.#hangingTimer) {\n clearTimeout(this.#hangingTimer);\n }\n\n this.#hangingTimer =\n this.#activeTasks > 0 &&\n setTimeout(() => this.onHanging(), this.options.timeout);\n }\n\n protected async innerExecute(\n command: string,\n options: Omit<EngineExecutionOptions, \"channel\">,\n inlineConfig: PartialKeys<InlineConfig, \"command\">\n ) {\n if (!this.#worker) {\n throw new Error(\"Execution Host Worker is not initialized\");\n }\n\n const { port1, port2 } = new MessageChannel();\n const promise = this.#worker.run(\n { command, options: { ...options, channel: port2 }, inlineConfig },\n {\n transferList: [port2] as StructuredSerializeOptions\n }\n );\n\n let aborted = false;\n const onActivityAbort = () => {\n if (!aborted) {\n aborted = true;\n }\n };\n const duplex = new MessagePortDuplex(port1, { onActivityAbort });\n\n pipeline(duplex, process.stdout, (err: NodeJS.ErrnoException | null) => {\n if (err) {\n this.#logger.debug(\n `Received exception message from worker: ${JSON.stringify(\n err,\n null,\n 2\n )}`\n );\n\n throw err;\n }\n });\n\n await promise;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAyCA,MAAM,YAAY,OAAO,6BAA6B;;;;AAatD,MAAM,sBAAsB,EAAE,MAAM,WAAiC;CACnE,OAAO,OAAO,GAAG,KAAK,GAAG,SAAS,GAAG;AACvC;;;;;;;;AAWA,MAAM,yBACJ,YACiB;CACjB,IAAI,CAAC,WAAW,CAAC,SAAS,OAAO,GAC/B,OAAO;EAAE,MAAM;EAAW,MAAM;CAAK;CAIvC,IAAI,QAAQ,SAAS,GAAG,GAAG;EACzB,MAAM,CAAC,MAAM,QAAQ,QAAQ,MAAM,GAAG;EACtC,IAAI,CAAC,QAAQ,CAAC,MACZ,MAAM,IAAI,MAAM,0BAA0B,SAAS;EAGrD,OAAO;GAAE;GAAM,MAAM,OAAO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,MAC9D,GACL,2DACH;EAEA,AAAK,KAAK,SAAS,CAAC,CAAC,WAAW;GAC9B,KAAKD,yBAAyB,SAAS;EACzC,CAAC;CACH;CAEA,AAAU,aAAa;EACrB,IAAI,KAAKK,eACP,aAAa,KAAKA,aAAa;EAGjC,KAAKA,gBACH,KAAKD,eAAe,KACpB,iBAAiB,KAAK,UAAU,GAAG,KAAK,QAAQ,OAAO;CAC3D;CAEA,MAAgB,aACd,SACA,SACA,cACA;EACA,IAAI,CAAC,KAAKF,SACR,MAAM,IAAI,MAAM,0CAA0C;EAG5D,MAAM,EAAE,OAAO,UAAU,IAAI,eAAe;EAC5C,MAAM,UAAU,KAAKA,QAAQ,IAC3B;GAAE;GAAS,SAAS;IAAE,GAAG;IAAS,SAAS;GAAM;GAAG;EAAa,GACjE,EACE,cAAc,CAAC,KAAK,EACtB,CACF;EAEA,IAAI,UAAU;EACd,MAAM,wBAAwB;GAC5B,IAAI,CAAC,SACH,UAAU;EAEd;EAGA,SAAS,IAFU,kBAAkB,OAAO,EAAE,gBAAgB,CAEhD,GAAG,QAAQ,SAAS,QAAsC;GACtE,IAAI,KAAK;IACP,KAAKD,QAAQ,MACX,2CAA2C,KAAK,UAC9C,KACA,MACA,CACF,GACF;IAEA,MAAM;GACR;EACF,CAAC;EAED,MAAM;CACR;AACF"}
@@ -9,6 +9,7 @@ let _powerlines_core_lib_utilities_format = require("@powerlines/core/lib/utilit
9
9
  let _powerlines_core_plugin_utils = require("@powerlines/core/plugin-utils");
10
10
  let _stryke_convert_to_array = require("@stryke/convert/to-array");
11
11
  let _stryke_fs_helpers = require("@stryke/fs/helpers");
12
+ let _stryke_string_format_title_case = require("@stryke/string-format/title-case");
12
13
  let _stryke_type_checks_is_object = require("@stryke/type-checks/is-object");
13
14
 
14
15
  //#region src/api/prepare.ts
@@ -32,7 +33,7 @@ async function prepare(context, skipTypes = false) {
32
33
  });
33
34
  if (env.entry.length > 0) {
34
35
  const entriesLength = (0, _stryke_type_checks_is_object.isObject)(env.config.input) ? Object.keys(env.config.input).length : (0, _stryke_convert_to_array.toArray)(env.config.input).length;
35
- env.debug(`The configuration provided ${entriesLength} entry point${entriesLength !== 1 ? "s" : ""}, Powerlines has found ${env.entry.length} entry file${env.entry.length !== 1 ? "s" : ""} for the ${env.config.title} project${env.entry.length > 0 && env.entry.length < 10 ? `: \n${env.entry.map((entry) => `- ${(0, _stryke_path_replace.replacePath)(entry.file, context.config.root)}${entry.output ? ` -> ${(0, _stryke_path_replace.replacePath)(entry.output, context.config.root)}` : ""}`).join(" \n")}` : ""}`);
36
+ env.debug(`The configuration provided ${entriesLength} entry point${entriesLength !== 1 ? "s" : ""}, ${(0, _stryke_string_format_title_case.titleCase)(env.config.framework?.name) || "Powerlines"} has found ${env.entry.length} entry file${env.entry.length !== 1 ? "s" : ""} for the ${env.config.title} project${env.entry.length > 0 && env.entry.length < 10 ? `: \n${env.entry.map((entry) => `- ${(0, _stryke_path_replace.replacePath)(entry.file, context.config.cwd)}${entry.output ? ` -> ${(0, _stryke_path_replace.replacePath)(entry.output, context.config.cwd)}` : ""}`).join(" \n")}` : ""}`);
36
37
  } else env.warn(`No entry files were found for the ${env.config.title} project. Please ensure this is correct. Powerlines plugins generally require at least one entry point to function properly.`);
37
38
  await (0, _powerlines_core_lib_typescript_tsconfig.resolveTsconfig)(env);
38
39
  await (0, _powerlines_core_lib_install_dependencies.installDependencies)(env);
@@ -1 +1 @@
1
- {"version":3,"file":"prepare.d.cts","names":[],"sources":["../../src/api/prepare.ts"],"mappings":";;;;;;;AAyCA;;;iBAAsB,OAAA,yBACI,oBAAA,yBACD,mBAAA,EAEvB,OAAA,EAAS,gBAAA,CAAiB,eAAA,EAAiB,cAAA,GAC3C,SAAA,aAAiB,OAAA"}
1
+ {"version":3,"file":"prepare.d.cts","names":[],"sources":["../../src/api/prepare.ts"],"mappings":";;;;;;;AA0CA;;;iBAAsB,OAAA,yBACI,oBAAA,yBACD,mBAAA,EAEvB,OAAA,EAAS,gBAAA,CAAiB,eAAA,EAAiB,cAAA,GAC3C,SAAA,aAAiB,OAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"prepare.d.mts","names":[],"sources":["../../src/api/prepare.ts"],"mappings":";;;;;;;AAyCA;;;iBAAsB,OAAA,yBACI,oBAAA,yBACD,mBAAA,EAEvB,OAAA,EAAS,gBAAA,CAAiB,eAAA,EAAiB,cAAA,GAC3C,SAAA,aAAiB,OAAA"}
1
+ {"version":3,"file":"prepare.d.mts","names":[],"sources":["../../src/api/prepare.ts"],"mappings":";;;;;;;AA0CA;;;iBAAsB,OAAA,yBACI,oBAAA,yBACD,mBAAA,EAEvB,OAAA,EAAS,gBAAA,CAAiB,eAAA,EAAiB,cAAA,GAC3C,SAAA,aAAiB,OAAA"}
@@ -8,6 +8,7 @@ import { formatFolder } from "@powerlines/core/lib/utilities/format";
8
8
  import { formatConfig } from "@powerlines/core/plugin-utils";
9
9
  import { toArray } from "@stryke/convert/to-array";
10
10
  import { createDirectory } from "@stryke/fs/helpers";
11
+ import { titleCase } from "@stryke/string-format/title-case";
11
12
  import { isObject } from "@stryke/type-checks/is-object";
12
13
 
13
14
  //#region src/api/prepare.ts
@@ -31,7 +32,7 @@ async function prepare(context, skipTypes = false) {
31
32
  });
32
33
  if (env.entry.length > 0) {
33
34
  const entriesLength = isObject(env.config.input) ? Object.keys(env.config.input).length : toArray(env.config.input).length;
34
- env.debug(`The configuration provided ${entriesLength} entry point${entriesLength !== 1 ? "s" : ""}, Powerlines has found ${env.entry.length} entry file${env.entry.length !== 1 ? "s" : ""} for the ${env.config.title} project${env.entry.length > 0 && env.entry.length < 10 ? `: \n${env.entry.map((entry) => `- ${replacePath(entry.file, context.config.root)}${entry.output ? ` -> ${replacePath(entry.output, context.config.root)}` : ""}`).join(" \n")}` : ""}`);
35
+ env.debug(`The configuration provided ${entriesLength} entry point${entriesLength !== 1 ? "s" : ""}, ${titleCase(env.config.framework?.name) || "Powerlines"} has found ${env.entry.length} entry file${env.entry.length !== 1 ? "s" : ""} for the ${env.config.title} project${env.entry.length > 0 && env.entry.length < 10 ? `: \n${env.entry.map((entry) => `- ${replacePath(entry.file, context.config.cwd)}${entry.output ? ` -> ${replacePath(entry.output, context.config.cwd)}` : ""}`).join(" \n")}` : ""}`);
35
36
  } else env.warn(`No entry files were found for the ${env.config.title} project. Please ensure this is correct. Powerlines plugins generally require at least one entry point to function properly.`);
36
37
  await resolveTsconfig(env);
37
38
  await installDependencies(env);
@@ -1 +1 @@
1
- {"version":3,"file":"prepare.mjs","names":[],"sources":["../../src/api/prepare.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 type { ExecutionContext } from \"@powerlines/core\";\nimport { executeEnvironments } from \"@powerlines/core/lib/environment\";\nimport { handleTypes } from \"@powerlines/core/lib/generate-types\";\nimport { installDependencies } from \"@powerlines/core/lib/install-dependencies\";\nimport { writeMetaFile } from \"@powerlines/core/lib/meta\";\nimport {\n initializeTsconfig,\n resolveTsconfig\n} from \"@powerlines/core/lib/typescript/tsconfig\";\nimport { formatFolder } from \"@powerlines/core/lib/utilities/format\";\nimport { formatConfig } from \"@powerlines/core/plugin-utils\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { createDirectory } from \"@stryke/fs/helpers\";\nimport { replacePath } from \"@stryke/path/replace\";\nimport { isObject } from \"@stryke/type-checks/is-object\";\nimport { EngineResolvedConfig } from \"../types/config\";\nimport { EngineSystemContext } from \"../types/context\";\n\n/**\n * Prepare the project\n *\n * @param context - The execution context for the build process, which provides access to the project configuration, environment, and utility functions for performing the build. The context is used to manage the state and behavior of the build process, allowing for hooks to be called at different stages of the build and for environment-specific configurations to be applied.\n */\nexport async function prepare<\n TResolvedConfig extends EngineResolvedConfig,\n TSystemContext extends EngineSystemContext\n>(\n context: ExecutionContext<TResolvedConfig, TSystemContext>,\n skipTypes = false\n) {\n const timer = context.timer(\"Preparation\");\n\n await executeEnvironments(context, async env => {\n env.debug(\n `Initializing the processing options for the Powerlines project.`\n );\n\n await context.callHook(\"configResolved\", {\n environment: env,\n order: \"pre\"\n });\n\n await initializeTsconfig<TResolvedConfig, TSystemContext>(env);\n\n await context.callHook(\"configResolved\", {\n environment: env,\n order: \"normal\"\n });\n\n if (env.entry.length > 0) {\n const entriesLength = isObject(env.config.input)\n ? Object.keys(env.config.input).length\n : toArray(env.config.input).length;\n env.debug(\n `The configuration provided ${entriesLength} entry point${\n entriesLength !== 1 ? \"s\" : \"\"\n }, Powerlines has found ${env.entry.length} entry file${\n env.entry.length !== 1 ? \"s\" : \"\"\n } for the ${env.config.title} project${\n env.entry.length > 0 && env.entry.length < 10\n ? `: \\n${env.entry\n .map(\n entry =>\n `- ${replacePath(entry.file, context.config.root)}${\n entry.output\n ? ` -> ${replacePath(\n entry.output,\n context.config.root\n )}`\n : \"\"\n }`\n )\n .join(\" \\n\")}`\n : \"\"\n }`\n );\n } else {\n env.warn(\n `No entry files were found for the ${\n env.config.title\n } project. Please ensure this is correct. Powerlines plugins generally require at least one entry point to function properly.`\n );\n }\n\n await resolveTsconfig<TResolvedConfig, TSystemContext>(env);\n await installDependencies(env);\n\n await context.callHook(\"configResolved\", {\n environment: env,\n order: \"post\"\n });\n\n env.trace({\n meta: {\n category: \"config\"\n },\n message: `Powerlines configuration after configResolved hook: \\n${formatConfig(\n env.config\n )}`\n });\n\n if (!env.fs.existsSync(env.cachePath)) {\n await createDirectory(env.cachePath);\n }\n\n if (!env.fs.existsSync(env.dataPath)) {\n await createDirectory(env.dataPath);\n }\n\n await context.callHook(\"prepare\", {\n environment: env,\n order: \"pre\"\n });\n await context.callHook(\"prepare\", {\n environment: env,\n order: \"normal\"\n });\n\n await context.callHook(\"prepare\", {\n environment: env,\n order: \"post\"\n });\n\n if (!skipTypes && env.config.output.types !== false) {\n await handleTypes(context, env);\n }\n\n context.debug(\"Formatting files generated during the prepare step.\");\n\n await Promise.all([\n formatFolder(env, env.builtinsPath),\n formatFolder(env, env.entryPath)\n ]);\n\n await writeMetaFile(env);\n env.persistedMeta = env.meta;\n });\n\n timer();\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAyCA,eAAsB,QAIpB,SACA,YAAY,OACZ;CACA,MAAM,QAAQ,QAAQ,MAAM,aAAa;CAEzC,MAAM,oBAAoB,SAAS,OAAM,QAAO;EAC9C,IAAI,MACF,iEACF;EAEA,MAAM,QAAQ,SAAS,kBAAkB;GACvC,aAAa;GACb,OAAO;EACT,CAAC;EAED,MAAM,mBAAoD,GAAG;EAE7D,MAAM,QAAQ,SAAS,kBAAkB;GACvC,aAAa;GACb,OAAO;EACT,CAAC;EAED,IAAI,IAAI,MAAM,SAAS,GAAG;GACxB,MAAM,gBAAgB,SAAS,IAAI,OAAO,KAAK,IAC3C,OAAO,KAAK,IAAI,OAAO,KAAK,CAAC,CAAC,SAC9B,QAAQ,IAAI,OAAO,KAAK,CAAC,CAAC;GAC9B,IAAI,MACF,8BAA8B,cAAc,cAC1C,kBAAkB,IAAI,MAAM,GAC7B,yBAAyB,IAAI,MAAM,OAAO,aACzC,IAAI,MAAM,WAAW,IAAI,MAAM,GAChC,WAAW,IAAI,OAAO,MAAM,UAC3B,IAAI,MAAM,SAAS,KAAK,IAAI,MAAM,SAAS,KACvC,OAAO,IAAI,MACR,KACC,UACE,KAAK,YAAY,MAAM,MAAM,QAAQ,OAAO,IAAI,IAC9C,MAAM,SACF,OAAO,YACL,MAAM,QACN,QAAQ,OAAO,IACjB,MACA,IAEV,CAAC,CACA,KAAK,KAAK,MACb,IAER;EACF,OACE,IAAI,KACF,qCACE,IAAI,OAAO,MACZ,6HACH;EAGF,MAAM,gBAAiD,GAAG;EAC1D,MAAM,oBAAoB,GAAG;EAE7B,MAAM,QAAQ,SAAS,kBAAkB;GACvC,aAAa;GACb,OAAO;EACT,CAAC;EAED,IAAI,MAAM;GACR,MAAM,EACJ,UAAU,SACZ;GACA,SAAS,yDAAyD,aAChE,IAAI,MACN;EACF,CAAC;EAED,IAAI,CAAC,IAAI,GAAG,WAAW,IAAI,SAAS,GAClC,MAAM,gBAAgB,IAAI,SAAS;EAGrC,IAAI,CAAC,IAAI,GAAG,WAAW,IAAI,QAAQ,GACjC,MAAM,gBAAgB,IAAI,QAAQ;EAGpC,MAAM,QAAQ,SAAS,WAAW;GAChC,aAAa;GACb,OAAO;EACT,CAAC;EACD,MAAM,QAAQ,SAAS,WAAW;GAChC,aAAa;GACb,OAAO;EACT,CAAC;EAED,MAAM,QAAQ,SAAS,WAAW;GAChC,aAAa;GACb,OAAO;EACT,CAAC;EAED,IAAI,CAAC,aAAa,IAAI,OAAO,OAAO,UAAU,OAC5C,MAAM,YAAY,SAAS,GAAG;EAGhC,QAAQ,MAAM,qDAAqD;EAEnE,MAAM,QAAQ,IAAI,CAChB,aAAa,KAAK,IAAI,YAAY,GAClC,aAAa,KAAK,IAAI,SAAS,CACjC,CAAC;EAED,MAAM,cAAc,GAAG;EACvB,IAAI,gBAAgB,IAAI;CAC1B,CAAC;CAED,MAAM;AACR"}
1
+ {"version":3,"file":"prepare.mjs","names":[],"sources":["../../src/api/prepare.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 type { ExecutionContext } from \"@powerlines/core\";\nimport { executeEnvironments } from \"@powerlines/core/lib/environment\";\nimport { handleTypes } from \"@powerlines/core/lib/generate-types\";\nimport { installDependencies } from \"@powerlines/core/lib/install-dependencies\";\nimport { writeMetaFile } from \"@powerlines/core/lib/meta\";\nimport {\n initializeTsconfig,\n resolveTsconfig\n} from \"@powerlines/core/lib/typescript/tsconfig\";\nimport { formatFolder } from \"@powerlines/core/lib/utilities/format\";\nimport { formatConfig } from \"@powerlines/core/plugin-utils\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { createDirectory } from \"@stryke/fs/helpers\";\nimport { replacePath } from \"@stryke/path/replace\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { isObject } from \"@stryke/type-checks/is-object\";\nimport { EngineResolvedConfig } from \"../types/config\";\nimport { EngineSystemContext } from \"../types/context\";\n\n/**\n * Prepare the project\n *\n * @param context - The execution context for the build process, which provides access to the project configuration, environment, and utility functions for performing the build. The context is used to manage the state and behavior of the build process, allowing for hooks to be called at different stages of the build and for environment-specific configurations to be applied.\n */\nexport async function prepare<\n TResolvedConfig extends EngineResolvedConfig,\n TSystemContext extends EngineSystemContext\n>(\n context: ExecutionContext<TResolvedConfig, TSystemContext>,\n skipTypes = false\n) {\n const timer = context.timer(\"Preparation\");\n\n await executeEnvironments(context, async env => {\n env.debug(\n `Initializing the processing options for the Powerlines project.`\n );\n\n await context.callHook(\"configResolved\", {\n environment: env,\n order: \"pre\"\n });\n\n await initializeTsconfig<TResolvedConfig, TSystemContext>(env);\n\n await context.callHook(\"configResolved\", {\n environment: env,\n order: \"normal\"\n });\n\n if (env.entry.length > 0) {\n const entriesLength = isObject(env.config.input)\n ? Object.keys(env.config.input).length\n : toArray(env.config.input).length;\n env.debug(\n `The configuration provided ${entriesLength} entry point${\n entriesLength !== 1 ? \"s\" : \"\"\n }, ${titleCase(env.config.framework?.name) || \"Powerlines\"} has found ${env.entry.length} entry file${\n env.entry.length !== 1 ? \"s\" : \"\"\n } for the ${env.config.title} project${\n env.entry.length > 0 && env.entry.length < 10\n ? `: \\n${env.entry\n .map(\n entry =>\n `- ${replacePath(entry.file, context.config.cwd)}${\n entry.output\n ? ` -> ${replacePath(entry.output, context.config.cwd)}`\n : \"\"\n }`\n )\n .join(\" \\n\")}`\n : \"\"\n }`\n );\n } else {\n env.warn(\n `No entry files were found for the ${\n env.config.title\n } project. Please ensure this is correct. Powerlines plugins generally require at least one entry point to function properly.`\n );\n }\n\n await resolveTsconfig<TResolvedConfig, TSystemContext>(env);\n await installDependencies(env);\n\n await context.callHook(\"configResolved\", {\n environment: env,\n order: \"post\"\n });\n\n env.trace({\n meta: {\n category: \"config\"\n },\n message: `Powerlines configuration after configResolved hook: \\n${formatConfig(\n env.config\n )}`\n });\n\n if (!env.fs.existsSync(env.cachePath)) {\n await createDirectory(env.cachePath);\n }\n\n if (!env.fs.existsSync(env.dataPath)) {\n await createDirectory(env.dataPath);\n }\n\n await context.callHook(\"prepare\", {\n environment: env,\n order: \"pre\"\n });\n await context.callHook(\"prepare\", {\n environment: env,\n order: \"normal\"\n });\n\n await context.callHook(\"prepare\", {\n environment: env,\n order: \"post\"\n });\n\n if (!skipTypes && env.config.output.types !== false) {\n await handleTypes(context, env);\n }\n\n context.debug(\"Formatting files generated during the prepare step.\");\n\n await Promise.all([\n formatFolder(env, env.builtinsPath),\n formatFolder(env, env.entryPath)\n ]);\n\n await writeMetaFile(env);\n env.persistedMeta = env.meta;\n });\n\n timer();\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA0CA,eAAsB,QAIpB,SACA,YAAY,OACZ;CACA,MAAM,QAAQ,QAAQ,MAAM,aAAa;CAEzC,MAAM,oBAAoB,SAAS,OAAM,QAAO;EAC9C,IAAI,MACF,iEACF;EAEA,MAAM,QAAQ,SAAS,kBAAkB;GACvC,aAAa;GACb,OAAO;EACT,CAAC;EAED,MAAM,mBAAoD,GAAG;EAE7D,MAAM,QAA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,QAAQ,SAAS,WAAW;GAChC,aAAa;GACb,OAAO;EACT,CAAC;EAED,IAAI,CAAC,aAAa,IAAI,OAAO,OAAO,UAAU,OAC5C,MAAM,YAAY,SAAS,GAAG;EAGhC,QAAQ,MAAM,qDAAqD;EAEnE,MAAM,QAAQ,IAAI,CAChB,aAAa,KAAK,IAAI,YAAY,GAClC,aAAa,KAAK,IAAI,SAAS,CACjC,CAAC;EAED,MAAM,cAAc,GAAG;EACvB,IAAI,gBAAgB,IAAI;CAC1B,CAAC;CAED,MAAM;AACR"}
@@ -9,6 +9,7 @@ let _powerlines_core_lib_typescript_tsconfig = require("@powerlines/core/lib/typ
9
9
  let _powerlines_core_lib_utilities_format = require("@powerlines/core/lib/utilities/format");
10
10
  let _stryke_convert_to_array = require("@stryke/convert/to-array");
11
11
  let _stryke_fs_helpers = require("@stryke/fs/helpers");
12
+ let _stryke_string_format_title_case = require("@stryke/string-format/title-case");
12
13
  let _stryke_type_checks_is_object = require("@stryke/type-checks/is-object");
13
14
  let _storm_software_config_tools_logger = require("@storm-software/config-tools/logger");
14
15
  let _stryke_helpers_omit = require("@stryke/helpers/omit");
@@ -39,7 +40,7 @@ async function types(context) {
39
40
  });
40
41
  if (env.entry.length > 0) {
41
42
  const entriesLength = (0, _stryke_type_checks_is_object.isObject)(env.config.input) ? Object.keys(env.config.input).length : (0, _stryke_convert_to_array.toArray)(env.config.input).length;
42
- env.debug(`The configuration provided ${entriesLength} entry point${entriesLength !== 1 ? "s" : ""}, Powerlines has found ${env.entry.length} entry file${env.entry.length !== 1 ? "s" : ""} for the ${env.config.title} project${env.entry.length > 0 && env.entry.length < 10 ? `: \n${env.entry.map((entry) => `- ${(0, _stryke_path_replace.replacePath)(entry.file, context.config.root)}${entry.output ? ` -> ${(0, _stryke_path_replace.replacePath)(entry.output, context.config.root)}` : ""}`).join(" \n")}` : ""}`);
43
+ env.debug(`The configuration provided ${entriesLength} entry point${entriesLength !== 1 ? "s" : ""}, ${(0, _stryke_string_format_title_case.titleCase)(env.config.framework?.name) || "Powerlines"} has found ${env.entry.length} entry file${env.entry.length !== 1 ? "s" : ""} for the ${env.config.title} project${env.entry.length > 0 && env.entry.length < 10 ? `: \n${env.entry.map((entry) => `- ${(0, _stryke_path_replace.replacePath)(entry.file, context.config.cwd)}${entry.output ? ` -> ${(0, _stryke_path_replace.replacePath)(entry.output, context.config.cwd)}` : ""}`).join(" \n")}` : ""}`);
43
44
  } else env.warn(`No entry files were found for the ${env.config.title} project. Please ensure this is correct. Powerlines plugins generally require at least one entry point to function properly.`);
44
45
  await (0, _powerlines_core_lib_typescript_tsconfig.resolveTsconfig)(env);
45
46
  await (0, _powerlines_core_lib_install_dependencies.installDependencies)(env);
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.cts","names":[],"sources":["../../src/api/types.ts"],"mappings":";;;;;;;AA+CA;;;;;;iBAAsB,KAAA,yBACI,oBAAA,yBACD,mBAAA,EACvB,OAAA,EAAS,gBAAA,CAAiB,eAAA,EAAiB,cAAA,IAAe,OAAA"}
1
+ {"version":3,"file":"types.d.cts","names":[],"sources":["../../src/api/types.ts"],"mappings":";;;;;;;AAgDA;;;;;;iBAAsB,KAAA,yBACI,oBAAA,yBACD,mBAAA,EACvB,OAAA,EAAS,gBAAA,CAAiB,eAAA,EAAiB,cAAA,IAAe,OAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.mts","names":[],"sources":["../../src/api/types.ts"],"mappings":";;;;;;;AA+CA;;;;;;iBAAsB,KAAA,yBACI,oBAAA,yBACD,mBAAA,EACvB,OAAA,EAAS,gBAAA,CAAiB,eAAA,EAAiB,cAAA,IAAe,OAAA"}
1
+ {"version":3,"file":"types.d.mts","names":[],"sources":["../../src/api/types.ts"],"mappings":";;;;;;;AAgDA;;;;;;iBAAsB,KAAA,yBACI,oBAAA,yBACD,mBAAA,EACvB,OAAA,EAAS,gBAAA,CAAiB,eAAA,EAAiB,cAAA,IAAe,OAAA"}
@@ -8,6 +8,7 @@ import { initializeTsconfig, resolveTsconfig } from "@powerlines/core/lib/typesc
8
8
  import { format } from "@powerlines/core/lib/utilities/format";
9
9
  import { toArray } from "@stryke/convert/to-array";
10
10
  import { createDirectory } from "@stryke/fs/helpers";
11
+ import { titleCase } from "@stryke/string-format/title-case";
11
12
  import { isObject } from "@stryke/type-checks/is-object";
12
13
  import { formatLogMessage } from "@storm-software/config-tools/logger";
13
14
  import { omit } from "@stryke/helpers/omit";
@@ -38,7 +39,7 @@ async function types(context) {
38
39
  });
39
40
  if (env.entry.length > 0) {
40
41
  const entriesLength = isObject(env.config.input) ? Object.keys(env.config.input).length : toArray(env.config.input).length;
41
- env.debug(`The configuration provided ${entriesLength} entry point${entriesLength !== 1 ? "s" : ""}, Powerlines has found ${env.entry.length} entry file${env.entry.length !== 1 ? "s" : ""} for the ${env.config.title} project${env.entry.length > 0 && env.entry.length < 10 ? `: \n${env.entry.map((entry) => `- ${replacePath(entry.file, context.config.root)}${entry.output ? ` -> ${replacePath(entry.output, context.config.root)}` : ""}`).join(" \n")}` : ""}`);
42
+ env.debug(`The configuration provided ${entriesLength} entry point${entriesLength !== 1 ? "s" : ""}, ${titleCase(env.config.framework?.name) || "Powerlines"} has found ${env.entry.length} entry file${env.entry.length !== 1 ? "s" : ""} for the ${env.config.title} project${env.entry.length > 0 && env.entry.length < 10 ? `: \n${env.entry.map((entry) => `- ${replacePath(entry.file, context.config.cwd)}${entry.output ? ` -> ${replacePath(entry.output, context.config.cwd)}` : ""}`).join(" \n")}` : ""}`);
42
43
  } else env.warn(`No entry files were found for the ${env.config.title} project. Please ensure this is correct. Powerlines plugins generally require at least one entry point to function properly.`);
43
44
  await resolveTsconfig(env);
44
45
  await installDependencies(env);
@@ -1 +1 @@
1
- {"version":3,"file":"types.mjs","names":[],"sources":["../../src/api/types.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 { executeEnvironments } from \"@powerlines/core/lib/environment\";\nimport { handleTypes } from \"@powerlines/core/lib/generate-types\";\nimport { installDependencies } from \"@powerlines/core/lib/install-dependencies\";\nimport { writeMetaFile } from \"@powerlines/core/lib/meta\";\nimport {\n initializeTsconfig,\n resolveTsconfig\n} from \"@powerlines/core/lib/typescript/tsconfig\";\nimport { format } from \"@powerlines/core/lib/utilities/format\";\nimport { ExecutionContext } from \"@powerlines/core/types/context\";\nimport { formatLogMessage } from \"@storm-software/config-tools/logger\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { createDirectory } from \"@stryke/fs/helpers\";\nimport { omit } from \"@stryke/helpers/omit\";\nimport { replacePath } from \"@stryke/path/replace\";\nimport { isObject } from \"@stryke/type-checks/is-object\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { EngineResolvedConfig } from \"../types/config\";\nimport { EngineSystemContext } from \"../types/context\";\nimport { prepare } from \"./prepare\";\n\n/**\n * Generate runtime types for the Powerlines project.\n *\n * @remarks\n * This function is responsible for generating TypeScript declaration files based on the project's configuration and environment. It executes hooks at various stages of the type generation process, allowing for customization and extension by plugins. The generated types are formatted and written to the appropriate location in the project's file system, ensuring that they are available for use by other parts of the Powerlines system and by end-users of the project.\n *\n * @param context - The execution context for the build process, which provides access to the project configuration, environment, and utility functions for performing the build. The context is used to manage the state and behavior of the build process, allowing for hooks to be called at different stages of the build and for environment-specific configurations to be applied.\n */\nexport async function types<\n TResolvedConfig extends EngineResolvedConfig,\n TSystemContext extends EngineSystemContext\n>(context: ExecutionContext<TResolvedConfig, TSystemContext>) {\n const timer = context.timer(\"Type Generation\");\n context.debug(\n \" Aggregating configuration options for the Powerlines project\"\n );\n\n await executeEnvironments(context, async env => {\n env.debug(\n `Initializing the processing options for the Powerlines project.`\n );\n\n await context.callHook(\"configResolved\", {\n environment: env,\n order: \"pre\"\n });\n\n await initializeTsconfig<TResolvedConfig, TSystemContext>(env);\n\n await context.callHook(\"configResolved\", {\n environment: env,\n order: \"normal\"\n });\n\n if (env.entry.length > 0) {\n const entriesLength = isObject(env.config.input)\n ? Object.keys(env.config.input).length\n : toArray(env.config.input).length;\n env.debug(\n `The configuration provided ${entriesLength} entry point${\n entriesLength !== 1 ? \"s\" : \"\"\n }, Powerlines has found ${env.entry.length} entry file${\n env.entry.length !== 1 ? \"s\" : \"\"\n } for the ${env.config.title} project${\n env.entry.length > 0 && env.entry.length < 10\n ? `: \\n${env.entry\n .map(\n entry =>\n `- ${replacePath(entry.file, context.config.root)}${\n entry.output\n ? ` -> ${replacePath(\n entry.output,\n context.config.root\n )}`\n : \"\"\n }`\n )\n .join(\" \\n\")}`\n : \"\"\n }`\n );\n } else {\n env.warn(\n `No entry files were found for the ${\n env.config.title\n } project. Please ensure this is correct. Powerlines plugins generally require at least one entry point to function properly.`\n );\n }\n\n await resolveTsconfig<TResolvedConfig, TSystemContext>(env);\n await installDependencies(env);\n\n await context.callHook(\"configResolved\", {\n environment: env,\n order: \"post\"\n });\n\n context.trace(\n `Powerlines configuration has been resolved: \\n\\n${formatLogMessage({\n ...env.config,\n userConfig: isSetObject(env.config.userConfig)\n ? omit(env.config.userConfig, [\"plugins\"])\n : undefined,\n inlineConfig: isSetObject(env.config.inlineConfig)\n ? env.config.inlineConfig\n : undefined,\n plugins: env.plugins.map(plugin => plugin.name)\n })}`\n );\n\n if (!env.fs.existsSync(env.cachePath)) {\n await createDirectory(env.cachePath);\n }\n\n if (!env.fs.existsSync(env.dataPath)) {\n await createDirectory(env.dataPath);\n }\n\n if (\n env.config.skipCache === true ||\n env.persistedMeta?.checksum !== env.meta.checksum\n ) {\n env.debug(\n `Using previously prepared files as the meta checksum has not changed.`\n );\n } else {\n env.info(\n `Running \\`prepare\\` command as the meta checksum has changed since the last run.`\n );\n\n await prepare(context, true);\n }\n\n await handleTypes(context, env);\n\n context.debug(\"Formatting files generated during the types step.\");\n\n await format(env, env.typesPath, (await env.fs.read(env.typesPath)) ?? \"\");\n\n await writeMetaFile(env);\n env.persistedMeta = env.meta;\n });\n\n timer();\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA+CA,eAAsB,MAGpB,SAA4D;CAC5D,MAAM,QAAQ,QAAQ,MAAM,iBAAiB;CAC7C,QAAQ,MACN,+DACF;CAEA,MAAM,oBAAoB,SAAS,OAAM,QAAO;EAC9C,IAAI,MACF,iEACF;EAEA,MAAM,QAAQ,SAAS,kBAAkB;GACvC,aAAa;GACb,OAAO;EACT,CAAC;EAED,MAAM,mBAAoD,GAAG;EAE7D,MAAM,QAAQ,SAAS,kBAAkB;GACvC,aAAa;GACb,OAAO;EACT,CAAC;EAED,IAAI,IAAI,MAAM,SAAS,GAAG;GACxB,MAAM,gBAAgB,SAAS,IAAI,OAAO,KAAK,IAC3C,OAAO,KAAK,IAAI,OAAO,KAAK,CAAC,CAAC,SAC9B,QAAQ,IAAI,OAAO,KAAK,CAAC,CAAC;GAC9B,IAAI,MACF,8BAA8B,cAAc,cAC1C,kBAAkB,IAAI,MAAM,GAC7B,yBAAyB,IAAI,MAAM,OAAO,aACzC,IAAI,MAAM,WAAW,IAAI,MAAM,GAChC,WAAW,IAAI,OAAO,MAAM,UAC3B,IAAI,MAAM,SAAS,KAAK,IAAI,MAAM,SAAS,KACvC,OAAO,IAAI,MACR,KACC,UACE,KAAK,YAAY,MAAM,MAAM,QAAQ,OAAO,IAAI,IAC9C,MAAM,SACF,OAAO,YACL,MAAM,QACN,QAAQ,OAAO,IACjB,MACA,IAEV,CAAC,CACA,KAAK,KAAK,MACb,IAER;EACF,OACE,IAAI,KACF,qCACE,IAAI,OAAO,MACZ,6HACH;EAGF,MAAM,gBAAiD,GAAG;EAC1D,MAAM,oBAAoB,GAAG;EAE7B,MAAM,QAAQ,SAAS,kBAAkB;GACvC,aAAa;GACb,OAAO;EACT,CAAC;EAED,QAAQ,MACN,mDAAmD,iBAAiB;GAClE,GAAG,IAAI;GACP,YAAY,YAAY,IAAI,OAAO,UAAU,IACzC,KAAK,IAAI,OAAO,YAAY,CAAC,SAAS,CAAC,IACvC;GACJ,cAAc,YAAY,IAAI,OAAO,YAAY,IAC7C,IAAI,OAAO,eACX;GACJ,SAAS,IAAI,QAAQ,KAAI,WAAU,OAAO,IAAI;EAChD,CAAC,GACH;EAEA,IAAI,CAAC,IAAI,GAAG,WAAW,IAAI,SAAS,GAClC,MAAM,gBAAgB,IAAI,SAAS;EAGrC,IAAI,CAAC,IAAI,GAAG,WAAW,IAAI,QAAQ,GACjC,MAAM,gBAAgB,IAAI,QAAQ;EAGpC,IACE,IAAI,OAAO,cAAc,QACzB,IAAI,eAAe,aAAa,IAAI,KAAK,UAEzC,IAAI,MACF,uEACF;OACK;GACL,IAAI,KACF,kFACF;GAEA,MAAM,QAAQ,SAAS,IAAI;EAC7B;EAEA,MAAM,YAAY,SAAS,GAAG;EAE9B,QAAQ,MAAM,mDAAmD;EAEjE,MAAM,OAAO,KAAK,IAAI,WAAY,MAAM,IAAI,GAAG,KAAK,IAAI,SAAS,KAAM,EAAE;EAEzE,MAAM,cAAc,GAAG;EACvB,IAAI,gBAAgB,IAAI;CAC1B,CAAC;CAED,MAAM;AACR"}
1
+ {"version":3,"file":"types.mjs","names":[],"sources":["../../src/api/types.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 { executeEnvironments } from \"@powerlines/core/lib/environment\";\nimport { handleTypes } from \"@powerlines/core/lib/generate-types\";\nimport { installDependencies } from \"@powerlines/core/lib/install-dependencies\";\nimport { writeMetaFile } from \"@powerlines/core/lib/meta\";\nimport {\n initializeTsconfig,\n resolveTsconfig\n} from \"@powerlines/core/lib/typescript/tsconfig\";\nimport { format } from \"@powerlines/core/lib/utilities/format\";\nimport { ExecutionContext } from \"@powerlines/core/types/context\";\nimport { formatLogMessage } from \"@storm-software/config-tools/logger\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { createDirectory } from \"@stryke/fs/helpers\";\nimport { omit } from \"@stryke/helpers/omit\";\nimport { replacePath } from \"@stryke/path/replace\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { isObject } from \"@stryke/type-checks/is-object\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { EngineResolvedConfig } from \"../types/config\";\nimport { EngineSystemContext } from \"../types/context\";\nimport { prepare } from \"./prepare\";\n\n/**\n * Generate runtime types for the Powerlines project.\n *\n * @remarks\n * This function is responsible for generating TypeScript declaration files based on the project's configuration and environment. It executes hooks at various stages of the type generation process, allowing for customization and extension by plugins. The generated types are formatted and written to the appropriate location in the project's file system, ensuring that they are available for use by other parts of the Powerlines system and by end-users of the project.\n *\n * @param context - The execution context for the build process, which provides access to the project configuration, environment, and utility functions for performing the build. The context is used to manage the state and behavior of the build process, allowing for hooks to be called at different stages of the build and for environment-specific configurations to be applied.\n */\nexport async function types<\n TResolvedConfig extends EngineResolvedConfig,\n TSystemContext extends EngineSystemContext\n>(context: ExecutionContext<TResolvedConfig, TSystemContext>) {\n const timer = context.timer(\"Type Generation\");\n context.debug(\n \" Aggregating configuration options for the Powerlines project\"\n );\n\n await executeEnvironments(context, async env => {\n env.debug(\n `Initializing the processing options for the Powerlines project.`\n );\n\n await context.callHook(\"configResolved\", {\n environment: env,\n order: \"pre\"\n });\n\n await initializeTsconfig<TResolvedConfig, TSystemContext>(env);\n\n await context.callHook(\"configResolved\", {\n environment: env,\n order: \"normal\"\n });\n\n if (env.entry.length > 0) {\n const entriesLength = isObject(env.config.input)\n ? Object.keys(env.config.input).length\n : toArray(env.config.input).length;\n env.debug(\n `The configuration provided ${entriesLength} entry point${\n entriesLength !== 1 ? \"s\" : \"\"\n }, ${titleCase(env.config.framework?.name) || \"Powerlines\"} has found ${env.entry.length} entry file${\n env.entry.length !== 1 ? \"s\" : \"\"\n } for the ${env.config.title} project${\n env.entry.length > 0 && env.entry.length < 10\n ? `: \\n${env.entry\n .map(\n entry =>\n `- ${replacePath(entry.file, context.config.cwd)}${\n entry.output\n ? ` -> ${replacePath(entry.output, context.config.cwd)}`\n : \"\"\n }`\n )\n .join(\" \\n\")}`\n : \"\"\n }`\n );\n } else {\n env.warn(\n `No entry files were found for the ${\n env.config.title\n } project. Please ensure this is correct. Powerlines plugins generally require at least one entry point to function properly.`\n );\n }\n\n await resolveTsconfig<TResolvedConfig, TSystemContext>(env);\n await installDependencies(env);\n\n await context.callHook(\"configResolved\", {\n environment: env,\n order: \"post\"\n });\n\n context.trace(\n `Powerlines configuration has been resolved: \\n\\n${formatLogMessage({\n ...env.config,\n userConfig: isSetObject(env.config.userConfig)\n ? omit(env.config.userConfig, [\"plugins\"])\n : undefined,\n inlineConfig: isSetObject(env.config.inlineConfig)\n ? env.config.inlineConfig\n : undefined,\n plugins: env.plugins.map(plugin => plugin.name)\n })}`\n );\n\n if (!env.fs.existsSync(env.cachePath)) {\n await createDirectory(env.cachePath);\n }\n\n if (!env.fs.existsSync(env.dataPath)) {\n await createDirectory(env.dataPath);\n }\n\n if (\n env.config.skipCache === true ||\n env.persistedMeta?.checksum !== env.meta.checksum\n ) {\n env.debug(\n `Using previously prepared files as the meta checksum has not changed.`\n );\n } else {\n env.info(\n `Running \\`prepare\\` command as the meta checksum has changed since the last run.`\n );\n\n await prepare(context, true);\n }\n\n await handleTypes(context, env);\n\n context.debug(\"Formatting files generated during the types step.\");\n\n await format(env, env.typesPath, (await env.fs.read(env.typesPath)) ?? \"\");\n\n await writeMetaFile(env);\n env.persistedMeta = env.meta;\n });\n\n timer();\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAgDA,eAAsB,MAGpB,SAA4D;CAC5D,MAAM,QAAQ,QAAQ,MAAM,iBAAiB;CAC7C,QAAQ,MACN,+DACF;CAEA,MAAM,oBAAoB,SAAS,OAAM,QAAO;EAC9C,IAAI,MACF,iEACF;EAEA,MAAM,QAAQ,SAAS,kBAAkB;GACvC,aAAa;GACb,OAAO;EACT,CAAC;EAED,MAAM,mBAAoD,GAAG;EAE7D,MAAM,QAAQ,SAAS,kBAAkB;GACvC,aAAa;GACb,OAAO;EACT,CAAC;EAED,IAAI,IAAI,MAAM,SAAS,GAAG;GACxB,MAAM,gBAAgB,SAAS,IAAI,OAAO,KAAK,IAC3C,OAAO,KAAK,IAAI,OAAO,KAAK,CAAC,CAAC,SAC9B,QAAQ,IAAI,OAAO,KAAK,CAAC,CAAC;GAC9B,IAAI,MACF,8BAA8B,cAAc,cAC1C,kBAAkB,IAAI,MAAM,GAC7B,IAAI,UAAU,IAAI,OAAO,WAAW,IAAI,KAAK,aAAa,aAAa,IAAI,MAAM,OAAO,aACvF,IAAI,MAAM,WAAW,IAAI,MAAM,GAChC,WAAW,IAAI,OAAO,MAAM,UAC3B,IAAI,MAAM,SAAS,KAAK,IAAI,MAAM,SAAS,KACvC,OAAO,IAAI,MACR,KACC,UACE,KAAK,YAAY,MAAM,MAAM,QAAQ,OAAO,GAAG,IAC7C,MAAM,SACF,OAAO,YAAY,MAAM,QAAQ,QAAQ,OAAO,GAAG,MACnD,IAEV,CAAC,CACA,KAAK,KAAK,MACb,IAER;EACF,OACE,IAAI,KACF,qCACE,IAAI,OAAO,MACZ,6HACH;EAGF,MAAM,gBAAiD,GAAG;EAC1D,MAAM,oBAAoB,GAAG;EAE7B,MAAM,QAAQ,SAAS,kBAAkB;GACvC,aAAa;GACb,OAAO;EACT,CAAC;EAED,QAAQ,MACN,mDAAmD,iBAAiB;GAClE,GAAG,IAAI;GACP,YAAY,YAAY,IAAI,OAAO,UAAU,IACzC,KAAK,IAAI,OAAO,YAAY,CAAC,SAAS,CAAC,IACvC;GACJ,cAAc,YAAY,IAAI,OAAO,YAAY,IAC7C,IAAI,OAAO,eACX;GACJ,SAAS,IAAI,QAAQ,KAAI,WAAU,OAAO,IAAI;EAChD,CAAC,GACH;EAEA,IAAI,CAAC,IAAI,GAAG,WAAW,IAAI,SAAS,GAClC,MAAM,gBAAgB,IAAI,SAAS;EAGrC,IAAI,CAAC,IAAI,GAAG,WAAW,IAAI,QAAQ,GACjC,MAAM,gBAAgB,IAAI,QAAQ;EAGpC,IACE,IAAI,OAAO,cAAc,QACzB,IAAI,eAAe,aAAa,IAAI,KAAK,UAEzC,IAAI,MACF,uEACF;OACK;GACL,IAAI,KACF,kFACF;GAEA,MAAM,QAAQ,SAAS,IAAI;EAC7B;EAEA,MAAM,YAAY,SAAS,GAAG;EAE9B,QAAQ,MAAM,mDAAmD;EAEjE,MAAM,OAAO,KAAK,IAAI,WAAY,MAAM,IAAI,GAAG,KAAK,IAAI,SAAS,KAAM,EAAE;EAEzE,MAAM,cAAc,GAAG;EACvB,IAAI,gBAAgB,IAAI;CAC1B,CAAC;CAED,MAAM;AACR"}
@@ -6,6 +6,7 @@ let _stryke_unique_id_uuid = require("@stryke/unique-id/uuid");
6
6
  let devframe_node = require("devframe/node");
7
7
  let _powerlines_core_lib_config = require("@powerlines/core/lib/config");
8
8
  let _powerlines_core_context_base_context = require("@powerlines/core/context/base-context");
9
+ let _powerlines_core_plugin_utils_context_helpers = require("@powerlines/core/plugin-utils/context-helpers");
9
10
  let _stryke_env_get_env_paths = require("@stryke/env/get-env-paths");
10
11
  let _stryke_string_format_kebab_case = require("@stryke/string-format/kebab-case");
11
12
  let valibot = require("valibot");
@@ -125,11 +126,14 @@ var PowerlinesEngineContext = class PowerlinesEngineContext extends _powerlines_
125
126
  */
126
127
  async loadExecutions(command, inlineConfig) {
127
128
  const root = (0, _powerlines_core_lib_config.resolveRoot)(this.cwd, inlineConfig.root, inlineConfig.configFile);
128
- const config = await (0, _powerlines_core_lib_config.loadParsedConfig)(this.cwd, root, this.framework?.name, this.orgId, inlineConfig);
129
+ const config = await (0, _powerlines_core_lib_config.loadParsedConfig)(this.cwd, root, this.framework?.name, this.orgId, {
130
+ ...inlineConfig,
131
+ command
132
+ });
129
133
  if (!config) throw new Error("Failed to load configuration");
130
134
  const invocationId = (0, _stryke_unique_id_uuid.uuid)();
131
135
  const executions = await Promise.all((0, _stryke_convert_to_array.toArray)(config.config).map(async (_, configIndex) => {
132
- const executionId = (0, _powerlines_core_plugin_utils.formatExecutionId)(config.config.name || inlineConfig.name || root, command, configIndex);
136
+ const executionId = (0, _powerlines_core_plugin_utils.formatExecutionId)(config.config.name || inlineConfig.name || await (0, _powerlines_core_plugin_utils_context_helpers.getName)(this.cwd, root), command, configIndex);
133
137
  const options = {
134
138
  cwd: this.cwd,
135
139
  root,
@@ -1,6 +1,7 @@
1
1
  import { EngineOptions } from "../types/config.cjs";
2
2
  import { EngineContext, EngineExecutionItem } from "../types/context.cjs";
3
3
  import { FrameworkOptions, InlineConfig, LogFn, LoggerOptions } from "@powerlines/core";
4
+ import { PartialKeys } from "@stryke/types/base";
4
5
  import { ConnectionMeta, DevToolsHost, DevToolsNodeContext } from "devframe/types";
5
6
  import { PowerlinesBaseContext } from "@powerlines/core/context/base-context";
6
7
  import { EnvPaths } from "@stryke/env/get-env-paths";
@@ -39,7 +40,7 @@ declare class PowerlinesEngineContext<TSystemContext = unknown> extends Powerlin
39
40
  * @param command - The path to the execution configuration to load and run, which can be used to specify different execution configurations for different commands or scenarios.
40
41
  * @param inlineConfig - Additional configuration options provided at runtime, which can override or supplement the options defined in the user configuration file.
41
42
  */
42
- loadExecutions(command: string, inlineConfig: InlineConfig): Promise<EngineExecutionItem[]>;
43
+ loadExecutions(command: string, inlineConfig: PartialKeys<InlineConfig, "command">): Promise<EngineExecutionItem[]>;
43
44
  /**
44
45
  * Complete an execution by removing it from the list of active executions based on the provided invocation ID and execution ID. This method is typically called when an execution has finished or has been terminated, allowing the context to clean up any resources associated with that execution and update its internal state accordingly.
45
46
  *
@@ -1 +1 @@
1
- {"version":3,"file":"engine-context.d.cts","names":[],"sources":["../../src/context/engine-context.ts"],"mappings":";;;;;;;;cAoDa,uBAAA,mCACH,qBAAA,CAAsB,cAAA,aACnB,aAAA,CAAc,cAAA;EAAA;EAkIP,OAAA,EAAS,aAAA;EAClB,UAAA,EAAY,cAAA;EArIa;;;;;;EAAA,OAgBd,IAAA,2BAClB,OAAA,EAAS,aAAA,EACT,IAAA,EAAM,YAAA,EACN,UAAA,EAAY,cAAA,GACX,OAAA,CAAQ,uBAAA,CAAwB,cAAA;EA8DnB,YAAA,CAAa,OAAA,GAAS,aAAA,EAAoB,KAAA,GAAQ,KAAA,8BAAK,MAAA;EAAA,IAe5D,UAAA,IAAc,mBAAA;EAAA,IAId,QAAA,IAAY,mBAAA;EAAA,IAIZ,QAAA,IAAY,QAAA;EAAA,IAQZ,SAAA,IAAa,gBAAA;EAAA,IAQb,KAAA;EAxBc;;;;;;EAAA,UAkChB,WAAA,CACS,OAAA,EAAS,aAAA,EAClB,UAAA,EAAY,cAAA;EAiBV;;;;;;;;;EAHE,cAAA,CACX,OAAA,UACA,YAAA,EAAc,YAAA,GACb,OAAA,CAAQ,mBAAA;EApJc;;;;;;EA6NlB,iBAAA,CAAkB,YAAA,UAAsB,WAAA;AAAA"}
1
+ {"version":3,"file":"engine-context.d.cts","names":[],"sources":["../../src/context/engine-context.ts"],"mappings":";;;;;;;;;cAsDa,uBAAA,mCACH,qBAAA,CAAsB,cAAA,aACnB,aAAA,CAAc,cAAA;EAAA;EAkIP,OAAA,EAAS,aAAA;EAClB,UAAA,EAAY,cAAA;EArIa;;;;;;EAAA,OAgBd,IAAA,2BAClB,OAAA,EAAS,aAAA,EACT,IAAA,EAAM,YAAA,EACN,UAAA,EAAY,cAAA,GACX,OAAA,CAAQ,uBAAA,CAAwB,cAAA;EA8DnB,YAAA,CAAa,OAAA,GAAS,aAAA,EAAoB,KAAA,GAAQ,KAAA,8BAAK,MAAA;EAAA,IAe5D,UAAA,IAAc,mBAAA;EAAA,IAId,QAAA,IAAY,mBAAA;EAAA,IAIZ,QAAA,IAAY,QAAA;EAAA,IAQZ,SAAA,IAAa,gBAAA;EAAA,IAQb,KAAA;EAxBc;;;;;;EAAA,UAkChB,WAAA,CACS,OAAA,EAAS,aAAA,EAClB,UAAA,EAAY,cAAA;EAgBL;;;;;;;;;EAFH,cAAA,CACX,OAAA,UACA,YAAA,EAAc,WAAA,CAAY,YAAA,eACzB,OAAA,CAAQ,mBAAA;EApJA;;;;;;EA+NJ,iBAAA,CAAkB,YAAA,UAAsB,WAAA;AAAA"}
@@ -3,6 +3,7 @@ import { EngineContext, EngineExecutionItem } from "../types/context.mjs";
3
3
  import { FrameworkOptions, InlineConfig, LogFn, LoggerOptions } from "@powerlines/core";
4
4
  import { PowerlinesBaseContext } from "@powerlines/core/context/base-context";
5
5
  import { EnvPaths } from "@stryke/env/get-env-paths";
6
+ import { PartialKeys } from "@stryke/types/base";
6
7
  import { ConnectionMeta, DevToolsHost, DevToolsNodeContext } from "devframe/types";
7
8
 
8
9
  //#region src/context/engine-context.d.ts
@@ -39,7 +40,7 @@ declare class PowerlinesEngineContext<TSystemContext = unknown> extends Powerlin
39
40
  * @param command - The path to the execution configuration to load and run, which can be used to specify different execution configurations for different commands or scenarios.
40
41
  * @param inlineConfig - Additional configuration options provided at runtime, which can override or supplement the options defined in the user configuration file.
41
42
  */
42
- loadExecutions(command: string, inlineConfig: InlineConfig): Promise<EngineExecutionItem[]>;
43
+ loadExecutions(command: string, inlineConfig: PartialKeys<InlineConfig, "command">): Promise<EngineExecutionItem[]>;
43
44
  /**
44
45
  * Complete an execution by removing it from the list of active executions based on the provided invocation ID and execution ID. This method is typically called when an execution has finished or has been terminated, allowing the context to clean up any resources associated with that execution and update its internal state accordingly.
45
46
  *
@@ -1 +1 @@
1
- {"version":3,"file":"engine-context.d.mts","names":[],"sources":["../../src/context/engine-context.ts"],"mappings":";;;;;;;;cAoDa,uBAAA,mCACH,qBAAA,CAAsB,cAAA,aACnB,aAAA,CAAc,cAAA;EAAA;EAkIP,OAAA,EAAS,aAAA;EAClB,UAAA,EAAY,cAAA;EArIa;;;;;;EAAA,OAgBd,IAAA,2BAClB,OAAA,EAAS,aAAA,EACT,IAAA,EAAM,YAAA,EACN,UAAA,EAAY,cAAA,GACX,OAAA,CAAQ,uBAAA,CAAwB,cAAA;EA8DnB,YAAA,CAAa,OAAA,GAAS,aAAA,EAAoB,KAAA,GAAQ,KAAA,8BAAK,MAAA;EAAA,IAe5D,UAAA,IAAc,mBAAA;EAAA,IAId,QAAA,IAAY,mBAAA;EAAA,IAIZ,QAAA,IAAY,QAAA;EAAA,IAQZ,SAAA,IAAa,gBAAA;EAAA,IAQb,KAAA;EAxBc;;;;;;EAAA,UAkChB,WAAA,CACS,OAAA,EAAS,aAAA,EAClB,UAAA,EAAY,cAAA;EAiBV;;;;;;;;;EAHE,cAAA,CACX,OAAA,UACA,YAAA,EAAc,YAAA,GACb,OAAA,CAAQ,mBAAA;EApJc;;;;;;EA6NlB,iBAAA,CAAkB,YAAA,UAAsB,WAAA;AAAA"}
1
+ {"version":3,"file":"engine-context.d.mts","names":[],"sources":["../../src/context/engine-context.ts"],"mappings":";;;;;;;;;cAsDa,uBAAA,mCACH,qBAAA,CAAsB,cAAA,aACnB,aAAA,CAAc,cAAA;EAAA;EAkIP,OAAA,EAAS,aAAA;EAClB,UAAA,EAAY,cAAA;EArIa;;;;;;EAAA,OAgBd,IAAA,2BAClB,OAAA,EAAS,aAAA,EACT,IAAA,EAAM,YAAA,EACN,UAAA,EAAY,cAAA,GACX,OAAA,CAAQ,uBAAA,CAAwB,cAAA;EA8DnB,YAAA,CAAa,OAAA,GAAS,aAAA,EAAoB,KAAA,GAAQ,KAAA,8BAAK,MAAA;EAAA,IAe5D,UAAA,IAAc,mBAAA;EAAA,IAId,QAAA,IAAY,mBAAA;EAAA,IAIZ,QAAA,IAAY,QAAA;EAAA,IAQZ,SAAA,IAAa,gBAAA;EAAA,IAQb,KAAA;EAxBc;;;;;;EAAA,UAkChB,WAAA,CACS,OAAA,EAAS,aAAA,EAClB,UAAA,EAAY,cAAA;EAgBL;;;;;;;;;EAFH,cAAA,CACX,OAAA,UACA,YAAA,EAAc,WAAA,CAAY,YAAA,eACzB,OAAA,CAAQ,mBAAA;EApJA;;;;;;EA+NJ,iBAAA,CAAkB,YAAA,UAAsB,WAAA;AAAA"}
@@ -4,6 +4,7 @@ import { uuid } from "@stryke/unique-id/uuid";
4
4
  import { createHostContext } from "devframe/node";
5
5
  import { getDefaultLogLevel, loadParsedConfig, resolveRoot } from "@powerlines/core/lib/config";
6
6
  import { PowerlinesBaseContext } from "@powerlines/core/context/base-context";
7
+ import { getName } from "@powerlines/core/plugin-utils/context-helpers";
7
8
  import { getEnvPaths } from "@stryke/env/get-env-paths";
8
9
  import { kebabCase } from "@stryke/string-format/kebab-case";
9
10
  import * as v from "valibot";
@@ -122,11 +123,14 @@ var PowerlinesEngineContext = class PowerlinesEngineContext extends PowerlinesBa
122
123
  */
123
124
  async loadExecutions(command, inlineConfig) {
124
125
  const root = resolveRoot(this.cwd, inlineConfig.root, inlineConfig.configFile);
125
- const config = await loadParsedConfig(this.cwd, root, this.framework?.name, this.orgId, inlineConfig);
126
+ const config = await loadParsedConfig(this.cwd, root, this.framework?.name, this.orgId, {
127
+ ...inlineConfig,
128
+ command
129
+ });
126
130
  if (!config) throw new Error("Failed to load configuration");
127
131
  const invocationId = uuid();
128
132
  const executions = await Promise.all(toArray(config.config).map(async (_, configIndex) => {
129
- const executionId = formatExecutionId(config.config.name || inlineConfig.name || root, command, configIndex);
133
+ const executionId = formatExecutionId(config.config.name || inlineConfig.name || await getName(this.cwd, root), command, configIndex);
130
134
  const options = {
131
135
  cwd: this.cwd,
132
136
  root,
@@ -1 +1 @@
1
- {"version":3,"file":"engine-context.mjs","names":["#devtools","#logLevel","#executions"],"sources":["../../src/context/engine-context.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 type {\n FrameworkOptions,\n InlineConfig,\n LogFn,\n LoggerOptions,\n LogLevelResolvedConfig\n} from \"@powerlines/core\";\nimport { PowerlinesBaseContext } from \"@powerlines/core/context/base-context\";\nimport {\n getDefaultLogLevel,\n loadParsedConfig,\n resolveRoot\n} from \"@powerlines/core/lib/config\";\nimport {\n createLogger,\n formatConfig,\n formatExecutionId,\n resolveLogLevel,\n withCustomLogger\n} from \"@powerlines/core/plugin-utils\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { EnvPaths, getEnvPaths } from \"@stryke/env/get-env-paths\";\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { uuid } from \"@stryke/unique-id/uuid\";\nimport { createHostContext } from \"devframe/node\";\nimport {\n ConnectionMeta,\n DevToolsHost,\n DevToolsNodeContext\n} from \"devframe/types\";\nimport * as v from \"valibot\";\nimport { EngineOptions } from \"../types/config\";\nimport { EngineContext, EngineExecutionItem } from \"../types/context\";\n\nexport class PowerlinesEngineContext<TSystemContext = unknown>\n extends PowerlinesBaseContext<TSystemContext>\n implements EngineContext<TSystemContext>\n{\n #executions: EngineExecutionItem[] = [];\n\n #devtools!: DevToolsNodeContext;\n\n #logLevel!: LogLevelResolvedConfig;\n\n /**\n * Creates a new instance of the PowerlinesEngineContext class.\n *\n * @param options - The options to initialize the context with.\n * @returns A promise that resolves to an instance of the PowerlinesEngineContext class.\n */\n public static async from<TSystemContext = unknown>(\n options: EngineOptions,\n host: DevToolsHost,\n connection: ConnectionMeta\n ): Promise<PowerlinesEngineContext<TSystemContext>> {\n const context = new PowerlinesEngineContext<TSystemContext>(\n options,\n connection\n );\n\n context.#devtools = await createHostContext({\n cwd: context.cwd,\n mode: \"dev\",\n host\n });\n await options.setup?.(context.#devtools);\n\n context.#devtools.rpc.register({\n name: \"powerlines:log\",\n type: \"event\",\n args: [\n v.object({\n meta: v.object({\n category: v.string(),\n name: v.string(),\n command: v.string(),\n hook: v.string(),\n plugin: v.string(),\n source: v.string()\n }),\n message: v.string()\n })\n ],\n setup: _ => ({\n handler: payload => {\n switch (payload.meta.type) {\n case \"error\":\n context.error(payload);\n break;\n case \"warn\":\n context.warn(payload);\n break;\n case \"info\":\n context.info(payload);\n break;\n case \"debug\":\n context.debug(payload);\n break;\n case \"trace\":\n context.trace(payload);\n break;\n default:\n context.info(payload);\n break;\n }\n }\n })\n });\n\n context.#logLevel = options.logLevel\n ? resolveLogLevel(options.logLevel)\n : await getDefaultLogLevel(context.cwd);\n\n return context;\n }\n\n public override createLogger(options: LoggerOptions = {}, logFn?: LogFn) {\n let logger = createLogger(\n \"engine\",\n {\n logLevel: this.#logLevel,\n ...options\n },\n logFn\n );\n if (this.options.customLogger) {\n logger = withCustomLogger(logger, this.options.customLogger);\n }\n return logger;\n }\n\n public get executions(): EngineExecutionItem[] {\n return this.#executions;\n }\n\n public get devtools(): DevToolsNodeContext {\n return this.#devtools;\n }\n\n public get envPaths(): EnvPaths {\n return getEnvPaths({\n orgId: kebabCase(this.orgId),\n appId: kebabCase(this.framework.name),\n workspaceRoot: this.cwd\n });\n }\n\n public get framework(): FrameworkOptions {\n return {\n name: \"powerlines\",\n orgId: \"storm-software\",\n ...this.options.framework\n };\n }\n\n public get orgId(): string {\n return this.framework.orgId;\n }\n\n /**\n * Creates a new Context instance.\n *\n * @param options - The options to use for creating the context, including the resolved configuration and workspace settings.\n * @param connection - The connection metadata for the dev server.\n */\n protected constructor(\n public override options: EngineOptions,\n public connection: ConnectionMeta\n ) {\n super(options);\n }\n\n /**\n * Initialize the context with the provided configuration options\n *\n * @remarks\n * This method will set up the resolver and load the user configuration file based on the provided options. It is called during the construction of the context and can also be called when cloning the context to ensure that the new context has the same configuration and resolver setup.\n *\n * @param command - The path to the execution configuration to load and run, which can be used to specify different execution configurations for different commands or scenarios.\n * @param inlineConfig - Additional configuration options provided at runtime, which can override or supplement the options defined in the user configuration file.\n */\n public async loadExecutions(\n command: string,\n inlineConfig: InlineConfig\n ): Promise<EngineExecutionItem[]> {\n const root = resolveRoot(\n this.cwd,\n inlineConfig.root,\n inlineConfig.configFile\n );\n\n const config = await loadParsedConfig(\n this.cwd,\n root,\n this.framework?.name,\n this.orgId,\n inlineConfig\n );\n if (!config) {\n throw new Error(\"Failed to load configuration\");\n }\n\n const invocationId = uuid();\n const executions = await Promise.all(\n toArray(config.config).map(async (_, configIndex) => {\n const executionId = formatExecutionId(\n config.config.name || inlineConfig.name || root,\n command,\n configIndex\n );\n\n const options = {\n cwd: this.cwd,\n root,\n framework: this.framework,\n orgId: this.orgId,\n ...this.options,\n command,\n baseURL: this.#devtools.host.resolveOrigin(),\n connection: this.connection,\n configFile: config.configFile!,\n executionId,\n configIndex\n };\n\n this.logger.debug({\n meta: { category: \"config\" },\n message: `Invoking ${command} with the following execution parameters: \\n --- Options --- \\n${formatConfig(\n options\n )}\\n --- Inline Config --- \\n${formatConfig(inlineConfig)}`\n });\n\n return {\n invocationId,\n command,\n configFile: config,\n options,\n state: {\n command: null,\n hook: null,\n plugin: null\n }\n };\n })\n );\n\n this.#executions = this.#executions.concat(executions);\n\n return executions;\n }\n\n /**\n * Complete an execution by removing it from the list of active executions based on the provided invocation ID and execution ID. This method is typically called when an execution has finished or has been terminated, allowing the context to clean up any resources associated with that execution and update its internal state accordingly.\n *\n * @param invocationId - The unique identifier for the invocation of the execution to be completed.\n * @param executionId - The unique identifier for the specific execution to be completed.\n */\n public completeExecution(invocationId: string, executionId: string) {\n this.#executions = this.#executions.filter(\n execution =>\n execution.options.executionId !== executionId ||\n execution.invocationId !== invocationId\n );\n }\n}\n"],"mappings":";;;;;;;;;;;AAoDA,IAAa,0BAAb,MAAa,gCACH,sBAEV;CAiIoB;CACT;CAjIT,cAAqC,CAAC;CAEtC;CAEA;;;;;;;CAQA,aAAoB,KAClB,SACA,MACA,YACkD;EAClD,MAAM,UAAU,IAAI,wBAClB,SACA,UACF;EAEA,QAAQA,YAAY,MAAM,kBAAkB;GAC1C,KAAK,QAAQ;GACb,MAAM;GACN;EACF,CAAC;EACD,MAAM,QAAQ,QAAQ,QAAQA,SAAS;EAEvC,QAAQA,UAAU,IAAI,SAAS;GAC7B,MAAM;GACN,MAAM;GACN,MAAM,CACJ,EAAE,OAAO;IACP,MAAM,EAAE,OAAO;KACb,UAAU,EAAE,OAAO;KACnB,MAAM,EAAE,OAAO;KACf,SAAS,EAAE,OAAO;KAClB,MAAM,EAAE,OAAO;KACf,QAAQ,EAAE,OAAO;KACjB,QAAQ,EAAE,OAAO;IACnB,CAAC;IACD,SAAS,EAAE,OAAO;GACpB,CAAC,CACH;GACA,QAAO,OAAM,EACX,UAAS,YAAW;IAClB,QAAQ,QAAQ,KAAK,MAArB;KACE,KAAK;MACH,QAAQ,MAAM,OAAO;MACrB;KACF,KAAK;MACH,QAAQ,KAAK,OAAO;MACpB;KACF,KAAK;MACH,QAAQ,KAAK,OAAO;MACpB;KACF,KAAK;MACH,QAAQ,MAAM,OAAO;MACrB;KACF,KAAK;MACH,QAAQ,MAAM,OAAO;MACrB;KACF;MACE,QAAQ,KAAK,OAAO;MACpB;IACJ;GACF,EACF;EACF,CAAC;EAED,QAAQC,YAAY,QAAQ,WACxB,gBAAgB,QAAQ,QAAQ,IAChC,MAAM,mB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K,cAAc;IAC3C,YAAY,KAAK;IACjB,YAAY,OAAO;IACnB;IACA;GACF;GAEA,KAAK,OAAO,MAAM;IAChB,MAAM,EAAE,UAAU,SAAS;IAC3B,SAAS,YAAY,QAAQ,iEAAiE,aAC5F,OACF,EAAE,6BAA6B,aAAa,YAAY;GAC1D,CAAC;GAED,OAAO;IACL;IACA;IACA,YAAY;IACZ;IACA,OAAO;KACL,SAAS;KACT,MAAM;KACN,QAAQ;IACV;GACF;EACF,CAAC,CACH;EAEA,KAAKE,cAAc,KAAKA,YAAY,OAAO,UAAU;EAErD,OAAO;CACT;;;;;;;CAQA,AAAO,kBAAkB,cAAsB,aAAqB;EAClE,KAAKA,cAAc,KAAKA,YAAY,QAClC,cACE,UAAU,QAAQ,gBAAgB,eAClC,UAAU,iBAAiB,YAC/B;CACF;AACF"}
1
+ {"version":3,"file":"engine-context.mjs","names":["#devtools","#logLevel","#executions"],"sources":["../../src/context/engine-context.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 type {\n FrameworkOptions,\n InlineConfig,\n LogFn,\n LoggerOptions,\n LogLevelResolvedConfig\n} from \"@powerlines/core\";\nimport { PowerlinesBaseContext } from \"@powerlines/core/context/base-context\";\nimport {\n getDefaultLogLevel,\n loadParsedConfig,\n resolveRoot\n} from \"@powerlines/core/lib/config\";\nimport {\n createLogger,\n formatConfig,\n formatExecutionId,\n resolveLogLevel,\n withCustomLogger\n} from \"@powerlines/core/plugin-utils\";\nimport { getName } from \"@powerlines/core/plugin-utils/context-helpers\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { EnvPaths, getEnvPaths } from \"@stryke/env/get-env-paths\";\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { PartialKeys } from \"@stryke/types/base\";\nimport { uuid } from \"@stryke/unique-id/uuid\";\nimport { createHostContext } from \"devframe/node\";\nimport {\n ConnectionMeta,\n DevToolsHost,\n DevToolsNodeContext\n} from \"devframe/types\";\nimport * as v from \"valibot\";\nimport { EngineOptions } from \"../types/config\";\nimport { EngineContext, EngineExecutionItem } from \"../types/context\";\n\nexport class PowerlinesEngineContext<TSystemContext = unknown>\n extends PowerlinesBaseContext<TSystemContext>\n implements EngineContext<TSystemContext>\n{\n #executions: EngineExecutionItem[] = [];\n\n #devtools!: DevToolsNodeContext;\n\n #logLevel!: LogLevelResolvedConfig;\n\n /**\n * Creates a new instance of the PowerlinesEngineContext class.\n *\n * @param options - The options to initialize the context with.\n * @returns A promise that resolves to an instance of the PowerlinesEngineContext class.\n */\n public static async from<TSystemContext = unknown>(\n options: EngineOptions,\n host: DevToolsHost,\n connection: ConnectionMeta\n ): Promise<PowerlinesEngineContext<TSystemContext>> {\n const context = new PowerlinesEngineContext<TSystemContext>(\n options,\n connection\n );\n\n context.#devtools = await createHostContext({\n cwd: context.cwd,\n mode: \"dev\",\n host\n });\n await options.setup?.(context.#devtools);\n\n context.#devtools.rpc.register({\n name: \"powerlines:log\",\n type: \"event\",\n args: [\n v.object({\n meta: v.object({\n category: v.string(),\n name: v.string(),\n command: v.string(),\n hook: v.string(),\n plugin: v.string(),\n source: v.string()\n }),\n message: v.string()\n })\n ],\n setup: _ => ({\n handler: payload => {\n switch (payload.meta.type) {\n case \"error\":\n context.error(payload);\n break;\n case \"warn\":\n context.warn(payload);\n break;\n case \"info\":\n context.info(payload);\n break;\n case \"debug\":\n context.debug(payload);\n break;\n case \"trace\":\n context.trace(payload);\n break;\n default:\n context.info(payload);\n break;\n }\n }\n })\n });\n\n context.#logLevel = options.logLevel\n ? resolveLogLevel(options.logLevel)\n : await getDefaultLogLevel(context.cwd);\n\n return context;\n }\n\n public override createLogger(options: LoggerOptions = {}, logFn?: LogFn) {\n let logger = createLogger(\n \"engine\",\n {\n logLevel: this.#logLevel,\n ...options\n },\n logFn\n );\n if (this.options.customLogger) {\n logger = withCustomLogger(logger, this.options.customLogger);\n }\n return logger;\n }\n\n public get executions(): EngineExecutionItem[] {\n return this.#executions;\n }\n\n public get devtools(): DevToolsNodeContext {\n return this.#devtools;\n }\n\n public get envPaths(): EnvPaths {\n return getEnvPaths({\n orgId: kebabCase(this.orgId),\n appId: kebabCase(this.framework.name),\n workspaceRoot: this.cwd\n });\n }\n\n public get framework(): FrameworkOptions {\n return {\n name: \"powerlines\",\n orgId: \"storm-software\",\n ...this.options.framework\n };\n }\n\n public get orgId(): string {\n return this.framework.orgId;\n }\n\n /**\n * Creates a new Context instance.\n *\n * @param options - The options to use for creating the context, including the resolved configuration and workspace settings.\n * @param connection - The connection metadata for the dev server.\n */\n protected constructor(\n public override options: EngineOptions,\n public connection: ConnectionMeta\n ) {\n super(options);\n }\n\n /**\n * Initialize the context with the provided configuration options\n *\n * @remarks\n * This method will set up the resolver and load the user configuration file based on the provided options. It is called during the construction of the context and can also be called when cloning the context to ensure that the new context has the same configuration and resolver setup.\n *\n * @param command - The path to the execution configuration to load and run, which can be used to specify different execution configurations for different commands or scenarios.\n * @param inlineConfig - Additional configuration options provided at runtime, which can override or supplement the options defined in the user configuration file.\n */\n public async loadExecutions(\n command: string,\n inlineConfig: PartialKeys<InlineConfig, \"command\">\n ): Promise<EngineExecutionItem[]> {\n const root = resolveRoot(\n this.cwd,\n inlineConfig.root,\n inlineConfig.configFile\n );\n\n const config = await loadParsedConfig(\n this.cwd,\n root,\n this.framework?.name,\n this.orgId,\n { ...inlineConfig, command }\n );\n if (!config) {\n throw new Error(\"Failed to load configuration\");\n }\n\n const invocationId = uuid();\n const executions = await Promise.all(\n toArray(config.config).map(async (_, configIndex) => {\n const executionId = formatExecutionId(\n config.config.name ||\n inlineConfig.name ||\n (await getName(this.cwd, root)),\n command,\n configIndex\n );\n\n const options = {\n cwd: this.cwd,\n root,\n framework: this.framework,\n orgId: this.orgId,\n ...this.options,\n command,\n baseURL: this.#devtools.host.resolveOrigin(),\n connection: this.connection,\n configFile: config.configFile!,\n executionId,\n configIndex\n };\n\n this.logger.debug({\n meta: { category: \"config\" },\n message: `Invoking ${command} with the following execution parameters: \\n --- Options --- \\n${formatConfig(\n options\n )}\\n --- Inline Config --- \\n${formatConfig(inlineConfig)}`\n });\n\n return {\n invocationId,\n command,\n configFile: config,\n options,\n state: {\n command: null,\n hook: null,\n plugin: null\n }\n };\n })\n );\n\n this.#executions = this.#executions.concat(executions);\n\n return executions;\n }\n\n /**\n * Complete an execution by removing it from the list of active executions based on the provided invocation ID and execution ID. This method is typically called when an execution has finished or has been terminated, allowing the context to clean up any resources associated with that execution and update its internal state accordingly.\n *\n * @param invocationId - The unique identifier for the invocation of the execution to be completed.\n * @param executionId - The unique identifier for the specific execution to be completed.\n */\n public completeExecution(invocationId: string, executionId: string) {\n this.#executions = this.#executions.filter(\n execution =>\n execution.options.executionId !== executionId ||\n execution.invocationId !== invocationId\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;AAsDA,IAAa,0BAAb,MAAa,gCACH,sBAEV;CAiIoB;CACT;CAjIT,cAAqC,CAAC;CAEtC;CAEA;;;;;;;CAQA,aAAoB,KAClB,SACA,MACA,YACkD;EAClD,MAAM,UAAU,IAAI,wBAClB,SACA,UACF;EAEA,QAAQA,YAAY,MAAM,kBAAkB;GAC1C,KAAK,QAAQ;GACb,MAAM;GACN;EACF,CAAC;EACD,MAAM,QAAQ,QAAQ,QAAQA,SAAS;EAEvC,QAAQA,UAAU,IAAI,SAAS;GAC7B,MAAM;GACN,MAAM;GACN,MAAM,CACJ,EAAE,OAAO;IACP,MAAM,EAAE,OAAO;KACb,UAAU,EAAE,OAAO;KACnB,MAAM,EAAE,OAAO;KACf,SAA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;;;;;CAWA,MAAa,eACX,SACA,cACgC;EAChC,MAAM,OAAO,YACX,KAAK,KACL,aAAa,MACb,aAAa,UACf;EAEA,MAAM,SAAS,MAAM,iBACnB,KAAK,KACL,MACA,KAAK,WAAW,MAChB,KAAK,OACL;GAAE,GAAG;GAAc;EAAQ,CAC7B;EACA,IAAI,CAAC,QACH,MAAM,IAAI,MAAM,8BAA8B;EAGhD,MAAM,eAAe,KAAK;EAC1B,MAAM,aAAa,MAAM,QAAQ,IAC/B,QAAQ,OAAO,MAAM,CAAC,CAAC,IAAI,OAAO,GAAG,gBAAgB;GACnD,MAAM,cAAc,kBAClB,OAAO,OAAO,QACZ,aAAa,QACZ,MAAM,QAAQ,KAAK,KAAK,IAAI,GAC/B,SACA,WACF;GAEA,MAAM,UAAU;IACd,KAAK,KAAK;IACV;IACA,WAAW,KAAK;IAChB,OAAO,KAAK;IACZ,GAAG,KAAK;IACR;IACA,SAAS,KAAKA,UAAU,KAAK,cAAc;IAC3C,YAAY,KAAK;IACjB,YAAY,OAAO;IACnB;IACA;GACF;GAEA,KAAK,OAAO,MAAM;IAChB,MAAM,EAAE,UAAU,SAAS;IAC3B,SAAS,YAAY,QAAQ,iEAAiE,aAC5F,OACF,EAAE,6BAA6B,aAAa,YAAY;GAC1D,CAAC;GAED,OAAO;IACL;IACA;IACA,YAAY;IACZ;IACA,OAAO;KACL,SAAS;KACT,MAAM;KACN,QAAQ;IACV;GACF;EACF,CAAC,CACH;EAEA,KAAKE,cAAc,KAAKA,YAAY,OAAO,UAAU;EAErD,OAAO;CACT;;;;;;;CAQA,AAAO,kBAAkB,cAAsB,aAAqB;EAClE,KAAKA,cAAc,KAAKA,YAAY,QAClC,cACE,UAAU,QAAQ,gBAAgB,eAClC,UAAU,iBAAiB,YAC/B;CACF;AACF"}
package/dist/engine.d.cts CHANGED
@@ -4,6 +4,7 @@ import { Engine } from "./types/api.cjs";
4
4
  import { PowerlinesEngineContext } from "./context/engine-context.cjs";
5
5
  import { ExecutionApiWorker } from "./_internal/execution-api-worker.cjs";
6
6
  import { BuildInlineConfig, CleanInlineConfig, CreateInlineConfig, DeployInlineConfig, DocsInlineConfig, InlineConfig, LintInlineConfig, PrepareInlineConfig, TestInlineConfig, TypesInlineConfig } from "@powerlines/core";
7
+ import { PartialKeys } from "@stryke/types/base";
7
8
 
8
9
  //#region src/engine.d.ts
9
10
  /**
@@ -38,7 +39,7 @@ declare class PowerlinesEngine implements Engine, AsyncDisposable {
38
39
  * @param inlineConfig - The inline configuration for the create command
39
40
  * @returns A promise that resolves when the project has been created
40
41
  */
41
- create(inlineConfig: CreateInlineConfig): Promise<void>;
42
+ create(inlineConfig: PartialKeys<CreateInlineConfig, "command">): Promise<void>;
42
43
  /**
43
44
  * Generate the Powerlines typescript declaration file
44
45
  *
@@ -47,7 +48,7 @@ declare class PowerlinesEngine implements Engine, AsyncDisposable {
47
48
  *
48
49
  * @param inlineConfig - The inline configuration for the types command
49
50
  */
50
- types(inlineConfig: TypesInlineConfig): Promise<void>;
51
+ types(inlineConfig: PartialKeys<TypesInlineConfig, "command">): Promise<void>;
51
52
  /**
52
53
  * Prepare the Powerlines API
53
54
  *
@@ -56,7 +57,7 @@ declare class PowerlinesEngine implements Engine, AsyncDisposable {
56
57
  *
57
58
  * @param inlineConfig - The inline configuration for the prepare command
58
59
  */
59
- prepare(inlineConfig: PrepareInlineConfig): Promise<void>;
60
+ prepare(inlineConfig: PartialKeys<PrepareInlineConfig, "command">): Promise<void>;
60
61
  /**
61
62
  * Clean any previously prepared artifacts
62
63
  *
@@ -66,14 +67,14 @@ declare class PowerlinesEngine implements Engine, AsyncDisposable {
66
67
  * @param inlineConfig - The inline configuration for the clean command
67
68
  * @returns A promise that resolves when the clean command has completed
68
69
  */
69
- clean(inlineConfig: CleanInlineConfig): Promise<void>;
70
+ clean(inlineConfig: PartialKeys<CleanInlineConfig, "command">): Promise<void>;
70
71
  /**
71
72
  * Lint the project
72
73
  *
73
74
  * @param inlineConfig - The inline configuration for the lint command
74
75
  * @returns A promise that resolves when the lint command has completed
75
76
  */
76
- lint(inlineConfig: LintInlineConfig): Promise<void>;
77
+ lint(inlineConfig: PartialKeys<LintInlineConfig, "command">): Promise<void>;
77
78
  /**
78
79
  * Test the project
79
80
  *
@@ -83,7 +84,7 @@ declare class PowerlinesEngine implements Engine, AsyncDisposable {
83
84
  * @param inlineConfig - The inline configuration for the test command
84
85
  * @returns A promise that resolves when the test command has completed
85
86
  */
86
- test(inlineConfig: TestInlineConfig): Promise<void>;
87
+ test(inlineConfig: PartialKeys<TestInlineConfig, "command">): Promise<void>;
87
88
  /**
88
89
  * Build the project
89
90
  *
@@ -93,14 +94,14 @@ declare class PowerlinesEngine implements Engine, AsyncDisposable {
93
94
  * @param inlineConfig - The inline configuration for the build command
94
95
  * @returns A promise that resolves when the build command has completed
95
96
  */
96
- build(inlineConfig: BuildInlineConfig): Promise<void>;
97
+ build(inlineConfig: PartialKeys<BuildInlineConfig, "command">): Promise<void>;
97
98
  /**
98
99
  * Prepare the documentation for the project
99
100
  *
100
101
  * @param inlineConfig - The inline configuration for the docs command
101
102
  * @returns A promise that resolves when the documentation generation has completed
102
103
  */
103
- docs(inlineConfig: DocsInlineConfig): Promise<void>;
104
+ docs(inlineConfig: PartialKeys<DocsInlineConfig, "command">): Promise<void>;
104
105
  /**
105
106
  * Deploy the project source code
106
107
  *
@@ -110,7 +111,7 @@ declare class PowerlinesEngine implements Engine, AsyncDisposable {
110
111
  * @param inlineConfig - The inline configuration for the deploy command
111
112
  * @returns A promise that resolves when the deploy command has completed
112
113
  */
113
- deploy(inlineConfig: DeployInlineConfig): Promise<void>;
114
+ deploy(inlineConfig: PartialKeys<DeployInlineConfig, "command">): Promise<void>;
114
115
  /**
115
116
  * Finalization/cleanup processing for the Powerlines API
116
117
  *
@@ -134,7 +135,7 @@ declare class PowerlinesEngine implements Engine, AsyncDisposable {
134
135
  * @param inlineConfig - Additional configuration options provided at runtime, which can override or supplement the options defined in the user configuration file.
135
136
  * @returns A promise that resolves when all executions for the specified command have completed
136
137
  */
137
- protected execute(command: string, inlineConfig: InlineConfig): Promise<void>;
138
+ protected execute(command: string, inlineConfig: PartialKeys<InlineConfig, "command">): Promise<void>;
138
139
  }
139
140
  declare function createContext(options: EngineOptions): Promise<PowerlinesEngineContext<unknown>>;
140
141
  declare function createEngine(options: EngineOptions, apiPath?: string): Promise<PowerlinesEngine>;
@@ -1 +1 @@
1
- {"version":3,"file":"engine.d.cts","names":[],"sources":["../src/engine.ts"],"mappings":";;;;;;;;;;AA8CA;;;cAAa,gBAAA,YAA4B,MAAA,EAAQ,eAAA;EAAA;EAgCnB;;;EAAA,IAlBjB,OAAA,IAAW,aAAA;EAkDW;;;EAAA,IA3CtB,GAAA,IAAO,kBAAA;EAgFe;;;;;;;cArEd,OAAA,EAAS,aAAA,EAAe,GAAA,EAAK,kBAAA;EA2IhB;;;;;;;;;EA7HnB,MAAA,CAAO,YAAA,EAAc,kBAAA,GAAkB,OAAA;EA9CL;;;;;;;;EAgElC,KAAA,CAAM,YAAA,EAAc,iBAAA,GAAiB,OAAA;EA3ChC;;;;;;;;EA6DL,OAAA,CAAQ,YAAA,EAAc,mBAAA,GAAmB,OAAA;EApCF;;;;;;;;;EAuDvC,KAAA,CAAM,YAAA,EAAc,iBAAA,GAAiB,OAAA;EAAjB;;;;;;EAgBpB,IAAA,CAAK,YAAA,EAAc,gBAAA,GAAgB,OAAA;EAmBnC;;;;;;;;;EAAA,IAAA,CAAK,YAAA,EAAc,gBAAA,GAAgB,OAAA;EAmC9B;;;;;;;;;EAhBL,KAAA,CAAM,YAAA,EAAc,iBAAA,GAAiB,OAAA;EAkEhB;;;;;;EAlDrB,IAAA,CAAK,YAAA,EAAc,gBAAA,GAAgB,OAAA;EAgEmB;AA8BrE;;;;;;;;EA3Ee,MAAA,CAAO,YAAA,EAAc,kBAAA,GAAkB,OAAA;EA2ElB;;;;AAAsB;AAuB1D;;;EAhFe,QAAA,IAAQ,OAAA;EAkFa;;;EAAA,C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B/B,MAAA,CACX,YAAA,EAAc,WAAA,CAAY,kBAAA,eAA8B,OAAA;EAgC5C;;;;;;;;EAbD,QAAA,IAAQ,OAAA;EA6B+B;AAAA;AA+BtD;EA/BsD,CAhBtC,MAAA,CAAO,YAAA,KAAa,OAAA;;;;;;;;;;;YAclB,OAAA,CACd,OAAA,UACA,YAAA,EAAc,WAAA,CAAY,YAAA,eAAwB,OAAA;AAAA;AAAA,iBA+BhC,aAAA,CAAc,OAAA,EAAS,aAAA,GAAa,OAAA,CAAA,uBAAA;AAAA,iBAuBpC,YAAA,CACpB,OAAA,EAAS,aAAA,EACT,OAAA,YAAkC,OAAA,CAAA,gBAAA"}
package/dist/engine.d.mts CHANGED
@@ -4,6 +4,7 @@ import { Engine } from "./types/api.mjs";
4
4
  import { PowerlinesEngineContext } from "./context/engine-context.mjs";
5
5
  import { ExecutionApiWorker } from "./_internal/execution-api-worker.mjs";
6
6
  import { BuildInlineConfig, CleanInlineConfig, CreateInlineConfig, DeployInlineConfig, DocsInlineConfig, InlineConfig, LintInlineConfig, PrepareInlineConfig, TestInlineConfig, TypesInlineConfig } from "@powerlines/core";
7
+ import { PartialKeys } from "@stryke/types/base";
7
8
 
8
9
  //#region src/engine.d.ts
9
10
  /**
@@ -38,7 +39,7 @@ declare class PowerlinesEngine implements Engine, AsyncDisposable {
38
39
  * @param inlineConfig - The inline configuration for the create command
39
40
  * @returns A promise that resolves when the project has been created
40
41
  */
41
- create(inlineConfig: CreateInlineConfig): Promise<void>;
42
+ create(inlineConfig: PartialKeys<CreateInlineConfig, "command">): Promise<void>;
42
43
  /**
43
44
  * Generate the Powerlines typescript declaration file
44
45
  *
@@ -47,7 +48,7 @@ declare class PowerlinesEngine implements Engine, AsyncDisposable {
47
48
  *
48
49
  * @param inlineConfig - The inline configuration for the types command
49
50
  */
50
- types(inlineConfig: TypesInlineConfig): Promise<void>;
51
+ types(inlineConfig: PartialKeys<TypesInlineConfig, "command">): Promise<void>;
51
52
  /**
52
53
  * Prepare the Powerlines API
53
54
  *
@@ -56,7 +57,7 @@ declare class PowerlinesEngine implements Engine, AsyncDisposable {
56
57
  *
57
58
  * @param inlineConfig - The inline configuration for the prepare command
58
59
  */
59
- prepare(inlineConfig: PrepareInlineConfig): Promise<void>;
60
+ prepare(inlineConfig: PartialKeys<PrepareInlineConfig, "command">): Promise<void>;
60
61
  /**
61
62
  * Clean any previously prepared artifacts
62
63
  *
@@ -66,14 +67,14 @@ declare class PowerlinesEngine implements Engine, AsyncDisposable {
66
67
  * @param inlineConfig - The inline configuration for the clean command
67
68
  * @returns A promise that resolves when the clean command has completed
68
69
  */
69
- clean(inlineConfig: CleanInlineConfig): Promise<void>;
70
+ clean(inlineConfig: PartialKeys<CleanInlineConfig, "command">): Promise<void>;
70
71
  /**
71
72
  * Lint the project
72
73
  *
73
74
  * @param inlineConfig - The inline configuration for the lint command
74
75
  * @returns A promise that resolves when the lint command has completed
75
76
  */
76
- lint(inlineConfig: LintInlineConfig): Promise<void>;
77
+ lint(inlineConfig: PartialKeys<LintInlineConfig, "command">): Promise<void>;
77
78
  /**
78
79
  * Test the project
79
80
  *
@@ -83,7 +84,7 @@ declare class PowerlinesEngine implements Engine, AsyncDisposable {
83
84
  * @param inlineConfig - The inline configuration for the test command
84
85
  * @returns A promise that resolves when the test command has completed
85
86
  */
86
- test(inlineConfig: TestInlineConfig): Promise<void>;
87
+ test(inlineConfig: PartialKeys<TestInlineConfig, "command">): Promise<void>;
87
88
  /**
88
89
  * Build the project
89
90
  *
@@ -93,14 +94,14 @@ declare class PowerlinesEngine implements Engine, AsyncDisposable {
93
94
  * @param inlineConfig - The inline configuration for the build command
94
95
  * @returns A promise that resolves when the build command has completed
95
96
  */
96
- build(inlineConfig: BuildInlineConfig): Promise<void>;
97
+ build(inlineConfig: PartialKeys<BuildInlineConfig, "command">): Promise<void>;
97
98
  /**
98
99
  * Prepare the documentation for the project
99
100
  *
100
101
  * @param inlineConfig - The inline configuration for the docs command
101
102
  * @returns A promise that resolves when the documentation generation has completed
102
103
  */
103
- docs(inlineConfig: DocsInlineConfig): Promise<void>;
104
+ docs(inlineConfig: PartialKeys<DocsInlineConfig, "command">): Promise<void>;
104
105
  /**
105
106
  * Deploy the project source code
106
107
  *
@@ -110,7 +111,7 @@ declare class PowerlinesEngine implements Engine, AsyncDisposable {
110
111
  * @param inlineConfig - The inline configuration for the deploy command
111
112
  * @returns A promise that resolves when the deploy command has completed
112
113
  */
113
- deploy(inlineConfig: DeployInlineConfig): Promise<void>;
114
+ deploy(inlineConfig: PartialKeys<DeployInlineConfig, "command">): Promise<void>;
114
115
  /**
115
116
  * Finalization/cleanup processing for the Powerlines API
116
117
  *
@@ -134,7 +135,7 @@ declare class PowerlinesEngine implements Engine, AsyncDisposable {
134
135
  * @param inlineConfig - Additional configuration options provided at runtime, which can override or supplement the options defined in the user configuration file.
135
136
  * @returns A promise that resolves when all executions for the specified command have completed
136
137
  */
137
- protected execute(command: string, inlineConfig: InlineConfig): Promise<void>;
138
+ protected execute(command: string, inlineConfig: PartialKeys<InlineConfig, "command">): Promise<void>;
138
139
  }
139
140
  declare function createContext(options: EngineOptions): Promise<PowerlinesEngineContext<unknown>>;
140
141
  declare function createEngine(options: EngineOptions, apiPath?: string): Promise<PowerlinesEngine>;
@@ -1 +1 @@
1
- {"version":3,"file":"engine.d.mts","names":[],"sources":["../src/engine.ts"],"mappings":";;;;;;;;;;AA8CA;;;cAAa,gBAAA,YAA4B,MAAA,EAAQ,eAAA;EAAA;EAgCnB;;;EAAA,IAlBjB,OAAA,IAAW,aAAA;EAkDW;;;EAAA,IA3CtB,GAAA,IAAO,kBAAA;EAgFe;;;;;;;cArEd,OAAA,EAAS,aAAA,EAAe,GAAA,EAAK,kBAAA;EA2IhB;;;;;;;;;EA7HnB,MAAA,CAAO,YAAA,EAAc,kBAAA,GAAkB,OAAA;EA9CL;;;;;;;;EAgElC,KAAA,CAAM,YAAA,EAAc,iBAAA,GAAiB,OAAA;EA3ChC;;;;;;;;EA6DL,OA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c,WAAA,CAAY,iBAAA,eAA6B,OAAA;EAlEnC;;;;;;;;EAoF1B,OAAA,CACX,YAAA,EAAc,WAAA,CAAY,mBAAA,eAA+B,OAAA;EAhEhD;;;;;;;;;EAoFE,KAAA,CAAM,YAAA,EAAc,WAAA,CAAY,iBAAA,eAA6B,OAAA;EA1DxE;;;;;;EA0EW,IAAA,CAAK,YAAA,EAAc,WAAA,CAAY,gBAAA,eAA4B,OAAA;EArC3D;;;;;;;;;EAwDA,IAAA,CAAK,YAAA,EAAc,WAAA,CAAY,gBAAA,eAA4B,OAAA;EAnB3D;;;;;;;;;EAsCA,KAAA,CAAM,YAAA,EAAc,WAAA,CAAY,iBAAA,eAA6B,OAAA;EAA7D;;;;;;EAgBA,IAAA,CAAK,YAAA,EAAc,WAAA,CAAY,gBAAA,eAA4B,OAAA;EAA5B;;;;;;;;;EAmB/B,MAAA,CACX,YAAA,EAAc,WAAA,CAAY,kBAAA,eAA8B,OAAA;EAgC5C;;;;;;;;EAbD,QAAA,IAAQ,OAAA;EA6B+B;AAAA;AA+BtD;EA/BsD,CAhBtC,MAAA,CAAO,YAAA,KAAa,OAAA;;;;;;;;;;;YAclB,OAAA,CACd,OAAA,UACA,YAAA,EAAc,WAAA,CAAY,YAAA,eAAwB,OAAA;AAAA;AAAA,iBA+BhC,aAAA,CAAc,OAAA,EAAS,aAAA,GAAa,OAAA,CAAA,uBAAA;AAAA,iBAuBpC,YAAA,CACpB,OAAA,EAAS,aAAA,EACT,OAAA,YAAkC,OAAA,CAAA,gBAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"engine.mjs","names":["#context","#api"],"sources":["../src/engine.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 type {\n BuildInlineConfig,\n CleanInlineConfig,\n CreateInlineConfig,\n DeployInlineConfig,\n DocsInlineConfig,\n InlineConfig,\n LintInlineConfig,\n PrepareInlineConfig,\n TestInlineConfig,\n TypesInlineConfig\n} from \"@powerlines/core\";\nimport { createH3DevToolsHost } from \"devframe/node\";\nimport { getPort } from \"get-port-please\";\nimport { createApp, fromNodeMiddleware } from \"h3\";\nimport { EventEmitter } from \"node:events\";\nimport sirv from \"sirv\";\nimport { ExecutionApiWorker } from \"./_internal/execution-api-worker\";\nimport { PowerlinesEngineContext } from \"./context/engine-context\";\nimport { Engine } from \"./types/api\";\nimport { EngineOptions } from \"./types/config\";\nimport { EngineContext } from \"./types/context\";\n\n/**\n * The Powerlines process' orchestration and coordination API.\n *\n * @public\n */\nexport class PowerlinesEngine implements Engine, AsyncDisposable {\n /**\n * The Powerlines context\n */\n #context: EngineContext;\n\n /**\n * The execution host, which provides methods to call the execution API functions from the engine context. This allows the engine to invoke commands and other API functions during the execution of Powerlines commands, enabling communication between the engine and the execution contexts.\n */\n #api: ExecutionApiWorker;\n\n /**\n * The Powerlines context\n */\n public get context(): EngineContext {\n return this.#context;\n }\n\n /**\n * The execution host, which provides methods to call the execution API functions from the engine context. This allows the engine to invoke commands and other API functions during the execution of Powerlines commands, enabling communication between the engine and the execution contexts.\n */\n public get api(): ExecutionApiWorker {\n return this.#api;\n }\n\n /**\n * Create a new Powerlines Engine instance\n *\n * @param context - The Powerlines context\n * @param api - The API host for the execution workers\n * @returns A new instance of the Powerlines Engine\n */\n public constructor(context: EngineContext, api: ExecutionApiWorker) {\n this.#context = context;\n this.#api = api;\n }\n\n /**\n * Create a new Powerlines project\n *\n * @remarks\n * This method will create a new Powerlines project in the current directory.\n *\n * @param inlineConfig - The inline configuration for the create command\n * @returns A promise that resolves when the project has been created\n */\n public async create(inlineConfig: CreateInlineConfig) {\n const timer = this.context.timer(\"Create\");\n this.context.info(\"๐Ÿ†• Creating a new project\");\n\n await this.execute(\"create\", inlineConfig);\n\n this.context.debug(\"โœ” Create command completed successfully\");\n timer();\n }\n\n /**\n * Generate the Powerlines typescript declaration file\n *\n * @remarks\n * This method will only generate the typescript declaration file for the Powerlines project. It is generally recommended to run the full `prepare` command, which will run this method as part of its process.\n *\n * @param inlineConfig - The inline configuration for the types command\n */\n public async types(inlineConfig: TypesInlineConfig) {\n const timer = this.context.timer(\"Types\");\n this.context.info(\"๐Ÿ—๏ธ Generating typescript declarations for the project\");\n\n await this.execute(\"types\", inlineConfig);\n\n this.context.debug(\"โœ” Types generation has completed successfully\");\n timer();\n }\n\n /**\n * Prepare the Powerlines API\n *\n * @remarks\n * This method will prepare the Powerlines API for use, initializing any necessary resources.\n *\n * @param inlineConfig - The inline configuration for the prepare command\n */\n public async prepare(inlineConfig: PrepareInlineConfig) {\n const timer = this.context.timer(\"Prepare\");\n this.context.info(\"๐Ÿ—๏ธ Preparing the project\");\n\n await this.execute(\"prepare\", inlineConfig);\n\n this.context.debug(\"โœ” Preparation has completed successfully\");\n timer();\n }\n\n /**\n * Clean any previously prepared artifacts\n *\n * @remarks\n * This method will remove the previous Powerlines artifacts from the project.\n *\n * @param inlineConfig - The inline configuration for the clean command\n * @returns A promise that resolves when the clean command has completed\n */\n public async clean(inlineConfig: CleanInlineConfig) {\n const timer = this.context.timer(\"Clean\");\n this.context.info(\"๐Ÿงน Cleaning the previous artifacts\");\n\n await this.execute(\"clean\", inlineConfig);\n\n this.context.debug(\"โœ” Cleaning completed successfully\");\n timer();\n }\n\n /**\n * Lint the project\n *\n * @param inlineConfig - The inline configuration for the lint command\n * @returns A promise that resolves when the lint command has completed\n */\n public async lint(inlineConfig: LintInlineConfig) {\n const timer = this.context.timer(\"Lint\");\n this.context.info(\"๐Ÿ“ Linting the project\");\n\n await this.execute(\"lint\", inlineConfig);\n\n this.context.debug(\"โœ” Linting completed successfully\");\n timer();\n }\n\n /**\n * Test the project\n *\n * @remarks\n * This method will run the tests for the Powerlines project.\n *\n * @param inlineConfig - The inline configuration for the test command\n * @returns A promise that resolves when the test command has completed\n */\n public async test(inlineConfig: TestInlineConfig) {\n const timer = this.context.timer(\"Test\");\n this.context.info(\"๐Ÿงช Running tests for the project\");\n\n await this.execute(\"test\", inlineConfig);\n\n this.context.debug(\"โœ” Testing completed successfully\");\n timer();\n }\n\n /**\n * Build the project\n *\n * @remarks\n * This method will build the Powerlines project, generating the necessary artifacts.\n *\n * @param inlineConfig - The inline configuration for the build command\n * @returns A promise that resolves when the build command has completed\n */\n public async build(inlineConfig: BuildInlineConfig) {\n const timer = this.context.timer(\"Build\");\n this.context.info(\"๐Ÿ“ฆ Building the project\");\n\n await this.execute(\"build\", inlineConfig);\n\n this.context.debug(\"โœ” Build completed successfully\");\n timer();\n }\n\n /**\n * Prepare the documentation for the project\n *\n * @param inlineConfig - The inline configuration for the docs command\n * @returns A promise that resolves when the documentation generation has completed\n */\n public async docs(inlineConfig: DocsInlineConfig) {\n const timer = this.context.timer(\"Docs\");\n this.context.info(\"๐Ÿ““ Generating documentation for the project\");\n\n await this.execute(\"docs\", inlineConfig);\n\n this.context.debug(\"โœ” Documentation generation completed successfully\");\n timer();\n }\n\n /**\n * Deploy the project source code\n *\n * @remarks\n * This method will prepare and build the Powerlines project, generating the necessary artifacts for the deployment.\n *\n * @param inlineConfig - The inline configuration for the deploy command\n * @returns A promise that resolves when the deploy command has completed\n */\n public async deploy(inlineConfig: DeployInlineConfig) {\n const timer = this.context.timer(\"Deploy\");\n this.context.info(\"๐Ÿš€ Deploying the project\");\n\n await this.execute(\"deploy\", inlineConfig);\n\n this.context.debug(\"โœ” Deployment completed successfully\");\n timer();\n }\n\n /**\n * Finalization/cleanup processing for the Powerlines API\n *\n * @remarks\n * This step includes any final processes or clean up required by Powerlines. It will be run after each Powerlines command.\n *\n * @returns A promise that resolves when the finalization process has completed\n */\n public async finalize() {\n const timer = this.context.timer(\"Finalize\");\n this.context.info(\"๐Ÿ Finalization processes started\");\n\n await this.api.finalize();\n\n this.context.debug(\"โœ” Finalization completed successfully\");\n timer();\n }\n\n /**\n * Asynchronous disposal method for the Powerlines Engine, which will call the finalize method to perform any necessary cleanup when the engine is disposed of.\n */\n public async [Symbol.asyncDispose]() {\n return this.finalize();\n }\n\n /**\n * Execute a Powerlines command based on the provided execution path and inline configuration, loading the necessary executions from the context and managing their lifecycle.\n *\n * @remarks\n * This method will load the executions for the specified command and inline configuration, then execute each one while managing their lifecycle, including handling their completion and any errors that may occur during execution.\n *\n * @param command - The path to the execution configuration to load and run, which can be used to specify different execution configurations for different commands or scenarios.\n * @param inlineConfig - Additional configuration options provided at runtime, which can override or supplement the options defined in the user configuration file.\n * @returns A promise that resolves when all executions for the specified command have completed\n */\n protected async execute(command: string, inlineConfig: InlineConfig) {\n await Promise.all(\n (await this.context.loadExecutions(command, inlineConfig)).map(\n async execution => {\n try {\n await this.api.execute(command, execution.options, inlineConfig);\n } catch (error) {\n this.context.error(\n `Execution of method \"${command}\" failed for execution with invocation ID \"${\n execution.invocationId\n }\" and execution ID \"${execution.options.executionId}\": \\n\\n${\n error instanceof Error\n ? error.stack || error.message\n : String(error)\n }`\n );\n\n throw error;\n } finally {\n this.context.completeExecution(\n execution.invocationId,\n execution.options.executionId!\n );\n }\n }\n )\n );\n }\n}\n\nexport async function createContext(options: EngineOptions) {\n const port =\n options.port ??\n (await getPort({\n host: options.host || \"localhost\",\n random: true\n }));\n\n const app = createApp();\n const host = createH3DevToolsHost({\n appName: options.framework?.name || \"powerlines\",\n origin: `http://${options.host || \"localhost\"}:${port}`,\n mount: (base, dir) => {\n app.use(base, fromNodeMiddleware(sirv(dir, { dev: true, single: true })));\n }\n });\n\n return PowerlinesEngineContext.from(options, host, {\n backend: \"websocket\",\n websocket: port\n });\n}\n\nexport async function createEngine(\n options: EngineOptions,\n apiPath = \"@powerlines/engine/api\"\n) {\n EventEmitter.setMaxListeners(Infinity);\n\n const context = await createContext(options);\n const host = await ExecutionApiWorker.from(apiPath, {\n root: options.root,\n context\n });\n\n return new PowerlinesEngine(context, host);\n}\n"],"mappings":";;;;;;;;;;;;;;AA8CA,IAAa,mBAAb,MAAiE;;;;CAI/D;;;;CAKA;;;;CAKA,IAAW,UAAyB;EAClC,OAAO,KAAKA;CACd;;;;CAKA,IAAW,MAA0B;EACnC,OAAO,KAAKC;CACd;;;;;;;;CASA,AAAO,YAAY,SAAwB,KAAyB;EAClE,KAAKD,WAAW;EAChB,KAAKC,OAAO;CACd;;;;;;;;;;CAWA,MAAa,OAAO,cAAkC;EACpD,MAAM,QAAQ,KAAK,QAAQ,MAAM,QAAQ;EACzC,KAAK,QAAQ,KAAK,2BAA2B;EAE7C,MAAM,KAAK,QAAQ,UAAU,YAAY;EAEzC,KAAK,QAAQ,MAAM,yCAAyC;EAC5D,MAAM;CACR;;;;;;;;;CAUA,MAAa,MAAM,cAAiC;EAClD,MAAM,QAAQ,KAAK,QAAQ,MAAM,OAAO;EACxC,KAAK,QAAQ,KAAK,yDAAyD;EAE3E,MAAM,KAAK,QAAQ,SAAS,YAAY;EAExC,KAAK,QAAQ,MAAM,+CAA+C;EAClE,MAAM;CACR;;;;;;;;;CAUA,MAAa,QAAQ,cAAmC;EACtD,MAAM,QAAQ,KAAK,QAAQ,MAAM,SAAS;EAC1C,KAAK,QAAQ,KAAK,2BAA2B;EAE7C,MAAM,KAAK,QAAQ,WAAW,YAAY;EAE1C,KAAK,QAAQ,MAAM,0CAA0C;EAC7D,MAAM;CACR;;;;;;;;;;CAWA,MAAa,MAAM,cAAiC;EAClD,MAAM,QAAQ,KAAK,QAAQ,MAAM,OAAO;EACxC,KAAK,QAAQ,KAAK,oCAAoC;EAEtD,MAAM,KAAK,QAAQ,SAAS,YAAY;EAExC,KAAK,QAAQ,MAAM,mCAAmC;EACtD,MAAM;CACR;;;;;;;CAQA,MAAa,KAAK,cAAgC;EAChD,M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;;;;;;;CAYA,MAAgB,QAAQ,SAAiB,cAA4B;EACnE,MAAM,QAAQ,KACX,MAAM,KAAK,QAAQ,eAAe,SAAS,YAAY,EAAC,CAAE,IACzD,OAAM,cAAa;GACjB,IAAI;IACF,MAAM,KAAK,IAAI,QAAQ,SAAS,UAAU,SAAS,YAAY;GACjE,SAAS,OAAO;IACd,KAAK,QAAQ,MACX,wBAAwB,QAAQ,6CAC9B,UAAU,aACX,sBAAsB,UAAU,QAAQ,YAAY,SACnD,iBAAiB,QACb,MAAM,SAAS,MAAM,UACrB,OAAO,KAAK,GAEpB;IAEA,MAAM;GACR,UAAU;IACR,KAAK,QAAQ,kBACX,UAAU,cACV,UAAU,QAAQ,WACpB;GACF;EACF,CACF,CACF;CACF;AACF;AAEA,eAAsB,cAAc,SAAwB;CAC1D,MAAM,OACJ,QAAQ,QACP,MAAM,QAAQ;EACb,MAAM,QAAQ,QAAQ;EACtB,QAAQ;CACV,CAAC;CAEH,MAAM,MAAM,UAAU;CACtB,MAAM,OAAO,qBAAqB;EAChC,SAAS,QAAQ,WAAW,QAAQ;EACpC,QAAQ,UAAU,QAAQ,QAAQ,YAAY,GAAG;EACjD,QAAQ,MAAM,QAAQ;GACpB,IAAI,IAAI,MAAM,mBAAmB,KAAK,KAAK;IAAE,KAAK;IAAM,QAAQ;GAAK,CAAC,CAAC,CAAC;EAC1E;CACF,CAAC;CAED,OAAO,wBAAwB,KAAK,SAAS,MAAM;EACjD,SAAS;EACT,WAAW;CACb,CAAC;AACH;AAEA,eAAsB,aACpB,SACA,UAAU,0BACV;CACA,aAAa,gBAAgB,QAAQ;CAErC,MAAM,UAAU,MAAM,cAAc,OAAO;CAM3C,OAAO,IAAI,iBAAiB,SAAS,MALlB,mBAAmB,KAAK,SAAS;EAClD,MAAM,QAAQ;EACd;CACF,CAAC,CAEwC;AAC3C"}
1
+ {"version":3,"file":"engine.mjs","names":["#context","#api"],"sources":["../src/engine.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 type {\n BuildInlineConfig,\n CleanInlineConfig,\n CreateInlineConfig,\n DeployInlineConfig,\n DocsInlineConfig,\n InlineConfig,\n LintInlineConfig,\n PrepareInlineConfig,\n TestInlineConfig,\n TypesInlineConfig\n} from \"@powerlines/core\";\nimport type { PartialKeys } from \"@stryke/types/base\";\nimport { createH3DevToolsHost } from \"devframe/node\";\nimport { getPort } from \"get-port-please\";\nimport { createApp, fromNodeMiddleware } from \"h3\";\nimport { EventEmitter } from \"node:events\";\nimport sirv from \"sirv\";\nimport { ExecutionApiWorker } from \"./_internal/execution-api-worker\";\nimport { PowerlinesEngineContext } from \"./context/engine-context\";\nimport { Engine } from \"./types/api\";\nimport { EngineOptions } from \"./types/config\";\nimport { EngineContext } from \"./types/context\";\n\n/**\n * The Powerlines process' orchestration and coordination API.\n *\n * @public\n */\nexport class PowerlinesEngine implements Engine, AsyncDisposable {\n /**\n * The Powerlines context\n */\n #context: EngineContext;\n\n /**\n * The execution host, which provides methods to call the execution API functions from the engine context. This allows the engine to invoke commands and other API functions during the execution of Powerlines commands, enabling communication between the engine and the execution contexts.\n */\n #api: ExecutionApiWorker;\n\n /**\n * The Powerlines context\n */\n public get context(): EngineContext {\n return this.#context;\n }\n\n /**\n * The execution host, which provides methods to call the execution API functions from the engine context. This allows the engine to invoke commands and other API functions during the execution of Powerlines commands, enabling communication between the engine and the execution contexts.\n */\n public get api(): ExecutionApiWorker {\n return this.#api;\n }\n\n /**\n * Create a new Powerlines Engine instance\n *\n * @param context - The Powerlines context\n * @param api - The API host for the execution workers\n * @returns A new instance of the Powerlines Engine\n */\n public constructor(context: EngineContext, api: ExecutionApiWorker) {\n this.#context = context;\n this.#api = api;\n }\n\n /**\n * Create a new Powerlines project\n *\n * @remarks\n * This method will create a new Powerlines project in the current directory.\n *\n * @param inlineConfig - The inline configuration for the create command\n * @returns A promise that resolves when the project has been created\n */\n public async create(\n inlineConfig: PartialKeys<CreateInlineConfig, \"command\">\n ) {\n const timer = this.context.timer(\"Create\");\n this.context.info(\"๐Ÿ†• Creating a new project\");\n\n await this.execute(\"create\", inlineConfig);\n\n this.context.debug(\"โœ” Create command completed successfully\");\n timer();\n }\n\n /**\n * Generate the Powerlines typescript declaration file\n *\n * @remarks\n * This method will only generate the typescript declaration file for the Powerlines project. It is generally recommended to run the full `prepare` command, which will run this method as part of its process.\n *\n * @param inlineConfig - The inline configuration for the types command\n */\n public async types(inlineConfig: PartialKeys<TypesInlineConfig, \"command\">) {\n const timer = this.context.timer(\"Types\");\n this.context.info(\"๐Ÿ—๏ธ Generating typescript declarations for the project\");\n\n await this.execute(\"types\", inlineConfig);\n\n this.context.debug(\"โœ” Types generation has completed successfully\");\n timer();\n }\n\n /**\n * Prepare the Powerlines API\n *\n * @remarks\n * This method will prepare the Powerlines API for use, initializing any necessary resources.\n *\n * @param inlineConfig - The inline configuration for the prepare command\n */\n public async prepare(\n inlineConfig: PartialKeys<PrepareInlineConfig, \"command\">\n ) {\n const timer = this.context.timer(\"Prepare\");\n this.context.info(\"๐Ÿ—๏ธ Preparing the project\");\n\n await this.execute(\"prepare\", inlineConfig);\n\n this.context.debug(\"โœ” Preparation has completed successfully\");\n timer();\n }\n\n /**\n * Clean any previously prepared artifacts\n *\n * @remarks\n * This method will remove the previous Powerlines artifacts from the project.\n *\n * @param inlineConfig - The inline configuration for the clean command\n * @returns A promise that resolves when the clean command has completed\n */\n public async clean(inlineConfig: PartialKeys<CleanInlineConfig, \"command\">) {\n const timer = this.context.timer(\"Clean\");\n this.context.info(\"๐Ÿงน Cleaning the previous artifacts\");\n\n await this.execute(\"clean\", inlineConfig);\n\n this.context.debug(\"โœ” Cleaning completed successfully\");\n timer();\n }\n\n /**\n * Lint the project\n *\n * @param inlineConfig - The inline configuration for the lint command\n * @returns A promise that resolves when the lint command has completed\n */\n public async lint(inlineConfig: PartialKeys<LintInlineConfig, \"command\">) {\n const timer = this.context.timer(\"Lint\");\n this.context.info(\"๐Ÿ“ Linting the project\");\n\n await this.execute(\"lint\", inlineConfig);\n\n this.context.debug(\"โœ” Linting completed successfully\");\n timer();\n }\n\n /**\n * Test the project\n *\n * @remarks\n * This method will run the tests for the Powerlines project.\n *\n * @param inlineConfig - The inline configuration for the test command\n * @returns A promise that resolves when the test command has completed\n */\n public async test(inlineConfig: PartialKeys<TestInlineConfig, \"command\">) {\n const timer = this.context.timer(\"Test\");\n this.context.info(\"๐Ÿงช Running tests for the project\");\n\n await this.execute(\"test\", inlineConfig);\n\n this.context.debug(\"โœ” Testing completed successfully\");\n timer();\n }\n\n /**\n * Build the project\n *\n * @remarks\n * This method will build the Powerlines project, generating the necessary artifacts.\n *\n * @param inlineConfig - The inline configuration for the build command\n * @returns A promise that resolves when the build command has completed\n */\n public async build(inlineConfig: PartialKeys<BuildInlineConfig, \"command\">) {\n const timer = this.context.timer(\"Build\");\n this.context.info(\"๐Ÿ“ฆ Building the project\");\n\n await this.execute(\"build\", inlineConfig);\n\n this.context.debug(\"โœ” Build completed successfully\");\n timer();\n }\n\n /**\n * Prepare the documentation for the project\n *\n * @param inlineConfig - The inline configuration for the docs command\n * @returns A promise that resolves when the documentation generation has completed\n */\n public async docs(inlineConfig: PartialKeys<DocsInlineConfig, \"command\">) {\n const timer = this.context.timer(\"Docs\");\n this.context.info(\"๐Ÿ““ Generating documentation for the project\");\n\n await this.execute(\"docs\", inlineConfig);\n\n this.context.debug(\"โœ” Documentation generation completed successfully\");\n timer();\n }\n\n /**\n * Deploy the project source code\n *\n * @remarks\n * This method will prepare and build the Powerlines project, generating the necessary artifacts for the deployment.\n *\n * @param inlineConfig - The inline configuration for the deploy command\n * @returns A promise that resolves when the deploy command has completed\n */\n public async deploy(\n inlineConfig: PartialKeys<DeployInlineConfig, \"command\">\n ) {\n const timer = this.context.timer(\"Deploy\");\n this.context.info(\"๐Ÿš€ Deploying the project\");\n\n await this.execute(\"deploy\", inlineConfig);\n\n this.context.debug(\"โœ” Deployment completed successfully\");\n timer();\n }\n\n /**\n * Finalization/cleanup processing for the Powerlines API\n *\n * @remarks\n * This step includes any final processes or clean up required by Powerlines. It will be run after each Powerlines command.\n *\n * @returns A promise that resolves when the finalization process has completed\n */\n public async finalize() {\n const timer = this.context.timer(\"Finalize\");\n this.context.info(\"๐Ÿ Finalization processes started\");\n\n await this.api.finalize();\n\n this.context.debug(\"โœ” Finalization completed successfully\");\n timer();\n }\n\n /**\n * Asynchronous disposal method for the Powerlines Engine, which will call the finalize method to perform any necessary cleanup when the engine is disposed of.\n */\n public async [Symbol.asyncDispose]() {\n return this.finalize();\n }\n\n /**\n * Execute a Powerlines command based on the provided execution path and inline configuration, loading the necessary executions from the context and managing their lifecycle.\n *\n * @remarks\n * This method will load the executions for the specified command and inline configuration, then execute each one while managing their lifecycle, including handling their completion and any errors that may occur during execution.\n *\n * @param command - The path to the execution configuration to load and run, which can be used to specify different execution configurations for different commands or scenarios.\n * @param inlineConfig - Additional configuration options provided at runtime, which can override or supplement the options defined in the user configuration file.\n * @returns A promise that resolves when all executions for the specified command have completed\n */\n protected async execute(\n command: string,\n inlineConfig: PartialKeys<InlineConfig, \"command\">\n ) {\n await Promise.all(\n (await this.context.loadExecutions(command, inlineConfig)).map(\n async execution => {\n try {\n await this.api.execute(command, execution.options, inlineConfig);\n } catch (error) {\n this.context.error(\n `Execution of method \"${command}\" failed for execution with invocation ID \"${\n execution.invocationId\n }\" and execution ID \"${execution.options.executionId}\": \\n\\n${\n error instanceof Error\n ? error.stack || error.message\n : String(error)\n }`\n );\n\n throw error;\n } finally {\n this.context.completeExecution(\n execution.invocationId,\n execution.options.executionId!\n );\n }\n }\n )\n );\n }\n}\n\nexport async function createContext(options: EngineOptions) {\n const port =\n options.port ??\n (await getPort({\n host: options.host || \"localhost\",\n random: true\n }));\n\n const app = createApp();\n const host = createH3DevToolsHost({\n appName: options.framework?.name || \"powerlines\",\n origin: `http://${options.host || \"localhost\"}:${port}`,\n mount: (base, dir) => {\n app.use(base, fromNodeMiddleware(sirv(dir, { dev: true, single: true })));\n }\n });\n\n return PowerlinesEngineContext.from(options, host, {\n backend: \"websocket\",\n websocket: port\n });\n}\n\nexport async function createEngine(\n options: EngineOptions,\n apiPath = \"@powerlines/engine/api\"\n) {\n EventEmitter.setMaxListeners(Infinity);\n\n const context = await createContext(options);\n const host = await ExecutionApiWorker.from(apiPath, {\n root: options.root,\n context\n });\n\n return new PowerlinesEngine(context, host);\n}\n"],"mappings":";;;;;;;;;;;;;;AA+CA,IAAa,mBAAb,MAAiE;;;;CAI/D;;;;CAKA;;;;CAKA,IAAW,UAAyB;EAClC,OAAO,KAAKA;CACd;;;;CAKA,IAAW,MAA0B;EACnC,OAAO,KAAKC;CACd;;;;;;;;CASA,AAAO,YAAY,SAAwB,KAAyB;EAClE,KAAKD,WAAW;EAChB,KAAKC,OAAO;CACd;;;;;;;;;;CAWA,MAAa,OACX,cACA;EACA,MAAM,QAAQ,KAAK,QAAQ,MAAM,QAAQ;EACzC,KAAK,QAAQ,KAAK,2BAA2B;EAE7C,MAAM,KAAK,QAAQ,UAAU,YAAY;EAEzC,KAAK,QAAQ,MAAM,yCAAyC;EAC5D,MAAM;CACR;;;;;;;;;CAUA,MAAa,MAAM,cAAyD;EAC1E,MAAM,QAAQ,KAAK,QAAQ,MAAM,OAAO;EACxC,KAAK,QAAQ,KAAK,yDAAyD;EAE3E,MAAM,KAAK,QAAQ,SAAS,YAAY;EAExC,KAAK,QAAQ,MAAM,+CAA+C;EAClE,MAAM;CACR;;;;;;;;;CAUA,MAAa,QACX,cACA;EACA,MAAM,QAAQ,KAAK,QAA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C;CAED,OAAO,wBAAwB,KAAK,SAAS,MAAM;EACjD,SAAS;EACT,WAAW;CACb,CAAC;AACH;AAEA,eAAsB,aACpB,SACA,UAAU,0BACV;CACA,aAAa,gBAAgB,QAAQ;CAErC,MAAM,UAAU,MAAM,cAAc,OAAO;CAM3C,OAAO,IAAI,iBAAiB,SAAS,MALlB,mBAAmB,KAAK,SAAS;EAClD,MAAM,QAAQ;EACd;CACF,CAAC,CAEwC;AAC3C"}
@@ -3,11 +3,11 @@ const require_helpers_rpc = require('./rpc.cjs');
3
3
  const require_helpers_stream = require('./stream.cjs');
4
4
  const require_helpers_type_checks = require('./type-checks.cjs');
5
5
  let _powerlines_core_plugin_utils = require("@powerlines/core/plugin-utils");
6
+ let _stryke_string_format_title_case = require("@stryke/string-format/title-case");
6
7
  let _stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
7
8
  let _powerlines_core_context_execution_context = require("@powerlines/core/context/execution-context");
8
9
  let _powerlines_core_lib_context_helpers = require("@powerlines/core/lib/context-helpers");
9
10
  let _stryke_string_format_list = require("@stryke/string-format/list");
10
- let _stryke_string_format_title_case = require("@stryke/string-format/title-case");
11
11
  let _stryke_type_checks_is_function = require("@stryke/type-checks/is-function");
12
12
  let _stryke_unique_id_uuid = require("@stryke/unique-id/uuid");
13
13
  let defu = require("defu");
@@ -2,11 +2,11 @@ import { createRpcClient } from "./rpc.mjs";
2
2
  import { MessagePortDuplex } from "./stream.mjs";
3
3
  import { isEngineExecutionOptions } from "./type-checks.mjs";
4
4
  import { consoleLogger, formatExecutionId } from "@powerlines/core/plugin-utils";
5
+ import { titleCase } from "@stryke/string-format/title-case";
5
6
  import { isSetObject } from "@stryke/type-checks/is-set-object";
6
7
  import { PowerlinesExecutionContext } from "@powerlines/core/context/execution-context";
7
8
  import { resolvePluginConfig } from "@powerlines/core/lib/context-helpers";
8
9
  import { list } from "@stryke/string-format/list";
9
- import { titleCase } from "@stryke/string-format/title-case";
10
10
  import { isFunction } from "@stryke/type-checks/is-function";
11
11
  import { uuid } from "@stryke/unique-id/uuid";
12
12
  import { defu } from "defu";
@@ -1,6 +1,7 @@
1
1
  import { RpcClient } from "./rpc.cjs";
2
2
  import { EngineExecutionOptions, EngineOptions } from "./config.cjs";
3
3
  import { BaseContext, InlineConfig, ParsedUserConfig } from "@powerlines/core";
4
+ import { PartialKeys } from "@stryke/types/base";
4
5
  import { ConnectionMeta, DevToolsNodeContext } from "devframe/types";
5
6
 
6
7
  //#region src/types/context.d.ts
@@ -130,7 +131,7 @@ interface EngineContext<TSystemContext = unknown> extends BaseContext<TSystemCon
130
131
  * @remarks
131
132
  * This method will set up the resolver and load the user configuration file based on the provided options. It is called during the construction of the context and can also be called when cloning the context to ensure that the new context has the same configuration and resolver setup.
132
133
  */
133
- loadExecutions: (method: string, inlineConfig: InlineConfig) => Promise<EngineExecutionItem[]>;
134
+ loadExecutions: (method: string, inlineConfig: PartialKeys<InlineConfig, "command">) => Promise<EngineExecutionItem[]>;
134
135
  /**
135
136
  * Complete an execution by removing it from the list of active executions based on the provided invocation ID and execution ID. This method is typically called when an execution has finished or has been terminated, allowing the context to clean up any resources associated with that execution and update its internal state accordingly.
136
137
  *
@@ -1 +1 @@
1
- {"version":3,"file":"context.d.cts","names":[],"sources":["../../src/types/context.ts"],"mappings":";;;;;;;;AA0BA;KAAY,kBAAA;;;AAAkB;UAKb,mBAAA;EAAmB;;;EAIlC,SAAA;EAKA;;;EAAA,IAAA;EAKwB;AAM1B;;EANE,IAAA,EAAM,kBAAkB;AAAA;AAUpB;AAMN;;AANM,UAJW,0BAAA,SAAmC,mBAAmB;EAUH;;;EANlE,IAAI;AAAA;AAeA;AAMN;;AANM,UATW,uBAAA,SAAgC,mBAAmB;EAejB;AAI7C;AAMN;EArBE,KAAA;;;;EAKA,IAAA;AAAA;;;;UAMe,yBAAA,SAAkC,mBAAmB;EAmB9D;;;EAfN,IAAI;AAAA;AA0BN;;;AAAA,UApBiB,cAAA;EAkCN;;;EA9BT,OAAA,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;EAnCrB,IAAA,EAAM,uBAAA;EAyBG;;;EApBT,MAAA,EAAQ,yBAAA;AAAA;;;AA8Ba;UAxBN,mBAAA;EAiCa;;;EA7B5B,YAAA;EAgCO;;;EA3BP,OAAA;EAiDY;;;EA5CZ,OAAA,EAAS,IAAA,CAAK,sBAAA;EAuDT;;;EAlDL,UAAA,EAAY,gBAAA;EAiBN;;;EAZN,KAAA,EAAO,cAAA;AAAA;;;;;;;UASQ,aAAA,mCAEb,WAAA,CAAY,cAAA,GACZ,IAAA,CAAK,QAAA,CAAS,aAAA;EAiBN;;;EAbV,OAAA,EAAS,aAAA;EA2BP;;;EAtBF,UAAA,EAAY,cAAA;EAwBP;;;;;;EAhBL,QAAA,EAAU,mBAAA;EA2BK;;;EAtBf,UAAA,EAAY,mBAAA;EA0BE;;;;;;EAlBd,cAAA,GACE,MAAA,UACA,YAAA,EAAc,WAAA,CAAY,YAAA,iBACvB,OAAA,CAAQ,mBAAA;;;;;;;EAQb,iBAAA,GAAoB,YAAA,UAAsB,WAAA;AAAA;AAAA,UAG3B,mBAAA;;;;EAIf,GAAA,EAAK,SAAS;AAAA"}
@@ -1,6 +1,7 @@
1
1
  import { RpcClient } from "./rpc.mjs";
2
2
  import { EngineExecutionOptions, EngineOptions } from "./config.mjs";
3
3
  import { BaseContext, InlineConfig, ParsedUserConfig } from "@powerlines/core";
4
+ import { PartialKeys } from "@stryke/types/base";
4
5
  import { ConnectionMeta, DevToolsNodeContext } from "devframe/types";
5
6
 
6
7
  //#region src/types/context.d.ts
@@ -130,7 +131,7 @@ interface EngineContext<TSystemContext = unknown> extends BaseContext<TSystemCon
130
131
  * @remarks
131
132
  * This method will set up the resolver and load the user configuration file based on the provided options. It is called during the construction of the context and can also be called when cloning the context to ensure that the new context has the same configuration and resolver setup.
132
133
  */
133
- loadExecutions: (method: string, inlineConfig: InlineConfig) => Promise<EngineExecutionItem[]>;
134
+ loadExecutions: (method: string, inlineConfig: PartialKeys<InlineConfig, "command">) => Promise<EngineExecutionItem[]>;
134
135
  /**
135
136
  * Complete an execution by removing it from the list of active executions based on the provided invocation ID and execution ID. This method is typically called when an execution has finished or has been terminated, allowing the context to clean up any resources associated with that execution and update its internal state accordingly.
136
137
  *
@@ -1 +1 @@
1
- {"version":3,"file":"context.d.mts","names":[],"sources":["../../src/types/context.ts"],"mappings":";;;;;;;;AA0BA;KAAY,kBAAA;;;AAAkB;UAKb,mBAAA;EAAmB;;;EAIlC,SAAA;EAKA;;;EAAA,IAAA;EAKwB;AAM1B;;EANE,IAAA,EAAM,kBAAkB;AAAA;AAUpB;AAMN;;AANM,UAJW,0BAAA,SAAmC,mBAAmB;EAUH;;;EANlE,IAAI;AAAA;AAeA;AAMN;;AANM,UATW,uBAAA,SAAgC,mBAAmB;EAejB;AAI7C;AAMN;EArBE,KAAA;;;;EAKA,IAAA;AAAA;;;;UAMe,yBAAA,SAAkC,mBAAmB;EAmB9D;;;EAfN,IAAI;AAAA;AA0BN;;;AAAA,UApBiB,cAAA;EAkCN;;;EA9BT,OAAA,EAAS,0BAAA;EAwCY;;;EAnCrB,IAAA,EAAM,uBAAA;EAyBG;;;EApBT,MAAA,EAAQ,yBAAA;AAAA;;;AA8Ba;UAxBN,mBAAA;EAiCa;;;EA7B5B,YAAA;EAgCO;;;EA3BP,OAAA;EAiDY;;;EA5CZ,OAAA,EAAS,IAAA,CAAK,sBAAA;EAqBZ;;;EAhBF,UAAA,EAAY,gBAAA;EAciB;;;EAT7B,KAAA,EAAO,cAAA;AAAA;;;;;;;UASQ,aAAA,mCAEb,WAAA,CAAY,cAAA,GACZ,IAAA,CAAK,QAAA,CAAS,aAAA;EAsBhB;;;EAlBA,OAAA,EAAS,aAAA;EA4BO;;;EAvBhB,UAAA,EAAY,cAAA;EAgCZ;;;;AAA6D;AAG/D;EA3BE,QAAA,EAAU,mBAAA;;;AA+BI;EA1Bd,UAAA,EAAY,mBAAA;;;;;;;EAQZ,cAAA,GACE,MAAA,UACA,YAAA,EAAc,YAAA,KACX,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;;;;;;EAQb,iBAAA,GAAoB,YAAA,UAAsB,WAAA;AAAA;AAAA,UAG3B,mBAAA;;;;EAIf,GAAA,EAAK,SAAS;AAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/engine",
3
- "version": "0.49.48",
3
+ "version": "0.49.49",
4
4
  "private": false,
5
5
  "description": "An internal package containing the core engine modules for Powerlines.",
6
6
  "homepage": "https://stormsoftware.com",
@@ -120,7 +120,7 @@
120
120
  "types": "./dist/index.d.cts",
121
121
  "files": ["dist"],
122
122
  "dependencies": {
123
- "@powerlines/core": "^0.48.46",
123
+ "@powerlines/core": "^0.48.47",
124
124
  "@storm-software/config": "^1.137.72",
125
125
  "@storm-software/config-tools": "^1.190.40",
126
126
  "@stryke/async": "^0.1.12",
@@ -156,5 +156,5 @@
156
156
  "@types/node": "^25.9.1",
157
157
  "typescript": "^6.0.3"
158
158
  },
159
- "gitHead": "1530c8cbb090f1f728d112475074eb3a86070557"
159
+ "gitHead": "30ba301952db7af53c07d369bd22f650e5ca9c45"
160
160
  }