@powerlines/engine 0.15.19 → 0.15.21

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 (128) hide show
  1. package/dist/api/build.cjs +1 -1
  2. package/dist/api/build.d.mts +2 -2
  3. package/dist/api/build.mjs +1 -1
  4. package/dist/api/build.mjs.map +1 -1
  5. package/dist/api/clean.d.mts +2 -2
  6. package/dist/api/clean.mjs.map +1 -1
  7. package/dist/api/create.d.mts +2 -2
  8. package/dist/api/create.mjs.map +1 -1
  9. package/dist/api/deploy.d.mts +2 -2
  10. package/dist/api/deploy.mjs.map +1 -1
  11. package/dist/api/docs.d.mts +2 -2
  12. package/dist/api/docs.mjs.map +1 -1
  13. package/dist/api/lint.d.mts +2 -2
  14. package/dist/api/lint.mjs.map +1 -1
  15. package/dist/api/prepare.cjs +2 -2
  16. package/dist/api/prepare.d.mts +2 -2
  17. package/dist/api/prepare.mjs +2 -2
  18. package/dist/api/prepare.mjs.map +1 -1
  19. package/dist/api/test.d.mts +2 -2
  20. package/dist/api/test.mjs.map +1 -1
  21. package/dist/api/types.cjs +2 -2
  22. package/dist/api/types.d.mts +2 -2
  23. package/dist/api/types.mjs +2 -2
  24. package/dist/api/types.mjs.map +1 -1
  25. package/dist/{api-Cdw4v0W4.d.mts → api-B2dWvRMM.d.mts} +10 -7
  26. package/dist/api-B2dWvRMM.d.mts.map +1 -0
  27. package/dist/{api-6w4hZL6n.d.cts → api-DgxYwNuZ.d.cts} +8 -5
  28. package/dist/api-DgxYwNuZ.d.cts.map +1 -0
  29. package/dist/{execution-host.cjs → api.cjs} +1 -1
  30. package/dist/{execution-host.d.mts → api.d.cts} +3 -3
  31. package/dist/api.d.cts.map +1 -0
  32. package/dist/{execution-host.d.cts → api.d.mts} +3 -3
  33. package/dist/api.d.mts.map +1 -0
  34. package/dist/{execution-host.mjs → api.mjs} +2 -2
  35. package/dist/api.mjs.map +1 -0
  36. package/dist/{config-BNe23XHx.d.mts → config-C9AD-erz.d.mts} +1 -1
  37. package/dist/config-C9AD-erz.d.mts.map +1 -0
  38. package/dist/config-D6xUniHh.d.cts.map +1 -1
  39. package/dist/context/engine-context.cjs +6 -4
  40. package/dist/context/engine-context.d.cts +1 -1
  41. package/dist/context/engine-context.d.mts +1 -1
  42. package/dist/context/engine-context.mjs +6 -4
  43. package/dist/context/engine-context.mjs.map +1 -1
  44. package/dist/context/index.d.cts +1 -1
  45. package/dist/context/index.d.mts +1 -1
  46. package/dist/{context-DzgsMSWr.d.mts → context-S3XH2DWP.d.mts} +2 -2
  47. package/dist/context-S3XH2DWP.d.mts.map +1 -0
  48. package/dist/context-epL7NPvL.d.cts.map +1 -1
  49. package/dist/engine-Ct0OGdyp.mjs +571 -0
  50. package/dist/engine-Ct0OGdyp.mjs.map +1 -0
  51. package/dist/{engine-context-DEotmVzB.d.mts → engine-context-Cc93ql_I.d.mts} +5 -6
  52. package/dist/engine-context-Cc93ql_I.d.mts.map +1 -0
  53. package/dist/{engine-context-Dw8odBCo.d.cts → engine-context-lrWc13AH.d.cts} +2 -3
  54. package/dist/engine-context-lrWc13AH.d.cts.map +1 -0
  55. package/dist/engine-ntih8wNh.cjs +590 -0
  56. package/dist/engine.cjs +4 -265
  57. package/dist/engine.d.cts +3 -3
  58. package/dist/engine.d.cts.map +1 -1
  59. package/dist/engine.d.mts +5 -5
  60. package/dist/engine.d.mts.map +1 -1
  61. package/dist/engine.mjs +2 -262
  62. package/dist/helpers/create-execution-host.cjs +10 -3
  63. package/dist/helpers/create-execution-host.d.cts +20 -2
  64. package/dist/helpers/create-execution-host.d.cts.map +1 -0
  65. package/dist/helpers/create-execution-host.d.mts +20 -2
  66. package/dist/helpers/create-execution-host.d.mts.map +1 -0
  67. package/dist/helpers/create-execution-host.mjs +10 -3
  68. package/dist/helpers/create-execution-host.mjs.map +1 -1
  69. package/dist/helpers/finalize.d.cts +12 -2
  70. package/dist/helpers/finalize.d.cts.map +1 -0
  71. package/dist/helpers/finalize.d.mts +12 -2
  72. package/dist/helpers/finalize.d.mts.map +1 -0
  73. package/dist/helpers/finalize.mjs.map +1 -1
  74. package/dist/helpers/index.cjs +4 -2
  75. package/dist/helpers/index.d.cts +5 -5
  76. package/dist/helpers/index.d.mts +5 -5
  77. package/dist/helpers/index.mjs +2 -2
  78. package/dist/helpers/rpc.cjs +2 -2
  79. package/dist/helpers/rpc.d.cts +7 -2
  80. package/dist/helpers/rpc.d.cts.map +1 -0
  81. package/dist/helpers/rpc.d.mts +7 -2
  82. package/dist/helpers/rpc.d.mts.map +1 -0
  83. package/dist/helpers/rpc.mjs +2 -2
  84. package/dist/helpers/rpc.mjs.map +1 -1
  85. package/dist/helpers/stream.cjs +120 -0
  86. package/dist/helpers/stream.d.cts +45 -0
  87. package/dist/helpers/stream.d.cts.map +1 -0
  88. package/dist/helpers/stream.d.mts +45 -0
  89. package/dist/helpers/stream.d.mts.map +1 -0
  90. package/dist/helpers/stream.mjs +117 -0
  91. package/dist/helpers/stream.mjs.map +1 -0
  92. package/dist/index.cjs +2 -11
  93. package/dist/index.d.cts +3 -7
  94. package/dist/index.d.mts +5 -9
  95. package/dist/index.mjs +2 -7
  96. package/package.json +10 -12
  97. package/dist/api-6w4hZL6n.d.cts.map +0 -1
  98. package/dist/api-Cdw4v0W4.d.mts.map +0 -1
  99. package/dist/config-BNe23XHx.d.mts.map +0 -1
  100. package/dist/context-DzgsMSWr.d.mts.map +0 -1
  101. package/dist/create-execution-host-CdpuL_YG.d.mts +0 -20
  102. package/dist/create-execution-host-CdpuL_YG.d.mts.map +0 -1
  103. package/dist/create-execution-host-DbOCE5bd.d.cts +0 -20
  104. package/dist/create-execution-host-DbOCE5bd.d.cts.map +0 -1
  105. package/dist/engine-context-DEotmVzB.d.mts.map +0 -1
  106. package/dist/engine-context-Dw8odBCo.d.cts.map +0 -1
  107. package/dist/engine.mjs.map +0 -1
  108. package/dist/execution-host-worker-D7LinO52.d.cts +0 -70
  109. package/dist/execution-host-worker-D7LinO52.d.cts.map +0 -1
  110. package/dist/execution-host-worker-zpQqaW_W.d.mts +0 -70
  111. package/dist/execution-host-worker-zpQqaW_W.d.mts.map +0 -1
  112. package/dist/execution-host.d.cts.map +0 -1
  113. package/dist/execution-host.d.mts.map +0 -1
  114. package/dist/execution-host.mjs.map +0 -1
  115. package/dist/finalize-CW0cO75l.d.cts +0 -12
  116. package/dist/finalize-CW0cO75l.d.cts.map +0 -1
  117. package/dist/finalize-DeSY1r74.d.mts +0 -12
  118. package/dist/finalize-DeSY1r74.d.mts.map +0 -1
  119. package/dist/helpers/execution-host-worker.cjs +0 -327
  120. package/dist/helpers/execution-host-worker.d.cts +0 -2
  121. package/dist/helpers/execution-host-worker.d.mts +0 -2
  122. package/dist/helpers/execution-host-worker.mjs +0 -326
  123. package/dist/helpers/execution-host-worker.mjs.map +0 -1
  124. package/dist/rpc-BsFxzyAK.d.cts +0 -7
  125. package/dist/rpc-BsFxzyAK.d.cts.map +0 -1
  126. package/dist/rpc-xwbFMMNu.d.mts +0 -7
  127. package/dist/rpc-xwbFMMNu.d.mts.map +0 -1
  128. /package/dist/{index-D_TYgLX3.d.cts → index-DDRpa5CJ.d.cts} +0 -0
@@ -0,0 +1,117 @@
1
+ import { Duplex, Readable, Writable } from "node:stream";
2
+
3
+ //#region src/helpers/stream.ts
4
+ const kPort = Symbol("kPort");
5
+ function toTransferable(chunk) {
6
+ if (ArrayBuffer.isView(chunk)) return chunk.buffer instanceof ArrayBuffer ? chunk.buffer : void 0;
7
+ if (chunk instanceof ArrayBuffer) return chunk;
8
+ }
9
+ var MessagePortWritable = class extends Writable {
10
+ [kPort];
11
+ constructor(port, options) {
12
+ super(options);
13
+ this[kPort] = port;
14
+ }
15
+ _write(chunk, _encoding, callback) {
16
+ const transfer = toTransferable(chunk);
17
+ this[kPort].postMessage(chunk, transfer ? [transfer] : []);
18
+ callback();
19
+ }
20
+ _writev(data, callback) {
21
+ const chunks = data.map((entry) => entry.chunk);
22
+ const transfers = data.map((entry) => toTransferable(entry.chunk)).filter((value) => Boolean(value));
23
+ this[kPort].postMessage(chunks, transfers);
24
+ callback();
25
+ }
26
+ _final(callback) {
27
+ this[kPort].postMessage(null);
28
+ callback();
29
+ }
30
+ _destroy(error, callback) {
31
+ this[kPort].close(() => callback(error));
32
+ }
33
+ unref() {
34
+ this[kPort].unref();
35
+ return this;
36
+ }
37
+ ref() {
38
+ this[kPort].ref();
39
+ return this;
40
+ }
41
+ };
42
+ var MessagePortReadable = class extends Readable {
43
+ [kPort];
44
+ constructor(port, options) {
45
+ super(options);
46
+ this[kPort] = port;
47
+ port.onmessage = ({ data }) => {
48
+ this.push(data);
49
+ };
50
+ }
51
+ _read(_size) {
52
+ this[kPort].start();
53
+ }
54
+ _destroy(error, callback) {
55
+ this[kPort].close(() => {
56
+ this[kPort].onmessage = null;
57
+ callback(error);
58
+ });
59
+ }
60
+ unref() {
61
+ this[kPort].unref();
62
+ return this;
63
+ }
64
+ ref() {
65
+ this[kPort].ref();
66
+ return this;
67
+ }
68
+ };
69
+ var MessagePortDuplex = class extends Duplex {
70
+ [kPort];
71
+ _activityAbortHandler;
72
+ constructor(port, options) {
73
+ super(options);
74
+ this[kPort] = port;
75
+ this._activityAbortHandler = options?.onActivityAbort;
76
+ port.onmessage = ({ data }) => {
77
+ this.push(data);
78
+ };
79
+ }
80
+ _read(_size) {
81
+ this[kPort].start();
82
+ }
83
+ _write(chunk, _encoding, callback) {
84
+ if (this._activityAbortHandler) this._activityAbortHandler();
85
+ const transfer = toTransferable(chunk);
86
+ this[kPort].postMessage(chunk, transfer ? [transfer] : []);
87
+ callback();
88
+ }
89
+ _writev(data, callback) {
90
+ const chunks = data.map((entry) => entry.chunk);
91
+ const transfers = data.map((entry) => toTransferable(entry.chunk)).filter((value) => Boolean(value));
92
+ this[kPort].postMessage(chunks, transfers);
93
+ callback();
94
+ }
95
+ _final(callback) {
96
+ this[kPort].postMessage(null);
97
+ callback();
98
+ }
99
+ _destroy(error, callback) {
100
+ this[kPort].close(() => {
101
+ this[kPort].onmessage = null;
102
+ callback(error);
103
+ });
104
+ }
105
+ unref() {
106
+ this[kPort].unref();
107
+ return this;
108
+ }
109
+ ref() {
110
+ this[kPort].ref();
111
+ return this;
112
+ }
113
+ };
114
+
115
+ //#endregion
116
+ export { MessagePortDuplex, MessagePortReadable, MessagePortWritable };
117
+ //# sourceMappingURL=stream.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stream.mjs","names":[],"sources":["../../src/helpers/stream.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 DuplexOptions,\n ReadableOptions,\n WritableOptions\n} from \"node:stream\";\nimport { Duplex, Readable, Writable } from \"node:stream\";\nimport type { MessagePort, Transferable } from \"node:worker_threads\";\n\nconst kPort = Symbol(\"kPort\");\n\ntype PortLike = MessagePort & {\n close: (callback?: () => void) => void;\n};\n\ninterface WritevChunk {\n chunk: unknown;\n encoding: BufferEncoding;\n}\n\nfunction toTransferable(chunk: unknown): Transferable | undefined {\n if (ArrayBuffer.isView(chunk)) {\n return chunk.buffer instanceof ArrayBuffer ? chunk.buffer : undefined;\n }\n\n if (chunk instanceof ArrayBuffer) {\n return chunk;\n }\n\n return undefined;\n}\n\nexport class MessagePortWritable extends Writable {\n private [kPort]: PortLike;\n\n public constructor(port: MessagePort, options?: WritableOptions) {\n super(options);\n this[kPort] = port;\n }\n\n public override _write(\n chunk: unknown,\n _encoding: BufferEncoding,\n callback: (error?: Error | null) => void\n ): void {\n const transfer = toTransferable(chunk);\n this[kPort].postMessage(chunk, transfer ? [transfer] : []);\n callback();\n }\n\n public override _writev(\n data: WritevChunk[],\n callback: (error?: Error | null) => void\n ): void {\n const chunks = data.map(entry => entry.chunk);\n const transfers = data\n .map(entry => toTransferable(entry.chunk))\n .filter((value): value is Transferable => Boolean(value));\n\n this[kPort].postMessage(chunks, transfers);\n callback();\n }\n\n public override _final(callback: (error?: Error | null) => void): void {\n this[kPort].postMessage(null);\n callback();\n }\n\n public override _destroy(\n error: Error | null,\n callback: (error?: Error | null) => void\n ): void {\n this[kPort].close(() => callback(error));\n }\n\n public unref(): this {\n this[kPort].unref();\n return this;\n }\n\n public ref(): this {\n this[kPort].ref();\n return this;\n }\n}\n\nexport class MessagePortReadable extends Readable {\n private [kPort]: PortLike;\n\n public constructor(port: MessagePort, options?: ReadableOptions) {\n super(options);\n this[kPort] = port;\n port.onmessage = ({ data }) => {\n this.push(data);\n };\n }\n\n public override _read(_size: number): void {\n this[kPort].start();\n }\n\n public override _destroy(\n error: Error | null,\n callback: (error?: Error | null) => void\n ): void {\n this[kPort].close(() => {\n this[kPort].onmessage = null;\n callback(error);\n });\n }\n\n public unref(): this {\n this[kPort].unref();\n return this;\n }\n\n public ref(): this {\n this[kPort].ref();\n return this;\n }\n}\n\nexport interface MessagePortDuplexOptions extends DuplexOptions {\n onActivityAbort?: () => void;\n}\n\nexport class MessagePortDuplex extends Duplex {\n private [kPort]: PortLike;\n\n private _activityAbortHandler?: () => void;\n\n public constructor(port: MessagePort, options?: MessagePortDuplexOptions) {\n super(options);\n this[kPort] = port;\n this._activityAbortHandler = options?.onActivityAbort;\n\n port.onmessage = ({ data }) => {\n this.push(data);\n };\n }\n\n public override _read(_size: number): void {\n this[kPort].start();\n }\n\n public override _write(\n chunk: unknown,\n _encoding: BufferEncoding,\n callback: (error?: Error | null) => void\n ): void {\n if (this._activityAbortHandler) {\n this._activityAbortHandler();\n }\n const transfer = toTransferable(chunk);\n this[kPort].postMessage(chunk, transfer ? [transfer] : []);\n callback();\n }\n\n public override _writev(\n data: WritevChunk[],\n callback: (error?: Error | null) => void\n ): void {\n const chunks = data.map(entry => entry.chunk);\n const transfers = data\n .map(entry => toTransferable(entry.chunk))\n .filter((value): value is Transferable => Boolean(value));\n\n this[kPort].postMessage(chunks, transfers);\n callback();\n }\n\n public override _final(callback: (error?: Error | null) => void): void {\n this[kPort].postMessage(null);\n callback();\n }\n\n public override _destroy(\n error: Error | null,\n callback: (error?: Error | null) => void\n ): void {\n this[kPort].close(() => {\n this[kPort].onmessage = null;\n callback(error);\n });\n }\n\n public unref(): this {\n this[kPort].unref();\n return this;\n }\n\n public ref(): this {\n this[kPort].ref();\n return this;\n }\n}\n"],"mappings":";;;AA0BA,MAAM,QAAQ,OAAO,OAAO;AAW5B,SAAS,eAAe,OAA0C;CAChE,IAAI,YAAY,OAAO,KAAK,GAC1B,OAAO,MAAM,kBAAkB,cAAc,MAAM,SAAS;CAG9D,IAAI,iBAAiB,aACnB,OAAO;AAIX;AAEA,IAAa,sBAAb,cAAyC,SAAS;CAChD,CAAS;CAET,AAAO,YAAY,MAAmB,SAA2B;EAC/D,MAAM,OAAO;EACb,KAAK,SAAS;CAChB;CAEA,AAAgB,OACd,OACA,WACA,UACM;EACN,MAAM,WAAW,eAAe,KAAK;EACrC,KAAK,OAAO,YAAY,OAAO,WAAW,CAAC,QAAQ,IAAI,CAAC,CAAC;EACzD,SAAS;CACX;CAEA,AAAgB,QACd,MACA,UACM;EACN,MAAM,SAAS,KAAK,KAAI,UAAS,MAAM,KAAK;EAC5C,MAAM,YAAY,KACf,KAAI,UAAS,eAAe,MAAM,KAAK,CAAC,EACxC,QAAQ,UAAiC,QAAQ,KAAK,CAAC;EAE1D,KAAK,OAAO,YAAY,QAAQ,SAAS;EACzC,SAAS;CACX;CAEA,AAAgB,OAAO,UAAgD;EACrE,KAAK,OAAO,YAAY,IAAI;EAC5B,SAAS;CACX;CAEA,AAAgB,SACd,OACA,UACM;EACN,KAAK,OAAO,YAAY,SAAS,KAAK,C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EAE1D,KAAK,OAAO,YAAY,QAAQ,SAAS;EACzC,SAAS;CACX;CAEA,AAAgB,OAAO,UAAgD;EACrE,KAAK,OAAO,YAAY,IAAI;EAC5B,SAAS;CACX;CAEA,AAAgB,SACd,OACA,UACM;EACN,KAAK,OAAO,YAAY;GACtB,KAAK,OAAO,YAAY;GACxB,SAAS,KAAK;EAChB,CAAC;CACH;CAEA,AAAO,QAAc;EACnB,KAAK,OAAO,MAAM;EAClB,OAAO;CACT;CAEA,AAAO,MAAY;EACjB,KAAK,OAAO,IAAI;EAChB,OAAO;CACT;AACF"}
package/dist/index.cjs CHANGED
@@ -1,18 +1,9 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_engine = require('./engine-ntih8wNh.cjs');
2
3
  const require_context_engine_context = require('./context/engine-context.cjs');
3
- const require_helpers_execution_host_worker = require('./helpers/execution-host-worker.cjs');
4
- const require_engine = require('./engine.cjs');
5
- const require_helpers_rpc = require('./helpers/rpc.cjs');
6
- const require_helpers_create_execution_host = require('./helpers/create-execution-host.cjs');
7
4
  require('./context/index.cjs');
8
- const require_helpers_finalize = require('./helpers/finalize.cjs');
9
- require('./helpers/index.cjs');
10
5
 
11
- exports.ExecutionHostWorker = require_helpers_execution_host_worker.ExecutionHostWorker;
12
6
  exports.PowerlinesEngine = require_engine.PowerlinesEngine;
13
7
  exports.PowerlinesEngineContext = require_context_engine_context.PowerlinesEngineContext;
14
8
  exports.createContext = require_engine.createContext;
15
- exports.createEngine = require_engine.createEngine;
16
- exports.createExecutionHost = require_helpers_create_execution_host.createExecutionHost;
17
- exports.createRpcClient = require_helpers_rpc.createRpcClient;
18
- exports.finalize = require_helpers_finalize.finalize;
9
+ exports.createEngine = require_engine.createEngine;
package/dist/index.d.cts CHANGED
@@ -1,10 +1,6 @@
1
1
  import { C as RpcServerFunctions, D as WrappedRpcFunctions, E as WrappedRpcFunction, S as RpcPayloadMetadata, T as WrapRpcFunctions, _ as RpcClientRemoteFunctions, a as ExtractRpcFunction, b as RpcFunctions, c as InputRpcFunctions, d as RpcClientCall, f as RpcClientCallEvent, g as RpcClientHost, h as RpcClientFunctions, i as RpcClientOptions, l as LogPayload, m as RpcClientEvents, n as EngineOptions, o as ExtractRpcFunctions, p as RpcClientCallOptional, r as EngineResolvedConfig, s as InputRpcFunction, t as EngineExecutionOptions, u as RpcClient, v as RpcContext, w as WrapRpcFunction, x as RpcPayloadEnvelop, y as RpcFunction } from "./config-D6xUniHh.cjs";
2
2
  import { a as ExecutionHookScopeState, c as ExecutionScopeType, i as ExecutionCommandScopeState, l as ExecutionState, n as EngineExecutionItem, o as ExecutionPluginScopeState, r as EngineSystemContext, s as ExecutionScopeState, t as EngineContext } from "./context-epL7NPvL.cjs";
3
- import { t as PowerlinesEngineContext } from "./engine-context-Dw8odBCo.cjs";
4
- import { a as PowerlinesExecutionHost, i as ExecutionInterface, n as ExecutionHost, o as Worker, r as ExecutionHostParams, t as Engine } from "./api-6w4hZL6n.cjs";
3
+ import { a as PowerlinesExecutionHost, i as ExecutionInterface, n as ExecutionHost, o as Worker, r as ExecutionHostParams, t as Engine } from "./api-DgxYwNuZ.cjs";
4
+ import { t as PowerlinesEngineContext } from "./engine-context-lrWc13AH.cjs";
5
5
  import { PowerlinesEngine, createContext, createEngine } from "./engine.cjs";
6
- import { t as createExecutionHost } from "./create-execution-host-DbOCE5bd.cjs";
7
- import { n as ExecutionHostWorkerOptions, r as NodeOptions, t as ExecutionHostWorker } from "./execution-host-worker-D7LinO52.cjs";
8
- import { t as finalize } from "./finalize-CW0cO75l.cjs";
9
- import { t as createRpcClient } from "./rpc-BsFxzyAK.cjs";
10
- export { Engine, EngineContext, EngineExecutionItem, EngineExecutionOptions, EngineOptions, EngineResolvedConfig, EngineSystemContext, ExecutionCommandScopeState, ExecutionHookScopeState, ExecutionHost, ExecutionHostParams, ExecutionHostWorker, ExecutionHostWorkerOptions, ExecutionInterface, ExecutionPluginScopeState, ExecutionScopeState, ExecutionScopeType, ExecutionState, ExtractRpcFunction, ExtractRpcFunctions, InputRpcFunction, InputRpcFunctions, LogPayload, NodeOptions, PowerlinesEngine, PowerlinesEngineContext, PowerlinesExecutionHost, RpcClient, RpcClientCall, RpcClientCallEvent, RpcClientCallOptional, RpcClientEvents, RpcClientFunctions, RpcClientHost, RpcClientOptions, RpcClientRemoteFunctions, RpcContext, RpcFunction, RpcFunctions, RpcPayloadEnvelop, RpcPayloadMetadata, RpcServerFunctions, Worker, WrapRpcFunction, WrapRpcFunctions, WrappedRpcFunction, WrappedRpcFunctions, createContext, createEngine, createExecutionHost, createRpcClient, finalize };
6
+ export { type Engine, type EngineContext, type EngineExecutionItem, type EngineExecutionOptions, type EngineOptions, type EngineResolvedConfig, type EngineSystemContext, type ExecutionCommandScopeState, type ExecutionHookScopeState, type ExecutionHost, type ExecutionHostParams, type ExecutionInterface, type ExecutionPluginScopeState, type ExecutionScopeState, type ExecutionScopeType, type ExecutionState, type ExtractRpcFunction, type ExtractRpcFunctions, type InputRpcFunction, type InputRpcFunctions, type LogPayload, PowerlinesEngine, PowerlinesEngineContext, type PowerlinesExecutionHost, type RpcClient, type RpcClientCall, type RpcClientCallEvent, type RpcClientCallOptional, type RpcClientEvents, type RpcClientFunctions, type RpcClientHost, type RpcClientOptions, type RpcClientRemoteFunctions, type RpcContext, type RpcFunction, type RpcFunctions, type RpcPayloadEnvelop, type RpcPayloadMetadata, type RpcServerFunctions, type Worker, type WrapRpcFunction, type WrapRpcFunctions, type WrappedRpcFunction, type WrappedRpcFunctions, createContext, createEngine };
package/dist/index.d.mts CHANGED
@@ -1,10 +1,6 @@
1
- import { C as RpcServerFunctions, D as WrappedRpcFunctions, E as WrappedRpcFunction, S as RpcPayloadMetadata, T as WrapRpcFunctions, _ as RpcClientRemoteFunctions, a as ExtractRpcFunction, b as RpcFunctions, c as InputRpcFunctions, d as RpcClientCall, f as RpcClientCallEvent, g as RpcClientHost, h as RpcClientFunctions, i as RpcClientOptions, l as LogPayload, m as RpcClientEvents, n as EngineOptions, o as ExtractRpcFunctions, p as RpcClientCallOptional, r as EngineResolvedConfig, s as InputRpcFunction, t as EngineExecutionOptions, u as RpcClient, v as RpcContext, w as WrapRpcFunction, x as RpcPayloadEnvelop, y as RpcFunction } from "./config-BNe23XHx.mjs";
2
- import { a as ExecutionHookScopeState, c as ExecutionScopeType, i as ExecutionCommandScopeState, l as ExecutionState, n as EngineExecutionItem, o as ExecutionPluginScopeState, r as EngineSystemContext, s as ExecutionScopeState, t as EngineContext } from "./context-DzgsMSWr.mjs";
3
- import { t as PowerlinesEngineContext } from "./engine-context-DEotmVzB.mjs";
4
- import { a as PowerlinesExecutionHost, i as ExecutionInterface, n as ExecutionHost, o as Worker, r as ExecutionHostParams, t as Engine } from "./api-Cdw4v0W4.mjs";
1
+ import { C as RpcServerFunctions, D as WrappedRpcFunctions, E as WrappedRpcFunction, S as RpcPayloadMetadata, T as WrapRpcFunctions, _ as RpcClientRemoteFunctions, a as ExtractRpcFunction, b as RpcFunctions, c as InputRpcFunctions, d as RpcClientCall, f as RpcClientCallEvent, g as RpcClientHost, h as RpcClientFunctions, i as RpcClientOptions, l as LogPayload, m as RpcClientEvents, n as EngineOptions, o as ExtractRpcFunctions, p as RpcClientCallOptional, r as EngineResolvedConfig, s as InputRpcFunction, t as EngineExecutionOptions, u as RpcClient, v as RpcContext, w as WrapRpcFunction, x as RpcPayloadEnvelop, y as RpcFunction } from "./config-C9AD-erz.mjs";
2
+ import { a as ExecutionHookScopeState, c as ExecutionScopeType, i as ExecutionCommandScopeState, l as ExecutionState, n as EngineExecutionItem, o as ExecutionPluginScopeState, r as EngineSystemContext, s as ExecutionScopeState, t as EngineContext } from "./context-S3XH2DWP.mjs";
3
+ import { a as PowerlinesExecutionHost, i as ExecutionInterface, n as ExecutionHost, o as Worker, r as ExecutionHostParams, t as Engine } from "./api-B2dWvRMM.mjs";
4
+ import { t as PowerlinesEngineContext } from "./engine-context-Cc93ql_I.mjs";
5
5
  import { PowerlinesEngine, createContext, createEngine } from "./engine.mjs";
6
- import { t as createExecutionHost } from "./create-execution-host-CdpuL_YG.mjs";
7
- import { n as ExecutionHostWorkerOptions, r as NodeOptions, t as ExecutionHostWorker } from "./execution-host-worker-zpQqaW_W.mjs";
8
- import { t as finalize } from "./finalize-DeSY1r74.mjs";
9
- import { t as createRpcClient } from "./rpc-xwbFMMNu.mjs";
10
- export { Engine, EngineContext, EngineExecutionItem, EngineExecutionOptions, EngineOptions, EngineResolvedConfig, EngineSystemContext, ExecutionCommandScopeState, ExecutionHookScopeState, ExecutionHost, ExecutionHostParams, ExecutionHostWorker, ExecutionHostWorkerOptions, ExecutionInterface, ExecutionPluginScopeState, ExecutionScopeState, ExecutionScopeType, ExecutionState, ExtractRpcFunction, ExtractRpcFunctions, InputRpcFunction, InputRpcFunctions, LogPayload, NodeOptions, PowerlinesEngine, PowerlinesEngineContext, PowerlinesExecutionHost, RpcClient, RpcClientCall, RpcClientCallEvent, RpcClientCallOptional, RpcClientEvents, RpcClientFunctions, RpcClientHost, RpcClientOptions, RpcClientRemoteFunctions, RpcContext, RpcFunction, RpcFunctions, RpcPayloadEnvelop, RpcPayloadMetadata, RpcServerFunctions, Worker, WrapRpcFunction, WrapRpcFunctions, WrappedRpcFunction, WrappedRpcFunctions, createContext, createEngine, createExecutionHost, createRpcClient, finalize };
6
+ export { type Engine, type EngineContext, type EngineExecutionItem, type EngineExecutionOptions, type EngineOptions, type EngineResolvedConfig, type EngineSystemContext, type ExecutionCommandScopeState, type ExecutionHookScopeState, type ExecutionHost, type ExecutionHostParams, type ExecutionInterface, type ExecutionPluginScopeState, type ExecutionScopeState, type ExecutionScopeType, type ExecutionState, type ExtractRpcFunction, type ExtractRpcFunctions, type InputRpcFunction, type InputRpcFunctions, type LogPayload, PowerlinesEngine, PowerlinesEngineContext, type PowerlinesExecutionHost, type RpcClient, type RpcClientCall, type RpcClientCallEvent, type RpcClientCallOptional, type RpcClientEvents, type RpcClientFunctions, type RpcClientHost, type RpcClientOptions, type RpcClientRemoteFunctions, type RpcContext, type RpcFunction, type RpcFunctions, type RpcPayloadEnvelop, type RpcPayloadMetadata, type RpcServerFunctions, type Worker, type WrapRpcFunction, type WrapRpcFunctions, type WrappedRpcFunction, type WrappedRpcFunctions, createContext, createEngine };
package/dist/index.mjs CHANGED
@@ -1,10 +1,5 @@
1
+ import { n as createContext, r as createEngine, t as PowerlinesEngine } from "./engine-Ct0OGdyp.mjs";
1
2
  import { PowerlinesEngineContext } from "./context/engine-context.mjs";
2
- import { ExecutionHostWorker } from "./helpers/execution-host-worker.mjs";
3
- import { PowerlinesEngine, createContext, createEngine } from "./engine.mjs";
4
- import { createRpcClient } from "./helpers/rpc.mjs";
5
- import { createExecutionHost } from "./helpers/create-execution-host.mjs";
6
3
  import "./context/index.mjs";
7
- import { finalize } from "./helpers/finalize.mjs";
8
- import "./helpers/index.mjs";
9
4
 
10
- export { ExecutionHostWorker, PowerlinesEngine, PowerlinesEngineContext, createContext, createEngine, createExecutionHost, createRpcClient, finalize };
5
+ export { PowerlinesEngine, PowerlinesEngineContext, createContext, createEngine };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/engine",
3
- "version": "0.15.19",
3
+ "version": "0.15.21",
4
4
  "private": false,
5
5
  "description": "An internal package containing the core engine modules for Powerlines.",
6
6
  "homepage": "https://stormsoftware.com",
@@ -40,6 +40,7 @@
40
40
  "type": "module",
41
41
  "exports": {
42
42
  ".": { "import": "./dist/index.mjs", "require": "./dist/index.cjs" },
43
+ "./api": { "import": "./dist/api.mjs", "require": "./dist/api.cjs" },
43
44
  "./api/build": {
44
45
  "import": "./dist/api/build.mjs",
45
46
  "require": "./dist/api/build.cjs"
@@ -88,10 +89,6 @@
88
89
  "import": "./dist/engine.mjs",
89
90
  "require": "./dist/engine.cjs"
90
91
  },
91
- "./execution-host": {
92
- "import": "./dist/execution-host.mjs",
93
- "require": "./dist/execution-host.cjs"
94
- },
95
92
  "./helpers": {
96
93
  "import": "./dist/helpers/index.mjs",
97
94
  "require": "./dist/helpers/index.cjs"
@@ -100,10 +97,6 @@
100
97
  "import": "./dist/helpers/create-execution-host.mjs",
101
98
  "require": "./dist/helpers/create-execution-host.cjs"
102
99
  },
103
- "./helpers/execution-host-worker": {
104
- "import": "./dist/helpers/execution-host-worker.mjs",
105
- "require": "./dist/helpers/execution-host-worker.cjs"
106
- },
107
100
  "./helpers/finalize": {
108
101
  "import": "./dist/helpers/finalize.mjs",
109
102
  "require": "./dist/helpers/finalize.cjs"
@@ -112,6 +105,10 @@
112
105
  "import": "./dist/helpers/rpc.mjs",
113
106
  "require": "./dist/helpers/rpc.cjs"
114
107
  },
108
+ "./helpers/stream": {
109
+ "import": "./dist/helpers/stream.mjs",
110
+ "require": "./dist/helpers/stream.cjs"
111
+ },
115
112
  "./package.json": "./package.json"
116
113
  },
117
114
  "main": "./dist/index.cjs",
@@ -119,7 +116,7 @@
119
116
  "types": "./dist/index.d.cts",
120
117
  "files": ["dist"],
121
118
  "dependencies": {
122
- "@powerlines/core": "^0.15.17",
119
+ "@powerlines/core": "^0.15.19",
123
120
  "@storm-software/config": "^1.137.52",
124
121
  "@storm-software/config-tools": "^1.190.20",
125
122
  "@stryke/async": "^0.1.5",
@@ -142,9 +139,10 @@
142
139
  "h3": "^1.15.11",
143
140
  "handlebars": "^4.7.9",
144
141
  "human-id": "^4.1.3",
145
- "jest-worker": "^30.4.1",
146
142
  "jiti": "^2.7.0",
143
+ "piscina": "^5.1.4",
147
144
  "sirv": "^3.0.2",
145
+ "structured-clone-es": "^2.0.0",
148
146
  "ua-parser-modern": "^0.1.1",
149
147
  "unimport": "^5.7.0",
150
148
  "unplugin": "^3.0.0"
@@ -155,5 +153,5 @@
155
153
  "@types/node": "^25.8.0",
156
154
  "typescript": "^6.0.3"
157
155
  },
158
- "gitHead": "defec65066e27532bba43fc6c8ef65ccb74d5877"
156
+ "gitHead": "b5c7361d0ca942652f98baf11488435c7918fd65"
159
157
  }
@@ -1 +0,0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AO,cAAA;AAAA;;;;;;;UASQ,aAAA,mCAEb,WAAA,CAAY,cAAA,GACZ,IAAA,CAAK,QAAA,CAAS,aAAA;EA+Bd;;;EA3BF,OAAA,EAAS,aAAA;EA6BI;;;EAxBb,UAAA,EAAY,cAAA;EAgCiD;;AAG/D;;;;EA3BE,QAAA,EAAU,mBAAA;;;;EAKV,UAAA,EAAY,mBAAA;;;;;;;EAQZ,cAAA,GACE,MAAA,UACA,YAAA,EAAc,YAAA,KACX,OAAA,CAAQ,mBAAA;;;;;;;EAQb,iBAAA,GAAoB,YAAA,UAAsB,WAAA;AAAA;AAAA,UAG3B,mBAAA;;;;EAIf,GAAA,EAAK,SAAA;AAAA"}
@@ -1,20 +0,0 @@
1
- import { r as EngineResolvedConfig } from "./config-BNe23XHx.mjs";
2
- import { r as EngineSystemContext } from "./context-DzgsMSWr.mjs";
3
- import { r as ExecutionHostParams } from "./api-Cdw4v0W4.mjs";
4
- import { ExecutionContext, InlineConfig } from "@powerlines/core";
5
- import { DeepPartial, MaybePromise } from "@stryke/types/base";
6
-
7
- //#region src/helpers/create-execution-host.d.ts
8
- /**
9
- * Creates an execution host with the provided methods. Each method will be wrapped to create an execution context and handle errors appropriately.
10
- *
11
- * @param methods - An object where keys are method names and values are functions that take an execution context and return a promise.
12
- * @param inlineConfig - An optional partial inline configuration object that will be merged with the context's options when creating the execution context for each method.
13
- * @returns An object with the same keys as the input methods, but each function is wrapped to create an execution context and handle errors.
14
- */
15
- declare function createExecutionHost<TContext extends ExecutionContext<EngineResolvedConfig, EngineSystemContext> = ExecutionContext<EngineResolvedConfig, EngineSystemContext>>(methods: Record<string, (context: TContext) => Promise<void>>, inlineConfig?: DeepPartial<InlineConfig> | ((prev: InlineConfig) => MaybePromise<InlineConfig>)): {
16
- [k: string]: (params: ExecutionHostParams) => Promise<void>;
17
- };
18
- //#endregion
19
- export { createExecutionHost as t };
20
- //# sourceMappingURL=create-execution-host-CdpuL_YG.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-execution-host-CdpuL_YG.d.mts","names":[],"sources":["../src/helpers/create-execution-host.ts"],"mappings":";;;;;;;;;AA6CA;;;;;iBAAgB,mBAAA,kBACG,gBAAA,CAAiB,oBAAA,EAAsB,mBAAA,IACtD,gBAAA,CAAiB,oBAAA,EAAsB,mBAAA,EAAA,CAEzC,OAAA,EAAS,MAAA,UAAgB,OAAA,EAAS,QAAA,KAAa,OAAA,SAC/C,YAAA,GACI,WAAA,CAAY,YAAA,MACV,IAAA,EAAM,YAAA,KAAiB,YAAA,CAAa,YAAA;EAAA,sBAKvB,mBAAA,KAAmB,OAAA;AAAA"}
@@ -1,20 +0,0 @@
1
- import { r as EngineResolvedConfig } from "./config-D6xUniHh.cjs";
2
- import { r as EngineSystemContext } from "./context-epL7NPvL.cjs";
3
- import { r as ExecutionHostParams } from "./api-6w4hZL6n.cjs";
4
- import { ExecutionContext, InlineConfig } from "@powerlines/core";
5
- import { DeepPartial, MaybePromise } from "@stryke/types/base";
6
-
7
- //#region src/helpers/create-execution-host.d.ts
8
- /**
9
- * Creates an execution host with the provided methods. Each method will be wrapped to create an execution context and handle errors appropriately.
10
- *
11
- * @param methods - An object where keys are method names and values are functions that take an execution context and return a promise.
12
- * @param inlineConfig - An optional partial inline configuration object that will be merged with the context's options when creating the execution context for each method.
13
- * @returns An object with the same keys as the input methods, but each function is wrapped to create an execution context and handle errors.
14
- */
15
- declare function createExecutionHost<TContext extends ExecutionContext<EngineResolvedConfig, EngineSystemContext> = ExecutionContext<EngineResolvedConfig, EngineSystemContext>>(methods: Record<string, (context: TContext) => Promise<void>>, inlineConfig?: DeepPartial<InlineConfig> | ((prev: InlineConfig) => MaybePromise<InlineConfig>)): {
16
- [k: string]: (params: ExecutionHostParams) => Promise<void>;
17
- };
18
- //#endregion
19
- export { createExecutionHost as t };
20
- //# sourceMappingURL=create-execution-host-DbOCE5bd.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-execution-host-DbOCE5bd.d.cts","names":[],"sources":["../src/helpers/create-execution-host.ts"],"mappings":";;;;;;;;;AA6CA;;;;;iBAAgB,mBAAA,kBACG,gBAAA,CAAiB,oBAAA,EAAsB,mBAAA,IACtD,gBAAA,CAAiB,oBAAA,EAAsB,mBAAA,EAAA,CAEzC,OAAA,EAAS,MAAA,UAAgB,OAAA,EAAS,QAAA,KAAa,OAAA,SAC/C,YAAA,GACI,WAAA,CAAY,YAAA,MACV,IAAA,EAAM,YAAA,KAAiB,YAAA,CAAa,YAAA;EAAA,sBAKvB,mBAAA,KAAmB,OAAA;AAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"engine-context-DEotmVzB.d.mts","names":[],"sources":["../src/context/engine-context.ts"],"mappings":";;;;;;;;;cAmDa,uBAAA,mCACH,qBAAA,CAAsB,cAAA,aACnB,aAAA,CAAc,cAAA;EAAA;EAkIP,OAAA,EAAS,aAAA;EAClB,UAAA,EAAY,cAAA;EArIa;;;;;;EAAA,OAgBd,IAAA,0BAAA,CAClB,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,GAAK,mBAAA,CAAA,MAAA;EAAA,IAe5D,UAAA,CAAA,GAAc,mBAAA;EAAA,IAId,QAAA,CAAA,GAAY,mBAAA;EAAA,IAIZ,QAAA,CAAA,GAAY,QAAA;EAAA,IAQZ,SAAA,CAAA,GAAa,gBAAA;EAAA,IAQb,KAAA,CAAA;EAvCuD;;;;;;EAAA,UAiDzD,WAAA,CACS,OAAA,EAAS,aAAA,EAClB,UAAA,EAAY,cAAA;EAAA;;;;;;;;;EAcR,cAAA,CACX,MAAA,UACA,YAAA,EAAc,YAAA,GACb,OAAA,CAAQ,mBAAA;EArJmB;;;;;;EAyNvB,iBAAA,CAAkB,YAAA,UAAsB,WAAA;AAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"engine-context-Dw8odBCo.d.cts","names":[],"sources":["../src/context/engine-context.ts"],"mappings":";;;;;;;;;cAmDa,uBAAA,mCACH,qBAAA,CAAsB,cAAA,aACnB,aAAA,CAAc,cAAA;EAAA;EAkIP,OAAA,EAAS,aAAA;EAClB,UAAA,EAAY,cAAA;EArIa;;;;;;EAAA,OAgBd,IAAA,0BAAA,CAClB,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,GAAK,mBAAA,CAAA,MAAA;EAAA,IAe5D,UAAA,CAAA,GAAc,mBAAA;EAAA,IAId,QAAA,CAAA,GAAY,mBAAA;EAAA,IAIZ,QAAA,CAAA,GAAY,QAAA;EAAA,IAQZ,SAAA,CAAA,GAAa,gBAAA;EAAA,IAQb,KAAA,CAAA;EAvCuD;;;;;;EAAA,UAiDzD,WAAA,CACS,OAAA,EAAS,aAAA,EAClB,UAAA,EAAY,cAAA;EAAA;;;;;;;;;EAcR,cAAA,CACX,MAAA,UACA,YAAA,EAAc,YAAA,GACb,OAAA,CAAQ,mBAAA;EArJmB;;;;;;EAyNvB,iBAAA,CAAkB,YAAA,UAAsB,WAAA;AAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"engine.mjs","names":["#context","#host"],"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 { EXECUTION_API_METHODS } from \"@powerlines/core/constants\";\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 { PowerlinesEngineContext } from \"./context/engine-context\";\nimport { ExecutionHostWorker } from \"./helpers/execution-host-worker\";\nimport { Engine, ExecutionHost } 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<\n TExecutionAPI extends ReadonlyArray<string> = typeof EXECUTION_API_METHODS\n>\n implements Engine<TExecutionAPI>, AsyncDisposable\n{\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 #host: ExecutionHost<TExecutionAPI>;\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 host(): ExecutionHost<TExecutionAPI> {\n return this.#host;\n }\n\n /**\n * Create a new Powerlines Engine instance\n *\n * @param context - The Powerlines context\n * @param host - The API host for the execution workers\n * @returns A new instance of the Powerlines Engine\n */\n public constructor(\n context: EngineContext,\n host: ExecutionHost<TExecutionAPI>\n ) {\n this.#context = context;\n this.#host = host;\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.host.end();\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 method - 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 method: TExecutionAPI[number],\n inlineConfig: InlineConfig\n ) {\n await Promise.all(\n (await this.context.loadExecutions(method, inlineConfig)).map(\n async execution => {\n try {\n await this.host[method]({\n options: execution.options,\n inlineConfig\n });\n } catch (error) {\n this.context.error(\n `Execution of method \"${method}\" 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<TExecutionAPI extends ReadonlyArray<string>>(\n options: EngineOptions,\n executionHostPath = \"@powerlines/engine/execution-host\",\n executionMethods?: TExecutionAPI\n) {\n EventEmitter.setMaxListeners(100);\n\n const context = await createContext(options);\n const host = await ExecutionHostWorker.from<TExecutionAPI>(\n executionHostPath,\n {\n root: options.root,\n context,\n executionMethods\n }\n );\n\n return new PowerlinesEngine<TExecutionAPI>(context, host);\n}\n"],"mappings":";;;;;;;;;;;;;;AA+CA,IAAa,mBAAb,MAIA;;;;CAIE;;;;CAKA;;;;CAKA,IAAW,UAAyB;AAClC,SAAO,MAAKA;;;;;CAMd,IAAW,OAAqC;AAC9C,SAAO,MAAKC;;;;;;;;;CAUd,AAAO,YACL,SACA,MACA;AACA,QAAKD,UAAW;AAChB,QAAKC,OAAQ;;;;;;;;;;;CAYf,MAAa,OAAO,cAAkC;EACpD,MAAM,QAAQ,KAAK,QAAQ,MAAM,SAAS;AAC1C,OAAK,QAAQ,KAAK,4BAA4B;AAE9C,QAAM,KAAK,QAAQ,UAAU,aAAa;AAE1C,OAAK,QAAQ,MAAM,0CAA0C;AAC7D,SAAO;;;;;;;;;;CAWT,MAAa,MAAM,cAAiC;EAClD,MAAM,QAAQ,KAAK,QAAQ,MAAM,QAAQ;AACzC,OAAK,QAAQ,KAAK,0DAA0D;AAE5E,QAAM,KAAK,QAAQ,SAAS,aAAa;AAEzC,OAAK,QAAQ,MAAM,gDAAgD;AACnE,SAAO;;;;;;;;;;CAWT,MAAa,QAAQ,cAAmC;EACtD,MAAM,QAAQ,KAAK,QAAQ,MAAM,UAAU;AAC3C,OAAK,QAAQ,KAAK,4BAA4B;AAE9C,QAAM,KAAK,QAAQ,WAAW,aAAa;AAE3C,OAAK,QAAQ,MAAM,2CAA2C;AAC9D,SAAO;;;;;;;;;;;CAYT,MAAa,MAAM,cAAiC;EAClD,MAAM,QAAQ,KAAK,QAAQ,MAAM,QAAQ;AACzC,OAAK,QAAQ,KAAK,qCAAqC;AAEvD,QAAM,KAAK,QAAQ,SAAS,aAAa;AAEzC,OAAK,QAAQ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} from "./api-6w4hZL6n.cjs";
3
- import { Mode } from "@powerlines/core";
4
- import { Worker } from "jest-worker";
5
-
6
- //#region src/helpers/execution-host-worker.d.ts
7
- type NodeOptions = Record<string, string | boolean | undefined>;
8
- interface ExecutionHostWorkerOptions<TExecutionAPI extends ReadonlyArray<string>> {
9
- /**
10
- * The maximum time in milliseconds a worker can run before being terminated.
11
- *
12
- * @defaultValue 900000 (15 minutes)
13
- */
14
- timeout?: number;
15
- /**
16
- * True if `--max-old-space-size` should not be forwarded to the worker.
17
- */
18
- isolatedMemory?: boolean;
19
- /**
20
- * 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.).
21
- */
22
- mode?: Mode;
23
- /**
24
- * 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.
25
- */
26
- root?: string;
27
- /**
28
- * 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.
29
- */
30
- context: EngineContext;
31
- /**
32
- * An array of method names that the worker exposes. These methods will be available on the Worker instance and can be called to execute tasks in the worker process.
33
- */
34
- executionMethods?: TExecutionAPI;
35
- }
36
- declare class ExecutionHostWorker<TExecutionAPI extends ReadonlyArray<string>> {
37
- #private;
38
- protected executionHostPath: string;
39
- protected exposedMethods: string[];
40
- protected options: ExecutionHostWorkerOptions<TExecutionAPI>;
41
- /**
42
- * Creates a new instance of the ExecutionHostWorker 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.
43
- *
44
- * @param executionHostPath - The path to the Execution Host file.
45
- * @param options - The options for configuring the worker, including the execution context, exposed methods, timeout, and mode.
46
- * @returns A promise that resolves to an instance of the ExecutionHostWorker class.
47
- */
48
- static from<TExecutionAPI extends ReadonlyArray<string>>(executionHostPath: string, options: ExecutionHostWorkerOptions<TExecutionAPI>): Promise<ExecutionHost<TExecutionAPI>>;
49
- /**
50
- * Create a new worker instance.
51
- *
52
- * @param executionHostPath - The path to the worker file.
53
- * @param exposedMethods - An array of method names that the worker exposes.
54
- * @param options - The options for the worker, including exposed methods, timeout, and hooks for activity and restart.
55
- */
56
- constructor(executionHostPath: string, exposedMethods: string[], options: ExecutionHostWorkerOptions<TExecutionAPI>);
57
- /**
58
- * Ends the worker process and cleans up any resources associated with it. This method should be called when the worker is no longer needed, to ensure that it is properly terminated and does not continue to consume system resources. If the worker is already terminated or was never initialized, this method will throw an error.
59
- *
60
- * @returns A promise that resolves when the worker has been successfully terminated.
61
- */
62
- end(): ReturnType<Worker["end"]>;
63
- /**
64
- * Quietly end the worker if it exists
65
- */
66
- close(): void;
67
- }
68
- //#endregion
69
- export { ExecutionHostWorkerOptions as n, NodeOptions as r, ExecutionHostWorker as t };
70
- //# sourceMappingURL=execution-host-worker-D7LinO52.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"execution-host-worker-D7LinO52.d.cts","names":[],"sources":["../src/helpers/execution-host-worker.ts"],"mappings":";;;;;;KAwDY,WAAA,GAAc,MAAA;AAAA,UAqDT,0BAAA,uBACO,aAAA;EAtDZ;;;;;EAuEV,OAAA;EAlByC;;;EAuBzC,cAAA;EAeS;;;EAVT,IAAA,GAAO,IAAA;EA3BP;;;EAgCA,IAAA;EALA;;;EAUA,OAAA,EAAS,aAAA;EAAA;;;EAKT,gBAAA,GAAmB,aAAA;AAAA;AAAA,cAGR,mBAAA,uBAA0C,aAAA;EAAA;YA2DzC,iBAAA;EAAA,UACA,cAAA;EAAA,UACA,OAAA,EAAS,0BAAA,CAA2B,aAAA;EAA3B;;;;;;;EAAA,OAnDD,IAAA,uBAA2B,aAAA,SAAA,CAC7C,iBAAA,UACA,OAAA,EAAS,0BAAA,CAA2B,aAAA,IAAc,OAAA,CAAA,aAAA,CAAA,aAAA;EAiD/B;;;;;;;cAFT,iBAAA,UACA,cAAA,YACA,OAAA,EAAS,0BAAA,CAA2B,aAAA;EAFpC;;;;;EAiaC,GAAA,CAAA,GAAO,UAAA,CAAW,MAAA;EAldN;;;EAgelB,KAAA,CAAA;AAAA"}
@@ -1,70 +0,0 @@
1
- import { t as EngineContext } from "./context-DzgsMSWr.mjs";
2
- import { n as ExecutionHost } from "./api-Cdw4v0W4.mjs";
3
- import { Worker } from "jest-worker";
4
- import { Mode } from "@powerlines/core";
5
-
6
- //#region src/helpers/execution-host-worker.d.ts
7
- type NodeOptions = Record<string, string | boolean | undefined>;
8
- interface ExecutionHostWorkerOptions<TExecutionAPI extends ReadonlyArray<string>> {
9
- /**
10
- * The maximum time in milliseconds a worker can run before being terminated.
11
- *
12
- * @defaultValue 900000 (15 minutes)
13
- */
14
- timeout?: number;
15
- /**
16
- * True if `--max-old-space-size` should not be forwarded to the worker.
17
- */
18
- isolatedMemory?: boolean;
19
- /**
20
- * 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.).
21
- */
22
- mode?: Mode;
23
- /**
24
- * 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.
25
- */
26
- root?: string;
27
- /**
28
- * 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.
29
- */
30
- context: EngineContext;
31
- /**
32
- * An array of method names that the worker exposes. These methods will be available on the Worker instance and can be called to execute tasks in the worker process.
33
- */
34
- executionMethods?: TExecutionAPI;
35
- }
36
- declare class ExecutionHostWorker<TExecutionAPI extends ReadonlyArray<string>> {
37
- #private;
38
- protected executionHostPath: string;
39
- protected exposedMethods: string[];
40
- protected options: ExecutionHostWorkerOptions<TExecutionAPI>;
41
- /**
42
- * Creates a new instance of the ExecutionHostWorker 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.
43
- *
44
- * @param executionHostPath - The path to the Execution Host file.
45
- * @param options - The options for configuring the worker, including the execution context, exposed methods, timeout, and mode.
46
- * @returns A promise that resolves to an instance of the ExecutionHostWorker class.
47
- */
48
- static from<TExecutionAPI extends ReadonlyArray<string>>(executionHostPath: string, options: ExecutionHostWorkerOptions<TExecutionAPI>): Promise<ExecutionHost<TExecutionAPI>>;
49
- /**
50
- * Create a new worker instance.
51
- *
52
- * @param executionHostPath - The path to the worker file.
53
- * @param exposedMethods - An array of method names that the worker exposes.
54
- * @param options - The options for the worker, including exposed methods, timeout, and hooks for activity and restart.
55
- */
56
- constructor(executionHostPath: string, exposedMethods: string[], options: ExecutionHostWorkerOptions<TExecutionAPI>);
57
- /**
58
- * Ends the worker process and cleans up any resources associated with it. This method should be called when the worker is no longer needed, to ensure that it is properly terminated and does not continue to consume system resources. If the worker is already terminated or was never initialized, this method will throw an error.
59
- *
60
- * @returns A promise that resolves when the worker has been successfully terminated.
61
- */
62
- end(): ReturnType<Worker["end"]>;
63
- /**
64
- * Quietly end the worker if it exists
65
- */
66
- close(): void;
67
- }
68
- //#endregion
69
- export { ExecutionHostWorkerOptions as n, NodeOptions as r, ExecutionHostWorker as t };
70
- //# sourceMappingURL=execution-host-worker-zpQqaW_W.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"execution-host-worker-zpQqaW_W.d.mts","names":[],"sources":["../src/helpers/execution-host-worker.ts"],"mappings":";;;;;;KAwDY,WAAA,GAAc,MAAA;AAAA,UAqDT,0BAAA,uBACO,aAAA;EAtDZ;;;;;EAuEV,OAAA;EAlByC;;;EAuBzC,cAAA;EAeS;;;EAVT,IAAA,GAAO,IAAA;EA3BP;;;EAgCA,IAAA;EALA;;;EAUA,OAAA,EAAS,aAAA;EAAA;;;EAKT,gBAAA,GAAmB,aAAA;AAAA;AAAA,cAGR,mBAAA,uBAA0C,aAAA;EAAA;YA2DzC,iBAAA;EAAA,UACA,cAAA;EAAA,UACA,OAAA,EAAS,0BAAA,CAA2B,aAAA;EAA3B;;;;;;;EAAA,OAnDD,IAAA,uBAA2B,aAAA,SAAA,CAC7C,iBAAA,UACA,OAAA,EAAS,0BAAA,CAA2B,aAAA,IAAc,OAAA,CAAA,aAAA,CAAA,aAAA;EAiD/B;;;;;;;cAFT,iBAAA,UACA,cAAA,YACA,OAAA,EAAS,0BAAA,CAA2B,aAAA;EAFpC;;;;;EAiaC,GAAA,CAAA,GAAO,UAAA,CAAW,MAAA;EAldN;;;EAgelB,KAAA,CAAA;AAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"execution-host.d.cts","names":[],"sources":["../src/execution-host.ts"],"mappings":";;cAyCa,KAAA,IAAK,MAAA,EAAsB,mBAAA,KAAtB,OAAA;AAAA,cACL,OAAA,IAAO,MAAA,EAAwB,mBAAA,KAAxB,OAAA;AAAA,cACP,MAAA,IAAM,MAAA,EAAuB,mBAAA,KAAvB,OAAA;AAAA,cACN,KAAA,IAAK,MAAA,EAAsB,mBAAA,KAAtB,OAAA;AAAA,cACL,IAAA,IAAI,MAAA,EAAqB,mBAAA,KAArB,OAAA;AAAA,cACJ,IAAA,IAAI,MAAA,EAAqB,mBAAA,KAArB,OAAA;AAAA,cACJ,KAAA,IAAK,MAAA,EAAsB,mBAAA,KAAtB,OAAA;AAAA,cACL,IAAA,IAAI,MAAA,EAAqB,mBAAA,KAArB,OAAA;AAAA,cACJ,MAAA,IAAM,MAAA,EAAuB,mBAAA,KAAvB,OAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"execution-host.d.mts","names":[],"sources":["../src/execution-host.ts"],"mappings":";;cAyCa,KAAA,IAAK,MAAA,EAAsB,mBAAA,KAAtB,OAAA;AAAA,cACL,OAAA,IAAO,MAAA,EAAwB,mBAAA,KAAxB,OAAA;AAAA,cACP,MAAA,IAAM,MAAA,EAAuB,mBAAA,KAAvB,OAAA;AAAA,cACN,KAAA,IAAK,MAAA,EAAsB,mBAAA,KAAtB,OAAA;AAAA,cACL,IAAA,IAAI,MAAA,EAAqB,mBAAA,KAArB,OAAA;AAAA,cACJ,IAAA,IAAI,MAAA,EAAqB,mBAAA,KAArB,OAAA;AAAA,cACJ,KAAA,IAAK,MAAA,EAAsB,mBAAA,KAAtB,OAAA;AAAA,cACL,IAAA,IAAI,MAAA,EAAqB,mBAAA,KAArB,OAAA;AAAA,cACJ,MAAA,IAAM,MAAA,EAAuB,mBAAA,KAAvB,OAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"execution-host.mjs","names":["executeTypes","executePrepare","executeCreate","executeClean","executeLint","executeTest","executeBuild","executeDocs","executeDeploy"],"sources":["../src/execution-host.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 { build as executeBuild } from \"./api/build\";\nimport { clean as executeClean } from \"./api/clean\";\nimport { create as executeCreate } from \"./api/create\";\nimport { deploy as executeDeploy } from \"./api/deploy\";\nimport { docs as executeDocs } from \"./api/docs\";\nimport { lint as executeLint } from \"./api/lint\";\nimport { prepare as executePrepare } from \"./api/prepare\";\nimport { test as executeTest } from \"./api/test\";\nimport { types as executeTypes } from \"./api/types\";\nimport { createExecutionHost } from \"./helpers/create-execution-host\";\n\nconst executionHost = createExecutionHost({\n types: executeTypes,\n prepare: executePrepare,\n create: executeCreate,\n clean: executeClean,\n lint: executeLint,\n test: executeTest,\n build: executeBuild,\n docs: executeDocs,\n deploy: executeDeploy\n});\n\nexport const types = executionHost.types;\nexport const prepare = executionHost.prepare;\nexport const create = executionHost.create;\nexport const clean = executionHost.clean;\nexport const lint = executionHost.lint;\nexport const test = executionHost.test;\nexport const build = executionHost.build;\nexport const docs = executionHost.docs;\nexport const deploy = executionHost.deploy;\n"],"mappings":";;;;;;;;;;;;AA6BA,MAAM,gBAAgB,oBAAoB;CACxC,OAAOA;CACP,SAASC;CACT,QAAQC;CACR,OAAOC;CACP,MAAMC;CACN,MAAMC;CACN,OAAOC;CACP,MAAMC;CACN,QAAQC;CACT,CAAC;AAEF,MAAa,QAAQ,cAAc;AACnC,MAAa,UAAU,cAAc;AACrC,MAAa,SAAS,cAAc;AACpC,MAAa,QAAQ,cAAc;AACnC,MAAa,OAAO,cAAc;AAClC,MAAa,OAAO,cAAc;AAClC,MAAa,QAAQ,cAAc;AACnC,MAAa,OAAO,cAAc;AAClC,MAAa,SAAS,cAAc"}
@@ -1,12 +0,0 @@
1
- import { ExecutionContext, ResolvedConfig } from "@powerlines/core";
2
-
3
- //#region src/helpers/finalize.d.ts
4
- /**
5
- * Finalize the execution context by disposing resources and cleaning up.
6
- *
7
- * @param context - The execution context to finalize
8
- */
9
- declare function finalize<TResolvedConfig extends ResolvedConfig = ResolvedConfig>(context: ExecutionContext<TResolvedConfig>): Promise<void>;
10
- //#endregion
11
- export { finalize as t };
12
- //# sourceMappingURL=finalize-CW0cO75l.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"finalize-CW0cO75l.d.cts","names":[],"sources":["../src/helpers/finalize.ts"],"mappings":";;;;;AA+BA;;;iBAAsB,QAAA,yBACI,cAAA,GAAiB,cAAA,CAAA,CACzC,OAAA,EAAS,gBAAA,CAAiB,eAAA,IAAgB,OAAA"}
@@ -1,12 +0,0 @@
1
- import { ExecutionContext, ResolvedConfig } from "@powerlines/core";
2
-
3
- //#region src/helpers/finalize.d.ts
4
- /**
5
- * Finalize the execution context by disposing resources and cleaning up.
6
- *
7
- * @param context - The execution context to finalize
8
- */
9
- declare function finalize<TResolvedConfig extends ResolvedConfig = ResolvedConfig>(context: ExecutionContext<TResolvedConfig>): Promise<void>;
10
- //#endregion
11
- export { finalize as t };
12
- //# sourceMappingURL=finalize-DeSY1r74.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"finalize-DeSY1r74.d.mts","names":[],"sources":["../src/helpers/finalize.ts"],"mappings":";;;;;AA+BA;;;iBAAsB,QAAA,yBACI,cAAA,GAAiB,cAAA,CAAA,CACzC,OAAA,EAAS,gBAAA,CAAiB,eAAA,IAAgB,OAAA"}