@powerlines/engine 0.15.0 → 0.15.2

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 (195) hide show
  1. package/dist/api/build.cjs +66 -0
  2. package/dist/api/build.d.cts +14 -0
  3. package/dist/api/build.d.cts.map +1 -0
  4. package/dist/api/build.d.mts +14 -0
  5. package/dist/api/build.d.mts.map +1 -0
  6. package/dist/api/build.mjs +64 -0
  7. package/dist/api/build.mjs.map +1 -0
  8. package/dist/api/clean.cjs +29 -0
  9. package/dist/api/clean.d.cts +14 -0
  10. package/dist/api/clean.d.cts.map +1 -0
  11. package/dist/api/clean.d.mts +14 -0
  12. package/dist/api/clean.d.mts.map +1 -0
  13. package/dist/api/clean.mjs +28 -0
  14. package/dist/api/clean.mjs.map +1 -0
  15. package/dist/api/create.cjs +59 -0
  16. package/dist/api/create.d.cts +14 -0
  17. package/dist/api/create.d.cts.map +1 -0
  18. package/dist/api/create.d.mts +14 -0
  19. package/dist/api/create.d.mts.map +1 -0
  20. package/dist/api/create.mjs +57 -0
  21. package/dist/api/create.mjs.map +1 -0
  22. package/dist/api/deploy.cjs +25 -0
  23. package/dist/api/deploy.d.cts +17 -0
  24. package/dist/api/deploy.d.cts.map +1 -0
  25. package/dist/api/deploy.d.mts +17 -0
  26. package/dist/api/deploy.d.mts.map +1 -0
  27. package/dist/api/deploy.mjs +24 -0
  28. package/dist/api/deploy.mjs.map +1 -0
  29. package/dist/api/docs.cjs +25 -0
  30. package/dist/api/docs.d.cts +17 -0
  31. package/dist/api/docs.d.cts.map +1 -0
  32. package/dist/api/docs.d.mts +17 -0
  33. package/dist/api/docs.d.mts.map +1 -0
  34. package/dist/api/docs.mjs +24 -0
  35. package/dist/api/docs.mjs.map +1 -0
  36. package/dist/api/lint.cjs +28 -0
  37. package/dist/api/lint.d.cts +17 -0
  38. package/dist/api/lint.d.cts.map +1 -0
  39. package/dist/api/lint.d.mts +17 -0
  40. package/dist/api/lint.d.mts.map +1 -0
  41. package/dist/api/lint.mjs +27 -0
  42. package/dist/api/lint.mjs.map +1 -0
  43. package/dist/api/prepare.cjs +69 -0
  44. package/dist/api/prepare.d.cts +14 -0
  45. package/dist/api/prepare.d.cts.map +1 -0
  46. package/dist/api/prepare.d.mts +14 -0
  47. package/dist/api/prepare.d.mts.map +1 -0
  48. package/dist/api/prepare.mjs +68 -0
  49. package/dist/api/prepare.mjs.map +1 -0
  50. package/dist/api/test.cjs +28 -0
  51. package/dist/api/test.d.cts +17 -0
  52. package/dist/api/test.d.cts.map +1 -0
  53. package/dist/api/test.d.mts +17 -0
  54. package/dist/api/test.d.mts.map +1 -0
  55. package/dist/api/test.mjs +27 -0
  56. package/dist/api/test.mjs.map +1 -0
  57. package/dist/api/types.cjs +71 -0
  58. package/dist/api/types.d.cts +17 -0
  59. package/dist/api/types.d.cts.map +1 -0
  60. package/dist/api/types.d.mts +17 -0
  61. package/dist/api/types.d.mts.map +1 -0
  62. package/dist/api/types.mjs +70 -0
  63. package/dist/api/types.mjs.map +1 -0
  64. package/dist/api-6w4hZL6n.d.cts +135 -0
  65. package/dist/api-6w4hZL6n.d.cts.map +1 -0
  66. package/dist/api-Cdw4v0W4.d.mts +135 -0
  67. package/dist/api-Cdw4v0W4.d.mts.map +1 -0
  68. package/dist/config-BNe23XHx.d.mts +204 -0
  69. package/dist/config-BNe23XHx.d.mts.map +1 -0
  70. package/dist/config-D6xUniHh.d.cts +204 -0
  71. package/dist/config-D6xUniHh.d.cts.map +1 -0
  72. package/dist/context/engine-context.cjs +175 -0
  73. package/dist/context/engine-context.d.cts +2 -0
  74. package/dist/context/engine-context.d.mts +2 -0
  75. package/dist/context/engine-context.mjs +173 -0
  76. package/dist/context/engine-context.mjs.map +1 -0
  77. package/dist/context/index.cjs +2 -9
  78. package/dist/context/index.d.cts +2 -660
  79. package/dist/context/index.d.mts +2 -660
  80. package/dist/context/index.mjs +2 -4
  81. package/dist/context-DzgsMSWr.d.mts +149 -0
  82. package/dist/context-DzgsMSWr.d.mts.map +1 -0
  83. package/dist/context-epL7NPvL.d.cts +149 -0
  84. package/dist/context-epL7NPvL.d.cts.map +1 -0
  85. package/dist/engine-context-DEotmVzB.d.mts +54 -0
  86. package/dist/engine-context-DEotmVzB.d.mts.map +1 -0
  87. package/dist/engine-context-Dw8odBCo.d.cts +54 -0
  88. package/dist/engine-context-Dw8odBCo.d.cts.map +1 -0
  89. package/dist/engine.cjs +268 -0
  90. package/dist/engine.d.cts +143 -0
  91. package/dist/engine.d.cts.map +1 -0
  92. package/dist/engine.d.mts +143 -0
  93. package/dist/engine.d.mts.map +1 -0
  94. package/dist/engine.mjs +264 -0
  95. package/dist/engine.mjs.map +1 -0
  96. package/dist/execution-host.cjs +44 -0
  97. package/dist/execution-host.d.cts +14 -0
  98. package/dist/execution-host.d.cts.map +1 -0
  99. package/dist/execution-host.d.mts +14 -0
  100. package/dist/execution-host.d.mts.map +1 -0
  101. package/dist/execution-host.mjs +36 -0
  102. package/dist/execution-host.mjs.map +1 -0
  103. package/dist/helpers/create-execution-host.cjs +51 -0
  104. package/dist/helpers/create-execution-host.d.cts +21 -0
  105. package/dist/helpers/create-execution-host.d.cts.map +1 -0
  106. package/dist/helpers/create-execution-host.d.mts +21 -0
  107. package/dist/helpers/create-execution-host.d.mts.map +1 -0
  108. package/dist/helpers/create-execution-host.mjs +50 -0
  109. package/dist/helpers/create-execution-host.mjs.map +1 -0
  110. package/dist/helpers/execution-host-worker.cjs +308 -0
  111. package/dist/helpers/execution-host-worker.d.cts +68 -0
  112. package/dist/helpers/execution-host-worker.d.cts.map +1 -0
  113. package/dist/helpers/execution-host-worker.d.mts +68 -0
  114. package/dist/helpers/execution-host-worker.d.mts.map +1 -0
  115. package/dist/helpers/execution-host-worker.mjs +307 -0
  116. package/dist/helpers/execution-host-worker.mjs.map +1 -0
  117. package/dist/helpers/finalize.cjs +27 -0
  118. package/dist/helpers/finalize.d.cts +12 -0
  119. package/dist/helpers/finalize.d.cts.map +1 -0
  120. package/dist/helpers/finalize.d.mts +12 -0
  121. package/dist/helpers/finalize.d.mts.map +1 -0
  122. package/dist/helpers/finalize.mjs +26 -0
  123. package/dist/helpers/finalize.mjs.map +1 -0
  124. package/dist/helpers/rpc.cjs +140 -0
  125. package/dist/helpers/rpc.d.cts +7 -0
  126. package/dist/helpers/rpc.d.cts.map +1 -0
  127. package/dist/helpers/rpc.d.mts +7 -0
  128. package/dist/helpers/rpc.d.mts.map +1 -0
  129. package/dist/helpers/rpc.mjs +139 -0
  130. package/dist/helpers/rpc.mjs.map +1 -0
  131. package/dist/index-CNgSR_kt.d.mts +1 -0
  132. package/dist/index-D_TYgLX3.d.cts +1 -0
  133. package/dist/index.cjs +13 -567
  134. package/dist/index.d.cts +9 -126
  135. package/dist/index.d.mts +9 -126
  136. package/dist/index.mjs +7 -567
  137. package/package.json +101 -129
  138. package/dist/_internal/worker.cjs +0 -4843
  139. package/dist/_internal/worker.d.cts +0 -38
  140. package/dist/_internal/worker.d.cts.map +0 -1
  141. package/dist/_internal/worker.d.mts +0 -38
  142. package/dist/_internal/worker.d.mts.map +0 -1
  143. package/dist/_internal/worker.mjs +0 -4804
  144. package/dist/_internal/worker.mjs.map +0 -1
  145. package/dist/api.cjs +0 -1274
  146. package/dist/api.d.cts +0 -265
  147. package/dist/api.d.cts.map +0 -1
  148. package/dist/api.d.mts +0 -265
  149. package/dist/api.d.mts.map +0 -1
  150. package/dist/api.mjs +0 -1270
  151. package/dist/api.mjs.map +0 -1
  152. package/dist/base-context-BUnL_9z8.mjs +0 -241
  153. package/dist/base-context-BUnL_9z8.mjs.map +0 -1
  154. package/dist/base-context-CFvO2N9I.cjs +0 -248
  155. package/dist/context/index.d.cts.map +0 -1
  156. package/dist/context/index.d.mts.map +0 -1
  157. package/dist/engine-context-BuD9AGfd.mjs +0 -41
  158. package/dist/engine-context-BuD9AGfd.mjs.map +0 -1
  159. package/dist/engine-context-NO6enYev.cjs +0 -45
  160. package/dist/execution-context-BgGV4xyW.cjs +0 -2614
  161. package/dist/execution-context-D_CXpe9I.mjs +0 -2570
  162. package/dist/execution-context-D_CXpe9I.mjs.map +0 -1
  163. package/dist/fs-D1nIP45P.mjs +0 -226
  164. package/dist/fs-D1nIP45P.mjs.map +0 -1
  165. package/dist/fs-XogSgMqT.cjs +0 -262
  166. package/dist/index.d.cts.map +0 -1
  167. package/dist/index.d.mts.map +0 -1
  168. package/dist/index.mjs.map +0 -1
  169. package/dist/schemas.cjs +0 -9
  170. package/dist/schemas.d.cts +0 -127
  171. package/dist/schemas.d.cts.map +0 -1
  172. package/dist/schemas.d.mts +0 -127
  173. package/dist/schemas.d.mts.map +0 -1
  174. package/dist/schemas.mjs +0 -3
  175. package/dist/storage/index.cjs +0 -9
  176. package/dist/storage/index.d.cts +0 -419
  177. package/dist/storage/index.d.cts.map +0 -1
  178. package/dist/storage/index.d.mts +0 -419
  179. package/dist/storage/index.d.mts.map +0 -1
  180. package/dist/storage/index.mjs +0 -3
  181. package/dist/ts-morph-BaLPVAdB.cjs +0 -114
  182. package/dist/ts-morph-D0CaA37w.mjs +0 -102
  183. package/dist/ts-morph-D0CaA37w.mjs.map +0 -1
  184. package/dist/tsconfig-Cstsoprg.mjs +0 -155
  185. package/dist/tsconfig-Cstsoprg.mjs.map +0 -1
  186. package/dist/tsconfig-DeyWQC2N.cjs +0 -198
  187. package/dist/typescript/index.cjs +0 -13
  188. package/dist/typescript/index.d.cts +0 -106
  189. package/dist/typescript/index.d.cts.map +0 -1
  190. package/dist/typescript/index.d.mts +0 -106
  191. package/dist/typescript/index.d.mts.map +0 -1
  192. package/dist/typescript/index.mjs +0 -4
  193. package/dist/virtual-BNdKVkRw.cjs +0 -548
  194. package/dist/virtual-gIlTc3Lj.mjs +0 -513
  195. package/dist/virtual-gIlTc3Lj.mjs.map +0 -1
@@ -0,0 +1,149 @@
1
+ import { n as EngineOptions, t as EngineExecutionOptions, u as RpcClient } from "./config-BNe23XHx.mjs";
2
+ import { BaseContext, InlineConfig, ParsedUserConfig } from "@powerlines/core";
3
+ import { ConnectionMeta, DevToolsNodeContext } from "devframe/types";
4
+
5
+ //#region src/types/context.d.ts
6
+ /**
7
+ * The execution scope state represents the current state of a command, hook, or plugin execution within the Powerlines engine. It includes information about the name and type of the execution, as well as any relevant metadata such as the order of hook execution or the timestamp of when the execution started. This state can be used for logging, debugging, and other purposes to provide insight into the behavior of the Powerlines engine during its operation.
8
+ */
9
+ type ExecutionScopeType = "command" | "hook" | "plugin";
10
+ /**
11
+ * The execution state for a command, hook, or plugin execution within the Powerlines engine. This state includes information about the name and type of the execution, as well as any relevant metadata such as the order of hook execution or the timestamp of when the execution started. This state can be used for logging, debugging, and other purposes to provide insight into the behavior of the Powerlines engine during its operation.
12
+ */
13
+ interface ExecutionScopeState {
14
+ /**
15
+ * The timestamp when the command, hook, or plugin execution started
16
+ */
17
+ timestamp: number;
18
+ /**
19
+ * The name of the command, hook, or plugin being executed
20
+ */
21
+ name: string;
22
+ /**
23
+ * The type of execution scope, which can be "command", "hook", or "plugin". This indicates whether the execution state represents a command being executed, a hook being executed, or a plugin being executed.
24
+ */
25
+ type: ExecutionScopeType;
26
+ }
27
+ /**
28
+ * The execution state for a command execution within the Powerlines engine. This state includes information about the name and type of the execution, as well as any relevant metadata such as the order of hook execution or the timestamp of when the execution started. This state can be used for logging, debugging, and other purposes to provide insight into the behavior of the Powerlines engine during its operation.
29
+ */
30
+ interface ExecutionCommandScopeState extends ExecutionScopeState {
31
+ /**
32
+ * The type of execution scope, which can be "command", "hook", or "plugin". This indicates whether the execution state represents a command being executed, a hook being executed, or a plugin being executed.
33
+ */
34
+ type: "command";
35
+ }
36
+ /**
37
+ * The execution state for a hook execution within the Powerlines engine. This state includes information about the name and type of the execution, as well as any relevant metadata such as the order of hook execution or the timestamp of when the execution started. This state can be used for logging, debugging, and other purposes to provide insight into the behavior of the Powerlines engine during its operation.
38
+ */
39
+ interface ExecutionHookScopeState extends ExecutionScopeState {
40
+ /**
41
+ * The order of the hook being executed, which can be "pre", "post", or "normal". This indicates whether the hook is being executed
42
+ */
43
+ order?: "pre" | "post";
44
+ /**
45
+ * The type of execution scope, which can be "command", "hook", or "plugin". This indicates whether the execution state represents a command being executed, a hook being executed, or a plugin being executed.
46
+ */
47
+ type: "hook";
48
+ }
49
+ /**
50
+ * The execution state for a plugin execution within the Powerlines engine. This state includes information about the name and type of the execution, as well as any relevant metadata such as the order of hook execution or the timestamp of when the execution started. This state can be used for logging, debugging, and other purposes to provide insight into the behavior of the Powerlines engine during its operation.
51
+ */
52
+ interface ExecutionPluginScopeState extends ExecutionScopeState {
53
+ /**
54
+ * The type of execution scope, which can be "command", "hook", or "plugin". This indicates whether the execution state represents a command being executed, a hook being executed, or a plugin being executed.
55
+ */
56
+ type: "plugin";
57
+ }
58
+ /**
59
+ * The execution state for the Powerlines engine, which includes information about the currently active command, hook, and plugin executions. This state can be used for logging, debugging, and other purposes to provide insight into the behavior of the Powerlines engine during its operation.
60
+ */
61
+ interface ExecutionState {
62
+ /**
63
+ * The currently active command execution for this execution context
64
+ */
65
+ command: ExecutionCommandScopeState | null;
66
+ /**
67
+ * The currently active hook execution for this execution context, if any
68
+ */
69
+ hook: ExecutionHookScopeState | null;
70
+ /**
71
+ * The currently active plugin execution for this execution context, if any
72
+ */
73
+ plugin: ExecutionPluginScopeState | null;
74
+ }
75
+ /**
76
+ * The execution context for a command, hook, or plugin execution within the Powerlines engine. This context includes information about the name and type of the execution, as well as any relevant metadata such as the order of hook execution or the timestamp of when the execution started. This context can be used for logging, debugging, and other purposes to provide insight into the behavior of the Powerlines engine during its operation.
77
+ */
78
+ interface EngineExecutionItem {
79
+ /**
80
+ * A unique identifier for the current invocation (a single invocation can include multiple executions).
81
+ */
82
+ invocationId: string;
83
+ /**
84
+ * The method being executed, which can be one of the supported Powerlines execution API methods such as "build", "docs", or "deploy". This indicates the specific command or action that is being executed within the Powerlines engine.
85
+ */
86
+ method: string;
87
+ /**
88
+ * The options provided to the Powerlines process for this execution
89
+ */
90
+ options: EngineExecutionOptions;
91
+ /**
92
+ * The parsed user configuration file provided to the Powerlines process before any resolution or merging
93
+ */
94
+ configFile: ParsedUserConfig;
95
+ /**
96
+ * An object representing the currently active command, hook, and plugin executions for this execution context
97
+ */
98
+ state: ExecutionState;
99
+ }
100
+ /**
101
+ * The Powerlines engine context.
102
+ *
103
+ * @remarks
104
+ * This context is used during the execution of the Powerlines engine, providing access to the input user configurations.
105
+ */
106
+ interface EngineContext<TSystemContext = unknown> extends BaseContext<TSystemContext>, Pick<Required<EngineOptions>, "framework"> {
107
+ /**
108
+ * The options provided to the Powerlines process
109
+ */
110
+ options: EngineOptions;
111
+ /**
112
+ * The metadata information for the RPC connection
113
+ */
114
+ connection: ConnectionMeta;
115
+ /**
116
+ * The [Devframe](https://devtools.vite.dev/devframe/guide/) context for interacting with the DevTools.
117
+ *
118
+ * @see https://devtools.vite.dev/devframe/guide/
119
+ * @see https://github.com/vitejs/devtools/blob/main/devframe
120
+ */
121
+ devtools: DevToolsNodeContext;
122
+ /**
123
+ * A list of all command executions that will be run during the lifecycle of the engine
124
+ */
125
+ executions: EngineExecutionItem[];
126
+ /**
127
+ * Initialize the context with the provided configuration options
128
+ *
129
+ * @remarks
130
+ * 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.
131
+ */
132
+ loadExecutions: (method: string, inlineConfig: InlineConfig) => Promise<EngineExecutionItem[]>;
133
+ /**
134
+ * 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.
135
+ *
136
+ * @param invocationId - The unique identifier for the invocation of the execution to be completed.
137
+ * @param executionId - The unique identifier for the specific execution to be completed.
138
+ */
139
+ completeExecution: (invocationId: string, executionId: string) => void;
140
+ }
141
+ interface EngineSystemContext {
142
+ /**
143
+ * The RPC client instance used for communication between the engine and its worker threads, allowing for remote procedure calls to be made between the main thread and worker threads for tasks such as logging, file system operations, and other interactions that require communication between the different execution contexts within the Powerlines engine.
144
+ */
145
+ rpc: RpcClient;
146
+ }
147
+ //#endregion
148
+ export { ExecutionHookScopeState as a, ExecutionScopeType as c, ExecutionCommandScopeState as i, ExecutionState as l, EngineExecutionItem as n, ExecutionPluginScopeState as o, EngineSystemContext as r, ExecutionScopeState as s, EngineContext as t };
149
+ //# sourceMappingURL=context-DzgsMSWr.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context-DzgsMSWr.d.mts","names":[],"sources":["../src/types/context.ts"],"mappings":";;;;;;AA0BA;;KAAY,kBAAA;;;AAKZ;UAAiB,mBAAA;;;;EAIf,SAAA;EAUA;;;EALA,IAAA;EAWe;;;EANf,IAAA,EAAM,kBAAA;AAAA;AAgBR;;;AAAA,UAViB,0BAAA,SAAmC,mBAAA;EAUH;;;EAN/C,IAAA;AAAA;AAqBF;;;AAAA,UAfiB,uBAAA,SAAgC,mBAAA;EAmB3C;AAMN;;EArBE,KAAA;EAyBS;;;EApBT,IAAA;AAAA;;;;UAMe,yBAAA,SAAkC,mBAAA;EAwBjD;;;EApBA,IAAA;AAAA;;;;UAMe,cAAA;EA4CR;;;EAxCP,OAAA,EAAS,0BAAA;EAyBT;;;EApBA,IAAA,EAAM,uBAAA;EA8BM;;;EAzBZ,MAAA,EAAQ,yBAAA;AAAA;AAuCV;;;AAAA,UAjCiB,mBAAA;EAoCC;;;EAhChB,YAAA;EAiDU;;;EA5CV,MAAA;EA4DK;;;EAvDL,OAAA,EAAS,sBAAA;EAsBH;;;EAjBN,UAAA,EAAY,gBAAA;EAiBV;;;EAZF,KAAA,EAAO,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"}
@@ -0,0 +1,149 @@
1
+ import { n as EngineOptions, t as EngineExecutionOptions, u as RpcClient } from "./config-D6xUniHh.cjs";
2
+ import { BaseContext, InlineConfig, ParsedUserConfig } from "@powerlines/core";
3
+ import { ConnectionMeta, DevToolsNodeContext } from "devframe/types";
4
+
5
+ //#region src/types/context.d.ts
6
+ /**
7
+ * The execution scope state represents the current state of a command, hook, or plugin execution within the Powerlines engine. It includes information about the name and type of the execution, as well as any relevant metadata such as the order of hook execution or the timestamp of when the execution started. This state can be used for logging, debugging, and other purposes to provide insight into the behavior of the Powerlines engine during its operation.
8
+ */
9
+ type ExecutionScopeType = "command" | "hook" | "plugin";
10
+ /**
11
+ * The execution state for a command, hook, or plugin execution within the Powerlines engine. This state includes information about the name and type of the execution, as well as any relevant metadata such as the order of hook execution or the timestamp of when the execution started. This state can be used for logging, debugging, and other purposes to provide insight into the behavior of the Powerlines engine during its operation.
12
+ */
13
+ interface ExecutionScopeState {
14
+ /**
15
+ * The timestamp when the command, hook, or plugin execution started
16
+ */
17
+ timestamp: number;
18
+ /**
19
+ * The name of the command, hook, or plugin being executed
20
+ */
21
+ name: string;
22
+ /**
23
+ * The type of execution scope, which can be "command", "hook", or "plugin". This indicates whether the execution state represents a command being executed, a hook being executed, or a plugin being executed.
24
+ */
25
+ type: ExecutionScopeType;
26
+ }
27
+ /**
28
+ * The execution state for a command execution within the Powerlines engine. This state includes information about the name and type of the execution, as well as any relevant metadata such as the order of hook execution or the timestamp of when the execution started. This state can be used for logging, debugging, and other purposes to provide insight into the behavior of the Powerlines engine during its operation.
29
+ */
30
+ interface ExecutionCommandScopeState extends ExecutionScopeState {
31
+ /**
32
+ * The type of execution scope, which can be "command", "hook", or "plugin". This indicates whether the execution state represents a command being executed, a hook being executed, or a plugin being executed.
33
+ */
34
+ type: "command";
35
+ }
36
+ /**
37
+ * The execution state for a hook execution within the Powerlines engine. This state includes information about the name and type of the execution, as well as any relevant metadata such as the order of hook execution or the timestamp of when the execution started. This state can be used for logging, debugging, and other purposes to provide insight into the behavior of the Powerlines engine during its operation.
38
+ */
39
+ interface ExecutionHookScopeState extends ExecutionScopeState {
40
+ /**
41
+ * The order of the hook being executed, which can be "pre", "post", or "normal". This indicates whether the hook is being executed
42
+ */
43
+ order?: "pre" | "post";
44
+ /**
45
+ * The type of execution scope, which can be "command", "hook", or "plugin". This indicates whether the execution state represents a command being executed, a hook being executed, or a plugin being executed.
46
+ */
47
+ type: "hook";
48
+ }
49
+ /**
50
+ * The execution state for a plugin execution within the Powerlines engine. This state includes information about the name and type of the execution, as well as any relevant metadata such as the order of hook execution or the timestamp of when the execution started. This state can be used for logging, debugging, and other purposes to provide insight into the behavior of the Powerlines engine during its operation.
51
+ */
52
+ interface ExecutionPluginScopeState extends ExecutionScopeState {
53
+ /**
54
+ * The type of execution scope, which can be "command", "hook", or "plugin". This indicates whether the execution state represents a command being executed, a hook being executed, or a plugin being executed.
55
+ */
56
+ type: "plugin";
57
+ }
58
+ /**
59
+ * The execution state for the Powerlines engine, which includes information about the currently active command, hook, and plugin executions. This state can be used for logging, debugging, and other purposes to provide insight into the behavior of the Powerlines engine during its operation.
60
+ */
61
+ interface ExecutionState {
62
+ /**
63
+ * The currently active command execution for this execution context
64
+ */
65
+ command: ExecutionCommandScopeState | null;
66
+ /**
67
+ * The currently active hook execution for this execution context, if any
68
+ */
69
+ hook: ExecutionHookScopeState | null;
70
+ /**
71
+ * The currently active plugin execution for this execution context, if any
72
+ */
73
+ plugin: ExecutionPluginScopeState | null;
74
+ }
75
+ /**
76
+ * The execution context for a command, hook, or plugin execution within the Powerlines engine. This context includes information about the name and type of the execution, as well as any relevant metadata such as the order of hook execution or the timestamp of when the execution started. This context can be used for logging, debugging, and other purposes to provide insight into the behavior of the Powerlines engine during its operation.
77
+ */
78
+ interface EngineExecutionItem {
79
+ /**
80
+ * A unique identifier for the current invocation (a single invocation can include multiple executions).
81
+ */
82
+ invocationId: string;
83
+ /**
84
+ * The method being executed, which can be one of the supported Powerlines execution API methods such as "build", "docs", or "deploy". This indicates the specific command or action that is being executed within the Powerlines engine.
85
+ */
86
+ method: string;
87
+ /**
88
+ * The options provided to the Powerlines process for this execution
89
+ */
90
+ options: EngineExecutionOptions;
91
+ /**
92
+ * The parsed user configuration file provided to the Powerlines process before any resolution or merging
93
+ */
94
+ configFile: ParsedUserConfig;
95
+ /**
96
+ * An object representing the currently active command, hook, and plugin executions for this execution context
97
+ */
98
+ state: ExecutionState;
99
+ }
100
+ /**
101
+ * The Powerlines engine context.
102
+ *
103
+ * @remarks
104
+ * This context is used during the execution of the Powerlines engine, providing access to the input user configurations.
105
+ */
106
+ interface EngineContext<TSystemContext = unknown> extends BaseContext<TSystemContext>, Pick<Required<EngineOptions>, "framework"> {
107
+ /**
108
+ * The options provided to the Powerlines process
109
+ */
110
+ options: EngineOptions;
111
+ /**
112
+ * The metadata information for the RPC connection
113
+ */
114
+ connection: ConnectionMeta;
115
+ /**
116
+ * The [Devframe](https://devtools.vite.dev/devframe/guide/) context for interacting with the DevTools.
117
+ *
118
+ * @see https://devtools.vite.dev/devframe/guide/
119
+ * @see https://github.com/vitejs/devtools/blob/main/devframe
120
+ */
121
+ devtools: DevToolsNodeContext;
122
+ /**
123
+ * A list of all command executions that will be run during the lifecycle of the engine
124
+ */
125
+ executions: EngineExecutionItem[];
126
+ /**
127
+ * Initialize the context with the provided configuration options
128
+ *
129
+ * @remarks
130
+ * 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.
131
+ */
132
+ loadExecutions: (method: string, inlineConfig: InlineConfig) => Promise<EngineExecutionItem[]>;
133
+ /**
134
+ * 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.
135
+ *
136
+ * @param invocationId - The unique identifier for the invocation of the execution to be completed.
137
+ * @param executionId - The unique identifier for the specific execution to be completed.
138
+ */
139
+ completeExecution: (invocationId: string, executionId: string) => void;
140
+ }
141
+ interface EngineSystemContext {
142
+ /**
143
+ * The RPC client instance used for communication between the engine and its worker threads, allowing for remote procedure calls to be made between the main thread and worker threads for tasks such as logging, file system operations, and other interactions that require communication between the different execution contexts within the Powerlines engine.
144
+ */
145
+ rpc: RpcClient;
146
+ }
147
+ //#endregion
148
+ export { ExecutionHookScopeState as a, ExecutionScopeType as c, ExecutionCommandScopeState as i, ExecutionState as l, EngineExecutionItem as n, ExecutionPluginScopeState as o, EngineSystemContext as r, ExecutionScopeState as s, EngineContext as t };
149
+ //# sourceMappingURL=context-epL7NPvL.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context-epL7NPvL.d.cts","names":[],"sources":["../src/types/context.ts"],"mappings":";;;;;;AA0BA;;KAAY,kBAAA;;;AAKZ;UAAiB,mBAAA;;;;EAIf,SAAA;EAUA;;;EALA,IAAA;EAWe;;;EANf,IAAA,EAAM,kBAAA;AAAA;AAgBR;;;AAAA,UAViB,0BAAA,SAAmC,mBAAA;EAUH;;;EAN/C,IAAA;AAAA;AAqBF;;;AAAA,UAfiB,uBAAA,SAAgC,mBAAA;EAmB3C;AAMN;;EArBE,KAAA;EAyBS;;;EApBT,IAAA;AAAA;;;;UAMe,yBAAA,SAAkC,mBAAA;EAwBjD;;;EApBA,IAAA;AAAA;;;;UAMe,cAAA;EA4CR;;;EAxCP,OAAA,EAAS,0BAAA;EAyBT;;;EApBA,IAAA,EAAM,uBAAA;EA8BM;;;EAzBZ,MAAA,EAAQ,yBAAA;AAAA;AAuCV;;;AAAA,UAjCiB,mBAAA;EAoCC;;;EAhChB,YAAA;EAiDU;;;EA5CV,MAAA;EA4DK;;;EAvDL,OAAA,EAAS,sBAAA;EAsBH;;;EAjBN,UAAA,EAAY,gBAAA;EAiBV;;;EAZF,KAAA,EAAO,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"}
@@ -0,0 +1,54 @@
1
+ import { n as EngineOptions } from "./config-BNe23XHx.mjs";
2
+ import { n as EngineExecutionItem, t as EngineContext } from "./context-DzgsMSWr.mjs";
3
+ import { PowerlinesBaseContext } from "@powerlines/core/context/base-context";
4
+ import { EnvPaths } from "@stryke/env/get-env-paths";
5
+ import * as _$_powerlines_core0 from "@powerlines/core";
6
+ import { FrameworkOptions, InlineConfig, LogFn, LoggerOptions } from "@powerlines/core";
7
+ import { ConnectionMeta, DevToolsHost, DevToolsNodeContext } from "devframe/types";
8
+
9
+ //#region src/context/engine-context.d.ts
10
+ declare class PowerlinesEngineContext<TSystemContext = unknown> extends PowerlinesBaseContext<TSystemContext> implements EngineContext<TSystemContext> {
11
+ #private;
12
+ options: EngineOptions;
13
+ connection: ConnectionMeta;
14
+ /**
15
+ * Creates a new instance of the PowerlinesEngineContext class.
16
+ *
17
+ * @param options - The options to initialize the context with.
18
+ * @returns A promise that resolves to an instance of the PowerlinesEngineContext class.
19
+ */
20
+ static from<TSystemContext = unknown>(options: EngineOptions, host: DevToolsHost, connection: ConnectionMeta): Promise<PowerlinesEngineContext<TSystemContext>>;
21
+ createLogger(options?: LoggerOptions, logFn?: LogFn): _$_powerlines_core0.Logger;
22
+ get executions(): EngineExecutionItem[];
23
+ get devtools(): DevToolsNodeContext;
24
+ get envPaths(): EnvPaths;
25
+ get framework(): FrameworkOptions;
26
+ get orgId(): string;
27
+ /**
28
+ * Creates a new Context instance.
29
+ *
30
+ * @param options - The options to use for creating the context, including the resolved configuration and workspace settings.
31
+ * @param connection - The connection metadata for the dev server.
32
+ */
33
+ protected constructor(options: EngineOptions, connection: ConnectionMeta);
34
+ /**
35
+ * Initialize the context with the provided configuration options
36
+ *
37
+ * @remarks
38
+ * 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.
39
+ *
40
+ * @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.
41
+ * @param inlineConfig - Additional configuration options provided at runtime, which can override or supplement the options defined in the user configuration file.
42
+ */
43
+ loadExecutions(method: string, inlineConfig: InlineConfig): Promise<EngineExecutionItem[]>;
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.
46
+ *
47
+ * @param invocationId - The unique identifier for the invocation of the execution to be completed.
48
+ * @param executionId - The unique identifier for the specific execution to be completed.
49
+ */
50
+ completeExecution(invocationId: string, executionId: string): void;
51
+ }
52
+ //#endregion
53
+ export { PowerlinesEngineContext as t };
54
+ //# sourceMappingURL=engine-context-DEotmVzB.d.mts.map
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,54 @@
1
+ import { n as EngineOptions } from "./config-D6xUniHh.cjs";
2
+ import { n as EngineExecutionItem, t as EngineContext } from "./context-epL7NPvL.cjs";
3
+ import * as _$_powerlines_core0 from "@powerlines/core";
4
+ import { FrameworkOptions, InlineConfig, LogFn, LoggerOptions } from "@powerlines/core";
5
+ import { ConnectionMeta, DevToolsHost, DevToolsNodeContext } from "devframe/types";
6
+ import { PowerlinesBaseContext } from "@powerlines/core/context/base-context";
7
+ import { EnvPaths } from "@stryke/env/get-env-paths";
8
+
9
+ //#region src/context/engine-context.d.ts
10
+ declare class PowerlinesEngineContext<TSystemContext = unknown> extends PowerlinesBaseContext<TSystemContext> implements EngineContext<TSystemContext> {
11
+ #private;
12
+ options: EngineOptions;
13
+ connection: ConnectionMeta;
14
+ /**
15
+ * Creates a new instance of the PowerlinesEngineContext class.
16
+ *
17
+ * @param options - The options to initialize the context with.
18
+ * @returns A promise that resolves to an instance of the PowerlinesEngineContext class.
19
+ */
20
+ static from<TSystemContext = unknown>(options: EngineOptions, host: DevToolsHost, connection: ConnectionMeta): Promise<PowerlinesEngineContext<TSystemContext>>;
21
+ createLogger(options?: LoggerOptions, logFn?: LogFn): _$_powerlines_core0.Logger;
22
+ get executions(): EngineExecutionItem[];
23
+ get devtools(): DevToolsNodeContext;
24
+ get envPaths(): EnvPaths;
25
+ get framework(): FrameworkOptions;
26
+ get orgId(): string;
27
+ /**
28
+ * Creates a new Context instance.
29
+ *
30
+ * @param options - The options to use for creating the context, including the resolved configuration and workspace settings.
31
+ * @param connection - The connection metadata for the dev server.
32
+ */
33
+ protected constructor(options: EngineOptions, connection: ConnectionMeta);
34
+ /**
35
+ * Initialize the context with the provided configuration options
36
+ *
37
+ * @remarks
38
+ * 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.
39
+ *
40
+ * @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.
41
+ * @param inlineConfig - Additional configuration options provided at runtime, which can override or supplement the options defined in the user configuration file.
42
+ */
43
+ loadExecutions(method: string, inlineConfig: InlineConfig): Promise<EngineExecutionItem[]>;
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.
46
+ *
47
+ * @param invocationId - The unique identifier for the invocation of the execution to be completed.
48
+ * @param executionId - The unique identifier for the specific execution to be completed.
49
+ */
50
+ completeExecution(invocationId: string, executionId: string): void;
51
+ }
52
+ //#endregion
53
+ export { PowerlinesEngineContext as t };
54
+ //# sourceMappingURL=engine-context-Dw8odBCo.d.cts.map
@@ -0,0 +1 @@
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"}