@powerlines/core 0.0.8

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 (286) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +1 -0
  3. package/dist/_virtual/rolldown_runtime.cjs +29 -0
  4. package/dist/index.cjs +65 -0
  5. package/dist/index.d.cts +23 -0
  6. package/dist/index.d.mts +25 -0
  7. package/dist/index.mjs +22 -0
  8. package/dist/lib/config.cjs +90 -0
  9. package/dist/lib/config.cjs.map +1 -0
  10. package/dist/lib/config.d.cts +40 -0
  11. package/dist/lib/config.d.cts.map +1 -0
  12. package/dist/lib/config.d.mts +40 -0
  13. package/dist/lib/config.d.mts.map +1 -0
  14. package/dist/lib/config.mjs +86 -0
  15. package/dist/lib/config.mjs.map +1 -0
  16. package/dist/lib/constants/environments.cjs +17 -0
  17. package/dist/lib/constants/environments.cjs.map +1 -0
  18. package/dist/lib/constants/environments.d.cts +10 -0
  19. package/dist/lib/constants/environments.d.cts.map +1 -0
  20. package/dist/lib/constants/environments.d.mts +10 -0
  21. package/dist/lib/constants/environments.d.mts.map +1 -0
  22. package/dist/lib/constants/environments.mjs +11 -0
  23. package/dist/lib/constants/environments.mjs.map +1 -0
  24. package/dist/lib/constants/index.cjs +11 -0
  25. package/dist/lib/constants/index.d.cts +3 -0
  26. package/dist/lib/constants/index.d.mts +3 -0
  27. package/dist/lib/constants/index.mjs +4 -0
  28. package/dist/lib/constants/meta.cjs +9 -0
  29. package/dist/lib/constants/meta.cjs.map +1 -0
  30. package/dist/lib/constants/meta.d.cts +6 -0
  31. package/dist/lib/constants/meta.d.cts.map +1 -0
  32. package/dist/lib/constants/meta.d.mts +6 -0
  33. package/dist/lib/constants/meta.d.mts.map +1 -0
  34. package/dist/lib/constants/meta.mjs +7 -0
  35. package/dist/lib/constants/meta.mjs.map +1 -0
  36. package/dist/lib/entry.cjs +127 -0
  37. package/dist/lib/entry.cjs.map +1 -0
  38. package/dist/lib/entry.d.cts +47 -0
  39. package/dist/lib/entry.d.cts.map +1 -0
  40. package/dist/lib/entry.d.mts +48 -0
  41. package/dist/lib/entry.d.mts.map +1 -0
  42. package/dist/lib/entry.mjs +120 -0
  43. package/dist/lib/entry.mjs.map +1 -0
  44. package/dist/lib/index.cjs +50 -0
  45. package/dist/lib/index.d.cts +14 -0
  46. package/dist/lib/index.d.mts +16 -0
  47. package/dist/lib/index.mjs +17 -0
  48. package/dist/lib/logger.cjs +59 -0
  49. package/dist/lib/logger.cjs.map +1 -0
  50. package/dist/lib/logger.d.cts +23 -0
  51. package/dist/lib/logger.d.cts.map +1 -0
  52. package/dist/lib/logger.d.mts +24 -0
  53. package/dist/lib/logger.d.mts.map +1 -0
  54. package/dist/lib/logger.mjs +56 -0
  55. package/dist/lib/logger.mjs.map +1 -0
  56. package/dist/lib/unplugin/helpers.cjs +30 -0
  57. package/dist/lib/unplugin/helpers.cjs.map +1 -0
  58. package/dist/lib/unplugin/helpers.d.cts +24 -0
  59. package/dist/lib/unplugin/helpers.d.cts.map +1 -0
  60. package/dist/lib/unplugin/helpers.d.mts +24 -0
  61. package/dist/lib/unplugin/helpers.d.mts.map +1 -0
  62. package/dist/lib/unplugin/helpers.mjs +28 -0
  63. package/dist/lib/unplugin/helpers.mjs.map +1 -0
  64. package/dist/lib/unplugin/index.cjs +9 -0
  65. package/dist/lib/unplugin/index.d.cts +4 -0
  66. package/dist/lib/unplugin/index.d.mts +4 -0
  67. package/dist/lib/unplugin/index.mjs +5 -0
  68. package/dist/lib/unplugin/module-resolution.cjs +67 -0
  69. package/dist/lib/unplugin/module-resolution.cjs.map +1 -0
  70. package/dist/lib/unplugin/module-resolution.d.cts +21 -0
  71. package/dist/lib/unplugin/module-resolution.d.cts.map +1 -0
  72. package/dist/lib/unplugin/module-resolution.d.mts +21 -0
  73. package/dist/lib/unplugin/module-resolution.d.mts.map +1 -0
  74. package/dist/lib/unplugin/module-resolution.mjs +66 -0
  75. package/dist/lib/unplugin/module-resolution.mjs.map +1 -0
  76. package/dist/lib/unplugin/plugin.cjs +105 -0
  77. package/dist/lib/unplugin/plugin.cjs.map +1 -0
  78. package/dist/lib/unplugin/plugin.d.cts +22 -0
  79. package/dist/lib/unplugin/plugin.d.cts.map +1 -0
  80. package/dist/lib/unplugin/plugin.d.mts +22 -0
  81. package/dist/lib/unplugin/plugin.d.mts.map +1 -0
  82. package/dist/lib/unplugin/plugin.mjs +103 -0
  83. package/dist/lib/unplugin/plugin.mjs.map +1 -0
  84. package/dist/lib/utilities/file-header.cjs +24 -0
  85. package/dist/lib/utilities/file-header.cjs.map +1 -0
  86. package/dist/lib/utilities/file-header.d.cts +13 -0
  87. package/dist/lib/utilities/file-header.d.cts.map +1 -0
  88. package/dist/lib/utilities/file-header.d.mts +13 -0
  89. package/dist/lib/utilities/file-header.d.mts.map +1 -0
  90. package/dist/lib/utilities/file-header.mjs +22 -0
  91. package/dist/lib/utilities/file-header.mjs.map +1 -0
  92. package/dist/lib/utilities/format.cjs +49 -0
  93. package/dist/lib/utilities/format.cjs.map +1 -0
  94. package/dist/lib/utilities/format.d.cts +25 -0
  95. package/dist/lib/utilities/format.d.cts.map +1 -0
  96. package/dist/lib/utilities/format.d.mts +25 -0
  97. package/dist/lib/utilities/format.d.mts.map +1 -0
  98. package/dist/lib/utilities/format.mjs +47 -0
  99. package/dist/lib/utilities/format.mjs.map +1 -0
  100. package/dist/lib/utilities/index.cjs +15 -0
  101. package/dist/lib/utilities/index.d.cts +6 -0
  102. package/dist/lib/utilities/index.d.mts +6 -0
  103. package/dist/lib/utilities/index.mjs +7 -0
  104. package/dist/lib/utilities/source-file.cjs +50 -0
  105. package/dist/lib/utilities/source-file.cjs.map +1 -0
  106. package/dist/lib/utilities/source-file.d.cts +31 -0
  107. package/dist/lib/utilities/source-file.d.cts.map +1 -0
  108. package/dist/lib/utilities/source-file.d.mts +31 -0
  109. package/dist/lib/utilities/source-file.d.mts.map +1 -0
  110. package/dist/lib/utilities/source-file.mjs +46 -0
  111. package/dist/lib/utilities/source-file.mjs.map +1 -0
  112. package/dist/lib/utilities/source-map.cjs +57 -0
  113. package/dist/lib/utilities/source-map.cjs.map +1 -0
  114. package/dist/lib/utilities/source-map.d.cts +17 -0
  115. package/dist/lib/utilities/source-map.d.cts.map +1 -0
  116. package/dist/lib/utilities/source-map.d.mts +17 -0
  117. package/dist/lib/utilities/source-map.d.mts.map +1 -0
  118. package/dist/lib/utilities/source-map.mjs +55 -0
  119. package/dist/lib/utilities/source-map.mjs.map +1 -0
  120. package/dist/lib/utilities/write-file.cjs +29 -0
  121. package/dist/lib/utilities/write-file.cjs.map +1 -0
  122. package/dist/lib/utilities/write-file.d.cts +16 -0
  123. package/dist/lib/utilities/write-file.d.cts.map +1 -0
  124. package/dist/lib/utilities/write-file.d.mts +16 -0
  125. package/dist/lib/utilities/write-file.d.mts.map +1 -0
  126. package/dist/lib/utilities/write-file.mjs +28 -0
  127. package/dist/lib/utilities/write-file.mjs.map +1 -0
  128. package/dist/plugin-base.cjs +73 -0
  129. package/dist/plugin-base.cjs.map +1 -0
  130. package/dist/plugin-base.d.cts +27 -0
  131. package/dist/plugin-base.d.cts.map +1 -0
  132. package/dist/plugin-base.d.mts +27 -0
  133. package/dist/plugin-base.d.mts.map +1 -0
  134. package/dist/plugin-base.mjs +70 -0
  135. package/dist/plugin-base.mjs.map +1 -0
  136. package/dist/plugin-utils/build-helpers.cjs +36 -0
  137. package/dist/plugin-utils/build-helpers.cjs.map +1 -0
  138. package/dist/plugin-utils/build-helpers.d.cts +19 -0
  139. package/dist/plugin-utils/build-helpers.d.cts.map +1 -0
  140. package/dist/plugin-utils/build-helpers.d.mts +19 -0
  141. package/dist/plugin-utils/build-helpers.d.mts.map +1 -0
  142. package/dist/plugin-utils/build-helpers.mjs +35 -0
  143. package/dist/plugin-utils/build-helpers.mjs.map +1 -0
  144. package/dist/plugin-utils/context-helpers.cjs +50 -0
  145. package/dist/plugin-utils/context-helpers.cjs.map +1 -0
  146. package/dist/plugin-utils/context-helpers.d.cts +21 -0
  147. package/dist/plugin-utils/context-helpers.d.cts.map +1 -0
  148. package/dist/plugin-utils/context-helpers.d.mts +21 -0
  149. package/dist/plugin-utils/context-helpers.d.mts.map +1 -0
  150. package/dist/plugin-utils/context-helpers.mjs +48 -0
  151. package/dist/plugin-utils/context-helpers.mjs.map +1 -0
  152. package/dist/plugin-utils/extend.cjs +25 -0
  153. package/dist/plugin-utils/extend.cjs.map +1 -0
  154. package/dist/plugin-utils/extend.d.cts +20 -0
  155. package/dist/plugin-utils/extend.d.cts.map +1 -0
  156. package/dist/plugin-utils/extend.d.mts +20 -0
  157. package/dist/plugin-utils/extend.d.mts.map +1 -0
  158. package/dist/plugin-utils/extend.mjs +24 -0
  159. package/dist/plugin-utils/extend.mjs.map +1 -0
  160. package/dist/plugin-utils/format-package-json.cjs +20 -0
  161. package/dist/plugin-utils/format-package-json.cjs.map +1 -0
  162. package/dist/plugin-utils/format-package-json.d.cts +13 -0
  163. package/dist/plugin-utils/format-package-json.d.cts.map +1 -0
  164. package/dist/plugin-utils/format-package-json.d.mts +13 -0
  165. package/dist/plugin-utils/format-package-json.d.mts.map +1 -0
  166. package/dist/plugin-utils/format-package-json.mjs +19 -0
  167. package/dist/plugin-utils/format-package-json.mjs.map +1 -0
  168. package/dist/plugin-utils/get-config-path.cjs +50 -0
  169. package/dist/plugin-utils/get-config-path.cjs.map +1 -0
  170. package/dist/plugin-utils/get-config-path.d.cts +15 -0
  171. package/dist/plugin-utils/get-config-path.d.cts.map +1 -0
  172. package/dist/plugin-utils/get-config-path.d.mts +15 -0
  173. package/dist/plugin-utils/get-config-path.d.mts.map +1 -0
  174. package/dist/plugin-utils/get-config-path.mjs +49 -0
  175. package/dist/plugin-utils/get-config-path.mjs.map +1 -0
  176. package/dist/plugin-utils/helpers.cjs +185 -0
  177. package/dist/plugin-utils/helpers.cjs.map +1 -0
  178. package/dist/plugin-utils/helpers.d.cts +144 -0
  179. package/dist/plugin-utils/helpers.d.cts.map +1 -0
  180. package/dist/plugin-utils/helpers.d.mts +144 -0
  181. package/dist/plugin-utils/helpers.d.mts.map +1 -0
  182. package/dist/plugin-utils/helpers.mjs +170 -0
  183. package/dist/plugin-utils/helpers.mjs.map +1 -0
  184. package/dist/plugin-utils/index.cjs +35 -0
  185. package/dist/plugin-utils/index.d.cts +10 -0
  186. package/dist/plugin-utils/index.d.mts +10 -0
  187. package/dist/plugin-utils/index.mjs +11 -0
  188. package/dist/plugin-utils/merge.cjs +60 -0
  189. package/dist/plugin-utils/merge.cjs.map +1 -0
  190. package/dist/plugin-utils/merge.d.cts +35 -0
  191. package/dist/plugin-utils/merge.d.cts.map +1 -0
  192. package/dist/plugin-utils/merge.d.mts +35 -0
  193. package/dist/plugin-utils/merge.d.mts.map +1 -0
  194. package/dist/plugin-utils/merge.mjs +57 -0
  195. package/dist/plugin-utils/merge.mjs.map +1 -0
  196. package/dist/plugin-utils/modules.cjs +17 -0
  197. package/dist/plugin-utils/modules.cjs.map +1 -0
  198. package/dist/plugin-utils/modules.d.cts +15 -0
  199. package/dist/plugin-utils/modules.d.cts.map +1 -0
  200. package/dist/plugin-utils/modules.d.mts +15 -0
  201. package/dist/plugin-utils/modules.d.mts.map +1 -0
  202. package/dist/plugin-utils/modules.mjs +16 -0
  203. package/dist/plugin-utils/modules.mjs.map +1 -0
  204. package/dist/plugin-utils/paths.cjs +38 -0
  205. package/dist/plugin-utils/paths.cjs.map +1 -0
  206. package/dist/plugin-utils/paths.d.cts +34 -0
  207. package/dist/plugin-utils/paths.d.cts.map +1 -0
  208. package/dist/plugin-utils/paths.d.mts +34 -0
  209. package/dist/plugin-utils/paths.d.mts.map +1 -0
  210. package/dist/plugin-utils/paths.mjs +37 -0
  211. package/dist/plugin-utils/paths.mjs.map +1 -0
  212. package/dist/types/_internal.cjs +0 -0
  213. package/dist/types/_internal.d.cts +107 -0
  214. package/dist/types/_internal.d.cts.map +1 -0
  215. package/dist/types/_internal.d.mts +107 -0
  216. package/dist/types/_internal.d.mts.map +1 -0
  217. package/dist/types/_internal.mjs +1 -0
  218. package/dist/types/api.cjs +0 -0
  219. package/dist/types/api.d.cts +104 -0
  220. package/dist/types/api.d.cts.map +1 -0
  221. package/dist/types/api.d.mts +104 -0
  222. package/dist/types/api.d.mts.map +1 -0
  223. package/dist/types/api.mjs +1 -0
  224. package/dist/types/commands.cjs +17 -0
  225. package/dist/types/commands.cjs.map +1 -0
  226. package/dist/types/commands.d.cts +13 -0
  227. package/dist/types/commands.d.cts.map +1 -0
  228. package/dist/types/commands.d.mts +13 -0
  229. package/dist/types/commands.d.mts.map +1 -0
  230. package/dist/types/commands.mjs +16 -0
  231. package/dist/types/commands.mjs.map +1 -0
  232. package/dist/types/config.cjs +0 -0
  233. package/dist/types/config.d.cts +617 -0
  234. package/dist/types/config.d.cts.map +1 -0
  235. package/dist/types/config.d.mts +617 -0
  236. package/dist/types/config.d.mts.map +1 -0
  237. package/dist/types/config.mjs +1 -0
  238. package/dist/types/context.cjs +0 -0
  239. package/dist/types/context.d.cts +564 -0
  240. package/dist/types/context.d.cts.map +1 -0
  241. package/dist/types/context.d.mts +564 -0
  242. package/dist/types/context.d.mts.map +1 -0
  243. package/dist/types/context.mjs +1 -0
  244. package/dist/types/fs.cjs +11 -0
  245. package/dist/types/fs.cjs.map +1 -0
  246. package/dist/types/fs.d.cts +502 -0
  247. package/dist/types/fs.d.cts.map +1 -0
  248. package/dist/types/fs.d.mts +502 -0
  249. package/dist/types/fs.d.mts.map +1 -0
  250. package/dist/types/fs.mjs +8 -0
  251. package/dist/types/fs.mjs.map +1 -0
  252. package/dist/types/hooks.cjs +13 -0
  253. package/dist/types/hooks.cjs.map +1 -0
  254. package/dist/types/hooks.d.cts +117 -0
  255. package/dist/types/hooks.d.cts.map +1 -0
  256. package/dist/types/hooks.d.mts +117 -0
  257. package/dist/types/hooks.d.mts.map +1 -0
  258. package/dist/types/hooks.mjs +12 -0
  259. package/dist/types/hooks.mjs.map +1 -0
  260. package/dist/types/index.cjs +16 -0
  261. package/dist/types/index.d.cts +10 -0
  262. package/dist/types/index.d.mts +10 -0
  263. package/dist/types/index.mjs +7 -0
  264. package/dist/types/plugin.cjs +35 -0
  265. package/dist/types/plugin.cjs.map +1 -0
  266. package/dist/types/plugin.d.cts +218 -0
  267. package/dist/types/plugin.d.cts.map +1 -0
  268. package/dist/types/plugin.d.mts +218 -0
  269. package/dist/types/plugin.d.mts.map +1 -0
  270. package/dist/types/plugin.mjs +33 -0
  271. package/dist/types/plugin.mjs.map +1 -0
  272. package/dist/types/tsconfig.cjs +0 -0
  273. package/dist/types/tsconfig.d.cts +77 -0
  274. package/dist/types/tsconfig.d.cts.map +1 -0
  275. package/dist/types/tsconfig.d.mts +77 -0
  276. package/dist/types/tsconfig.d.mts.map +1 -0
  277. package/dist/types/tsconfig.mjs +1 -0
  278. package/dist/types/unplugin.cjs +24 -0
  279. package/dist/types/unplugin.cjs.map +1 -0
  280. package/dist/types/unplugin.d.cts +41 -0
  281. package/dist/types/unplugin.d.cts.map +1 -0
  282. package/dist/types/unplugin.d.mts +41 -0
  283. package/dist/types/unplugin.d.mts.map +1 -0
  284. package/dist/types/unplugin.mjs +22 -0
  285. package/dist/types/unplugin.mjs.map +1 -0
  286. package/package.json +238 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modules.mjs","names":["prefix: string"],"sources":["../../src/plugin-utils/modules.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 { Context } from \"../types/context\";\n\n/**\n * Determine if a module ID is a built-in Powerlines module ID.\n *\n * @param context - The Powerlines context.\n * @param moduleName - The name of the module to check.\n * @returns `true` if the module is a built-in module, otherwise `false`.\n */\nexport function isBuiltinModule(context: Context, moduleName: string): boolean {\n const prefix: string = context.config?.framework || \"powerlines\";\n\n return (\n moduleName.startsWith(`${prefix.replace(/:$/, \"\")}:`) ||\n Object.keys(context.fs.metadata)\n .filter(key => context.fs.metadata[key]?.type === \"builtin\")\n .includes(moduleName)\n );\n}\n"],"mappings":";;;;;;;;AA2BA,SAAgB,gBAAgB,SAAkB,YAA6B;CAC7E,MAAMA,SAAiB,QAAQ,QAAQ,aAAa;AAEpD,QACE,WAAW,WAAW,GAAG,OAAO,QAAQ,MAAM,GAAG,CAAC,GAAG,IACrD,OAAO,KAAK,QAAQ,GAAG,SAAS,CAC7B,QAAO,QAAO,QAAQ,GAAG,SAAS,MAAM,SAAS,UAAU,CAC3D,SAAS,WAAW"}
@@ -0,0 +1,38 @@
1
+ const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
+ let __stryke_path_replace = require("@stryke/path/replace");
3
+ let __stryke_path_join = require("@stryke/path/join");
4
+
5
+ //#region src/plugin-utils/paths.ts
6
+ /**
7
+ * Replaces tokens in the given path string with their corresponding values from the context.
8
+ *
9
+ * @remarks
10
+ * The following tokens are supported:
11
+ * - `{workspaceRoot}` - The root directory of the workspace.
12
+ * - `{root}` - The root directory of the project (same as `{projectRoot}`).
13
+ * - `{projectRoot}` - The root directory of the project (same as `{root}`).
14
+ * - `{sourceRoot}` - The source root directory of the project (usually `./src`).
15
+ * - `{powerlinesPath}` - The directory where Powerlines is installed.
16
+ * - `{cachePath}` - The environment's directory for cached files.
17
+ * - `{dataPath}` - The environment's directory for data files.
18
+ * - `{logPath}` - The environment's directory for log files.
19
+ * - `{tempPath}` - The environment's directory for temporary files.
20
+ * - `{configPath}` - The environment's directory for configuration files.
21
+ * - `{outputPath}` - The configured output directory for the project.
22
+ * - `{buildPath}` - The configured distribution directory for the project.
23
+ * - `{artifactsPath}` - The configured directory for build artifacts.
24
+ * - `{builtinPath}` - The configured directory for generated built-in plugins.
25
+ * - `{entryPath}` - The configured directory for generated entry files.
26
+ *
27
+ * @param context - The context containing the values for the path tokens.
28
+ * @param path - The path string with tokens to replace.
29
+ * @returns The path string with tokens replaced by their corresponding values from the context.
30
+ */
31
+ function replacePathTokens(context, path) {
32
+ if (!path) return path;
33
+ return path.replaceAll("{workspaceRoot}", context.workspaceConfig.workspaceRoot).replaceAll("{root}", context.config.root).replaceAll("{projectRoot}", context.config.root).replaceAll("{sourceRoot}", (0, __stryke_path_join.joinPaths)(context.config.root, "src")).replaceAll("{powerlinesPath}", context.powerlinesPath).replaceAll("{cachePath}", context.cachePath).replaceAll("{dataPath}", context.dataPath).replaceAll("{logPath}", context.envPaths.log).replaceAll("{tempPath}", context.envPaths.temp).replaceAll("{configPath}", context.envPaths.config).replaceAll("{outputPath}", context.config.output.outputPath).replaceAll("{buildPath}", context.config.output.buildPath).replaceAll("{artifactsPath}", (0, __stryke_path_replace.replacePath)(context.artifactsPath, context.workspaceConfig.workspaceRoot)).replaceAll("{builtinPath}", (0, __stryke_path_replace.replacePath)(context.builtinsPath, context.workspaceConfig.workspaceRoot)).replaceAll("{entryPath}", (0, __stryke_path_replace.replacePath)(context.entryPath, context.workspaceConfig.workspaceRoot));
34
+ }
35
+
36
+ //#endregion
37
+ exports.replacePathTokens = replacePathTokens;
38
+ //# sourceMappingURL=paths.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paths.cjs","names":[],"sources":["../../src/plugin-utils/paths.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 { joinPaths } from \"@stryke/path/join\";\nimport { replacePath } from \"@stryke/path/replace\";\nimport { IsUndefined } from \"@stryke/types/base\";\nimport { UnresolvedContext } from \"../types/context\";\n\n/**\n * Replaces tokens in the given path string with their corresponding values from the context.\n *\n * @remarks\n * The following tokens are supported:\n * - `{workspaceRoot}` - The root directory of the workspace.\n * - `{root}` - The root directory of the project (same as `{projectRoot}`).\n * - `{projectRoot}` - The root directory of the project (same as `{root}`).\n * - `{sourceRoot}` - The source root directory of the project (usually `./src`).\n * - `{powerlinesPath}` - The directory where Powerlines is installed.\n * - `{cachePath}` - The environment's directory for cached files.\n * - `{dataPath}` - The environment's directory for data files.\n * - `{logPath}` - The environment's directory for log files.\n * - `{tempPath}` - The environment's directory for temporary files.\n * - `{configPath}` - The environment's directory for configuration files.\n * - `{outputPath}` - The configured output directory for the project.\n * - `{buildPath}` - The configured distribution directory for the project.\n * - `{artifactsPath}` - The configured directory for build artifacts.\n * - `{builtinPath}` - The configured directory for generated built-in plugins.\n * - `{entryPath}` - The configured directory for generated entry files.\n *\n * @param context - The context containing the values for the path tokens.\n * @param path - The path string with tokens to replace.\n * @returns The path string with tokens replaced by their corresponding values from the context.\n */\nexport function replacePathTokens(\n context: UnresolvedContext,\n path?: string\n): IsUndefined<typeof path> extends true ? undefined : string {\n if (!path) {\n return path as IsUndefined<typeof path> extends true ? undefined : string;\n }\n\n return path\n .replaceAll(\"{workspaceRoot}\", context.workspaceConfig.workspaceRoot)\n .replaceAll(\"{root}\", context.config.root)\n .replaceAll(\"{projectRoot}\", context.config.root)\n .replaceAll(\"{sourceRoot}\", joinPaths(context.config.root, \"src\"))\n .replaceAll(\"{powerlinesPath}\", context.powerlinesPath)\n .replaceAll(\"{cachePath}\", context.cachePath)\n .replaceAll(\"{dataPath}\", context.dataPath)\n .replaceAll(\"{logPath}\", context.envPaths.log)\n .replaceAll(\"{tempPath}\", context.envPaths.temp)\n .replaceAll(\"{configPath}\", context.envPaths.config)\n .replaceAll(\"{outputPath}\", context.config.output.outputPath)\n .replaceAll(\"{buildPath}\", context.config.output.buildPath)\n .replaceAll(\n \"{artifactsPath}\",\n replacePath(context.artifactsPath, context.workspaceConfig.workspaceRoot)\n )\n .replaceAll(\n \"{builtinPath}\",\n replacePath(context.builtinsPath, context.workspaceConfig.workspaceRoot)\n )\n .replaceAll(\n \"{entryPath}\",\n replacePath(context.entryPath, context.workspaceConfig.workspaceRoot)\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDA,SAAgB,kBACd,SACA,MAC4D;AAC5D,KAAI,CAAC,KACH,QAAO;AAGT,QAAO,KACJ,WAAW,mBAAmB,QAAQ,gBAAgB,cAAc,CACpE,WAAW,UAAU,QAAQ,OAAO,KAAK,CACzC,WAAW,iBAAiB,QAAQ,OAAO,KAAK,CAChD,WAAW,kDAA0B,QAAQ,OAAO,MAAM,MAAM,CAAC,CACjE,WAAW,oBAAoB,QAAQ,eAAe,CACtD,WAAW,eAAe,QAAQ,UAAU,CAC5C,WAAW,cAAc,QAAQ,SAAS,CAC1C,WAAW,aAAa,QAAQ,SAAS,IAAI,CAC7C,WAAW,cAAc,QAAQ,SAAS,KAAK,CAC/C,WAAW,gBAAgB,QAAQ,SAAS,OAAO,CACnD,WAAW,gBAAgB,QAAQ,OAAO,OAAO,WAAW,CAC5D,WAAW,eAAe,QAAQ,OAAO,OAAO,UAAU,CAC1D,WACC,0DACY,QAAQ,eAAe,QAAQ,gBAAgB,cAAc,CAC1E,CACA,WACC,wDACY,QAAQ,cAAc,QAAQ,gBAAgB,cAAc,CACzE,CACA,WACC,sDACY,QAAQ,WAAW,QAAQ,gBAAgB,cAAc,CACtE"}
@@ -0,0 +1,34 @@
1
+ import { UnresolvedContext } from "../types/context.cjs";
2
+ import { IsUndefined } from "@stryke/types/base";
3
+
4
+ //#region src/plugin-utils/paths.d.ts
5
+
6
+ /**
7
+ * Replaces tokens in the given path string with their corresponding values from the context.
8
+ *
9
+ * @remarks
10
+ * The following tokens are supported:
11
+ * - `{workspaceRoot}` - The root directory of the workspace.
12
+ * - `{root}` - The root directory of the project (same as `{projectRoot}`).
13
+ * - `{projectRoot}` - The root directory of the project (same as `{root}`).
14
+ * - `{sourceRoot}` - The source root directory of the project (usually `./src`).
15
+ * - `{powerlinesPath}` - The directory where Powerlines is installed.
16
+ * - `{cachePath}` - The environment's directory for cached files.
17
+ * - `{dataPath}` - The environment's directory for data files.
18
+ * - `{logPath}` - The environment's directory for log files.
19
+ * - `{tempPath}` - The environment's directory for temporary files.
20
+ * - `{configPath}` - The environment's directory for configuration files.
21
+ * - `{outputPath}` - The configured output directory for the project.
22
+ * - `{buildPath}` - The configured distribution directory for the project.
23
+ * - `{artifactsPath}` - The configured directory for build artifacts.
24
+ * - `{builtinPath}` - The configured directory for generated built-in plugins.
25
+ * - `{entryPath}` - The configured directory for generated entry files.
26
+ *
27
+ * @param context - The context containing the values for the path tokens.
28
+ * @param path - The path string with tokens to replace.
29
+ * @returns The path string with tokens replaced by their corresponding values from the context.
30
+ */
31
+ declare function replacePathTokens(context: UnresolvedContext, path?: string): IsUndefined<typeof path> extends true ? undefined : string;
32
+ //#endregion
33
+ export { replacePathTokens };
34
+ //# sourceMappingURL=paths.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paths.d.cts","names":[],"sources":["../../src/plugin-utils/paths.ts"],"sourcesContent":[],"mappings":";;;;;;;AAgDA;;;;;;;;;;;;;;;;;;;;;;;iBAAgB,iBAAA,UACL,mCAER,mBAAmB"}
@@ -0,0 +1,34 @@
1
+ import { UnresolvedContext } from "../types/context.mjs";
2
+ import { IsUndefined } from "@stryke/types/base";
3
+
4
+ //#region src/plugin-utils/paths.d.ts
5
+
6
+ /**
7
+ * Replaces tokens in the given path string with their corresponding values from the context.
8
+ *
9
+ * @remarks
10
+ * The following tokens are supported:
11
+ * - `{workspaceRoot}` - The root directory of the workspace.
12
+ * - `{root}` - The root directory of the project (same as `{projectRoot}`).
13
+ * - `{projectRoot}` - The root directory of the project (same as `{root}`).
14
+ * - `{sourceRoot}` - The source root directory of the project (usually `./src`).
15
+ * - `{powerlinesPath}` - The directory where Powerlines is installed.
16
+ * - `{cachePath}` - The environment's directory for cached files.
17
+ * - `{dataPath}` - The environment's directory for data files.
18
+ * - `{logPath}` - The environment's directory for log files.
19
+ * - `{tempPath}` - The environment's directory for temporary files.
20
+ * - `{configPath}` - The environment's directory for configuration files.
21
+ * - `{outputPath}` - The configured output directory for the project.
22
+ * - `{buildPath}` - The configured distribution directory for the project.
23
+ * - `{artifactsPath}` - The configured directory for build artifacts.
24
+ * - `{builtinPath}` - The configured directory for generated built-in plugins.
25
+ * - `{entryPath}` - The configured directory for generated entry files.
26
+ *
27
+ * @param context - The context containing the values for the path tokens.
28
+ * @param path - The path string with tokens to replace.
29
+ * @returns The path string with tokens replaced by their corresponding values from the context.
30
+ */
31
+ declare function replacePathTokens(context: UnresolvedContext, path?: string): IsUndefined<typeof path> extends true ? undefined : string;
32
+ //#endregion
33
+ export { replacePathTokens };
34
+ //# sourceMappingURL=paths.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paths.d.mts","names":[],"sources":["../../src/plugin-utils/paths.ts"],"sourcesContent":[],"mappings":";;;;;;;AAgDA;;;;;;;;;;;;;;;;;;;;;;;iBAAgB,iBAAA,UACL,mCAER,mBAAmB"}
@@ -0,0 +1,37 @@
1
+ import { replacePath } from "@stryke/path/replace";
2
+ import { joinPaths } from "@stryke/path/join";
3
+
4
+ //#region src/plugin-utils/paths.ts
5
+ /**
6
+ * Replaces tokens in the given path string with their corresponding values from the context.
7
+ *
8
+ * @remarks
9
+ * The following tokens are supported:
10
+ * - `{workspaceRoot}` - The root directory of the workspace.
11
+ * - `{root}` - The root directory of the project (same as `{projectRoot}`).
12
+ * - `{projectRoot}` - The root directory of the project (same as `{root}`).
13
+ * - `{sourceRoot}` - The source root directory of the project (usually `./src`).
14
+ * - `{powerlinesPath}` - The directory where Powerlines is installed.
15
+ * - `{cachePath}` - The environment's directory for cached files.
16
+ * - `{dataPath}` - The environment's directory for data files.
17
+ * - `{logPath}` - The environment's directory for log files.
18
+ * - `{tempPath}` - The environment's directory for temporary files.
19
+ * - `{configPath}` - The environment's directory for configuration files.
20
+ * - `{outputPath}` - The configured output directory for the project.
21
+ * - `{buildPath}` - The configured distribution directory for the project.
22
+ * - `{artifactsPath}` - The configured directory for build artifacts.
23
+ * - `{builtinPath}` - The configured directory for generated built-in plugins.
24
+ * - `{entryPath}` - The configured directory for generated entry files.
25
+ *
26
+ * @param context - The context containing the values for the path tokens.
27
+ * @param path - The path string with tokens to replace.
28
+ * @returns The path string with tokens replaced by their corresponding values from the context.
29
+ */
30
+ function replacePathTokens(context, path) {
31
+ if (!path) return path;
32
+ return path.replaceAll("{workspaceRoot}", context.workspaceConfig.workspaceRoot).replaceAll("{root}", context.config.root).replaceAll("{projectRoot}", context.config.root).replaceAll("{sourceRoot}", joinPaths(context.config.root, "src")).replaceAll("{powerlinesPath}", context.powerlinesPath).replaceAll("{cachePath}", context.cachePath).replaceAll("{dataPath}", context.dataPath).replaceAll("{logPath}", context.envPaths.log).replaceAll("{tempPath}", context.envPaths.temp).replaceAll("{configPath}", context.envPaths.config).replaceAll("{outputPath}", context.config.output.outputPath).replaceAll("{buildPath}", context.config.output.buildPath).replaceAll("{artifactsPath}", replacePath(context.artifactsPath, context.workspaceConfig.workspaceRoot)).replaceAll("{builtinPath}", replacePath(context.builtinsPath, context.workspaceConfig.workspaceRoot)).replaceAll("{entryPath}", replacePath(context.entryPath, context.workspaceConfig.workspaceRoot));
33
+ }
34
+
35
+ //#endregion
36
+ export { replacePathTokens };
37
+ //# sourceMappingURL=paths.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paths.mjs","names":[],"sources":["../../src/plugin-utils/paths.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 { joinPaths } from \"@stryke/path/join\";\nimport { replacePath } from \"@stryke/path/replace\";\nimport { IsUndefined } from \"@stryke/types/base\";\nimport { UnresolvedContext } from \"../types/context\";\n\n/**\n * Replaces tokens in the given path string with their corresponding values from the context.\n *\n * @remarks\n * The following tokens are supported:\n * - `{workspaceRoot}` - The root directory of the workspace.\n * - `{root}` - The root directory of the project (same as `{projectRoot}`).\n * - `{projectRoot}` - The root directory of the project (same as `{root}`).\n * - `{sourceRoot}` - The source root directory of the project (usually `./src`).\n * - `{powerlinesPath}` - The directory where Powerlines is installed.\n * - `{cachePath}` - The environment's directory for cached files.\n * - `{dataPath}` - The environment's directory for data files.\n * - `{logPath}` - The environment's directory for log files.\n * - `{tempPath}` - The environment's directory for temporary files.\n * - `{configPath}` - The environment's directory for configuration files.\n * - `{outputPath}` - The configured output directory for the project.\n * - `{buildPath}` - The configured distribution directory for the project.\n * - `{artifactsPath}` - The configured directory for build artifacts.\n * - `{builtinPath}` - The configured directory for generated built-in plugins.\n * - `{entryPath}` - The configured directory for generated entry files.\n *\n * @param context - The context containing the values for the path tokens.\n * @param path - The path string with tokens to replace.\n * @returns The path string with tokens replaced by their corresponding values from the context.\n */\nexport function replacePathTokens(\n context: UnresolvedContext,\n path?: string\n): IsUndefined<typeof path> extends true ? undefined : string {\n if (!path) {\n return path as IsUndefined<typeof path> extends true ? undefined : string;\n }\n\n return path\n .replaceAll(\"{workspaceRoot}\", context.workspaceConfig.workspaceRoot)\n .replaceAll(\"{root}\", context.config.root)\n .replaceAll(\"{projectRoot}\", context.config.root)\n .replaceAll(\"{sourceRoot}\", joinPaths(context.config.root, \"src\"))\n .replaceAll(\"{powerlinesPath}\", context.powerlinesPath)\n .replaceAll(\"{cachePath}\", context.cachePath)\n .replaceAll(\"{dataPath}\", context.dataPath)\n .replaceAll(\"{logPath}\", context.envPaths.log)\n .replaceAll(\"{tempPath}\", context.envPaths.temp)\n .replaceAll(\"{configPath}\", context.envPaths.config)\n .replaceAll(\"{outputPath}\", context.config.output.outputPath)\n .replaceAll(\"{buildPath}\", context.config.output.buildPath)\n .replaceAll(\n \"{artifactsPath}\",\n replacePath(context.artifactsPath, context.workspaceConfig.workspaceRoot)\n )\n .replaceAll(\n \"{builtinPath}\",\n replacePath(context.builtinsPath, context.workspaceConfig.workspaceRoot)\n )\n .replaceAll(\n \"{entryPath}\",\n replacePath(context.entryPath, context.workspaceConfig.workspaceRoot)\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDA,SAAgB,kBACd,SACA,MAC4D;AAC5D,KAAI,CAAC,KACH,QAAO;AAGT,QAAO,KACJ,WAAW,mBAAmB,QAAQ,gBAAgB,cAAc,CACpE,WAAW,UAAU,QAAQ,OAAO,KAAK,CACzC,WAAW,iBAAiB,QAAQ,OAAO,KAAK,CAChD,WAAW,gBAAgB,UAAU,QAAQ,OAAO,MAAM,MAAM,CAAC,CACjE,WAAW,oBAAoB,QAAQ,eAAe,CACtD,WAAW,eAAe,QAAQ,UAAU,CAC5C,WAAW,cAAc,QAAQ,SAAS,CAC1C,WAAW,aAAa,QAAQ,SAAS,IAAI,CAC7C,WAAW,cAAc,QAAQ,SAAS,KAAK,CAC/C,WAAW,gBAAgB,QAAQ,SAAS,OAAO,CACnD,WAAW,gBAAgB,QAAQ,OAAO,OAAO,WAAW,CAC5D,WAAW,eAAe,QAAQ,OAAO,OAAO,UAAU,CAC1D,WACC,mBACA,YAAY,QAAQ,eAAe,QAAQ,gBAAgB,cAAc,CAC1E,CACA,WACC,iBACA,YAAY,QAAQ,cAAc,QAAQ,gBAAgB,cAAc,CACzE,CACA,WACC,eACA,YAAY,QAAQ,WAAW,QAAQ,gBAAgB,cAAc,CACtE"}
File without changes
@@ -0,0 +1,107 @@
1
+ import { API } from "./api.cjs";
2
+ import { CallHookOptions, InferHookParameters, InferHookReturnType } from "./hooks.cjs";
3
+ import { APIContext, Context, EnvironmentContext, PluginContext } from "./context.cjs";
4
+ import { PluginConfig, ResolvedConfig } from "./config.cjs";
5
+
6
+ //#region src/types/_internal.d.ts
7
+
8
+ /**
9
+ * Internal fields and methods for internal contexts
10
+ *
11
+ * @internal
12
+ */
13
+ interface UNSAFE_ContextInternal<TResolvedConfig extends ResolvedConfig = ResolvedConfig> {
14
+ /**
15
+ * The API instance for interacting with Powerlines
16
+ *
17
+ * @internal
18
+ */
19
+ api: API<TResolvedConfig>;
20
+ /**
21
+ * Add a Powerlines plugin used in the build process
22
+ *
23
+ * @internal
24
+ *
25
+ * @param config - The import path of the plugin to add
26
+ */
27
+ addPlugin: (config: PluginConfig<PluginContext<TResolvedConfig>>) => Promise<void>;
28
+ }
29
+ /**
30
+ * An internal representation of the context, used for managing hooks and environment data.
31
+ *
32
+ * @internal
33
+ */
34
+ interface UNSAFE_Context<TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends Context<TResolvedConfig> {
35
+ $$internal: UNSAFE_ContextInternal<TResolvedConfig>;
36
+ }
37
+ /**
38
+ * An internal representation of the API context, used for managing hooks and environment data.
39
+ *
40
+ * @internal
41
+ */
42
+ interface UNSAFE_APIContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends APIContext<TResolvedConfig> {
43
+ $$internal: UNSAFE_ContextInternal<TResolvedConfig>;
44
+ }
45
+ /**
46
+ * An internal representation of the environment context, used for managing hooks and environment data.
47
+ *
48
+ * @internal
49
+ */
50
+ interface UNSAFE_EnvironmentContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends EnvironmentContext<TResolvedConfig> {
51
+ $$internal: UNSAFE_ContextInternal<TResolvedConfig>;
52
+ }
53
+ /**
54
+ * Internal fields and methods for the internal plugin context
55
+ *
56
+ * @internal
57
+ */
58
+ interface UNSAFE_PluginContextInternal<TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends UNSAFE_ContextInternal<TResolvedConfig> {
59
+ /**
60
+ * The API instance for interacting with Powerlines
61
+ *
62
+ * @internal
63
+ */
64
+ api: API<TResolvedConfig>;
65
+ /**
66
+ * The environment context associated with this plugin context
67
+ *
68
+ * @internal
69
+ */
70
+ environment: UNSAFE_EnvironmentContext<TResolvedConfig>;
71
+ /**
72
+ * Call a hook within the Powerlines system
73
+ *
74
+ * @internal
75
+ *
76
+ * @param hook - The name of the hook to call
77
+ * @param options - Options for calling the hook
78
+ * @param args - Arguments to pass to the hook
79
+ * @returns The result of the hook call
80
+ */
81
+ callHook: <TKey extends string>(hook: TKey, options: CallHookOptions & {
82
+ environment?: string | EnvironmentContext<TResolvedConfig>;
83
+ }, ...args: InferHookParameters<PluginContext<TResolvedConfig>, TKey>) => Promise<InferHookReturnType<PluginContext<TResolvedConfig>, TKey> | undefined>;
84
+ /**
85
+ * A place to store internal data for the plugin context
86
+ *
87
+ * @internal
88
+ */
89
+ meta: Record<string, any>;
90
+ }
91
+ /**
92
+ * An internal representation of the plugin context, used for managing hooks and environment data.
93
+ *
94
+ * @internal
95
+ */
96
+ interface UNSAFE_PluginContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends PluginContext<TResolvedConfig> {
97
+ $$internal: UNSAFE_PluginContextInternal<TResolvedConfig>;
98
+ }
99
+ declare type __ΩUNSAFE_ContextInternal = any[];
100
+ declare type __ΩUNSAFE_Context = any[];
101
+ declare type __ΩUNSAFE_APIContext = any[];
102
+ declare type __ΩUNSAFE_EnvironmentContext = any[];
103
+ declare type __ΩUNSAFE_PluginContextInternal = any[];
104
+ declare type __ΩUNSAFE_PluginContext = any[];
105
+ //#endregion
106
+ export { UNSAFE_APIContext, UNSAFE_Context, UNSAFE_ContextInternal, UNSAFE_EnvironmentContext, UNSAFE_PluginContext, UNSAFE_PluginContextInternal, __ΩUNSAFE_APIContext, __ΩUNSAFE_Context, __ΩUNSAFE_ContextInternal, __ΩUNSAFE_EnvironmentContext, __ΩUNSAFE_PluginContext, __ΩUNSAFE_PluginContextInternal };
107
+ //# sourceMappingURL=_internal.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_internal.d.cts","names":[],"sources":["../../src/types/_internal.ts"],"sourcesContent":[],"mappings":";;;;;;;;;AAuCA;;;AAQW,UARM,sBAQN,CAAA,wBAPe,cAOf,GAPgC,cAOhC,CAAA,CAAA;EAAJ;;;;;EAWO,GAAA,EAXP,GAWO,CAXH,eAWG,CAAA;EAQG;;;;;;;EAEA,SAAA,EAAA,CAAA,MAAA,EAXL,YAWK,CAXQ,aAWR,CAXsB,eAWtB,CAAA,CAAA,EAAA,GAVV,OAUU,CAAA,IAAA,CAAA;AASjB;;;;;;AAEU,UAbO,cAaP,CAAA,wBAZgB,cAYhB,GAZiC,cAYjC,CAAA,SAXA,OAWA,CAXQ,eAWR,CAAA,CAAA;EAAU,UAAA,EAVN,sBAUM,CAViB,eAUjB,CAAA;AASpB;;;;;;AAEU,UAbO,iBAaP,CAAA,wBAZgB,cAYhB,GAZiC,cAYjC,CAAA,SAXA,UAWA,CAXW,eAWX,CAAA,CAAA;EAAkB,UAAA,EAVd,sBAUc,CAVS,eAUT,CAAA;AAS5B;;;;;;AAeyC,UA1BxB,yBA0BwB,CAAA,wBAzBf,cAyBe,GAzBE,cAyBF,CAAA,SAxB/B,kBAwB+B,CAxBZ,eAwBY,CAAA,CAAA;EAA1B,UAAA,EAvBD,sBAuBC,CAvBsB,eAuBtB,CAAA;;;;;;;AAiBkD,UAhChD,4BAgCgD,CAAA,wBA/BvC,cA+BuC,GA/BtB,cA+BsB,CAAA,SA9BvD,sBA8BuD,CA9BhC,eA8BgC,CAAA,CAAA;EAApD;;;;;EACN,GAAA,EAzBA,GAyBA,CAzBI,eAyBJ,CAAA;EASC;;;AAQR;;EAC2C,WAAA,EApC5B,yBAoC4B,CApCF,eAoCE,CAAA;EACnB;;;;;;;;;;wCAxBd,eACG;2BACgB,mBAAmB;cAEnC,oBAAoB,cAAc,kBAAkB,UAC1D,QACH,oBAAoB,cAAc,kBAAkB;;;;;;QAQhD;;;;;;;UAQS,6CACS,iBAAiB,wBACjC,cAAc;cACV,6BAA6B"}
@@ -0,0 +1,107 @@
1
+ import { API } from "./api.mjs";
2
+ import { CallHookOptions, InferHookParameters, InferHookReturnType } from "./hooks.mjs";
3
+ import { APIContext, Context, EnvironmentContext, PluginContext } from "./context.mjs";
4
+ import { PluginConfig, ResolvedConfig } from "./config.mjs";
5
+
6
+ //#region src/types/_internal.d.ts
7
+
8
+ /**
9
+ * Internal fields and methods for internal contexts
10
+ *
11
+ * @internal
12
+ */
13
+ interface UNSAFE_ContextInternal<TResolvedConfig extends ResolvedConfig = ResolvedConfig> {
14
+ /**
15
+ * The API instance for interacting with Powerlines
16
+ *
17
+ * @internal
18
+ */
19
+ api: API<TResolvedConfig>;
20
+ /**
21
+ * Add a Powerlines plugin used in the build process
22
+ *
23
+ * @internal
24
+ *
25
+ * @param config - The import path of the plugin to add
26
+ */
27
+ addPlugin: (config: PluginConfig<PluginContext<TResolvedConfig>>) => Promise<void>;
28
+ }
29
+ /**
30
+ * An internal representation of the context, used for managing hooks and environment data.
31
+ *
32
+ * @internal
33
+ */
34
+ interface UNSAFE_Context<TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends Context<TResolvedConfig> {
35
+ $$internal: UNSAFE_ContextInternal<TResolvedConfig>;
36
+ }
37
+ /**
38
+ * An internal representation of the API context, used for managing hooks and environment data.
39
+ *
40
+ * @internal
41
+ */
42
+ interface UNSAFE_APIContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends APIContext<TResolvedConfig> {
43
+ $$internal: UNSAFE_ContextInternal<TResolvedConfig>;
44
+ }
45
+ /**
46
+ * An internal representation of the environment context, used for managing hooks and environment data.
47
+ *
48
+ * @internal
49
+ */
50
+ interface UNSAFE_EnvironmentContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends EnvironmentContext<TResolvedConfig> {
51
+ $$internal: UNSAFE_ContextInternal<TResolvedConfig>;
52
+ }
53
+ /**
54
+ * Internal fields and methods for the internal plugin context
55
+ *
56
+ * @internal
57
+ */
58
+ interface UNSAFE_PluginContextInternal<TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends UNSAFE_ContextInternal<TResolvedConfig> {
59
+ /**
60
+ * The API instance for interacting with Powerlines
61
+ *
62
+ * @internal
63
+ */
64
+ api: API<TResolvedConfig>;
65
+ /**
66
+ * The environment context associated with this plugin context
67
+ *
68
+ * @internal
69
+ */
70
+ environment: UNSAFE_EnvironmentContext<TResolvedConfig>;
71
+ /**
72
+ * Call a hook within the Powerlines system
73
+ *
74
+ * @internal
75
+ *
76
+ * @param hook - The name of the hook to call
77
+ * @param options - Options for calling the hook
78
+ * @param args - Arguments to pass to the hook
79
+ * @returns The result of the hook call
80
+ */
81
+ callHook: <TKey extends string>(hook: TKey, options: CallHookOptions & {
82
+ environment?: string | EnvironmentContext<TResolvedConfig>;
83
+ }, ...args: InferHookParameters<PluginContext<TResolvedConfig>, TKey>) => Promise<InferHookReturnType<PluginContext<TResolvedConfig>, TKey> | undefined>;
84
+ /**
85
+ * A place to store internal data for the plugin context
86
+ *
87
+ * @internal
88
+ */
89
+ meta: Record<string, any>;
90
+ }
91
+ /**
92
+ * An internal representation of the plugin context, used for managing hooks and environment data.
93
+ *
94
+ * @internal
95
+ */
96
+ interface UNSAFE_PluginContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends PluginContext<TResolvedConfig> {
97
+ $$internal: UNSAFE_PluginContextInternal<TResolvedConfig>;
98
+ }
99
+ declare type __ΩUNSAFE_ContextInternal = any[];
100
+ declare type __ΩUNSAFE_Context = any[];
101
+ declare type __ΩUNSAFE_APIContext = any[];
102
+ declare type __ΩUNSAFE_EnvironmentContext = any[];
103
+ declare type __ΩUNSAFE_PluginContextInternal = any[];
104
+ declare type __ΩUNSAFE_PluginContext = any[];
105
+ //#endregion
106
+ export { UNSAFE_APIContext, UNSAFE_Context, UNSAFE_ContextInternal, UNSAFE_EnvironmentContext, UNSAFE_PluginContext, UNSAFE_PluginContextInternal, __ΩUNSAFE_APIContext, __ΩUNSAFE_Context, __ΩUNSAFE_ContextInternal, __ΩUNSAFE_EnvironmentContext, __ΩUNSAFE_PluginContext, __ΩUNSAFE_PluginContextInternal };
107
+ //# sourceMappingURL=_internal.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_internal.d.mts","names":[],"sources":["../../src/types/_internal.ts"],"sourcesContent":[],"mappings":";;;;;;;;;AAuCA;;;AAQW,UARM,sBAQN,CAAA,wBAPe,cAOf,GAPgC,cAOhC,CAAA,CAAA;EAAJ;;;;;EAWO,GAAA,EAXP,GAWO,CAXH,eAWG,CAAA;EAQG;;;;;;;EAEA,SAAA,EAAA,CAAA,MAAA,EAXL,YAWK,CAXQ,aAWR,CAXsB,eAWtB,CAAA,CAAA,EAAA,GAVV,OAUU,CAAA,IAAA,CAAA;AASjB;;;;;;AAEU,UAbO,cAaP,CAAA,wBAZgB,cAYhB,GAZiC,cAYjC,CAAA,SAXA,OAWA,CAXQ,eAWR,CAAA,CAAA;EAAU,UAAA,EAVN,sBAUM,CAViB,eAUjB,CAAA;AASpB;;;;;;AAEU,UAbO,iBAaP,CAAA,wBAZgB,cAYhB,GAZiC,cAYjC,CAAA,SAXA,UAWA,CAXW,eAWX,CAAA,CAAA;EAAkB,UAAA,EAVd,sBAUc,CAVS,eAUT,CAAA;AAS5B;;;;;;AAeyC,UA1BxB,yBA0BwB,CAAA,wBAzBf,cAyBe,GAzBE,cAyBF,CAAA,SAxB/B,kBAwB+B,CAxBZ,eAwBY,CAAA,CAAA;EAA1B,UAAA,EAvBD,sBAuBC,CAvBsB,eAuBtB,CAAA;;;;;;;AAiBkD,UAhChD,4BAgCgD,CAAA,wBA/BvC,cA+BuC,GA/BtB,cA+BsB,CAAA,SA9BvD,sBA8BuD,CA9BhC,eA8BgC,CAAA,CAAA;EAApD;;;;;EACN,GAAA,EAzBA,GAyBA,CAzBI,eAyBJ,CAAA;EASC;;;AAQR;;EAC2C,WAAA,EApC5B,yBAoC4B,CApCF,eAoCE,CAAA;EACnB;;;;;;;;;;wCAxBd,eACG;2BACgB,mBAAmB;cAEnC,oBAAoB,cAAc,kBAAkB,UAC1D,QACH,oBAAoB,cAAc,kBAAkB;;;;;;QAQhD;;;;;;;UAQS,6CACS,iBAAiB,wBACjC,cAAc;cACV,6BAA6B"}
@@ -0,0 +1 @@
1
+ export { };
File without changes
@@ -0,0 +1,104 @@
1
+ import { CallHookOptions, InferHookParameters, InferHookReturnType } from "./hooks.cjs";
2
+ import { APIContext, EnvironmentContext, PluginContext } from "./context.cjs";
3
+ import { BuildInlineConfig, CleanInlineConfig, DeployInlineConfig, DocsInlineConfig, LintInlineConfig, NewInlineConfig, PrepareInlineConfig, ResolvedConfig } from "./config.cjs";
4
+
5
+ //#region src/types/api.d.ts
6
+
7
+ /**
8
+ * Powerlines API Interface
9
+ */
10
+ interface API<TResolvedConfig extends ResolvedConfig = ResolvedConfig> {
11
+ /**
12
+ * The Powerlines shared API context
13
+ */
14
+ context: APIContext<TResolvedConfig>;
15
+ /**
16
+ * Prepare the Powerlines API
17
+ *
18
+ * @remarks
19
+ * This method will prepare the Powerlines API for use, initializing any necessary resources.
20
+ *
21
+ * @param inlineConfig - The inline configuration for the prepare command
22
+ */
23
+ prepare: (inlineConfig: PrepareInlineConfig | NewInlineConfig | CleanInlineConfig | BuildInlineConfig | LintInlineConfig | DocsInlineConfig | DeployInlineConfig) => Promise<void>;
24
+ /**
25
+ * Create a new Powerlines project
26
+ *
27
+ * @remarks
28
+ * This method will create a new Powerlines project in the current directory.
29
+ *
30
+ * @param inlineConfig - The inline configuration for the new command
31
+ * @returns A promise that resolves when the project has been created
32
+ */
33
+ new: (inlineConfig: NewInlineConfig) => Promise<void>;
34
+ /**
35
+ * Clean any previously prepared artifacts
36
+ *
37
+ * @remarks
38
+ * This method will remove the previous Powerlines artifacts from the project.
39
+ *
40
+ * @param inlineConfig - The inline configuration for the clean command
41
+ * @returns A promise that resolves when the clean command has completed
42
+ */
43
+ clean: (inlineConfig: CleanInlineConfig | PrepareInlineConfig) => Promise<void>;
44
+ /**
45
+ * Lint the project source code
46
+ *
47
+ * @param inlineConfig - The inline configuration for the lint command
48
+ * @returns A promise that resolves when the lint command has completed
49
+ */
50
+ lint: (inlineConfig: LintInlineConfig) => Promise<void>;
51
+ /**
52
+ * Build the project
53
+ *
54
+ * @remarks
55
+ * This method will build the Powerlines project, generating the necessary artifacts.
56
+ *
57
+ * @param inlineConfig - The inline configuration for the build command
58
+ * @returns A promise that resolves when the build command has completed
59
+ */
60
+ build: (inlineConfig: BuildInlineConfig) => Promise<void>;
61
+ /**
62
+ * Prepare the documentation for the project
63
+ *
64
+ * @param inlineConfig - The inline configuration for the docs command
65
+ * @returns A promise that resolves when the documentation generation has completed
66
+ */
67
+ docs: (inlineConfig: DocsInlineConfig) => Promise<void>;
68
+ /**
69
+ * Deploy the project source code
70
+ *
71
+ * @remarks
72
+ * This method will prepare and build the Powerlines project, generating the necessary artifacts for the deployment.
73
+ *
74
+ * @param inlineConfig - The inline configuration for the deploy command
75
+ */
76
+ deploy: (inlineConfig: DeployInlineConfig) => Promise<void>;
77
+ /**
78
+ * Finalization process
79
+ *
80
+ * @remarks
81
+ * This step includes any final processes or clean up required by Powerlines. It will be run after each Powerlines command.
82
+ *
83
+ * @returns A promise that resolves when the finalization process has completed
84
+ */
85
+ finalize: () => Promise<void>;
86
+ /**
87
+ * Invokes the configured plugin hooks
88
+ *
89
+ * @remarks
90
+ * By default, it will call the `"pre"`, `"normal"`, and `"post"` ordered hooks in sequence
91
+ *
92
+ * @param hook - The hook to call
93
+ * @param options - The options to provide to the hook
94
+ * @param args - The arguments to pass to the hook
95
+ * @returns The result of the hook call
96
+ */
97
+ callHook: <TKey extends string>(hook: TKey, options: CallHookOptions & {
98
+ environment?: string | EnvironmentContext<TResolvedConfig>;
99
+ }, ...args: InferHookParameters<PluginContext<TResolvedConfig>, TKey>) => Promise<InferHookReturnType<PluginContext<TResolvedConfig>, TKey> | undefined>;
100
+ }
101
+ declare type __ΩAPI = any[];
102
+ //#endregion
103
+ export { API, __ΩAPI };
104
+ //# sourceMappingURL=api.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.d.cts","names":[],"sources":["../../src/types/api.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAsCA;AAA6C,UAA5B,GAA4B,CAAA,wBAAA,cAAA,GAAiB,cAAjB,CAAA,CAAA;EAAiB;;;EAgBtD,OAAA,EAZG,UAYH,CAZc,eAYd,CAAA;EACA;;;;;;;;EAiBkC,OAAA,EAAA,CAAA,YAAA,EAlBlC,mBAkBkC,GAjBlC,eAiBkC,GAhBlC,iBAgBkC,GAflC,iBAekC,GAdlC,gBAckC,GAblC,gBAakC,GAZlC,kBAYkC,EAAA,GAXnC,OAWmC,CAAA,IAAA,CAAA;EAYxB;;;;;;;;;EAsCO,GAAA,EAAA,CAAA,YAAA,EAlDH,eAkDG,EAAA,GAlDiB,OAkDjB,CAAA,IAAA,CAAA;EAAuB;;;;;;;;;EA4BnC,KAAA,EAAA,CAAA,YAAA,EAlEK,iBAkEL,GAlEyB,mBAkEzB,EAAA,GAjEN,OAiEM,CAAA,IAAA,CAAA;EAEyB;;;;;;uBA3Df,qBAAqB;;;;;;;;;;wBAWpB,sBAAsB;;;;;;;uBAQvB,qBAAqB;;;;;;;;;yBAUnB,uBAAuB;;;;;;;;;kBAU9B;;;;;;;;;;;;wCAcR,eACG;2BACgB,mBAAmB;cAEnC,oBAAoB,cAAc,kBAAkB,UAC1D,QACH,oBAAoB,cAAc,kBAAkB"}
@@ -0,0 +1,104 @@
1
+ import { CallHookOptions, InferHookParameters, InferHookReturnType } from "./hooks.mjs";
2
+ import { APIContext, EnvironmentContext, PluginContext } from "./context.mjs";
3
+ import { BuildInlineConfig, CleanInlineConfig, DeployInlineConfig, DocsInlineConfig, LintInlineConfig, NewInlineConfig, PrepareInlineConfig, ResolvedConfig } from "./config.mjs";
4
+
5
+ //#region src/types/api.d.ts
6
+
7
+ /**
8
+ * Powerlines API Interface
9
+ */
10
+ interface API<TResolvedConfig extends ResolvedConfig = ResolvedConfig> {
11
+ /**
12
+ * The Powerlines shared API context
13
+ */
14
+ context: APIContext<TResolvedConfig>;
15
+ /**
16
+ * Prepare the Powerlines API
17
+ *
18
+ * @remarks
19
+ * This method will prepare the Powerlines API for use, initializing any necessary resources.
20
+ *
21
+ * @param inlineConfig - The inline configuration for the prepare command
22
+ */
23
+ prepare: (inlineConfig: PrepareInlineConfig | NewInlineConfig | CleanInlineConfig | BuildInlineConfig | LintInlineConfig | DocsInlineConfig | DeployInlineConfig) => Promise<void>;
24
+ /**
25
+ * Create a new Powerlines project
26
+ *
27
+ * @remarks
28
+ * This method will create a new Powerlines project in the current directory.
29
+ *
30
+ * @param inlineConfig - The inline configuration for the new command
31
+ * @returns A promise that resolves when the project has been created
32
+ */
33
+ new: (inlineConfig: NewInlineConfig) => Promise<void>;
34
+ /**
35
+ * Clean any previously prepared artifacts
36
+ *
37
+ * @remarks
38
+ * This method will remove the previous Powerlines artifacts from the project.
39
+ *
40
+ * @param inlineConfig - The inline configuration for the clean command
41
+ * @returns A promise that resolves when the clean command has completed
42
+ */
43
+ clean: (inlineConfig: CleanInlineConfig | PrepareInlineConfig) => Promise<void>;
44
+ /**
45
+ * Lint the project source code
46
+ *
47
+ * @param inlineConfig - The inline configuration for the lint command
48
+ * @returns A promise that resolves when the lint command has completed
49
+ */
50
+ lint: (inlineConfig: LintInlineConfig) => Promise<void>;
51
+ /**
52
+ * Build the project
53
+ *
54
+ * @remarks
55
+ * This method will build the Powerlines project, generating the necessary artifacts.
56
+ *
57
+ * @param inlineConfig - The inline configuration for the build command
58
+ * @returns A promise that resolves when the build command has completed
59
+ */
60
+ build: (inlineConfig: BuildInlineConfig) => Promise<void>;
61
+ /**
62
+ * Prepare the documentation for the project
63
+ *
64
+ * @param inlineConfig - The inline configuration for the docs command
65
+ * @returns A promise that resolves when the documentation generation has completed
66
+ */
67
+ docs: (inlineConfig: DocsInlineConfig) => Promise<void>;
68
+ /**
69
+ * Deploy the project source code
70
+ *
71
+ * @remarks
72
+ * This method will prepare and build the Powerlines project, generating the necessary artifacts for the deployment.
73
+ *
74
+ * @param inlineConfig - The inline configuration for the deploy command
75
+ */
76
+ deploy: (inlineConfig: DeployInlineConfig) => Promise<void>;
77
+ /**
78
+ * Finalization process
79
+ *
80
+ * @remarks
81
+ * This step includes any final processes or clean up required by Powerlines. It will be run after each Powerlines command.
82
+ *
83
+ * @returns A promise that resolves when the finalization process has completed
84
+ */
85
+ finalize: () => Promise<void>;
86
+ /**
87
+ * Invokes the configured plugin hooks
88
+ *
89
+ * @remarks
90
+ * By default, it will call the `"pre"`, `"normal"`, and `"post"` ordered hooks in sequence
91
+ *
92
+ * @param hook - The hook to call
93
+ * @param options - The options to provide to the hook
94
+ * @param args - The arguments to pass to the hook
95
+ * @returns The result of the hook call
96
+ */
97
+ callHook: <TKey extends string>(hook: TKey, options: CallHookOptions & {
98
+ environment?: string | EnvironmentContext<TResolvedConfig>;
99
+ }, ...args: InferHookParameters<PluginContext<TResolvedConfig>, TKey>) => Promise<InferHookReturnType<PluginContext<TResolvedConfig>, TKey> | undefined>;
100
+ }
101
+ declare type __ΩAPI = any[];
102
+ //#endregion
103
+ export { API, __ΩAPI };
104
+ //# sourceMappingURL=api.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.d.mts","names":[],"sources":["../../src/types/api.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAsCA;AAA6C,UAA5B,GAA4B,CAAA,wBAAA,cAAA,GAAiB,cAAjB,CAAA,CAAA;EAAiB;;;EAgBtD,OAAA,EAZG,UAYH,CAZc,eAYd,CAAA;EACA;;;;;;;;EAiBkC,OAAA,EAAA,CAAA,YAAA,EAlBlC,mBAkBkC,GAjBlC,eAiBkC,GAhBlC,iBAgBkC,GAflC,iBAekC,GAdlC,gBAckC,GAblC,gBAakC,GAZlC,kBAYkC,EAAA,GAXnC,OAWmC,CAAA,IAAA,CAAA;EAYxB;;;;;;;;;EAsCO,GAAA,EAAA,CAAA,YAAA,EAlDH,eAkDG,EAAA,GAlDiB,OAkDjB,CAAA,IAAA,CAAA;EAAuB;;;;;;;;;EA4BnC,KAAA,EAAA,CAAA,YAAA,EAlEK,iBAkEL,GAlEyB,mBAkEzB,EAAA,GAjEN,OAiEM,CAAA,IAAA,CAAA;EAEyB;;;;;;uBA3Df,qBAAqB;;;;;;;;;;wBAWpB,sBAAsB;;;;;;;uBAQvB,qBAAqB;;;;;;;;;yBAUnB,uBAAuB;;;;;;;;;kBAU9B;;;;;;;;;;;;wCAcR,eACG;2BACgB,mBAAmB;cAEnC,oBAAoB,cAAc,kBAAkB,UAC1D,QACH,oBAAoB,cAAc,kBAAkB"}
@@ -0,0 +1 @@
1
+ export { };