@powerlines/engine 0.47.4 → 0.49.1

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 (249) 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 +28 -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 +24 -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 +24 -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 +27 -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 +68 -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 +27 -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 +70 -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-BgyEi2hF.d.mts +138 -0
  65. package/dist/api-BgyEi2hF.d.mts.map +1 -0
  66. package/dist/api-DcHfCjQK.d.cts +138 -0
  67. package/dist/api-DcHfCjQK.d.cts.map +1 -0
  68. package/dist/api.cjs +39 -1268
  69. package/dist/api.d.cts +11 -300
  70. package/dist/api.d.cts.map +1 -1
  71. package/dist/api.d.mts +11 -300
  72. package/dist/api.d.mts.map +1 -1
  73. package/dist/api.mjs +31 -1264
  74. package/dist/api.mjs.map +1 -1
  75. package/dist/config-ByLyzMI0.d.mts +204 -0
  76. package/dist/config-ByLyzMI0.d.mts.map +1 -0
  77. package/dist/config-DKEmqMrh.d.cts +204 -0
  78. package/dist/config-DKEmqMrh.d.cts.map +1 -0
  79. package/dist/context/engine-context.cjs +177 -0
  80. package/dist/context/engine-context.d.cts +2 -0
  81. package/dist/context/engine-context.d.mts +2 -0
  82. package/dist/context/engine-context.mjs +175 -0
  83. package/dist/context/engine-context.mjs.map +1 -0
  84. package/dist/context/index.cjs +2 -9
  85. package/dist/context/index.d.cts +2 -150
  86. package/dist/context/index.d.mts +2 -150
  87. package/dist/context/index.mjs +2 -4
  88. package/dist/context-D0_a0kRO.d.cts +149 -0
  89. package/dist/context-D0_a0kRO.d.cts.map +1 -0
  90. package/dist/context-DcXV6_GL.d.mts +149 -0
  91. package/dist/context-DcXV6_GL.d.mts.map +1 -0
  92. package/dist/engine-Dz6BvkFY.cjs +590 -0
  93. package/dist/engine-context-B8K6Jtkk.d.cts +53 -0
  94. package/dist/engine-context-B8K6Jtkk.d.cts.map +1 -0
  95. package/dist/engine-context-DKlA5Pgu.d.mts +53 -0
  96. package/dist/engine-context-DKlA5Pgu.d.mts.map +1 -0
  97. package/dist/engine-q6YKXXcB.mjs +571 -0
  98. package/dist/engine-q6YKXXcB.mjs.map +1 -0
  99. package/dist/engine.cjs +6 -0
  100. package/dist/engine.d.cts +143 -0
  101. package/dist/engine.d.cts.map +1 -0
  102. package/dist/engine.d.mts +143 -0
  103. package/dist/engine.d.mts.map +1 -0
  104. package/dist/engine.mjs +3 -0
  105. package/dist/helpers/create-execution-host.cjs +57 -0
  106. package/dist/helpers/create-execution-host.d.cts +20 -0
  107. package/dist/helpers/create-execution-host.d.cts.map +1 -0
  108. package/dist/helpers/create-execution-host.d.mts +20 -0
  109. package/dist/helpers/create-execution-host.d.mts.map +1 -0
  110. package/dist/helpers/create-execution-host.mjs +57 -0
  111. package/dist/helpers/create-execution-host.mjs.map +1 -0
  112. package/dist/helpers/finalize.cjs +26 -0
  113. package/dist/helpers/finalize.d.cts +12 -0
  114. package/dist/helpers/finalize.d.cts.map +1 -0
  115. package/dist/helpers/finalize.d.mts +12 -0
  116. package/dist/helpers/finalize.d.mts.map +1 -0
  117. package/dist/helpers/finalize.mjs +26 -0
  118. package/dist/helpers/finalize.mjs.map +1 -0
  119. package/dist/helpers/index.cjs +12 -0
  120. package/dist/helpers/index.d.cts +5 -0
  121. package/dist/helpers/index.d.mts +5 -0
  122. package/dist/helpers/index.mjs +6 -0
  123. package/dist/helpers/rpc.cjs +139 -0
  124. package/dist/helpers/rpc.d.cts +7 -0
  125. package/dist/helpers/rpc.d.cts.map +1 -0
  126. package/dist/helpers/rpc.d.mts +7 -0
  127. package/dist/helpers/rpc.d.mts.map +1 -0
  128. package/dist/helpers/rpc.mjs +139 -0
  129. package/dist/helpers/rpc.mjs.map +1 -0
  130. package/dist/helpers/stream.cjs +119 -0
  131. package/dist/helpers/stream.d.cts +45 -0
  132. package/dist/helpers/stream.d.cts.map +1 -0
  133. package/dist/helpers/stream.d.mts +45 -0
  134. package/dist/helpers/stream.d.mts.map +1 -0
  135. package/dist/helpers/stream.mjs +117 -0
  136. package/dist/helpers/stream.mjs.map +1 -0
  137. package/dist/index-BVVgDSdq.d.cts +1 -0
  138. package/dist/index-BVVgDSdq.d.mts +1 -0
  139. package/dist/index.cjs +8 -748
  140. package/dist/index.d.cts +6 -140
  141. package/dist/index.d.mts +6 -140
  142. package/dist/index.mjs +4 -747
  143. package/package.json +102 -132
  144. package/dist/_internal/worker.cjs +0 -5192
  145. package/dist/_internal/worker.d.cts +0 -46
  146. package/dist/_internal/worker.d.cts.map +0 -1
  147. package/dist/_internal/worker.d.mts +0 -46
  148. package/dist/_internal/worker.d.mts.map +0 -1
  149. package/dist/_internal/worker.mjs +0 -5153
  150. package/dist/_internal/worker.mjs.map +0 -1
  151. package/dist/base-context-DLemGRbd.cjs +0 -322
  152. package/dist/base-context-DUha4Lz-.mjs +0 -315
  153. package/dist/base-context-DUha4Lz-.mjs.map +0 -1
  154. package/dist/context/index.d.cts.map +0 -1
  155. package/dist/context/index.d.mts.map +0 -1
  156. package/dist/engine-context-BfFiKN53.mjs +0 -86
  157. package/dist/engine-context-BfFiKN53.mjs.map +0 -1
  158. package/dist/engine-context-D0y88i_J.cjs +0 -91
  159. package/dist/execution-context-CE5H90Um.mjs +0 -2845
  160. package/dist/execution-context-CE5H90Um.mjs.map +0 -1
  161. package/dist/execution-context-CnyaM3Ul.cjs +0 -2889
  162. package/dist/execution-context-NyDjVZ6T.d.cts +0 -647
  163. package/dist/execution-context-NyDjVZ6T.d.cts.map +0 -1
  164. package/dist/execution-context-YrjFeD9k.d.mts +0 -647
  165. package/dist/execution-context-YrjFeD9k.d.mts.map +0 -1
  166. package/dist/fs-CeEdzPKE.cjs +0 -262
  167. package/dist/fs-Dcle8lUp.mjs +0 -226
  168. package/dist/fs-Dcle8lUp.mjs.map +0 -1
  169. package/dist/index.d.cts.map +0 -1
  170. package/dist/index.d.mts.map +0 -1
  171. package/dist/index.mjs.map +0 -1
  172. package/dist/rpc/client.cjs +0 -74
  173. package/dist/rpc/client.d.cts +0 -31
  174. package/dist/rpc/client.d.cts.map +0 -1
  175. package/dist/rpc/client.d.mts +0 -31
  176. package/dist/rpc/client.d.mts.map +0 -1
  177. package/dist/rpc/client.mjs +0 -71
  178. package/dist/rpc/client.mjs.map +0 -1
  179. package/dist/rpc/serialization.cjs +0 -82
  180. package/dist/rpc/serialization.d.cts +0 -46
  181. package/dist/rpc/serialization.d.cts.map +0 -1
  182. package/dist/rpc/serialization.d.mts +0 -46
  183. package/dist/rpc/serialization.d.mts.map +0 -1
  184. package/dist/rpc/serialization.mjs +0 -76
  185. package/dist/rpc/serialization.mjs.map +0 -1
  186. package/dist/rpc/server.cjs +0 -69
  187. package/dist/rpc/server.d.cts +0 -29
  188. package/dist/rpc/server.d.cts.map +0 -1
  189. package/dist/rpc/server.d.mts +0 -29
  190. package/dist/rpc/server.d.mts.map +0 -1
  191. package/dist/rpc/server.mjs +0 -66
  192. package/dist/rpc/server.mjs.map +0 -1
  193. package/dist/rpc/types.cjs +0 -0
  194. package/dist/rpc/types.d.cts +0 -70
  195. package/dist/rpc/types.d.cts.map +0 -1
  196. package/dist/rpc/types.d.mts +0 -70
  197. package/dist/rpc/types.d.mts.map +0 -1
  198. package/dist/rpc/types.mjs +0 -1
  199. package/dist/schemas.cjs +0 -9
  200. package/dist/schemas.d.cts +0 -127
  201. package/dist/schemas.d.cts.map +0 -1
  202. package/dist/schemas.d.mts +0 -127
  203. package/dist/schemas.d.mts.map +0 -1
  204. package/dist/schemas.mjs +0 -3
  205. package/dist/storage/base.cjs +0 -216
  206. package/dist/storage/base.d.cts +0 -199
  207. package/dist/storage/base.d.cts.map +0 -1
  208. package/dist/storage/base.d.mts +0 -199
  209. package/dist/storage/base.d.mts.map +0 -1
  210. package/dist/storage/base.mjs +0 -215
  211. package/dist/storage/base.mjs.map +0 -1
  212. package/dist/storage/file-system.cjs +0 -180
  213. package/dist/storage/file-system.d.cts +0 -127
  214. package/dist/storage/file-system.d.cts.map +0 -1
  215. package/dist/storage/file-system.d.mts +0 -127
  216. package/dist/storage/file-system.d.mts.map +0 -1
  217. package/dist/storage/file-system.mjs +0 -179
  218. package/dist/storage/file-system.mjs.map +0 -1
  219. package/dist/storage/helpers.cjs +0 -37
  220. package/dist/storage/helpers.d.cts +0 -25
  221. package/dist/storage/helpers.d.cts.map +0 -1
  222. package/dist/storage/helpers.d.mts +0 -25
  223. package/dist/storage/helpers.d.mts.map +0 -1
  224. package/dist/storage/helpers.mjs +0 -34
  225. package/dist/storage/helpers.mjs.map +0 -1
  226. package/dist/storage/index.cjs +0 -12
  227. package/dist/storage/index.d.cts +0 -5
  228. package/dist/storage/index.d.mts +0 -5
  229. package/dist/storage/index.mjs +0 -6
  230. package/dist/storage/virtual.cjs +0 -98
  231. package/dist/storage/virtual.d.cts +0 -80
  232. package/dist/storage/virtual.d.cts.map +0 -1
  233. package/dist/storage/virtual.d.mts +0 -80
  234. package/dist/storage/virtual.d.mts.map +0 -1
  235. package/dist/storage/virtual.mjs +0 -97
  236. package/dist/storage/virtual.mjs.map +0 -1
  237. package/dist/ts-morph-BbM83PT9.cjs +0 -114
  238. package/dist/ts-morph-C6YBNc46.mjs +0 -102
  239. package/dist/ts-morph-C6YBNc46.mjs.map +0 -1
  240. package/dist/tsconfig-DeKMGasE.cjs +0 -198
  241. package/dist/tsconfig-HzJsMUrr.mjs +0 -155
  242. package/dist/tsconfig-HzJsMUrr.mjs.map +0 -1
  243. package/dist/typescript/index.cjs +0 -13
  244. package/dist/typescript/index.d.cts +0 -106
  245. package/dist/typescript/index.d.cts.map +0 -1
  246. package/dist/typescript/index.d.mts +0 -106
  247. package/dist/typescript/index.d.mts.map +0 -1
  248. package/dist/typescript/index.mjs +0 -4
  249. /package/dist/{chunk-C0xms8kb.cjs → chunk-C_NdSu1c.cjs} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.mts","names":[],"sources":["../../src/api/types.ts"],"mappings":";;;;;;;AA8CA;;;;;;iBAAsB,KAAA,yBACI,oBAAA,yBACD,mBAAA,CAAA,CACvB,OAAA,EAAS,gBAAA,CAAiB,eAAA,EAAiB,cAAA,IAAe,OAAA"}
@@ -0,0 +1,70 @@
1
+ import { prepare } from "./prepare.mjs";
2
+ import { executeEnvironments } from "@powerlines/core/lib/environment";
3
+ import { handleTypes } from "@powerlines/core/lib/generate-types";
4
+ import { installDependencies } from "@powerlines/core/lib/install-dependencies";
5
+ import { writeMetaFile } from "@powerlines/core/lib/meta";
6
+ import { initializeTsconfig, resolveTsconfig } from "@powerlines/core/lib/typescript/tsconfig";
7
+ import { format } from "@powerlines/core/lib/utilities/format";
8
+ import { toArray } from "@stryke/convert/to-array";
9
+ import { createDirectory } from "@stryke/fs/helpers";
10
+ import { isObject } from "@stryke/type-checks/is-object";
11
+ import { formatLogMessage } from "@storm-software/config-tools/logger";
12
+ import { omit } from "@stryke/helpers/omit";
13
+ import { isSetObject } from "@stryke/type-checks/is-set-object";
14
+
15
+ //#region src/api/types.ts
16
+ /**
17
+ * Generate runtime types for the Powerlines project.
18
+ *
19
+ * @remarks
20
+ * This function is responsible for generating TypeScript declaration files based on the project's configuration and environment. It executes hooks at various stages of the type generation process, allowing for customization and extension by plugins. The generated types are formatted and written to the appropriate location in the project's file system, ensuring that they are available for use by other parts of the Powerlines system and by end-users of the project.
21
+ *
22
+ * @param context - The execution context for the build process, which provides access to the project configuration, environment, and utility functions for performing the build. The context is used to manage the state and behavior of the build process, allowing for hooks to be called at different stages of the build and for environment-specific configurations to be applied.
23
+ */
24
+ async function types(context) {
25
+ const timer = context.timer("Type Generation");
26
+ context.debug(" Aggregating configuration options for the Powerlines project");
27
+ await executeEnvironments(context, async (env) => {
28
+ env.debug(`Initializing the processing options for the Powerlines project.`);
29
+ await context.callHook("configResolved", {
30
+ environment: env,
31
+ order: "pre"
32
+ });
33
+ await initializeTsconfig(env);
34
+ await context.callHook("configResolved", {
35
+ environment: env,
36
+ order: "normal"
37
+ });
38
+ if (env.entry.length > 0) env.debug(`The configuration provided ${isObject(env.config.input) ? Object.keys(env.config.input).length : toArray(env.config.input).length} entry point(s), Powerlines has found ${env.entry.length} entry files(s) for the ${env.config.title} project${env.entry.length > 0 && env.entry.length < 10 ? `: \n${env.entry.map((entry) => `- ${entry.file}${entry.output ? ` -> ${entry.output}` : ""}`).join(" \n")}` : ""}`);
39
+ else env.warn(`No entry files were found for the ${env.config.title} project. Please ensure this is correct. Powerlines plugins generally require at least one entry point to function properly.`);
40
+ await resolveTsconfig(env);
41
+ await installDependencies(env);
42
+ await context.callHook("configResolved", {
43
+ environment: env,
44
+ order: "post"
45
+ });
46
+ context.trace(`Powerlines configuration has been resolved: \n\n${formatLogMessage({
47
+ ...env.config,
48
+ userConfig: isSetObject(env.config.userConfig) ? omit(env.config.userConfig, ["plugins"]) : void 0,
49
+ inlineConfig: isSetObject(env.config.inlineConfig) ? env.config.inlineConfig : void 0,
50
+ plugins: env.plugins.map((plugin) => plugin.name)
51
+ })}`);
52
+ if (!env.fs.existsSync(env.cachePath)) await createDirectory(env.cachePath);
53
+ if (!env.fs.existsSync(env.dataPath)) await createDirectory(env.dataPath);
54
+ if (env.config.skipCache === true || env.persistedMeta?.checksum !== env.meta.checksum) env.debug(`Using previously prepared files as the meta checksum has not changed.`);
55
+ else {
56
+ env.info(`Running \`prepare\` command as the meta checksum has changed since the last run.`);
57
+ await prepare(context, true);
58
+ }
59
+ await handleTypes(context, env);
60
+ context.debug("Formatting files generated during the types step.");
61
+ await format(env, env.typesPath, await env.fs.read(env.typesPath) ?? "");
62
+ await writeMetaFile(env);
63
+ env.persistedMeta = env.meta;
64
+ });
65
+ timer();
66
+ }
67
+
68
+ //#endregion
69
+ export { types };
70
+ //# sourceMappingURL=types.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.mjs","names":[],"sources":["../../src/api/types.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { executeEnvironments } from \"@powerlines/core/lib/environment\";\nimport { handleTypes } from \"@powerlines/core/lib/generate-types\";\nimport { installDependencies } from \"@powerlines/core/lib/install-dependencies\";\nimport { writeMetaFile } from \"@powerlines/core/lib/meta\";\nimport {\n initializeTsconfig,\n resolveTsconfig\n} from \"@powerlines/core/lib/typescript/tsconfig\";\nimport { format } from \"@powerlines/core/lib/utilities/format\";\nimport { ExecutionContext } from \"@powerlines/core/types/context\";\nimport { formatLogMessage } from \"@storm-software/config-tools/logger\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { createDirectory } from \"@stryke/fs/helpers\";\nimport { omit } from \"@stryke/helpers/omit\";\nimport { isObject } from \"@stryke/type-checks/is-object\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { EngineResolvedConfig } from \"../types/config\";\nimport { EngineSystemContext } from \"../types/context\";\nimport { prepare } from \"./prepare\";\n\n/**\n * Generate runtime types for the Powerlines project.\n *\n * @remarks\n * This function is responsible for generating TypeScript declaration files based on the project's configuration and environment. It executes hooks at various stages of the type generation process, allowing for customization and extension by plugins. The generated types are formatted and written to the appropriate location in the project's file system, ensuring that they are available for use by other parts of the Powerlines system and by end-users of the project.\n *\n * @param context - The execution context for the build process, which provides access to the project configuration, environment, and utility functions for performing the build. The context is used to manage the state and behavior of the build process, allowing for hooks to be called at different stages of the build and for environment-specific configurations to be applied.\n */\nexport async function types<\n TResolvedConfig extends EngineResolvedConfig,\n TSystemContext extends EngineSystemContext\n>(context: ExecutionContext<TResolvedConfig, TSystemContext>) {\n const timer = context.timer(\"Type Generation\");\n context.debug(\n \" Aggregating configuration options for the Powerlines project\"\n );\n\n await executeEnvironments(context, async env => {\n env.debug(\n `Initializing the processing options for the Powerlines project.`\n );\n\n await context.callHook(\"configResolved\", {\n environment: env,\n order: \"pre\"\n });\n\n await initializeTsconfig<TResolvedConfig, TSystemContext>(env);\n\n await context.callHook(\"configResolved\", {\n environment: env,\n order: \"normal\"\n });\n\n if (env.entry.length > 0) {\n env.debug(\n `The configuration provided ${\n isObject(env.config.input)\n ? Object.keys(env.config.input).length\n : toArray(env.config.input).length\n } entry point(s), Powerlines has found ${\n env.entry.length\n } entry files(s) for the ${env.config.title} project${\n env.entry.length > 0 && env.entry.length < 10\n ? `: \\n${env.entry\n .map(\n entry =>\n `- ${entry.file}${\n entry.output ? ` -> ${entry.output}` : \"\"\n }`\n )\n .join(\" \\n\")}`\n : \"\"\n }`\n );\n } else {\n env.warn(\n `No entry files were found for the ${\n env.config.title\n } project. Please ensure this is correct. Powerlines plugins generally require at least one entry point to function properly.`\n );\n }\n\n await resolveTsconfig<TResolvedConfig, TSystemContext>(env);\n await installDependencies(env);\n\n await context.callHook(\"configResolved\", {\n environment: env,\n order: \"post\"\n });\n\n context.trace(\n `Powerlines configuration has been resolved: \\n\\n${formatLogMessage({\n ...env.config,\n userConfig: isSetObject(env.config.userConfig)\n ? omit(env.config.userConfig, [\"plugins\"])\n : undefined,\n inlineConfig: isSetObject(env.config.inlineConfig)\n ? env.config.inlineConfig\n : undefined,\n plugins: env.plugins.map(plugin => plugin.name)\n })}`\n );\n\n if (!env.fs.existsSync(env.cachePath)) {\n await createDirectory(env.cachePath);\n }\n\n if (!env.fs.existsSync(env.dataPath)) {\n await createDirectory(env.dataPath);\n }\n\n if (\n env.config.skipCache === true ||\n env.persistedMeta?.checksum !== env.meta.checksum\n ) {\n env.debug(\n `Using previously prepared files as the meta checksum has not changed.`\n );\n } else {\n env.info(\n `Running \\`prepare\\` command as the meta checksum has changed since the last run.`\n );\n\n await prepare(context, true);\n }\n\n await handleTypes(context, env);\n\n context.debug(\"Formatting files generated during the types step.\");\n\n await format(env, env.typesPath, (await env.fs.read(env.typesPath)) ?? \"\");\n\n await writeMetaFile(env);\n env.persistedMeta = env.meta;\n });\n\n timer();\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA8CA,eAAsB,MAGpB,SAA4D;CAC5D,MAAM,QAAQ,QAAQ,MAAM,iBAAiB;CAC7C,QAAQ,MACN,+DACF;CAEA,MAAM,oBAAoB,SAAS,OAAM,QAAO;EAC9C,IAAI,MACF,iEACF;EAEA,MAAM,QAAQ,SAAS,kBAAkB;GACvC,aAAa;GACb,OAAO;EACT,CAAC;EAED,MAAM,mBAAoD,GAAG;EAE7D,MAAM,QAAQ,SAAS,kBAAkB;GACvC,aAAa;GACb,OAAO;EACT,CAAC;EAED,IAAI,IAAI,MAAM,SAAS,GACrB,IAAI,MACF,8BACE,SAAS,IAAI,OAAO,KAAK,IACrB,OAAO,KAAK,IAAI,OAAO,KAAK,EAAE,SAC9B,QAAQ,IAAI,OAAO,KAAK,EAAE,OAC/B,wCACC,IAAI,MAAM,OACX,0BAA0B,IAAI,OAAO,MAAM,UAC1C,IAAI,MAAM,SAAS,KAAK,IAAI,MAAM,SAAS,KACvC,OAAO,IAAI,MACR,KACC,UACE,KAAK,MAAM,OACT,MAAM,SAAS,OAAO,MAAM,WAAW,IAE7C,EACC,KAAK,KAAK,MACb,IAER;OAEA,IAAI,KACF,qCACE,IAAI,OAAO,MACZ,6HACH;EAGF,MAAM,gBAAiD,GAAG;EAC1D,MAAM,oBAAoB,GAAG;EAE7B,MAAM,QAAQ,SAAS,kBAAkB;GACvC,aAAa;GACb,OAAO;EACT,CAAC;EAED,QAAQ,MACN,mDAAmD,iBAAiB;GAClE,GAAG,IAAI;GACP,YAAY,YAAY,IAAI,OAAO,UAAU,IACzC,KAAK,IAAI,OAAO,YAAY,CAAC,SAAS,CAAC,IACvC;GACJ,cAAc,YAAY,IAAI,OAAO,YAAY,IAC7C,IAAI,OAAO,eACX;GACJ,SAAS,IAAI,QAAQ,KAAI,WAAU,OAAO,IAAI;EAChD,CAAC,GACH;EAEA,IAAI,CAAC,IAAI,GAAG,WAAW,IAAI,SAAS,GAClC,MAAM,gBAAgB,IAAI,SAAS;EAGrC,IAAI,CAAC,IAAI,GAAG,WAAW,IAAI,QAAQ,GACjC,MAAM,gBAAgB,IAAI,QAAQ;EAGpC,IACE,IAAI,OAAO,cAAc,QACzB,IAAI,eAAe,aAAa,IAAI,KAAK,UAEzC,IAAI,MACF,uEACF;OACK;GACL,IAAI,KACF,kFACF;GAEA,MAAM,QAAQ,SAAS,IAAI;EAC7B;EAEA,MAAM,YAAY,SAAS,GAAG;EAE9B,QAAQ,MAAM,mDAAmD;EAEjE,MAAM,OAAO,KAAK,IAAI,WAAY,MAAM,IAAI,GAAG,KAAK,IAAI,SAAS,KAAM,EAAE;EAEzE,MAAM,cAAc,GAAG;EACvB,IAAI,gBAAgB,IAAI;CAC1B,CAAC;CAED,MAAM;AACR"}
@@ -0,0 +1,138 @@
1
+ import { t as EngineExecutionOptions } from "./config-ByLyzMI0.mjs";
2
+ import { t as EngineContext } from "./context-DcXV6_GL.mjs";
3
+ import { BuildInlineConfig, CleanInlineConfig, CreateInlineConfig, DeployInlineConfig, DocsInlineConfig, InlineConfig, LintInlineConfig, PrepareInlineConfig, TestInlineConfig, TypesInlineConfig } from "@powerlines/core";
4
+ import { EXECUTION_API_METHODS } from "@powerlines/core/constants/api";
5
+
6
+ //#region src/types/utils.d.ts
7
+ type Worker<TParams extends any[], TExposedMethods extends ReadonlyArray<string>> = { [K in TExposedMethods[number]]: (...params: TParams) => Promise<void> } & {
8
+ finalize: () => Promise<void>;
9
+ };
10
+ //#endregion
11
+ //#region src/types/api.d.ts
12
+ /**
13
+ * The Powerlines Base API Interface
14
+ *
15
+ * @remarks
16
+ * This interface defines the base API for Powerlines, which includes the shared context and the core commands. It is extended by the ExecutionAPI and EngineAPI interfaces to provide additional functionality specific to their respective contexts.
17
+ */
18
+ interface ExecutionInterface {
19
+ /**
20
+ * Prepare the Powerlines API
21
+ *
22
+ * @remarks
23
+ * This method will prepare the Powerlines API for use, initializing any necessary resources.
24
+ *
25
+ * @param inlineConfig - The inline configuration for the prepare command
26
+ */
27
+ prepare: (inlineConfig: PrepareInlineConfig) => Promise<void>;
28
+ /**
29
+ * Generate the Powerlines typescript declaration file
30
+ *
31
+ * @remarks
32
+ * 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.
33
+ *
34
+ * @param inlineConfig - The inline configuration for the types command
35
+ */
36
+ types: (inlineConfig: TypesInlineConfig) => Promise<void>;
37
+ /**
38
+ * Create a new Powerlines project
39
+ *
40
+ * @remarks
41
+ * This method will create a new Powerlines project in the current directory.
42
+ *
43
+ * @param inlineConfig - The inline configuration for the create command
44
+ * @returns A promise that resolves when the project has been created
45
+ */
46
+ create: (inlineConfig: CreateInlineConfig) => Promise<void>;
47
+ /**
48
+ * Clean any previously prepared artifacts
49
+ *
50
+ * @remarks
51
+ * This method will remove the previous Powerlines artifacts from the project.
52
+ *
53
+ * @param inlineConfig - The inline configuration for the clean command
54
+ * @returns A promise that resolves when the clean command has completed
55
+ */
56
+ clean: (inlineConfig: CleanInlineConfig) => Promise<void>;
57
+ /**
58
+ * Lint the project source code
59
+ *
60
+ * @param inlineConfig - The inline configuration for the lint command
61
+ * @returns A promise that resolves when the lint command has completed
62
+ */
63
+ lint: (inlineConfig: LintInlineConfig) => Promise<void>;
64
+ /**
65
+ * Test the project source code
66
+ *
67
+ * @param inlineConfig - The inline configuration for the test command
68
+ * @returns A promise that resolves when the test command has completed
69
+ */
70
+ test: (inlineConfig: TestInlineConfig) => Promise<void>;
71
+ /**
72
+ * Build the project
73
+ *
74
+ * @remarks
75
+ * This method will build the Powerlines project, generating the necessary artifacts.
76
+ *
77
+ * @param inlineConfig - The inline configuration for the build command
78
+ * @returns A promise that resolves when the build command has completed
79
+ */
80
+ build: (inlineConfig: BuildInlineConfig) => Promise<void>;
81
+ /**
82
+ * Prepare the documentation for the project
83
+ *
84
+ * @param inlineConfig - The inline configuration for the docs command
85
+ * @returns A promise that resolves when the documentation generation has completed
86
+ */
87
+ docs: (inlineConfig: DocsInlineConfig) => Promise<void>;
88
+ /**
89
+ * Deploy the project source code
90
+ *
91
+ * @remarks
92
+ * This method will prepare and build the Powerlines project, generating the necessary artifacts for the deployment.
93
+ *
94
+ * @param inlineConfig - The inline configuration for the deploy command
95
+ */
96
+ deploy: (inlineConfig: DeployInlineConfig) => Promise<void>;
97
+ /**
98
+ * Finalization process
99
+ *
100
+ * @remarks
101
+ * This step includes any final processes or clean up required by Powerlines. It will be run after each Powerlines command.
102
+ *
103
+ * @returns A promise that resolves when the finalization process has completed
104
+ */
105
+ finalize: () => Promise<void>;
106
+ }
107
+ interface ExecutionHostParams {
108
+ /**
109
+ * The {@link MessagePort} used for communication between the execution host and the engine. This port will be used to send and receive messages, allowing the execution host to invoke API methods and return results to the engine.
110
+ */
111
+ port: MessagePort;
112
+ /**
113
+ * The execution options for the current execution instance
114
+ */
115
+ options: EngineExecutionOptions;
116
+ /**
117
+ * The inline configuration for the current execution instance, which is the result of merging the user configuration with any configuration provided by plugins during the "config" hook.
118
+ */
119
+ inlineConfig: InlineConfig;
120
+ }
121
+ type ExecutionHost<TExecutionAPI extends ReadonlyArray<string>> = Worker<[EngineExecutionOptions, InlineConfig], TExecutionAPI>;
122
+ type PowerlinesExecutionHost = ExecutionHost<typeof EXECUTION_API_METHODS>;
123
+ /**
124
+ * The Engine interface represents the Powerlines process' orchestration and coordination API.
125
+ */
126
+ interface Engine<TExecutionAPI extends ReadonlyArray<string>> extends ExecutionInterface {
127
+ /**
128
+ * The Powerlines shared context
129
+ */
130
+ context: EngineContext;
131
+ /**
132
+ * 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.
133
+ */
134
+ host: ExecutionHost<TExecutionAPI>;
135
+ }
136
+ //#endregion
137
+ export { PowerlinesExecutionHost as a, ExecutionInterface as i, ExecutionHost as n, Worker as o, ExecutionHostParams as r, Engine as t };
138
+ //# sourceMappingURL=api-BgyEi2hF.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-BgyEi2hF.d.mts","names":[],"sources":["../src/types/utils.ts","../src/types/api.ts"],"mappings":";;;;;;KAkBY,MAAA,gDAEc,aAAA,oBAElB,eAAA,eAA8B,MAAA,EAAQ,OAAA,KAAY,OAAA;EAExD,QAAA,QAAgB,OAAA;AAAA;;;;AANlB;;;;;UCuBiB,kBAAA;EDnByC;;;;;;;;EC4BxD,OAAA,GAAU,YAAA,EAAc,mBAAA,KAAwB,OAAA;ED5BZ;;;;;;AAEb;;ECoCvB,KAAA,GAAQ,YAAA,EAAc,iBAAA,KAAsB,OAAA;;AAnB9C;;;;;;;;EA8BE,MAAA,GAAS,YAAA,EAAc,kBAAA,KAAuB,OAAA;EAWxB;;;;;;;;;EAAtB,KAAA,GAAQ,YAAA,EAAc,iBAAA,KAAsB,OAAA;EA6CrB;;;;;;EArCvB,IAAA,GAAO,YAAA,EAAc,gBAAA,KAAqB,OAAA;EAxChC;;;;;;EAgDV,IAAA,GAAO,YAAA,EAAc,gBAAA,KAAqB,OAAA;EA3BnB;;;;;;;;;EAsCvB,KAAA,GAAQ,YAAA,EAAc,iBAAA,KAAsB,OAAA;EAnBF;;;;;;EA2B1C,IAAA,GAAO,YAAA,EAAc,gBAAA,KAAqB,OAAA;EARlC;;;;;;;;EAkBR,MAAA,GAAS,YAAA,EAAc,kBAAA,KAAuB,OAAA;EAAA;;;;AAUvB;AAGzB;;;EAHE,QAAA,QAAgB,OAAA;AAAA;AAAA,UAGD,mBAAA;EAcW;;;EAV1B,IAAA,EAAM,WAAA;EAKN;;;EAAA,OAAA,EAAS,sBAAA;EAKiB;AAAA;AAG5B;EAHE,YAAA,EAAc,YAAA;AAAA;AAAA,KAGJ,aAAA,uBAAoC,aAAA,YAAyB,MAAA,EACtE,sBAAA,EAAwB,YAAA,GACzB,aAAA;AAAA,KAGU,uBAAA,GAA0B,aAAa,QAC1C,qBAAA;;;;UAMQ,MAAA,uBACO,aAAA,kBACd,kBAAA;EAd+D;;;EAkBvE,OAAA,EAAS,aAAA;EAhBI;AAAA;AAGf;EAkBE,IAAA,EAAM,aAAA,CAAc,aAAA;AAAA"}
@@ -0,0 +1,138 @@
1
+ import { t as EngineExecutionOptions } from "./config-DKEmqMrh.cjs";
2
+ import { t as EngineContext } from "./context-D0_a0kRO.cjs";
3
+ import { BuildInlineConfig, CleanInlineConfig, CreateInlineConfig, DeployInlineConfig, DocsInlineConfig, InlineConfig, LintInlineConfig, PrepareInlineConfig, TestInlineConfig, TypesInlineConfig } from "@powerlines/core";
4
+ import { EXECUTION_API_METHODS } from "@powerlines/core/constants/api";
5
+
6
+ //#region src/types/utils.d.ts
7
+ type Worker<TParams extends any[], TExposedMethods extends ReadonlyArray<string>> = { [K in TExposedMethods[number]]: (...params: TParams) => Promise<void> } & {
8
+ finalize: () => Promise<void>;
9
+ };
10
+ //#endregion
11
+ //#region src/types/api.d.ts
12
+ /**
13
+ * The Powerlines Base API Interface
14
+ *
15
+ * @remarks
16
+ * This interface defines the base API for Powerlines, which includes the shared context and the core commands. It is extended by the ExecutionAPI and EngineAPI interfaces to provide additional functionality specific to their respective contexts.
17
+ */
18
+ interface ExecutionInterface {
19
+ /**
20
+ * Prepare the Powerlines API
21
+ *
22
+ * @remarks
23
+ * This method will prepare the Powerlines API for use, initializing any necessary resources.
24
+ *
25
+ * @param inlineConfig - The inline configuration for the prepare command
26
+ */
27
+ prepare: (inlineConfig: PrepareInlineConfig) => Promise<void>;
28
+ /**
29
+ * Generate the Powerlines typescript declaration file
30
+ *
31
+ * @remarks
32
+ * 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.
33
+ *
34
+ * @param inlineConfig - The inline configuration for the types command
35
+ */
36
+ types: (inlineConfig: TypesInlineConfig) => Promise<void>;
37
+ /**
38
+ * Create a new Powerlines project
39
+ *
40
+ * @remarks
41
+ * This method will create a new Powerlines project in the current directory.
42
+ *
43
+ * @param inlineConfig - The inline configuration for the create command
44
+ * @returns A promise that resolves when the project has been created
45
+ */
46
+ create: (inlineConfig: CreateInlineConfig) => Promise<void>;
47
+ /**
48
+ * Clean any previously prepared artifacts
49
+ *
50
+ * @remarks
51
+ * This method will remove the previous Powerlines artifacts from the project.
52
+ *
53
+ * @param inlineConfig - The inline configuration for the clean command
54
+ * @returns A promise that resolves when the clean command has completed
55
+ */
56
+ clean: (inlineConfig: CleanInlineConfig) => Promise<void>;
57
+ /**
58
+ * Lint the project source code
59
+ *
60
+ * @param inlineConfig - The inline configuration for the lint command
61
+ * @returns A promise that resolves when the lint command has completed
62
+ */
63
+ lint: (inlineConfig: LintInlineConfig) => Promise<void>;
64
+ /**
65
+ * Test the project source code
66
+ *
67
+ * @param inlineConfig - The inline configuration for the test command
68
+ * @returns A promise that resolves when the test command has completed
69
+ */
70
+ test: (inlineConfig: TestInlineConfig) => Promise<void>;
71
+ /**
72
+ * Build the project
73
+ *
74
+ * @remarks
75
+ * This method will build the Powerlines project, generating the necessary artifacts.
76
+ *
77
+ * @param inlineConfig - The inline configuration for the build command
78
+ * @returns A promise that resolves when the build command has completed
79
+ */
80
+ build: (inlineConfig: BuildInlineConfig) => Promise<void>;
81
+ /**
82
+ * Prepare the documentation for the project
83
+ *
84
+ * @param inlineConfig - The inline configuration for the docs command
85
+ * @returns A promise that resolves when the documentation generation has completed
86
+ */
87
+ docs: (inlineConfig: DocsInlineConfig) => Promise<void>;
88
+ /**
89
+ * Deploy the project source code
90
+ *
91
+ * @remarks
92
+ * This method will prepare and build the Powerlines project, generating the necessary artifacts for the deployment.
93
+ *
94
+ * @param inlineConfig - The inline configuration for the deploy command
95
+ */
96
+ deploy: (inlineConfig: DeployInlineConfig) => Promise<void>;
97
+ /**
98
+ * Finalization process
99
+ *
100
+ * @remarks
101
+ * This step includes any final processes or clean up required by Powerlines. It will be run after each Powerlines command.
102
+ *
103
+ * @returns A promise that resolves when the finalization process has completed
104
+ */
105
+ finalize: () => Promise<void>;
106
+ }
107
+ interface ExecutionHostParams {
108
+ /**
109
+ * The {@link MessagePort} used for communication between the execution host and the engine. This port will be used to send and receive messages, allowing the execution host to invoke API methods and return results to the engine.
110
+ */
111
+ port: MessagePort;
112
+ /**
113
+ * The execution options for the current execution instance
114
+ */
115
+ options: EngineExecutionOptions;
116
+ /**
117
+ * The inline configuration for the current execution instance, which is the result of merging the user configuration with any configuration provided by plugins during the "config" hook.
118
+ */
119
+ inlineConfig: InlineConfig;
120
+ }
121
+ type ExecutionHost<TExecutionAPI extends ReadonlyArray<string>> = Worker<[EngineExecutionOptions, InlineConfig], TExecutionAPI>;
122
+ type PowerlinesExecutionHost = ExecutionHost<typeof EXECUTION_API_METHODS>;
123
+ /**
124
+ * The Engine interface represents the Powerlines process' orchestration and coordination API.
125
+ */
126
+ interface Engine<TExecutionAPI extends ReadonlyArray<string>> extends ExecutionInterface {
127
+ /**
128
+ * The Powerlines shared context
129
+ */
130
+ context: EngineContext;
131
+ /**
132
+ * 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.
133
+ */
134
+ host: ExecutionHost<TExecutionAPI>;
135
+ }
136
+ //#endregion
137
+ export { PowerlinesExecutionHost as a, ExecutionInterface as i, ExecutionHost as n, Worker as o, ExecutionHostParams as r, Engine as t };
138
+ //# sourceMappingURL=api-DcHfCjQK.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-DcHfCjQK.d.cts","names":[],"sources":["../src/types/utils.ts","../src/types/api.ts"],"mappings":";;;;;;KAkBY,MAAA,gDAEc,aAAA,oBAElB,eAAA,eAA8B,MAAA,EAAQ,OAAA,KAAY,OAAA;EAExD,QAAA,QAAgB,OAAA;AAAA;;;;AANlB;;;;;UCuBiB,kBAAA;EDnByC;;;;;;;;EC4BxD,OAAA,GAAU,YAAA,EAAc,mBAAA,KAAwB,OAAA;ED5BZ;;;;;;AAEb;;ECoCvB,KAAA,GAAQ,YAAA,EAAc,iBAAA,KAAsB,OAAA;;AAnB9C;;;;;;;;EA8BE,MAAA,GAAS,YAAA,EAAc,kBAAA,KAAuB,OAAA;EAWxB;;;;;;;;;EAAtB,KAAA,GAAQ,YAAA,EAAc,iBAAA,KAAsB,OAAA;EA6CrB;;;;;;EArCvB,IAAA,GAAO,YAAA,EAAc,gBAAA,KAAqB,OAAA;EAxChC;;;;;;EAgDV,IAAA,GAAO,YAAA,EAAc,gBAAA,KAAqB,OAAA;EA3BnB;;;;;;;;;EAsCvB,KAAA,GAAQ,YAAA,EAAc,iBAAA,KAAsB,OAAA;EAnBF;;;;;;EA2B1C,IAAA,GAAO,YAAA,EAAc,gBAAA,KAAqB,OAAA;EARlC;;;;;;;;EAkBR,MAAA,GAAS,YAAA,EAAc,kBAAA,KAAuB,OAAA;EAAA;;;;AAUvB;AAGzB;;;EAHE,QAAA,QAAgB,OAAA;AAAA;AAAA,UAGD,mBAAA;EAcW;;;EAV1B,IAAA,EAAM,WAAA;EAKN;;;EAAA,OAAA,EAAS,sBAAA;EAKiB;AAAA;AAG5B;EAHE,YAAA,EAAc,YAAA;AAAA;AAAA,KAGJ,aAAA,uBAAoC,aAAA,YAAyB,MAAA,EACtE,sBAAA,EAAwB,YAAA,GACzB,aAAA;AAAA,KAGU,uBAAA,GAA0B,aAAa,QAC1C,qBAAA;;;;UAMQ,MAAA,uBACO,aAAA,kBACd,kBAAA;EAd+D;;;EAkBvE,OAAA,EAAS,aAAA;EAhBI;AAAA;AAGf;EAkBE,IAAA,EAAM,aAAA,CAAc,aAAA;AAAA"}