@powerlines/engine 0.0.25 → 0.9.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 (191) hide show
  1. package/dist/api/build.cjs +66 -0
  2. package/dist/api/build.d.cts +14 -0
  3. package/dist/api/build.d.cts.map +1 -0
  4. package/dist/api/build.d.mts +14 -0
  5. package/dist/api/build.d.mts.map +1 -0
  6. package/dist/api/build.mjs +64 -0
  7. package/dist/api/build.mjs.map +1 -0
  8. package/dist/api/clean.cjs +29 -0
  9. package/dist/api/clean.d.cts +14 -0
  10. package/dist/api/clean.d.cts.map +1 -0
  11. package/dist/api/clean.d.mts +14 -0
  12. package/dist/api/clean.d.mts.map +1 -0
  13. package/dist/api/clean.mjs +28 -0
  14. package/dist/api/clean.mjs.map +1 -0
  15. package/dist/api/create.cjs +59 -0
  16. package/dist/api/create.d.cts +14 -0
  17. package/dist/api/create.d.cts.map +1 -0
  18. package/dist/api/create.d.mts +14 -0
  19. package/dist/api/create.d.mts.map +1 -0
  20. package/dist/api/create.mjs +57 -0
  21. package/dist/api/create.mjs.map +1 -0
  22. package/dist/api/deploy.cjs +25 -0
  23. package/dist/api/deploy.d.cts +17 -0
  24. package/dist/api/deploy.d.cts.map +1 -0
  25. package/dist/api/deploy.d.mts +17 -0
  26. package/dist/api/deploy.d.mts.map +1 -0
  27. package/dist/api/deploy.mjs +24 -0
  28. package/dist/api/deploy.mjs.map +1 -0
  29. package/dist/api/docs.cjs +25 -0
  30. package/dist/api/docs.d.cts +17 -0
  31. package/dist/api/docs.d.cts.map +1 -0
  32. package/dist/api/docs.d.mts +17 -0
  33. package/dist/api/docs.d.mts.map +1 -0
  34. package/dist/api/docs.mjs +24 -0
  35. package/dist/api/docs.mjs.map +1 -0
  36. package/dist/api/lint.cjs +28 -0
  37. package/dist/api/lint.d.cts +17 -0
  38. package/dist/api/lint.d.cts.map +1 -0
  39. package/dist/api/lint.d.mts +17 -0
  40. package/dist/api/lint.d.mts.map +1 -0
  41. package/dist/api/lint.mjs +27 -0
  42. package/dist/api/lint.mjs.map +1 -0
  43. package/dist/api/prepare.cjs +69 -0
  44. package/dist/api/prepare.d.cts +14 -0
  45. package/dist/api/prepare.d.cts.map +1 -0
  46. package/dist/api/prepare.d.mts +14 -0
  47. package/dist/api/prepare.d.mts.map +1 -0
  48. package/dist/api/prepare.mjs +68 -0
  49. package/dist/api/prepare.mjs.map +1 -0
  50. package/dist/api/test.cjs +28 -0
  51. package/dist/api/test.d.cts +17 -0
  52. package/dist/api/test.d.cts.map +1 -0
  53. package/dist/api/test.d.mts +17 -0
  54. package/dist/api/test.d.mts.map +1 -0
  55. package/dist/api/test.mjs +27 -0
  56. package/dist/api/test.mjs.map +1 -0
  57. package/dist/api/types.cjs +71 -0
  58. package/dist/api/types.d.cts +17 -0
  59. package/dist/api/types.d.cts.map +1 -0
  60. package/dist/api/types.d.mts +17 -0
  61. package/dist/api/types.d.mts.map +1 -0
  62. package/dist/api/types.mjs +70 -0
  63. package/dist/api/types.mjs.map +1 -0
  64. package/dist/api-Bi_h4LMX.d.cts +135 -0
  65. package/dist/api-Bi_h4LMX.d.cts.map +1 -0
  66. package/dist/api-oIs2Wp3t.d.mts +135 -0
  67. package/dist/api-oIs2Wp3t.d.mts.map +1 -0
  68. package/dist/config-B_E_HMcT.d.cts +200 -0
  69. package/dist/config-B_E_HMcT.d.cts.map +1 -0
  70. package/dist/config-FB8Zqjjz.d.mts +200 -0
  71. package/dist/config-FB8Zqjjz.d.mts.map +1 -0
  72. package/dist/context/index.cjs +2 -9
  73. package/dist/context/index.d.cts +2 -660
  74. package/dist/context/index.d.mts +2 -660
  75. package/dist/context/index.mjs +2 -4
  76. package/dist/context-DrNQXXRC.d.mts +149 -0
  77. package/dist/context-DrNQXXRC.d.mts.map +1 -0
  78. package/dist/context-LQBeYY23.d.cts +149 -0
  79. package/dist/context-LQBeYY23.d.cts.map +1 -0
  80. package/dist/engine-context-BBSMtv0b.d.mts +54 -0
  81. package/dist/engine-context-BBSMtv0b.d.mts.map +1 -0
  82. package/dist/engine-context-C6bNxumd.d.cts +54 -0
  83. package/dist/engine-context-C6bNxumd.d.cts.map +1 -0
  84. package/dist/engine-context-SEzTm1aq.cjs +179 -0
  85. package/dist/engine-context-f72fUF0N.mjs +173 -0
  86. package/dist/engine-context-f72fUF0N.mjs.map +1 -0
  87. package/dist/engine.cjs +267 -0
  88. package/dist/engine.d.cts +143 -0
  89. package/dist/engine.d.cts.map +1 -0
  90. package/dist/engine.d.mts +143 -0
  91. package/dist/engine.d.mts.map +1 -0
  92. package/dist/engine.mjs +263 -0
  93. package/dist/engine.mjs.map +1 -0
  94. package/dist/helpers/create-execution-host.cjs +48 -0
  95. package/dist/helpers/create-execution-host.d.cts +18 -0
  96. package/dist/helpers/create-execution-host.d.cts.map +1 -0
  97. package/dist/helpers/create-execution-host.d.mts +18 -0
  98. package/dist/helpers/create-execution-host.d.mts.map +1 -0
  99. package/dist/helpers/create-execution-host.mjs +47 -0
  100. package/dist/helpers/create-execution-host.mjs.map +1 -0
  101. package/dist/helpers/execution-host-worker.cjs +307 -0
  102. package/dist/helpers/execution-host-worker.d.cts +64 -0
  103. package/dist/helpers/execution-host-worker.d.cts.map +1 -0
  104. package/dist/helpers/execution-host-worker.d.mts +64 -0
  105. package/dist/helpers/execution-host-worker.d.mts.map +1 -0
  106. package/dist/helpers/execution-host-worker.mjs +306 -0
  107. package/dist/helpers/execution-host-worker.mjs.map +1 -0
  108. package/dist/helpers/finalize.cjs +27 -0
  109. package/dist/helpers/finalize.d.cts +12 -0
  110. package/dist/helpers/finalize.d.cts.map +1 -0
  111. package/dist/helpers/finalize.d.mts +12 -0
  112. package/dist/helpers/finalize.d.mts.map +1 -0
  113. package/dist/helpers/finalize.mjs +26 -0
  114. package/dist/helpers/finalize.mjs.map +1 -0
  115. package/dist/helpers/rpc.cjs +140 -0
  116. package/dist/helpers/rpc.d.cts +7 -0
  117. package/dist/helpers/rpc.d.cts.map +1 -0
  118. package/dist/helpers/rpc.d.mts +7 -0
  119. package/dist/helpers/rpc.d.mts.map +1 -0
  120. package/dist/helpers/rpc.mjs +139 -0
  121. package/dist/helpers/rpc.mjs.map +1 -0
  122. package/dist/index.cjs +4 -567
  123. package/dist/index.d.cts +5 -126
  124. package/dist/index.d.mts +5 -126
  125. package/dist/index.mjs +2 -567
  126. package/dist/worker/execution-host.cjs +577 -0
  127. package/dist/worker/execution-host.d.cts +76 -0
  128. package/dist/worker/execution-host.d.cts.map +1 -0
  129. package/dist/worker/execution-host.d.mts +76 -0
  130. package/dist/worker/execution-host.d.mts.map +1 -0
  131. package/dist/worker/execution-host.mjs +540 -0
  132. package/dist/worker/execution-host.mjs.map +1 -0
  133. package/package.json +88 -124
  134. package/dist/_internal/worker.cjs +0 -4844
  135. package/dist/_internal/worker.d.cts +0 -38
  136. package/dist/_internal/worker.d.cts.map +0 -1
  137. package/dist/_internal/worker.d.mts +0 -38
  138. package/dist/_internal/worker.d.mts.map +0 -1
  139. package/dist/_internal/worker.mjs +0 -4805
  140. package/dist/_internal/worker.mjs.map +0 -1
  141. package/dist/api.cjs +0 -1274
  142. package/dist/api.d.cts +0 -265
  143. package/dist/api.d.cts.map +0 -1
  144. package/dist/api.d.mts +0 -265
  145. package/dist/api.d.mts.map +0 -1
  146. package/dist/api.mjs +0 -1270
  147. package/dist/api.mjs.map +0 -1
  148. package/dist/base-context-BUnL_9z8.mjs +0 -241
  149. package/dist/base-context-BUnL_9z8.mjs.map +0 -1
  150. package/dist/base-context-CFvO2N9I.cjs +0 -248
  151. package/dist/context/index.d.cts.map +0 -1
  152. package/dist/context/index.d.mts.map +0 -1
  153. package/dist/engine-context-BuD9AGfd.mjs +0 -41
  154. package/dist/engine-context-BuD9AGfd.mjs.map +0 -1
  155. package/dist/engine-context-NO6enYev.cjs +0 -45
  156. package/dist/execution-context-Cq9cjr28.mjs +0 -2571
  157. package/dist/execution-context-Cq9cjr28.mjs.map +0 -1
  158. package/dist/execution-context-CyDSAifN.cjs +0 -2615
  159. package/dist/fs-D1nIP45P.mjs +0 -226
  160. package/dist/fs-D1nIP45P.mjs.map +0 -1
  161. package/dist/fs-XogSgMqT.cjs +0 -262
  162. package/dist/index.d.cts.map +0 -1
  163. package/dist/index.d.mts.map +0 -1
  164. package/dist/index.mjs.map +0 -1
  165. package/dist/schemas.cjs +0 -9
  166. package/dist/schemas.d.cts +0 -127
  167. package/dist/schemas.d.cts.map +0 -1
  168. package/dist/schemas.d.mts +0 -127
  169. package/dist/schemas.d.mts.map +0 -1
  170. package/dist/schemas.mjs +0 -3
  171. package/dist/storage/index.cjs +0 -9
  172. package/dist/storage/index.d.cts +0 -419
  173. package/dist/storage/index.d.cts.map +0 -1
  174. package/dist/storage/index.d.mts +0 -419
  175. package/dist/storage/index.d.mts.map +0 -1
  176. package/dist/storage/index.mjs +0 -3
  177. package/dist/ts-morph-BaLPVAdB.cjs +0 -114
  178. package/dist/ts-morph-D0CaA37w.mjs +0 -102
  179. package/dist/ts-morph-D0CaA37w.mjs.map +0 -1
  180. package/dist/tsconfig-Cstsoprg.mjs +0 -155
  181. package/dist/tsconfig-Cstsoprg.mjs.map +0 -1
  182. package/dist/tsconfig-DeyWQC2N.cjs +0 -198
  183. package/dist/typescript/index.cjs +0 -13
  184. package/dist/typescript/index.d.cts +0 -106
  185. package/dist/typescript/index.d.cts.map +0 -1
  186. package/dist/typescript/index.d.mts +0 -106
  187. package/dist/typescript/index.d.mts.map +0 -1
  188. package/dist/typescript/index.mjs +0 -4
  189. package/dist/virtual-BNdKVkRw.cjs +0 -548
  190. package/dist/virtual-gIlTc3Lj.mjs +0 -513
  191. package/dist/virtual-gIlTc3Lj.mjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execution-host.mjs","names":["prepare","formatFolder","build","prepare","clean","prepare","joinPaths","create","prepare","joinPaths","deploy","prepare","docs","prepare","lint","prepare","test","prepare","types","prepare","createDevframeRpcClient","createRpcClient","createRpcClient","executeTypes","executePrepare","executeCreate","executeClean","executeLint","executeTest","executeBuild","executeDocs","executeDeploy"],"sources":["../../src/api/prepare.ts","../../src/api/build.ts","../../src/api/clean.ts","../../src/api/create.ts","../../src/api/deploy.ts","../../src/api/docs.ts","../../src/api/lint.ts","../../src/api/test.ts","../../src/api/types.ts","../../src/helpers/rpc.ts","../../src/helpers/create-execution-host.ts","../../src/execution-host.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { ExecutionContext } from \"@powerlines/core\";\nimport { executeEnvironments } from \"@powerlines/core/lib/environment\";\nimport { handleTypes } from \"@powerlines/core/lib/generate-types\";\nimport { installDependencies } from \"@powerlines/core/lib/install-dependencies\";\nimport { writeMetaFile } from \"@powerlines/core/lib/meta\";\nimport {\n initializeTsconfig,\n resolveTsconfig\n} from \"@powerlines/core/lib/typescript/tsconfig\";\nimport { formatFolder } from \"@powerlines/core/lib/utilities/format\";\nimport { formatConfig } from \"@powerlines/core/plugin-utils\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { createDirectory } from \"@stryke/fs/helpers\";\nimport { isObject } from \"@stryke/type-checks/is-object\";\nimport { EngineResolvedConfig } from \"../types/config\";\nimport { EngineSystemContext } from \"../types/context\";\n\n/**\n * Prepare the project\n *\n * @param context - The execution context for the build process, which provides access to the project configuration, environment, and utility functions for performing the build. The context is used to manage the state and behavior of the build process, allowing for hooks to be called at different stages of the build and for environment-specific configurations to be applied.\n */\nexport async function prepare<\n TResolvedConfig extends EngineResolvedConfig,\n TSystemContext extends EngineSystemContext\n>(\n context: ExecutionContext<TResolvedConfig, TSystemContext>,\n skipTypes = false\n) {\n const timer = context.timer(\"Preparation\");\n\n await executeEnvironments(context, async env => {\n env.debug(\n `Initializing the processing options for the Powerlines project.`\n );\n\n await context.callHook(\"configResolved\", {\n environment: env,\n order: \"pre\"\n });\n\n await initializeTsconfig<TResolvedConfig, TSystemContext>(env);\n\n await context.callHook(\"configResolved\", {\n environment: env,\n order: \"normal\"\n });\n\n if (env.entry.length > 0) {\n 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 env.trace({\n meta: {\n category: \"config\"\n },\n message: `Powerlines configuration after configResolved hook: \\n${formatConfig(\n env.config\n )}`\n });\n\n if (!env.fs.existsSync(env.cachePath)) {\n await createDirectory(env.cachePath);\n }\n\n if (!env.fs.existsSync(env.dataPath)) {\n await createDirectory(env.dataPath);\n }\n\n await context.callHook(\"prepare\", {\n environment: env,\n order: \"pre\"\n });\n await context.callHook(\"prepare\", {\n environment: env,\n order: \"normal\"\n });\n\n await context.callHook(\"prepare\", {\n environment: env,\n order: \"post\"\n });\n\n if (!skipTypes && env.config.output.types !== false) {\n await handleTypes(context, env);\n }\n\n context.debug(\"Formatting files generated during the prepare step.\");\n\n await Promise.all([\n formatFolder(env, env.builtinsPath),\n formatFolder(env, env.entryPath)\n ]);\n\n await writeMetaFile(env);\n env.persistedMeta = env.meta;\n });\n\n timer();\n}\n","/* -------------------------------------------------------------------\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","/* -------------------------------------------------------------------\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","/* -------------------------------------------------------------------\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","/* -------------------------------------------------------------------\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","/* -------------------------------------------------------------------\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 * Generate the project's documentation.\n *\n * @remarks\n * 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.\n *\n * @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.\n */\nexport async function docs<\n TResolvedConfig extends EngineResolvedConfig,\n TSystemContext extends EngineSystemContext\n>(context: ExecutionContext<TResolvedConfig, TSystemContext>) {\n const timer = context.timer(\"Documentation\");\n\n await prepare<TResolvedConfig, TSystemContext>(context);\n await executeEnvironments(context, async env => {\n await context.callHook(\"docs\", {\n environment: env\n });\n });\n\n timer();\n}\n","/* -------------------------------------------------------------------\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 * Lint the project's source files and report any issues found.\n *\n * @remarks\n * This function serves as the main entry point for the linting process, orchestrating the execution of linting hooks across different environments defined in the project configuration. It ensures that all relevant linting operations are performed in a structured manner, allowing for pre-linting, main linting, and post-linting hooks to be executed at the appropriate stages of the process. The function also utilizes a timer to measure the duration of the linting operation, providing insights into the performance of the linting process.\n *\n * @param context - The execution context for the lint process, which provides access to the project configuration, environment, and utility functions for performing the lint operation. The context is used to manage the state and behavior of the lint process, allowing for hooks to be called at different stages of the lint and for environment-specific configurations to be applied.\n */\nexport async function lint<\n TResolvedConfig extends EngineResolvedConfig,\n TSystemContext extends EngineSystemContext\n>(context: ExecutionContext<TResolvedConfig, TSystemContext>) {\n const timer = context.timer(\"Linting\");\n\n await prepare<TResolvedConfig, TSystemContext>(context);\n await executeEnvironments(context, async env => {\n await context.callHook(\"lint\", {\n environment: env,\n sequential: false\n });\n });\n\n timer();\n}\n","/* -------------------------------------------------------------------\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 * Test the project's source files and report any issues found.\n *\n * @remarks\n * This function serves as the main entry point for the testing process, orchestrating the execution of testing hooks across different environments defined in the project configuration. It ensures that all relevant testing operations are performed in a structured manner, allowing for pre-testing, main testing, and post-testing hooks to be executed at the appropriate stages of the process. The function also utilizes a timer to measure the duration of the testing operation, providing insights into the performance of the testing process.\n *\n * @param context - The execution context for the test process, which provides access to the project configuration, environment, and utility functions for performing the test operation. The context is used to manage the state and behavior of the test process, allowing for hooks to be called at different stages of the test and for environment-specific configurations to be applied.\n */\nexport async function test<\n TResolvedConfig extends EngineResolvedConfig,\n TSystemContext extends EngineSystemContext\n>(context: ExecutionContext<TResolvedConfig, TSystemContext>) {\n const timer = context.timer(\"Testing\");\n\n await prepare(context);\n await executeEnvironments(context, async env => {\n await context.callHook(\"test\", {\n environment: env,\n sequential: false\n });\n });\n\n timer();\n}\n","/* -------------------------------------------------------------------\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","/* -------------------------------------------------------------------\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 { createEventEmitter } from \"@powerlines/core/lib/events\";\nimport { isNumber } from \"@stryke/type-checks/is-number\";\nimport { isSet } from \"@stryke/type-checks/is-set\";\nimport { StormURL } from \"@stryke/url\";\nimport { BirpcOptions } from \"birpc\";\nimport {\n createRpcStreamingClientHost,\n DevToolsClientRpcHost,\n DevToolsRpcClientMode,\n RpcClientEvents\n} from \"devframe/client\";\nimport { RpcCacheManager, RpcFunctionsCollectorBase } from \"devframe/rpc\";\nimport { createRpcClient as createDevframeRpcClient } from \"devframe/rpc/client\";\nimport {\n createWsRpcChannel,\n WsRpcChannelOptions\n} from \"devframe/rpc/transports/ws-client\";\nimport {\n ConnectionMeta,\n EventEmitter as DevFrameEventEmitter\n} from \"devframe/types\";\nimport { promiseWithResolver } from \"devframe/utils/promise\";\nimport { humanId } from \"human-id\";\nimport { EventEmitter } from \"node:events\";\nimport { RpcClientOptions } from \"../types/config\";\nimport {\n RpcClient,\n RpcClientFunctions,\n RpcContext,\n RpcServerFunctions\n} from \"../types/rpc\";\n\nfunction createWsRpcClientMode(\n baseURL: StormURL,\n connectionMeta: ConnectionMeta,\n events: DevFrameEventEmitter<RpcClientEvents>,\n clientRpc: DevToolsClientRpcHost,\n authToken: string = humanId({ separator: \"-\", capitalize: false }),\n rpcOptions: Partial<\n BirpcOptions<RpcServerFunctions, RpcClientFunctions, boolean>\n > = {},\n wsOptions: Partial<WsRpcChannelOptions> = {}\n): DevToolsRpcClientMode {\n let isTrusted = false;\n const trustedPromise = promiseWithResolver<boolean>();\n const url =\n isNumber(connectionMeta.websocket) ||\n (isSet(connectionMeta.websocket) &&\n `${+connectionMeta.websocket}` === `${connectionMeta.websocket}`)\n ? `${baseURL.protocol.replace(\"http\", \"ws\")}//${baseURL.hostname}:${connectionMeta.websocket}`\n : (connectionMeta.websocket as string);\n\n // Build a minimal `defs` map from the connection meta so the per-call\n // wire serializer dispatches outgoing requests with the correct\n // encoding (JSON for `jsonSerializable: true` methods; structured-\n // clone for the rest).\n const definitions = new Map<string, { jsonSerializable: true }>();\n for (const name of connectionMeta.jsonSerializableMethods ?? [])\n definitions.set(name, { jsonSerializable: true });\n\n const serverRpc = createDevframeRpcClient<\n RpcServerFunctions,\n RpcClientFunctions\n >(clientRpc.functions, {\n channel: createWsRpcChannel({\n url,\n authToken,\n definitions,\n ...wsOptions\n }),\n rpcOptions\n });\n\n // Handle server-initiated auth revocation\n clientRpc.register({\n name: \"devframe:auth:revoked\",\n type: \"event\",\n handler: () => {\n isTrusted = false;\n events.emit(\"rpc:is-trusted:updated\", false);\n }\n });\n\n let currentAuthToken = authToken;\n\n async function requestTrustWithToken(token: string) {\n currentAuthToken = token;\n\n // const info = parseUA(navigator.userAgent);\n // const ua = [\n // \"powerlines\",\n // \"1.0\",\n // \"|\",\n // info.os.name,\n // info.os.version,\n // info.device.type\n // ]\n // .filter(i => i)\n // .join(\" \");\n\n // const result = await serverRpc.$call(\"vite:anonymous:auth\", {\n // authToken: token,\n // ua,\n // origin: baseURL.origin\n // });\n\n // isTrusted = result.isTrusted;\n // trustedPromise.resolve(isTrusted);\n // events.emit(\"rpc:is-trusted:updated\", isTrusted);\n // return result.isTrusted;\n\n return true;\n }\n\n async function requestTrust() {\n if (isTrusted) return true;\n return requestTrustWithToken(currentAuthToken);\n }\n\n async function ensureTrusted(timeout = 60_000): Promise<boolean> {\n if (isTrusted) trustedPromise.resolve(true);\n\n if (timeout <= 0) return trustedPromise.promise;\n\n let clear = () => {};\n await Promise.race([\n trustedPromise.promise.then(clear),\n new Promise((resolve, reject) => {\n const id = setTimeout(() => {\n reject(new Error(\"Timeout waiting for rpc to be trusted\"));\n }, timeout);\n clear = () => clearTimeout(id);\n })\n ]);\n\n return isTrusted;\n }\n\n return {\n get isTrusted() {\n return isTrusted;\n },\n requestTrust,\n requestTrustWithToken,\n ensureTrusted,\n call: (...args: any): any => {\n return serverRpc.$call(\n // @ts-expect-error casting\n ...args\n );\n },\n callEvent: (...args: any): any => {\n return serverRpc.$callEvent(\n // @ts-expect-error casting\n ...args\n );\n },\n callOptional: (...args: any): any => {\n return serverRpc.$callOptional(\n // @ts-expect-error casting\n ...args\n );\n }\n };\n}\n\nconst CONNECTION_AUTH_TOKEN_KEY = \"__DEVTOOLS_CONNECTION_AUTH_TOKEN__\";\n\nexport function createRpcClient(options: RpcClientOptions) {\n const baseURL = new StormURL(options.baseURL);\n\n const cacheManager = new RpcCacheManager({\n functions: [],\n ...(typeof options.cacheOptions === \"object\" ? options.cacheOptions : {})\n });\n const context: RpcContext = {\n rpc: undefined!\n };\n\n const clientRpc: DevToolsClientRpcHost = new RpcFunctionsCollectorBase<\n RpcClientFunctions,\n RpcContext\n >(context);\n\n EventEmitter.setMaxListeners(100);\n const events = createEventEmitter<RpcClientEvents>();\n\n const mode = createWsRpcClientMode(\n baseURL,\n options.connection,\n events,\n clientRpc,\n undefined,\n {\n ...options.rpcOptions,\n async onRequest(req, next, resolve) {\n await options.rpcOptions?.onRequest?.call(this, req, next, resolve);\n if (options.cacheOptions && cacheManager?.validate(req.m)) {\n const cached = cacheManager.cached(req.m, req.a);\n if (cached) {\n return resolve(cached);\n } else {\n const res = await next(req);\n cacheManager?.apply(req, res);\n }\n } else {\n await next(req);\n }\n }\n },\n options.wsOptions\n );\n\n const rpc: RpcClient = {\n events,\n get isTrusted() {\n return mode.isTrusted;\n },\n connectionMeta: options.connection,\n ensureTrusted: mode.ensureTrusted,\n requestTrust: mode.requestTrust,\n requestTrustWithToken: async (token: string) => {\n // Update stored token for future reconnections\n localStorage.setItem(CONNECTION_AUTH_TOKEN_KEY, token);\n (globalThis as any)[CONNECTION_AUTH_TOKEN_KEY] = token;\n return mode.requestTrustWithToken(token);\n },\n call: mode.call,\n callEvent: mode.callEvent,\n callOptional: mode.callOptional,\n client: clientRpc,\n sharedState: undefined!,\n streaming: undefined!,\n cacheManager\n };\n\n // rpc.sharedState = createRpcSharedStateClientHost(rpc);\n rpc.streaming = createRpcStreamingClientHost(rpc);\n\n // @ts-expect-error assign to readonly property\n context.rpc = rpc;\n void mode.requestTrust();\n\n // Listen for auth updates from other tabs (e.g., auth URL page)\n try {\n const bc = new BroadcastChannel(\"vite-devtools-auth\");\n bc.onmessage = event => {\n if (event.data?.type === \"auth-update\" && event.data.authToken) {\n void rpc.requestTrustWithToken(event.data.authToken);\n }\n };\n } catch {\n // BroadcastChannel is not supported in all environments, so we can safely ignore errors here\n }\n\n return rpc;\n}\n","/* -------------------------------------------------------------------\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 { LogFnMeta } from \"@powerlines/core\";\nimport { PowerlinesExecutionContext } from \"@powerlines/core/context/execution-context\";\nimport { resolvePluginConfig } from \"@powerlines/core/lib/context-helpers\";\nimport { consoleLogger } from \"@powerlines/core/plugin-utils\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { uuid } from \"@stryke/unique-id/uuid\";\nimport { RpcClient } from \"../types\";\nimport { ExecutionHostParams } from \"../types/api\";\nimport { EngineResolvedConfig } from \"../types/config\";\nimport { EngineSystemContext } from \"../types/context\";\nimport { createRpcClient } from \"./rpc\";\n\n/**\n * Creates an execution host with the provided methods. Each method will be wrapped to create an execution context and handle errors appropriately.\n *\n * @param methods - An object where keys are method names and values are functions that take an execution context and return a promise.\n * @returns An object with the same keys as the input methods, but each function is wrapped to create an execution context and handle errors.\n */\nexport function createExecutionHost<\n TContext extends PowerlinesExecutionContext<\n EngineResolvedConfig,\n EngineSystemContext\n > = PowerlinesExecutionContext<EngineResolvedConfig, EngineSystemContext>\n>(methods: Record<string, (context: TContext) => Promise<void>>) {\n return Object.fromEntries(\n Object.entries(methods).map(([method, fn]) => [\n method,\n async (params: ExecutionHostParams) => {\n const { options, inlineConfig } = params;\n\n let rpc!: RpcClient;\n if (options.baseURL && options.connection) {\n rpc = createRpcClient(options);\n } else {\n throw new Error(\n `Execution RPC client could not be created - Missing ${\n !options.baseURL\n ? `baseURL${options.connection ? ` and connection information` : \"\"}`\n : \"connection\"\n } or connection information.`\n );\n }\n\n const logFn = (meta: LogFnMeta, message: string) => {\n consoleLogger(meta, message);\n if (rpc) {\n void rpc.callEvent(\"powerlines:log\", {\n meta: {\n category: \"general\",\n ...options,\n ...(isSetObject(meta) ? meta : { type: meta }),\n logId: uuid(),\n timestamp: Date.now()\n },\n message\n });\n }\n };\n\n const context = (await PowerlinesExecutionContext.from<\n EngineResolvedConfig,\n EngineSystemContext\n >({ ...options, logFn }, inlineConfig ?? {}, {\n rpc\n })) as TContext;\n\n context.logger.info(\n `Starting ${\n titleCase(options.framework?.name) || \"Powerlines\"\n } - ${titleCase(method)} execution (${options.executionId})`\n );\n\n await resolvePluginConfig(context as PowerlinesExecutionContext<any>);\n\n await fn(context);\n }\n ])\n );\n}\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { build as executeBuild } from \"./api/build\";\nimport { clean as executeClean } from \"./api/clean\";\nimport { create as executeCreate } from \"./api/create\";\nimport { deploy as executeDeploy } from \"./api/deploy\";\nimport { docs as executeDocs } from \"./api/docs\";\nimport { lint as executeLint } from \"./api/lint\";\nimport { prepare as executePrepare } from \"./api/prepare\";\nimport { test as executeTest } from \"./api/test\";\nimport { types as executeTypes } from \"./api/types\";\nimport { createExecutionHost } from \"./helpers/create-execution-host\";\n\nconst executionHost = createExecutionHost({\n types: executeTypes,\n prepare: executePrepare,\n create: executeCreate,\n clean: executeClean,\n lint: executeLint,\n test: executeTest,\n build: executeBuild,\n docs: executeDocs,\n deploy: executeDeploy\n});\n\nexport const types = executionHost.types;\nexport const prepare = executionHost.prepare;\nexport const create = executionHost.create;\nexport const clean = executionHost.clean;\nexport const lint = executionHost.lint;\nexport const test = executionHost.test;\nexport const build = executionHost.build;\nexport const docs = executionHost.docs;\nexport const deploy = executionHost.deploy;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCA,eAAsBA,UAIpB,SACA,YAAY,OACZ;CACA,MAAM,QAAQ,QAAQ,MAAM,cAAc;AAE1C,OAAM,oBAAoB,SAAS,OAAM,QAAO;AAC9C,MAAI,MACF,kEACD;AAED,QAAM,QAAQ,SAAS,kBAAkB;GACvC,aAAa;GACb,OAAO;GACR,CAAC;AAEF,QAAM,mBAAoD,IAAI;AAE9D,QAAM,QAAQ,SAAS,kBAAkB;GACvC,aAAa;GACb,OAAO;GACR,CAAC;AAEF,MAAI,IAAI,MAAM,SAAS,EACrB,KAAI,MACF,8BACE,SAAS,IAAI,OAAO,MAAM,GACtB,OAAO,KAAK,IAAI,OAAO,MAAM,CAAC,SAC9B,QAAQ,IAAI,OAAO,MAAM,CAAC,OAC/B,wCACC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AC;AAEF,UAAQ,OAAO,KACb,YACE,UAAU,QAAQ,WAAW,KAAK,IAAI,aACvC,KAAK,UAAU,OAAO,CAAC,cAAc,QAAQ,YAAY,GAC3D;AAED,QAAM,oBAAoB,QAA2C;AAErE,QAAM,GAAG,QAAQ;GAEpB,CAAC,CACH;;;;;ACnEH,MAAM,gBAAgB,oBAAoB;CACxC,OAAOC;CACP,SAASC;CACT,QAAQC;CACR,OAAOC;CACP,MAAMC;CACN,MAAMC;CACN,OAAOC;CACP,MAAMC;CACN,QAAQC;CACT,CAAC;AAEF,MAAa,QAAQ,cAAc;AACnC,MAAa,UAAU,cAAc;AACrC,MAAa,SAAS,cAAc;AACpC,MAAa,QAAQ,cAAc;AACnC,MAAa,OAAO,cAAc;AAClC,MAAa,OAAO,cAAc;AAClC,MAAa,QAAQ,cAAc;AACnC,MAAa,OAAO,cAAc;AAClC,MAAa,SAAS,cAAc"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/engine",
3
- "version": "0.0.25",
3
+ "version": "0.9.2",
4
4
  "private": false,
5
5
  "description": "An internal package containing the core engine modules for Powerlines.",
6
6
  "homepage": "https://stormsoftware.com",
@@ -11,7 +11,7 @@
11
11
  "repository": {
12
12
  "type": "github",
13
13
  "url": "https://github.com/storm-software/powerlines.git",
14
- "directory": "packages/engine"
14
+ "directory": "packages/base/engine"
15
15
  },
16
16
  "funding": {
17
17
  "type": "github",
@@ -39,145 +39,109 @@
39
39
  ],
40
40
  "type": "module",
41
41
  "exports": {
42
- ".": {
43
- "import": {
44
- "types": "./dist/index.d.mts",
45
- "default": "./dist/index.mjs"
46
- },
47
- "require": {
48
- "types": "./dist/index.d.cts",
49
- "default": "./dist/index.cjs"
50
- },
51
- "default": {
52
- "types": "./dist/index.d.cts",
53
- "default": "./dist/index.cjs"
54
- }
42
+ ".": { "import": "./dist/index.mjs", "require": "./dist/index.cjs" },
43
+ "./api/build": {
44
+ "import": "./dist/api/build.mjs",
45
+ "require": "./dist/api/build.cjs"
55
46
  },
56
- "./index": {
57
- "import": {
58
- "types": "./dist/index.d.mts",
59
- "default": "./dist/index.mjs"
60
- },
61
- "require": {
62
- "types": "./dist/index.d.cts",
63
- "default": "./dist/index.cjs"
64
- },
65
- "default": {
66
- "types": "./dist/index.d.cts",
67
- "default": "./dist/index.cjs"
68
- }
47
+ "./api/clean": {
48
+ "import": "./dist/api/clean.mjs",
49
+ "require": "./dist/api/clean.cjs"
69
50
  },
70
- "./api": {
71
- "import": { "types": "./dist/api.d.mts", "default": "./dist/api.mjs" },
72
- "require": { "types": "./dist/api.d.cts", "default": "./dist/api.cjs" },
73
- "default": { "types": "./dist/api.d.cts", "default": "./dist/api.cjs" }
51
+ "./api/create": {
52
+ "import": "./dist/api/create.mjs",
53
+ "require": "./dist/api/create.cjs"
74
54
  },
75
- "./schemas": {
76
- "import": {
77
- "types": "./dist/schemas.d.mts",
78
- "default": "./dist/schemas.mjs"
79
- },
80
- "require": {
81
- "types": "./dist/schemas.d.cts",
82
- "default": "./dist/schemas.cjs"
83
- },
84
- "default": {
85
- "types": "./dist/schemas.d.cts",
86
- "default": "./dist/schemas.cjs"
87
- }
55
+ "./api/deploy": {
56
+ "import": "./dist/api/deploy.mjs",
57
+ "require": "./dist/api/deploy.cjs"
88
58
  },
89
- "./typescript": {
90
- "import": {
91
- "types": "./dist/typescript/index.d.mts",
92
- "default": "./dist/typescript/index.mjs"
93
- },
94
- "require": {
95
- "types": "./dist/typescript/index.d.cts",
96
- "default": "./dist/typescript/index.cjs"
97
- },
98
- "default": {
99
- "types": "./dist/typescript/index.d.cts",
100
- "default": "./dist/typescript/index.cjs"
101
- }
59
+ "./api/docs": {
60
+ "import": "./dist/api/docs.mjs",
61
+ "require": "./dist/api/docs.cjs"
62
+ },
63
+ "./api/lint": {
64
+ "import": "./dist/api/lint.mjs",
65
+ "require": "./dist/api/lint.cjs"
66
+ },
67
+ "./api/prepare": {
68
+ "import": "./dist/api/prepare.mjs",
69
+ "require": "./dist/api/prepare.cjs"
70
+ },
71
+ "./api/test": {
72
+ "import": "./dist/api/test.mjs",
73
+ "require": "./dist/api/test.cjs"
74
+ },
75
+ "./api/types": {
76
+ "import": "./dist/api/types.mjs",
77
+ "require": "./dist/api/types.cjs"
102
78
  },
103
79
  "./context": {
104
- "import": {
105
- "types": "./dist/context/index.d.mts",
106
- "default": "./dist/context/index.mjs"
107
- },
108
- "require": {
109
- "types": "./dist/context/index.d.cts",
110
- "default": "./dist/context/index.cjs"
111
- },
112
- "default": {
113
- "types": "./dist/context/index.d.cts",
114
- "default": "./dist/context/index.cjs"
115
- }
80
+ "import": "./dist/context/index.mjs",
81
+ "require": "./dist/context/index.cjs"
116
82
  },
117
- "./storage": {
118
- "import": {
119
- "types": "./dist/storage/index.d.mts",
120
- "default": "./dist/storage/index.mjs"
121
- },
122
- "require": {
123
- "types": "./dist/storage/index.d.cts",
124
- "default": "./dist/storage/index.cjs"
125
- },
126
- "default": {
127
- "types": "./dist/storage/index.d.cts",
128
- "default": "./dist/storage/index.cjs"
129
- }
130
- }
83
+ "./engine": {
84
+ "import": "./dist/engine.mjs",
85
+ "require": "./dist/engine.cjs"
86
+ },
87
+ "./execution-host": {
88
+ "import": "./dist/worker/execution-host.mjs",
89
+ "require": "./dist/worker/execution-host.cjs"
90
+ },
91
+ "./helpers/create-execution-host": {
92
+ "import": "./dist/helpers/create-execution-host.mjs",
93
+ "require": "./dist/helpers/create-execution-host.cjs"
94
+ },
95
+ "./helpers/execution-host-worker": {
96
+ "import": "./dist/helpers/execution-host-worker.mjs",
97
+ "require": "./dist/helpers/execution-host-worker.cjs"
98
+ },
99
+ "./helpers/finalize": {
100
+ "import": "./dist/helpers/finalize.mjs",
101
+ "require": "./dist/helpers/finalize.cjs"
102
+ },
103
+ "./package.json": "./package.json"
131
104
  },
132
105
  "main": "./dist/index.cjs",
133
106
  "module": "./dist/index.mjs",
134
107
  "types": "./dist/index.d.cts",
135
- "files": ["dist/**/*", "schemas/**/*"],
108
+ "files": ["dist"],
136
109
  "dependencies": {
137
- "@cacheable/memory": "^2.0.8",
138
- "@donedeal0/superdiff": "^3.2.0",
139
- "@jridgewell/sourcemap-codec": "^1.5.5",
140
- "@powerlines/core": "^0.14.3",
141
- "@storm-software/config": "^1.137.31",
142
- "@storm-software/config-tools": "^1.189.77",
143
- "@stryke/capnp": "^0.12.93",
144
- "@stryke/convert": "^0.7.0",
145
- "@stryke/env": "^0.20.84",
146
- "@stryke/fs": "^0.33.67",
147
- "@stryke/hash": "^0.13.20",
148
- "@stryke/helpers": "^0.10.9",
149
- "@stryke/http": "^0.12.55",
150
- "@stryke/json": "^0.14.13",
151
- "@stryke/path": "^0.27.5",
152
- "@stryke/string-format": "^0.17.10",
153
- "@stryke/type-checks": "^0.6.2",
154
- "@stryke/unique-id": "^0.3.78",
155
- "bundle-require": "^5.1.0",
156
- "chalk": "5.6.2",
157
- "compatx": "^0.2.0",
158
- "date-fns": "^4.1.0",
110
+ "@powerlines/core": "^0.9.2",
111
+ "@storm-software/config": "^1.137.35",
112
+ "@storm-software/config-tools": "^1.190.2",
113
+ "@stryke/async": "^0.1.4",
114
+ "@stryke/convert": "^0.7.6",
115
+ "@stryke/env": "^0.20.92",
116
+ "@stryke/fs": "^0.33.75",
117
+ "@stryke/hash": "^0.13.28",
118
+ "@stryke/helpers": "^0.10.15",
119
+ "@stryke/http": "^0.12.65",
120
+ "@stryke/json": "^0.14.20",
121
+ "@stryke/path": "^0.29.2",
122
+ "@stryke/string-format": "^0.17.17",
123
+ "@stryke/type-checks": "^0.6.8",
124
+ "@stryke/unique-id": "^0.3.86",
125
+ "@stryke/url": "^0.4.26",
126
+ "birpc": "^4.0.0",
159
127
  "defu": "^6.1.7",
160
- "flat-cache": "^6.1.22",
128
+ "devframe": "^0.1.22",
129
+ "get-port-please": "^3.2.0",
130
+ "h3": "^1.15.11",
161
131
  "handlebars": "^4.7.9",
162
- "jest-worker": "^30.3.0",
163
- "jiti": "^2.6.1",
164
- "locate-character": "^3.0.0",
165
- "oxc-parser": "^0.99.0",
166
- "oxc-resolver": "^11.19.1",
167
- "ts-morph": "^27.0.2",
168
- "undici": "^7.25.0",
132
+ "human-id": "^4.1.3",
133
+ "jest-worker": "^30.4.1",
134
+ "jiti": "^2.7.0",
135
+ "sirv": "^3.0.2",
136
+ "ua-parser-modern": "^0.1.1",
169
137
  "unimport": "^5.7.0",
170
138
  "unplugin": "^3.0.0"
171
139
  },
172
140
  "devDependencies": {
173
- "@storm-software/testing-tools": "^1.119.152",
174
- "@stryke/types": "^0.11.4",
175
- "@types/bun": "^1.3.13",
176
- "@types/node": "^25.6.0",
177
- "@types/semver": "^7.7.1",
178
- "bun-types-no-globals": "^1.3.11",
179
- "typescript": "^6.0.3",
180
- "undici-types": "^7.25.0"
141
+ "@storm-software/testing-tools": "^1.119.156",
142
+ "@stryke/types": "^0.12.3",
143
+ "@types/node": "^25.7.0",
144
+ "typescript": "^6.0.3"
181
145
  },
182
- "gitHead": "f148d4759d20c66a7f05f248680578f4329e8f3b"
146
+ "gitHead": "3c5c701e16af74006dd70b965009d41eb22ace2a"
183
147
  }