@powerlines/engine 0.47.4 → 0.49.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 (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,66 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_chunk = require('../chunk-C_NdSu1c.cjs');
3
+ const require_api_prepare = require('./prepare.cjs');
4
+ let _powerlines_core = require("@powerlines/core");
5
+ let _powerlines_core_lib_environment = require("@powerlines/core/lib/environment");
6
+ let _stryke_fs_copy_file = require("@stryke/fs/copy-file");
7
+ let _stryke_path_append = require("@stryke/path/append");
8
+ let _stryke_path_file_path_fns = require("@stryke/path/file-path-fns");
9
+ let _stryke_path_is_parent_path = require("@stryke/path/is-parent-path");
10
+ let _stryke_path_join_paths = require("@stryke/path/join-paths");
11
+ let _stryke_path_replace = require("@stryke/path/replace");
12
+ let chalk = require("chalk");
13
+ chalk = require_chunk.__toESM(chalk, 1);
14
+ let node_fs = require("node:fs");
15
+
16
+ //#region src/api/build.ts
17
+ async function handleBuild(context, env) {
18
+ await context.callHook("build", {
19
+ environment: env,
20
+ order: "pre"
21
+ });
22
+ env.debug("Formatting the generated entry files before the build process starts.");
23
+ await (0, _powerlines_core.formatFolder)(env, env.entryPath);
24
+ await context.callHook("build", {
25
+ environment: env,
26
+ order: "normal"
27
+ });
28
+ if (env.config.output.copy) {
29
+ env.debug("Copying project's files from build output directory.");
30
+ const destinationPath = (0, _stryke_path_is_parent_path.isParentPath)((0, _stryke_path_append.appendPath)(env.config.output.path, env.config.cwd), (0, _stryke_path_append.appendPath)(env.config.root, env.config.cwd)) ? (0, _stryke_path_join_paths.joinPaths)(env.config.output.copy.path, (0, _stryke_path_file_path_fns.relativePath)((0, _stryke_path_append.appendPath)(env.config.root, env.config.cwd), (0, _stryke_path_append.appendPath)(env.config.output.path, env.config.cwd))) : (0, _stryke_path_join_paths.joinPaths)(env.config.output.copy.path, "dist");
31
+ const sourcePath = env.config.output.path;
32
+ if ((0, node_fs.existsSync)(sourcePath) && sourcePath !== destinationPath) {
33
+ env.debug(`Copying files from project's build output directory (${env.config.output.path}) to the project's copy/publish directory (${destinationPath}).`);
34
+ await (0, _stryke_fs_copy_file.copyFiles)(sourcePath, destinationPath);
35
+ } else env.warn(`The source path for the copy operation ${!(0, node_fs.existsSync)(sourcePath) ? "does not exist" : "is the same as the destination path"}. Source: ${sourcePath}, Destination: ${destinationPath}. Skipping copying of build output files.`);
36
+ if (env.config.output.copy.assets && Array.isArray(env.config.output.copy.assets)) await Promise.all(env.config.output.copy.assets.map(async (asset) => {
37
+ env.trace(`Copying asset(s): ${chalk.default.redBright(env.config.cwd === asset.input ? asset.glob : (0, _stryke_path_append.appendPath)(asset.glob, (0, _stryke_path_replace.replacePath)(asset.input, env.config.cwd)))} -> ${chalk.default.greenBright((0, _stryke_path_append.appendPath)(asset.glob, (0, _stryke_path_replace.replacePath)(asset.output, env.config.cwd)))} ${Array.isArray(asset.ignore) && asset.ignore.length > 0 ? ` (ignoring: ${asset.ignore.map((i) => chalk.default.yellowBright(i)).join(", ")})` : ""}`);
38
+ await env.fs.copy(asset, asset.output);
39
+ }));
40
+ } else env.debug("No copy configuration found for the project output. Skipping the copying of build output files.");
41
+ await context.callHook("build", {
42
+ environment: env,
43
+ order: "post"
44
+ });
45
+ }
46
+ /**
47
+ * Build the project
48
+ *
49
+ * @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.
50
+ */
51
+ async function build(context) {
52
+ const timer = context.timer("Building");
53
+ await context.generateChecksum();
54
+ if (context.meta.checksum !== context.persistedMeta?.checksum || context.config.skipCache) {
55
+ context.info(!context.persistedMeta?.checksum ? "No previous build cache found. Preparing the project for the initial build." : context.meta.checksum !== context.persistedMeta.checksum ? "The project has been modified since the last time `prepare` was ran. Re-preparing the project." : "The project is configured to skip cache. Re-preparing the project.");
56
+ await require_api_prepare.prepare(context);
57
+ }
58
+ if (context.config.singleBuild) await handleBuild(context, await context.toEnvironment());
59
+ else await (0, _powerlines_core_lib_environment.executeEnvironments)(context, async (env) => {
60
+ await handleBuild(context, env);
61
+ });
62
+ timer();
63
+ }
64
+
65
+ //#endregion
66
+ exports.build = build;
@@ -0,0 +1,14 @@
1
+ import { r as EngineResolvedConfig } from "../config-DKEmqMrh.cjs";
2
+ import { r as EngineSystemContext } from "../context-D0_a0kRO.cjs";
3
+ import { ExecutionContext } from "@powerlines/core";
4
+
5
+ //#region src/api/build.d.ts
6
+ /**
7
+ * Build the project
8
+ *
9
+ * @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.
10
+ */
11
+ declare function build<TResolvedConfig extends EngineResolvedConfig, TSystemContext extends EngineSystemContext>(context: ExecutionContext<TResolvedConfig, TSystemContext>): Promise<void>;
12
+ //#endregion
13
+ export { build };
14
+ //# sourceMappingURL=build.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build.d.cts","names":[],"sources":["../../src/api/build.ts"],"mappings":";;;;;;;AA6IA;;;iBAAsB,KAAA,yBACI,oBAAA,yBACD,mBAAA,CAAA,CACvB,OAAA,EAAS,gBAAA,CAAiB,eAAA,EAAiB,cAAA,IAAe,OAAA"}
@@ -0,0 +1,14 @@
1
+ import { r as EngineResolvedConfig } from "../config-ByLyzMI0.mjs";
2
+ import { r as EngineSystemContext } from "../context-DcXV6_GL.mjs";
3
+ import { ExecutionContext } from "@powerlines/core";
4
+
5
+ //#region src/api/build.d.ts
6
+ /**
7
+ * Build the project
8
+ *
9
+ * @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.
10
+ */
11
+ declare function build<TResolvedConfig extends EngineResolvedConfig, TSystemContext extends EngineSystemContext>(context: ExecutionContext<TResolvedConfig, TSystemContext>): Promise<void>;
12
+ //#endregion
13
+ export { build };
14
+ //# sourceMappingURL=build.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build.d.mts","names":[],"sources":["../../src/api/build.ts"],"mappings":";;;;;;;AA6IA;;;iBAAsB,KAAA,yBACI,oBAAA,yBACD,mBAAA,CAAA,CACvB,OAAA,EAAS,gBAAA,CAAiB,eAAA,EAAiB,cAAA,IAAe,OAAA"}
@@ -0,0 +1,64 @@
1
+ import { prepare } from "./prepare.mjs";
2
+ import { formatFolder } from "@powerlines/core";
3
+ import { executeEnvironments } from "@powerlines/core/lib/environment";
4
+ import { copyFiles } from "@stryke/fs/copy-file";
5
+ import { appendPath } from "@stryke/path/append";
6
+ import { relativePath } from "@stryke/path/file-path-fns";
7
+ import { isParentPath } from "@stryke/path/is-parent-path";
8
+ import { joinPaths } from "@stryke/path/join-paths";
9
+ import { replacePath } from "@stryke/path/replace";
10
+ import chalk from "chalk";
11
+ import { existsSync } from "node:fs";
12
+
13
+ //#region src/api/build.ts
14
+ async function handleBuild(context, env) {
15
+ await context.callHook("build", {
16
+ environment: env,
17
+ order: "pre"
18
+ });
19
+ env.debug("Formatting the generated entry files before the build process starts.");
20
+ await formatFolder(env, env.entryPath);
21
+ await context.callHook("build", {
22
+ environment: env,
23
+ order: "normal"
24
+ });
25
+ if (env.config.output.copy) {
26
+ env.debug("Copying project's files from build output directory.");
27
+ const destinationPath = isParentPath(appendPath(env.config.output.path, env.config.cwd), appendPath(env.config.root, env.config.cwd)) ? joinPaths(env.config.output.copy.path, relativePath(appendPath(env.config.root, env.config.cwd), appendPath(env.config.output.path, env.config.cwd))) : joinPaths(env.config.output.copy.path, "dist");
28
+ const sourcePath = env.config.output.path;
29
+ if (existsSync(sourcePath) && sourcePath !== destinationPath) {
30
+ env.debug(`Copying files from project's build output directory (${env.config.output.path}) to the project's copy/publish directory (${destinationPath}).`);
31
+ await copyFiles(sourcePath, destinationPath);
32
+ } else env.warn(`The source path for the copy operation ${!existsSync(sourcePath) ? "does not exist" : "is the same as the destination path"}. Source: ${sourcePath}, Destination: ${destinationPath}. Skipping copying of build output files.`);
33
+ if (env.config.output.copy.assets && Array.isArray(env.config.output.copy.assets)) await Promise.all(env.config.output.copy.assets.map(async (asset) => {
34
+ env.trace(`Copying asset(s): ${chalk.redBright(env.config.cwd === asset.input ? asset.glob : appendPath(asset.glob, replacePath(asset.input, env.config.cwd)))} -> ${chalk.greenBright(appendPath(asset.glob, replacePath(asset.output, env.config.cwd)))} ${Array.isArray(asset.ignore) && asset.ignore.length > 0 ? ` (ignoring: ${asset.ignore.map((i) => chalk.yellowBright(i)).join(", ")})` : ""}`);
35
+ await env.fs.copy(asset, asset.output);
36
+ }));
37
+ } else env.debug("No copy configuration found for the project output. Skipping the copying of build output files.");
38
+ await context.callHook("build", {
39
+ environment: env,
40
+ order: "post"
41
+ });
42
+ }
43
+ /**
44
+ * Build the project
45
+ *
46
+ * @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.
47
+ */
48
+ async function build(context) {
49
+ const timer = context.timer("Building");
50
+ await context.generateChecksum();
51
+ if (context.meta.checksum !== context.persistedMeta?.checksum || context.config.skipCache) {
52
+ context.info(!context.persistedMeta?.checksum ? "No previous build cache found. Preparing the project for the initial build." : context.meta.checksum !== context.persistedMeta.checksum ? "The project has been modified since the last time `prepare` was ran. Re-preparing the project." : "The project is configured to skip cache. Re-preparing the project.");
53
+ await prepare(context);
54
+ }
55
+ if (context.config.singleBuild) await handleBuild(context, await context.toEnvironment());
56
+ else await executeEnvironments(context, async (env) => {
57
+ await handleBuild(context, env);
58
+ });
59
+ timer();
60
+ }
61
+
62
+ //#endregion
63
+ export { build };
64
+ //# sourceMappingURL=build.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build.mjs","names":[],"sources":["../../src/api/build.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 {\n EnvironmentContext,\n ExecutionContext,\n formatFolder\n} from \"@powerlines/core\";\nimport { executeEnvironments } from \"@powerlines/core/lib/environment\";\nimport { copyFiles } from \"@stryke/fs/copy-file\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { relativePath } from \"@stryke/path/file-path-fns\";\nimport { isParentPath } from \"@stryke/path/is-parent-path\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { replacePath } from \"@stryke/path/replace\";\nimport chalk from \"chalk\";\nimport { existsSync } from \"node:fs\";\nimport { EngineResolvedConfig } from \"../types/config\";\nimport { EngineSystemContext } from \"../types/context\";\nimport { prepare } from \"./prepare\";\n\nasync function handleBuild<\n TResolvedConfig extends EngineResolvedConfig,\n TSystemContext extends EngineSystemContext\n>(\n context: ExecutionContext<TResolvedConfig, TSystemContext>,\n env: EnvironmentContext<TResolvedConfig, TSystemContext>\n) {\n await context.callHook(\"build\", {\n environment: env,\n order: \"pre\"\n });\n\n env.debug(\n \"Formatting the generated entry files before the build process starts.\"\n );\n await formatFolder(env, env.entryPath);\n\n await context.callHook(\"build\", {\n environment: env,\n order: \"normal\"\n });\n\n if (env.config.output.copy) {\n env.debug(\"Copying project's files from build output directory.\");\n\n const destinationPath = isParentPath(\n appendPath(env.config.output.path, env.config.cwd),\n appendPath(env.config.root, env.config.cwd)\n )\n ? joinPaths(\n env.config.output.copy.path,\n relativePath(\n appendPath(env.config.root, env.config.cwd),\n appendPath(env.config.output.path, env.config.cwd)\n )\n )\n : joinPaths(env.config.output.copy.path, \"dist\");\n const sourcePath = env.config.output.path;\n\n if (existsSync(sourcePath) && sourcePath !== destinationPath) {\n env.debug(\n `Copying files from project's build output directory (${\n env.config.output.path\n }) to the project's copy/publish directory (${destinationPath}).`\n );\n\n await copyFiles(sourcePath, destinationPath);\n } else {\n env.warn(\n `The source path for the copy operation ${\n !existsSync(sourcePath)\n ? \"does not exist\"\n : \"is the same as the destination path\"\n }. Source: ${sourcePath}, Destination: ${\n destinationPath\n }. Skipping copying of build output files.`\n );\n }\n\n if (\n env.config.output.copy.assets &&\n Array.isArray(env.config.output.copy.assets)\n ) {\n await Promise.all(\n env.config.output.copy.assets.map(async asset => {\n env.trace(\n `Copying asset(s): ${chalk.redBright(\n env.config.cwd === asset.input\n ? asset.glob\n : appendPath(\n asset.glob,\n replacePath(asset.input, env.config.cwd)\n )\n )} -> ${chalk.greenBright(\n appendPath(asset.glob, replacePath(asset.output, env.config.cwd))\n )} ${\n Array.isArray(asset.ignore) && asset.ignore.length > 0\n ? ` (ignoring: ${asset.ignore\n .map(i => chalk.yellowBright(i))\n .join(\", \")})`\n : \"\"\n }`\n );\n\n await env.fs.copy(asset, asset.output);\n })\n );\n }\n } else {\n env.debug(\n \"No copy configuration found for the project output. Skipping the copying of build output files.\"\n );\n }\n\n await context.callHook(\"build\", {\n environment: env,\n order: \"post\"\n });\n}\n\n/**\n * Build 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 build<\n TResolvedConfig extends EngineResolvedConfig,\n TSystemContext extends EngineSystemContext\n>(context: ExecutionContext<TResolvedConfig, TSystemContext>) {\n const timer = context.timer(\"Building\");\n\n await context.generateChecksum();\n if (\n context.meta.checksum !== context.persistedMeta?.checksum ||\n context.config.skipCache\n ) {\n context.info(\n !context.persistedMeta?.checksum\n ? \"No previous build cache found. Preparing the project for the initial build.\"\n : context.meta.checksum !== context.persistedMeta.checksum\n ? \"The project has been modified since the last time `prepare` was ran. Re-preparing the project.\"\n : \"The project is configured to skip cache. Re-preparing the project.\"\n );\n\n await prepare<TResolvedConfig, TSystemContext>(context);\n }\n\n if (context.config.singleBuild) {\n await handleBuild<TResolvedConfig, TSystemContext>(\n context,\n await context.toEnvironment()\n );\n } else {\n await executeEnvironments(context, async env => {\n await handleBuild<TResolvedConfig, TSystemContext>(context, env);\n });\n }\n\n timer();\n}\n"],"mappings":";;;;;;;;;;;;;AAoCA,eAAe,YAIb,SACA,KACA;CACA,MAAM,QAAQ,SAAS,SAAS;EAC9B,aAAa;EACb,OAAO;CACT,CAAC;CAED,IAAI,MACF,uEACF;CACA,MAAM,aAAa,KAAK,IAAI,SAAS;CAErC,MAAM,QAAQ,SAAS,SAAS;EAC9B,aAAa;EACb,OAAO;CACT,CAAC;CAED,IAAI,IAAI,OAAO,OAAO,MAAM;EAC1B,IAAI,MAAM,sDAAsD;EAEhE,MAAM,kBAAkB,aACtB,WAAW,IAAI,OAAO,OAAO,MAAM,IAAI,OAAO,GAAG,GACjD,WAAW,IAAI,OAAO,MAAM,IAAI,OAAO,GAAG,CAC5C,IACI,UACE,IAAI,OAAO,OAAO,KAAK,MACvB,aACE,WAAW,IAAI,OAAO,MAAM,IAAI,OAAO,GAAG,GAC1C,WAAW,IAAI,OAAO,OAAO,MAAM,IAAI,OAAO,GAAG,CACnD,CACF,IACA,UAAU,IAAI,OAAO,OAAO,KAAK,MAAM,MAAM;EACjD,MAAM,aAAa,IAAI,OAAO,OAAO;EAErC,IAAI,WAAW,UAAU,KAAK,eAAe,iBAAiB;GAC5D,IAAI,MACF,wDACE,IAAI,OAAO,OAAO,KACnB,6CAA6C,gBAAgB,GAChE;GAEA,MAAM,UAAU,YAAY,eAAe;EAC7C,OACE,IAAI,KACF,0CACE,CAAC,WAAW,UAAU,IAClB,mBACA,sCACL,YAAY,WAAW,iBACtB,gBACD,0CACH;EAGF,IACE,IAAI,OAAO,OAAO,KAAK,UACvB,MAAM,QAAQ,IAAI,OAAO,OAAO,KAAK,MAAM,GAE3C,MAAM,QAAQ,IACZ,IAAI,OAAO,OAAO,KAAK,OAAO,IAAI,OAAM,UAAS;GAC/C,IAAI,MACF,qBAAqB,MAAM,UACzB,IAAI,OAAO,QAAQ,MAAM,QACrB,MAAM,OACN,WACE,MAAM,MACN,YAAY,MAAM,OAAO,IAAI,OAAO,GAAG,CACzC,CACN,EAAE,MAAM,MAAM,YACZ,WAAW,MAAM,MAAM,YAAY,MAAM,QAAQ,IAAI,OAAO,GAAG,CAAC,CAClE,EAAE,GACA,MAAM,QAAQ,MAAM,MAAM,KAAK,MAAM,OAAO,SAAS,IACjD,eAAe,MAAM,OAClB,KAAI,MAAK,MAAM,aAAa,CAAC,CAAC,EAC9B,KAAK,IAAI,EAAE,KACd,IAER;GAEA,MAAM,IAAI,GAAG,KAAK,OAAO,MAAM,MAAM;EACvC,CAAC,CACH;CAEJ,OACE,IAAI,MACF,iGACF;CAGF,MAAM,QAAQ,SAAS,SAAS;EAC9B,aAAa;EACb,OAAO;CACT,CAAC;AACH;;;;;;AAOA,eAAsB,MAGpB,SAA4D;CAC5D,MAAM,QAAQ,QAAQ,MAAM,UAAU;CAEtC,MAAM,QAAQ,iBAAiB;CAC/B,IACE,QAAQ,KAAK,aAAa,QAAQ,eAAe,YACjD,QAAQ,OAAO,WACf;EACA,QAAQ,KACN,CAAC,QAAQ,eAAe,WACpB,gFACA,QAAQ,KAAK,aAAa,QAAQ,cAAc,WAC9C,mGACA,oEACR;EAEA,MAAM,QAAyC,OAAO;CACxD;CAEA,IAAI,QAAQ,OAAO,aACjB,MAAM,YACJ,SACA,MAAM,QAAQ,cAAc,CAC9B;MAEA,MAAM,oBAAoB,SAAS,OAAM,QAAO;EAC9C,MAAM,YAA6C,SAAS,GAAG;CACjE,CAAC;CAGH,MAAM;AACR"}
@@ -0,0 +1,28 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_api_prepare = require('./prepare.cjs');
3
+ let _powerlines_core_lib_environment = require("@powerlines/core/lib/environment");
4
+ let _stryke_path_join = require("@stryke/path/join");
5
+
6
+ //#region src/api/clean.ts
7
+ /**
8
+ * Clean any previously prepared artifacts
9
+ *
10
+ * @param context - The execution context for the clean process, which provides access to the project configuration, environment, and utility functions for performing the clean operation. The context is used to manage the state and behavior of the clean process, allowing for hooks to be called at different stages of the clean and for environment-specific configurations to be applied.
11
+ */
12
+ async function clean(context) {
13
+ const timer = context.timer("Cleaning");
14
+ await require_api_prepare.prepare(context, true);
15
+ await (0, _powerlines_core_lib_environment.executeEnvironments)(context, async (env) => {
16
+ env.debug("Cleaning the project's dist and artifacts directories.");
17
+ await env.fs.remove((0, _stryke_path_join.joinPaths)(env.config.cwd, env.config.output.path));
18
+ await env.fs.remove((0, _stryke_path_join.joinPaths)(env.config.cwd, env.config.root, env.config.output.artifactsPath));
19
+ await context.callHook("clean", {
20
+ environment: env,
21
+ sequential: false
22
+ });
23
+ });
24
+ timer();
25
+ }
26
+
27
+ //#endregion
28
+ exports.clean = clean;
@@ -0,0 +1,14 @@
1
+ import { r as EngineResolvedConfig } from "../config-DKEmqMrh.cjs";
2
+ import { r as EngineSystemContext } from "../context-D0_a0kRO.cjs";
3
+ import { ExecutionContext } from "@powerlines/core";
4
+
5
+ //#region src/api/clean.d.ts
6
+ /**
7
+ * Clean any previously prepared artifacts
8
+ *
9
+ * @param context - The execution context for the clean process, which provides access to the project configuration, environment, and utility functions for performing the clean operation. The context is used to manage the state and behavior of the clean process, allowing for hooks to be called at different stages of the clean and for environment-specific configurations to be applied.
10
+ */
11
+ declare function clean<TResolvedConfig extends EngineResolvedConfig, TSystemContext extends EngineSystemContext>(context: ExecutionContext<TResolvedConfig, TSystemContext>): Promise<void>;
12
+ //#endregion
13
+ export { clean };
14
+ //# sourceMappingURL=clean.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clean.d.cts","names":[],"sources":["../../src/api/clean.ts"],"mappings":";;;;;;;AA8BA;;;iBAAsB,KAAA,yBACI,oBAAA,yBACD,mBAAA,CAAA,CACvB,OAAA,EAAS,gBAAA,CAAiB,eAAA,EAAiB,cAAA,IAAe,OAAA"}
@@ -0,0 +1,14 @@
1
+ import { r as EngineResolvedConfig } from "../config-ByLyzMI0.mjs";
2
+ import { r as EngineSystemContext } from "../context-DcXV6_GL.mjs";
3
+ import { ExecutionContext } from "@powerlines/core";
4
+
5
+ //#region src/api/clean.d.ts
6
+ /**
7
+ * Clean any previously prepared artifacts
8
+ *
9
+ * @param context - The execution context for the clean process, which provides access to the project configuration, environment, and utility functions for performing the clean operation. The context is used to manage the state and behavior of the clean process, allowing for hooks to be called at different stages of the clean and for environment-specific configurations to be applied.
10
+ */
11
+ declare function clean<TResolvedConfig extends EngineResolvedConfig, TSystemContext extends EngineSystemContext>(context: ExecutionContext<TResolvedConfig, TSystemContext>): Promise<void>;
12
+ //#endregion
13
+ export { clean };
14
+ //# sourceMappingURL=clean.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clean.d.mts","names":[],"sources":["../../src/api/clean.ts"],"mappings":";;;;;;;AA8BA;;;iBAAsB,KAAA,yBACI,oBAAA,yBACD,mBAAA,CAAA,CACvB,OAAA,EAAS,gBAAA,CAAiB,eAAA,EAAiB,cAAA,IAAe,OAAA"}
@@ -0,0 +1,28 @@
1
+ import { prepare } from "./prepare.mjs";
2
+ import { executeEnvironments } from "@powerlines/core/lib/environment";
3
+ import { joinPaths } from "@stryke/path/join";
4
+
5
+ //#region src/api/clean.ts
6
+ /**
7
+ * Clean any previously prepared artifacts
8
+ *
9
+ * @param context - The execution context for the clean process, which provides access to the project configuration, environment, and utility functions for performing the clean operation. The context is used to manage the state and behavior of the clean process, allowing for hooks to be called at different stages of the clean and for environment-specific configurations to be applied.
10
+ */
11
+ async function clean(context) {
12
+ const timer = context.timer("Cleaning");
13
+ await prepare(context, true);
14
+ await executeEnvironments(context, async (env) => {
15
+ env.debug("Cleaning the project's dist and artifacts directories.");
16
+ await env.fs.remove(joinPaths(env.config.cwd, env.config.output.path));
17
+ await env.fs.remove(joinPaths(env.config.cwd, env.config.root, env.config.output.artifactsPath));
18
+ await context.callHook("clean", {
19
+ environment: env,
20
+ sequential: false
21
+ });
22
+ });
23
+ timer();
24
+ }
25
+
26
+ //#endregion
27
+ export { clean };
28
+ //# sourceMappingURL=clean.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clean.mjs","names":[],"sources":["../../src/api/clean.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 { ExecutionContext } from \"@powerlines/core\";\nimport { executeEnvironments } from \"@powerlines/core/lib/environment\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { EngineResolvedConfig } from \"../types/config\";\nimport { EngineSystemContext } from \"../types/context\";\nimport { prepare } from \"./prepare\";\n\n/**\n * Clean any previously prepared artifacts\n *\n * @param context - The execution context for the clean process, which provides access to the project configuration, environment, and utility functions for performing the clean operation. The context is used to manage the state and behavior of the clean process, allowing for hooks to be called at different stages of the clean and for environment-specific configurations to be applied.\n */\nexport async function clean<\n TResolvedConfig extends EngineResolvedConfig,\n TSystemContext extends EngineSystemContext\n>(context: ExecutionContext<TResolvedConfig, TSystemContext>) {\n const timer = context.timer(\"Cleaning\");\n\n await prepare<TResolvedConfig, TSystemContext>(context, true);\n await executeEnvironments(context, async env => {\n env.debug(\"Cleaning the project's dist and artifacts directories.\");\n\n await env.fs.remove(joinPaths(env.config.cwd, env.config.output.path));\n await env.fs.remove(\n joinPaths(\n env.config.cwd,\n env.config.root,\n env.config.output.artifactsPath\n )\n );\n\n await context.callHook(\"clean\", {\n environment: env,\n sequential: false\n });\n });\n\n timer();\n}\n"],"mappings":";;;;;;;;;;AA8BA,eAAsB,MAGpB,SAA4D;CAC5D,MAAM,QAAQ,QAAQ,MAAM,UAAU;CAEtC,MAAM,QAAyC,SAAS,IAAI;CAC5D,MAAM,oBAAoB,SAAS,OAAM,QAAO;EAC9C,IAAI,MAAM,wDAAwD;EAElE,MAAM,IAAI,GAAG,OAAO,UAAU,IAAI,OAAO,KAAK,IAAI,OAAO,OAAO,IAAI,CAAC;EACrE,MAAM,IAAI,GAAG,OACX,UACE,IAAI,OAAO,KACX,IAAI,OAAO,MACX,IAAI,OAAO,OAAO,aACpB,CACF;EAEA,MAAM,QAAQ,SAAS,SAAS;GAC9B,aAAa;GACb,YAAY;EACd,CAAC;CACH,CAAC;CAED,MAAM;AACR"}
@@ -0,0 +1,59 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_chunk = require('../chunk-C_NdSu1c.cjs');
3
+ const require_api_prepare = require('./prepare.cjs');
4
+ let _powerlines_core_lib_environment = require("@powerlines/core/lib/environment");
5
+ let _stryke_path_join = require("@stryke/path/join");
6
+ let _stryke_fs_list_files = require("@stryke/fs/list-files");
7
+ let handlebars = require("handlebars");
8
+ handlebars = require_chunk.__toESM(handlebars, 1);
9
+
10
+ //#region src/api/create.ts
11
+ /**
12
+ * Create a new Powerlines project
13
+ *
14
+ * @param context - The execution context for the create process, which provides access to the project configuration, environment, and utility functions for performing the create operation. The context is used to manage the state and behavior of the create process, allowing for hooks to be called at different stages of the create and for environment-specific configurations to be applied.
15
+ */
16
+ async function create(context) {
17
+ const timer = context.timer("Create a New Project Generation");
18
+ await require_api_prepare.prepare(context, true);
19
+ await (0, _powerlines_core_lib_environment.executeEnvironments)(context, async (env) => {
20
+ env.debug("Initializing the processing options for the project.");
21
+ await context.callHook("create", {
22
+ environment: env,
23
+ order: "pre"
24
+ });
25
+ const files = await (0, _stryke_fs_list_files.listFiles)((0, _stryke_path_join.joinPaths)(env.powerlinesPath, "files/common/**/*.hbs"));
26
+ for (const file of files) {
27
+ env.trace(`Adding template file to project: ${file}`);
28
+ const template = handlebars.default.compile(file);
29
+ await env.fs.write((0, _stryke_path_join.joinPaths)(env.config.root, file.replace(".hbs", "")), template(env));
30
+ }
31
+ await context.callHook("create", {
32
+ environment: env,
33
+ order: "normal"
34
+ });
35
+ if (env.config.projectType === "application") {
36
+ const appFiles = await (0, _stryke_fs_list_files.listFiles)((0, _stryke_path_join.joinPaths)(env.powerlinesPath, "files/application/**/*.hbs"));
37
+ for (const file of appFiles) {
38
+ env.trace(`Adding application template file: ${file}`);
39
+ const template = handlebars.default.compile(file);
40
+ await env.fs.write((0, _stryke_path_join.joinPaths)(env.config.root, file.replace(".hbs", "")), template(env));
41
+ }
42
+ } else {
43
+ const libFiles = await (0, _stryke_fs_list_files.listFiles)((0, _stryke_path_join.joinPaths)(env.powerlinesPath, "files/library/**/*.hbs"));
44
+ for (const file of libFiles) {
45
+ env.trace(`Adding library template file: ${file}`);
46
+ const template = handlebars.default.compile(file);
47
+ await env.fs.write((0, _stryke_path_join.joinPaths)(env.config.root, file.replace(".hbs", "")), template(env));
48
+ }
49
+ }
50
+ await context.callHook("create", {
51
+ environment: env,
52
+ order: "post"
53
+ });
54
+ });
55
+ timer();
56
+ }
57
+
58
+ //#endregion
59
+ exports.create = create;
@@ -0,0 +1,14 @@
1
+ import { r as EngineResolvedConfig } from "../config-DKEmqMrh.cjs";
2
+ import { r as EngineSystemContext } from "../context-D0_a0kRO.cjs";
3
+ import { ExecutionContext } from "@powerlines/core";
4
+
5
+ //#region src/api/create.d.ts
6
+ /**
7
+ * Create a new Powerlines project
8
+ *
9
+ * @param context - The execution context for the create process, which provides access to the project configuration, environment, and utility functions for performing the create operation. The context is used to manage the state and behavior of the create process, allowing for hooks to be called at different stages of the create and for environment-specific configurations to be applied.
10
+ */
11
+ declare function create<TResolvedConfig extends EngineResolvedConfig, TSystemContext extends EngineSystemContext>(context: ExecutionContext<TResolvedConfig, TSystemContext>): Promise<void>;
12
+ //#endregion
13
+ export { create };
14
+ //# sourceMappingURL=create.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.d.cts","names":[],"sources":["../../src/api/create.ts"],"mappings":";;;;;;;AAgCA;;;iBAAsB,MAAA,yBACI,oBAAA,yBACD,mBAAA,CAAA,CACvB,OAAA,EAAS,gBAAA,CAAiB,eAAA,EAAiB,cAAA,IAAe,OAAA"}
@@ -0,0 +1,14 @@
1
+ import { r as EngineResolvedConfig } from "../config-ByLyzMI0.mjs";
2
+ import { r as EngineSystemContext } from "../context-DcXV6_GL.mjs";
3
+ import { ExecutionContext } from "@powerlines/core";
4
+
5
+ //#region src/api/create.d.ts
6
+ /**
7
+ * Create a new Powerlines project
8
+ *
9
+ * @param context - The execution context for the create process, which provides access to the project configuration, environment, and utility functions for performing the create operation. The context is used to manage the state and behavior of the create process, allowing for hooks to be called at different stages of the create and for environment-specific configurations to be applied.
10
+ */
11
+ declare function create<TResolvedConfig extends EngineResolvedConfig, TSystemContext extends EngineSystemContext>(context: ExecutionContext<TResolvedConfig, TSystemContext>): Promise<void>;
12
+ //#endregion
13
+ export { create };
14
+ //# sourceMappingURL=create.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.d.mts","names":[],"sources":["../../src/api/create.ts"],"mappings":";;;;;;;AAgCA;;;iBAAsB,MAAA,yBACI,oBAAA,yBACD,mBAAA,CAAA,CACvB,OAAA,EAAS,gBAAA,CAAiB,eAAA,EAAiB,cAAA,IAAe,OAAA"}
@@ -0,0 +1,57 @@
1
+ import { prepare } from "./prepare.mjs";
2
+ import { executeEnvironments } from "@powerlines/core/lib/environment";
3
+ import { joinPaths } from "@stryke/path/join";
4
+ import { listFiles } from "@stryke/fs/list-files";
5
+ import Handlebars from "handlebars";
6
+
7
+ //#region src/api/create.ts
8
+ /**
9
+ * Create a new Powerlines project
10
+ *
11
+ * @param context - The execution context for the create process, which provides access to the project configuration, environment, and utility functions for performing the create operation. The context is used to manage the state and behavior of the create process, allowing for hooks to be called at different stages of the create and for environment-specific configurations to be applied.
12
+ */
13
+ async function create(context) {
14
+ const timer = context.timer("Create a New Project Generation");
15
+ await prepare(context, true);
16
+ await executeEnvironments(context, async (env) => {
17
+ env.debug("Initializing the processing options for the project.");
18
+ await context.callHook("create", {
19
+ environment: env,
20
+ order: "pre"
21
+ });
22
+ const files = await listFiles(joinPaths(env.powerlinesPath, "files/common/**/*.hbs"));
23
+ for (const file of files) {
24
+ env.trace(`Adding template file to project: ${file}`);
25
+ const template = Handlebars.compile(file);
26
+ await env.fs.write(joinPaths(env.config.root, file.replace(".hbs", "")), template(env));
27
+ }
28
+ await context.callHook("create", {
29
+ environment: env,
30
+ order: "normal"
31
+ });
32
+ if (env.config.projectType === "application") {
33
+ const appFiles = await listFiles(joinPaths(env.powerlinesPath, "files/application/**/*.hbs"));
34
+ for (const file of appFiles) {
35
+ env.trace(`Adding application template file: ${file}`);
36
+ const template = Handlebars.compile(file);
37
+ await env.fs.write(joinPaths(env.config.root, file.replace(".hbs", "")), template(env));
38
+ }
39
+ } else {
40
+ const libFiles = await listFiles(joinPaths(env.powerlinesPath, "files/library/**/*.hbs"));
41
+ for (const file of libFiles) {
42
+ env.trace(`Adding library template file: ${file}`);
43
+ const template = Handlebars.compile(file);
44
+ await env.fs.write(joinPaths(env.config.root, file.replace(".hbs", "")), template(env));
45
+ }
46
+ }
47
+ await context.callHook("create", {
48
+ environment: env,
49
+ order: "post"
50
+ });
51
+ });
52
+ timer();
53
+ }
54
+
55
+ //#endregion
56
+ export { create };
57
+ //# sourceMappingURL=create.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.mjs","names":[],"sources":["../../src/api/create.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 { ExecutionContext } from \"@powerlines/core\";\nimport { executeEnvironments } from \"@powerlines/core/lib/environment\";\nimport { listFiles } from \"@stryke/fs/list-files\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport Handlebars from \"handlebars\";\nimport { EngineResolvedConfig } from \"../types/config\";\nimport { EngineSystemContext } from \"../types/context\";\nimport { prepare } from \"./prepare\";\n\n/**\n * Create a new Powerlines project\n *\n * @param context - The execution context for the create process, which provides access to the project configuration, environment, and utility functions for performing the create operation. The context is used to manage the state and behavior of the create process, allowing for hooks to be called at different stages of the create and for environment-specific configurations to be applied.\n */\nexport async function create<\n TResolvedConfig extends EngineResolvedConfig,\n TSystemContext extends EngineSystemContext\n>(context: ExecutionContext<TResolvedConfig, TSystemContext>) {\n const timer = context.timer(\"Create a New Project Generation\");\n\n await prepare<TResolvedConfig, TSystemContext>(context, true);\n await executeEnvironments(context, async env => {\n env.debug(\"Initializing the processing options for the project.\");\n\n await context.callHook(\"create\", {\n environment: env,\n order: \"pre\"\n });\n\n const files = await listFiles(\n joinPaths(env.powerlinesPath, \"files/common/**/*.hbs\")\n );\n for (const file of files) {\n env.trace(`Adding template file to project: ${file}`);\n\n const template = Handlebars.compile(file);\n await env.fs.write(\n joinPaths(env.config.root, file.replace(\".hbs\", \"\")),\n template(env)\n );\n }\n\n await context.callHook(\"create\", {\n environment: env,\n order: \"normal\"\n });\n\n if (env.config.projectType === \"application\") {\n const appFiles = await listFiles(\n joinPaths(env.powerlinesPath, \"files/application/**/*.hbs\")\n );\n for (const file of appFiles) {\n env.trace(`Adding application template file: ${file}`);\n\n const template = Handlebars.compile(file);\n await env.fs.write(\n joinPaths(env.config.root, file.replace(\".hbs\", \"\")),\n template(env)\n );\n }\n } else {\n const libFiles = await listFiles(\n joinPaths(env.powerlinesPath, \"files/library/**/*.hbs\")\n );\n for (const file of libFiles) {\n env.trace(`Adding library template file: ${file}`);\n\n const template = Handlebars.compile(file);\n await env.fs.write(\n joinPaths(env.config.root, file.replace(\".hbs\", \"\")),\n template(env)\n );\n }\n }\n\n await context.callHook(\"create\", {\n environment: env,\n order: \"post\"\n });\n });\n\n timer();\n}\n"],"mappings":";;;;;;;;;;;;AAgCA,eAAsB,OAGpB,SAA4D;CAC5D,MAAM,QAAQ,QAAQ,MAAM,iCAAiC;CAE7D,MAAM,QAAyC,SAAS,IAAI;CAC5D,MAAM,oBAAoB,SAAS,OAAM,QAAO;EAC9C,IAAI,MAAM,sDAAsD;EAEhE,MAAM,QAAQ,SAAS,UAAU;GAC/B,aAAa;GACb,OAAO;EACT,CAAC;EAED,MAAM,QAAQ,MAAM,UAClB,UAAU,IAAI,gBAAgB,uBAAuB,CACvD;EACA,KAAK,MAAM,QAAQ,OAAO;GACxB,IAAI,MAAM,oCAAoC,MAAM;GAEpD,MAAM,WAAW,WAAW,QAAQ,IAAI;GACxC,MAAM,IAAI,GAAG,MACX,UAAU,IAAI,OAAO,MAAM,KAAK,QAAQ,QAAQ,EAAE,CAAC,GACnD,SAAS,GAAG,CACd;EACF;EAEA,MAAM,QAAQ,SAAS,UAAU;GAC/B,aAAa;GACb,OAAO;EACT,CAAC;EAED,IAAI,IAAI,OAAO,gBAAgB,eAAe;GAC5C,MAAM,WAAW,MAAM,UACrB,UAAU,IAAI,gBAAgB,4BAA4B,CAC5D;GACA,KAAK,MAAM,QAAQ,UAAU;IAC3B,IAAI,MAAM,qCAAqC,MAAM;IAErD,MAAM,WAAW,WAAW,QAAQ,IAAI;IACxC,MAAM,IAAI,GAAG,MACX,UAAU,IAAI,OAAO,MAAM,KAAK,QAAQ,QAAQ,EAAE,CAAC,GACnD,SAAS,GAAG,CACd;GACF;EACF,OAAO;GACL,MAAM,WAAW,MAAM,UACrB,UAAU,IAAI,gBAAgB,wBAAwB,CACxD;GACA,KAAK,MAAM,QAAQ,UAAU;IAC3B,IAAI,MAAM,iCAAiC,MAAM;IAEjD,MAAM,WAAW,WAAW,QAAQ,IAAI;IACxC,MAAM,IAAI,GAAG,MACX,UAAU,IAAI,OAAO,MAAM,KAAK,QAAQ,QAAQ,EAAE,CAAC,GACnD,SAAS,GAAG,CACd;GACF;EACF;EAEA,MAAM,QAAQ,SAAS,UAAU;GAC/B,aAAa;GACb,OAAO;EACT,CAAC;CACH,CAAC;CAED,MAAM;AACR"}
@@ -0,0 +1,24 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_api_prepare = require('./prepare.cjs');
3
+ let _powerlines_core_lib_environment = require("@powerlines/core/lib/environment");
4
+
5
+ //#region src/api/deploy.ts
6
+ /**
7
+ * Deploy the project's source files to the target environment.
8
+ *
9
+ * @remarks
10
+ * This function serves as the main entry point for the deployment process, orchestrating the execution of deployment hooks across different environments defined in the project configuration. It ensures that all relevant deployment operations are performed in a structured manner, allowing for pre-deployment, main deployment, and post-deployment hooks to be executed at the appropriate stages of the process. The function also utilizes a timer to measure the duration of the deployment operation, providing insights into the performance of the deployment process.
11
+ *
12
+ * @param context - The execution context for the deploy process, which provides access to the project configuration, environment, and utility functions for performing the deploy operation. The context is used to manage the state and behavior of the deploy process, allowing for hooks to be called at different stages of the deploy and for environment-specific configurations to be applied.
13
+ */
14
+ async function deploy(context) {
15
+ const timer = context.timer("Deployment");
16
+ await require_api_prepare.prepare(context);
17
+ await (0, _powerlines_core_lib_environment.executeEnvironments)(context, async (env) => {
18
+ await context.callHook("deploy", { environment: env });
19
+ });
20
+ timer();
21
+ }
22
+
23
+ //#endregion
24
+ exports.deploy = deploy;
@@ -0,0 +1,17 @@
1
+ import { r as EngineResolvedConfig } from "../config-DKEmqMrh.cjs";
2
+ import { r as EngineSystemContext } from "../context-D0_a0kRO.cjs";
3
+ import { ExecutionContext } from "@powerlines/core";
4
+
5
+ //#region src/api/deploy.d.ts
6
+ /**
7
+ * Deploy the project's source files to the target environment.
8
+ *
9
+ * @remarks
10
+ * This function serves as the main entry point for the deployment process, orchestrating the execution of deployment hooks across different environments defined in the project configuration. It ensures that all relevant deployment operations are performed in a structured manner, allowing for pre-deployment, main deployment, and post-deployment hooks to be executed at the appropriate stages of the process. The function also utilizes a timer to measure the duration of the deployment operation, providing insights into the performance of the deployment process.
11
+ *
12
+ * @param context - The execution context for the deploy process, which provides access to the project configuration, environment, and utility functions for performing the deploy operation. The context is used to manage the state and behavior of the deploy process, allowing for hooks to be called at different stages of the deploy and for environment-specific configurations to be applied.
13
+ */
14
+ declare function deploy<TResolvedConfig extends EngineResolvedConfig, TSystemContext extends EngineSystemContext>(context: ExecutionContext<TResolvedConfig, TSystemContext>): Promise<void>;
15
+ //#endregion
16
+ export { deploy };
17
+ //# sourceMappingURL=deploy.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deploy.d.cts","names":[],"sources":["../../src/api/deploy.ts"],"mappings":";;;;;;;AAgCA;;;;;;iBAAsB,MAAA,yBACI,oBAAA,yBACD,mBAAA,CAAA,CACvB,OAAA,EAAS,gBAAA,CAAiB,eAAA,EAAiB,cAAA,IAAe,OAAA"}
@@ -0,0 +1,17 @@
1
+ import { r as EngineResolvedConfig } from "../config-ByLyzMI0.mjs";
2
+ import { r as EngineSystemContext } from "../context-DcXV6_GL.mjs";
3
+ import { ExecutionContext } from "@powerlines/core";
4
+
5
+ //#region src/api/deploy.d.ts
6
+ /**
7
+ * Deploy the project's source files to the target environment.
8
+ *
9
+ * @remarks
10
+ * This function serves as the main entry point for the deployment process, orchestrating the execution of deployment hooks across different environments defined in the project configuration. It ensures that all relevant deployment operations are performed in a structured manner, allowing for pre-deployment, main deployment, and post-deployment hooks to be executed at the appropriate stages of the process. The function also utilizes a timer to measure the duration of the deployment operation, providing insights into the performance of the deployment process.
11
+ *
12
+ * @param context - The execution context for the deploy process, which provides access to the project configuration, environment, and utility functions for performing the deploy operation. The context is used to manage the state and behavior of the deploy process, allowing for hooks to be called at different stages of the deploy and for environment-specific configurations to be applied.
13
+ */
14
+ declare function deploy<TResolvedConfig extends EngineResolvedConfig, TSystemContext extends EngineSystemContext>(context: ExecutionContext<TResolvedConfig, TSystemContext>): Promise<void>;
15
+ //#endregion
16
+ export { deploy };
17
+ //# sourceMappingURL=deploy.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deploy.d.mts","names":[],"sources":["../../src/api/deploy.ts"],"mappings":";;;;;;;AAgCA;;;;;;iBAAsB,MAAA,yBACI,oBAAA,yBACD,mBAAA,CAAA,CACvB,OAAA,EAAS,gBAAA,CAAiB,eAAA,EAAiB,cAAA,IAAe,OAAA"}
@@ -0,0 +1,24 @@
1
+ import { prepare } from "./prepare.mjs";
2
+ import { executeEnvironments } from "@powerlines/core/lib/environment";
3
+
4
+ //#region src/api/deploy.ts
5
+ /**
6
+ * Deploy the project's source files to the target environment.
7
+ *
8
+ * @remarks
9
+ * This function serves as the main entry point for the deployment process, orchestrating the execution of deployment hooks across different environments defined in the project configuration. It ensures that all relevant deployment operations are performed in a structured manner, allowing for pre-deployment, main deployment, and post-deployment hooks to be executed at the appropriate stages of the process. The function also utilizes a timer to measure the duration of the deployment operation, providing insights into the performance of the deployment process.
10
+ *
11
+ * @param context - The execution context for the deploy process, which provides access to the project configuration, environment, and utility functions for performing the deploy operation. The context is used to manage the state and behavior of the deploy process, allowing for hooks to be called at different stages of the deploy and for environment-specific configurations to be applied.
12
+ */
13
+ async function deploy(context) {
14
+ const timer = context.timer("Deployment");
15
+ await prepare(context);
16
+ await executeEnvironments(context, async (env) => {
17
+ await context.callHook("deploy", { environment: env });
18
+ });
19
+ timer();
20
+ }
21
+
22
+ //#endregion
23
+ export { deploy };
24
+ //# sourceMappingURL=deploy.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deploy.mjs","names":[],"sources":["../../src/api/deploy.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 { ExecutionContext } from \"@powerlines/core\";\nimport { executeEnvironments } from \"@powerlines/core/lib/environment\";\nimport { EngineResolvedConfig } from \"../types/config\";\nimport { EngineSystemContext } from \"../types/context\";\nimport { prepare } from \"./prepare\";\n\n/**\n * Deploy the project's source files to the target environment.\n *\n * @remarks\n * This function serves as the main entry point for the deployment process, orchestrating the execution of deployment hooks across different environments defined in the project configuration. It ensures that all relevant deployment operations are performed in a structured manner, allowing for pre-deployment, main deployment, and post-deployment hooks to be executed at the appropriate stages of the process. The function also utilizes a timer to measure the duration of the deployment operation, providing insights into the performance of the deployment process.\n *\n * @param context - The execution context for the deploy process, which provides access to the project configuration, environment, and utility functions for performing the deploy operation. The context is used to manage the state and behavior of the deploy process, allowing for hooks to be called at different stages of the deploy and for environment-specific configurations to be applied.\n */\nexport async function deploy<\n TResolvedConfig extends EngineResolvedConfig,\n TSystemContext extends EngineSystemContext\n>(context: ExecutionContext<TResolvedConfig, TSystemContext>) {\n const timer = context.timer(\"Deployment\");\n\n await prepare<TResolvedConfig, TSystemContext>(context);\n await executeEnvironments(context, async env => {\n await context.callHook(\"deploy\", {\n environment: env\n });\n });\n\n timer();\n}\n"],"mappings":";;;;;;;;;;;;AAgCA,eAAsB,OAGpB,SAA4D;CAC5D,MAAM,QAAQ,QAAQ,MAAM,YAAY;CAExC,MAAM,QAAyC,OAAO;CACtD,MAAM,oBAAoB,SAAS,OAAM,QAAO;EAC9C,MAAM,QAAQ,SAAS,UAAU,EAC/B,aAAa,IACf,CAAC;CACH,CAAC;CAED,MAAM;AACR"}
@@ -0,0 +1,24 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_api_prepare = require('./prepare.cjs');
3
+ let _powerlines_core_lib_environment = require("@powerlines/core/lib/environment");
4
+
5
+ //#region src/api/docs.ts
6
+ /**
7
+ * Generate the project's documentation.
8
+ *
9
+ * @remarks
10
+ * This function serves as the main entry point for the documentation generation process, orchestrating the execution of documentation hooks across different environments defined in the project configuration. It ensures that all relevant documentation operations are performed in a structured manner, allowing for pre-documentation, main documentation, and post-documentation hooks to be executed at the appropriate stages of the process. The function also utilizes a timer to measure the duration of the documentation operation, providing insights into the performance of the documentation process.
11
+ *
12
+ * @param context - The execution context for the documentation process, which provides access to the project configuration, environment, and utility functions for performing the documentation operation. The context is used to manage the state and behavior of the documentation process, allowing for hooks to be called at different stages of the documentation and for environment-specific configurations to be applied.
13
+ */
14
+ async function docs(context) {
15
+ const timer = context.timer("Documentation");
16
+ await require_api_prepare.prepare(context);
17
+ await (0, _powerlines_core_lib_environment.executeEnvironments)(context, async (env) => {
18
+ await context.callHook("docs", { environment: env });
19
+ });
20
+ timer();
21
+ }
22
+
23
+ //#endregion
24
+ exports.docs = docs;