@powerlines/core 0.14.5 → 0.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (391) hide show
  1. package/dist/constants/api.cjs +6 -5
  2. package/dist/constants/api.d.cts +3 -3
  3. package/dist/constants/api.d.cts.map +1 -1
  4. package/dist/constants/api.d.mts +3 -3
  5. package/dist/constants/api.d.mts.map +1 -1
  6. package/dist/constants/api.mjs +4 -4
  7. package/dist/constants/api.mjs.map +1 -1
  8. package/dist/constants/commands.cjs +3 -2
  9. package/dist/constants/commands.d.cts +1 -1
  10. package/dist/constants/commands.d.mts +1 -1
  11. package/dist/constants/commands.mjs +2 -2
  12. package/dist/constants/commands.mjs.map +1 -1
  13. package/dist/constants/devtools.cjs +23 -0
  14. package/dist/constants/devtools.d.cts +13 -0
  15. package/dist/constants/devtools.d.cts.map +1 -0
  16. package/dist/constants/devtools.d.mts +13 -0
  17. package/dist/constants/devtools.d.mts.map +1 -0
  18. package/dist/constants/devtools.mjs +14 -0
  19. package/dist/constants/devtools.mjs.map +1 -0
  20. package/dist/constants/environments.cjs +1 -0
  21. package/dist/constants/extensions.cjs +21 -0
  22. package/dist/constants/extensions.d.cts +5 -0
  23. package/dist/constants/extensions.d.cts.map +1 -0
  24. package/dist/constants/extensions.d.mts +5 -0
  25. package/dist/constants/extensions.d.mts.map +1 -0
  26. package/dist/constants/extensions.mjs +20 -0
  27. package/dist/constants/extensions.mjs.map +1 -0
  28. package/dist/constants/fs.cjs +1 -0
  29. package/dist/constants/hooks.cjs +1 -0
  30. package/dist/constants/index.cjs +48 -30
  31. package/dist/constants/index.d.cts +5 -3
  32. package/dist/constants/index.d.mts +5 -3
  33. package/dist/constants/index.mjs +5 -3
  34. package/dist/constants/log-level.cjs +90 -0
  35. package/dist/constants/log-level.d.cts +63 -0
  36. package/dist/constants/log-level.d.cts.map +1 -0
  37. package/dist/constants/log-level.d.mts +63 -0
  38. package/dist/constants/log-level.d.mts.map +1 -0
  39. package/dist/constants/log-level.mjs +82 -0
  40. package/dist/constants/log-level.mjs.map +1 -0
  41. package/dist/constants/meta.cjs +1 -0
  42. package/dist/constants/plugin.cjs +3 -2
  43. package/dist/constants/plugin.d.cts +2 -2
  44. package/dist/constants/plugin.d.mts +2 -2
  45. package/dist/context/base-context.cjs +127 -0
  46. package/dist/context/base-context.d.cts +81 -0
  47. package/dist/context/base-context.d.cts.map +1 -0
  48. package/dist/context/base-context.d.mts +81 -0
  49. package/dist/context/base-context.d.mts.map +1 -0
  50. package/dist/context/base-context.mjs +125 -0
  51. package/dist/context/base-context.mjs.map +1 -0
  52. package/dist/context/context.cjs +934 -0
  53. package/dist/context/context.d.cts +369 -0
  54. package/dist/context/context.d.cts.map +1 -0
  55. package/dist/context/context.d.mts +369 -0
  56. package/dist/context/context.d.mts.map +1 -0
  57. package/dist/context/context.mjs +932 -0
  58. package/dist/context/context.mjs.map +1 -0
  59. package/dist/context/environment-context.cjs +219 -0
  60. package/dist/context/environment-context.d.cts +100 -0
  61. package/dist/context/environment-context.d.cts.map +1 -0
  62. package/dist/context/environment-context.d.mts +100 -0
  63. package/dist/context/environment-context.d.mts.map +1 -0
  64. package/dist/context/environment-context.mjs +218 -0
  65. package/dist/context/environment-context.mjs.map +1 -0
  66. package/dist/context/execution-context.cjs +230 -0
  67. package/dist/context/execution-context.d.cts +101 -0
  68. package/dist/context/execution-context.d.cts.map +1 -0
  69. package/dist/context/execution-context.d.mts +101 -0
  70. package/dist/context/execution-context.d.mts.map +1 -0
  71. package/dist/context/execution-context.mjs +228 -0
  72. package/dist/context/execution-context.mjs.map +1 -0
  73. package/dist/context/index.cjs +12 -0
  74. package/dist/context/index.d.cts +6 -0
  75. package/dist/context/index.d.mts +6 -0
  76. package/dist/context/index.mjs +7 -0
  77. package/dist/context/plugin-context.cjs +83 -0
  78. package/dist/context/plugin-context.d.cts +18 -0
  79. package/dist/context/plugin-context.d.cts.map +1 -0
  80. package/dist/context/plugin-context.d.mts +18 -0
  81. package/dist/context/plugin-context.d.mts.map +1 -0
  82. package/dist/context/plugin-context.mjs +82 -0
  83. package/dist/context/plugin-context.mjs.map +1 -0
  84. package/dist/index.cjs +62 -9
  85. package/dist/index.d.cts +20 -9
  86. package/dist/index.d.mts +20 -9
  87. package/dist/index.mjs +17 -5
  88. package/dist/lib/config.cjs +160 -15
  89. package/dist/lib/config.d.cts +92 -6
  90. package/dist/lib/config.d.cts.map +1 -1
  91. package/dist/lib/config.d.mts +92 -6
  92. package/dist/lib/config.d.mts.map +1 -1
  93. package/dist/lib/config.mjs +154 -16
  94. package/dist/lib/config.mjs.map +1 -1
  95. package/dist/lib/context-helpers.cjs +43 -0
  96. package/dist/lib/context-helpers.d.cts +19 -0
  97. package/dist/lib/context-helpers.d.cts.map +1 -0
  98. package/dist/lib/context-helpers.d.mts +19 -0
  99. package/dist/lib/context-helpers.d.mts.map +1 -0
  100. package/dist/lib/context-helpers.mjs +41 -0
  101. package/dist/lib/context-helpers.mjs.map +1 -0
  102. package/dist/lib/entry.cjs +5 -5
  103. package/dist/lib/entry.d.cts.map +1 -1
  104. package/dist/lib/entry.d.mts.map +1 -1
  105. package/dist/lib/entry.mjs +5 -5
  106. package/dist/lib/entry.mjs.map +1 -1
  107. package/dist/lib/environment.cjs +72 -0
  108. package/dist/lib/environment.d.cts +12 -0
  109. package/dist/lib/environment.d.cts.map +1 -0
  110. package/dist/lib/environment.d.mts +12 -0
  111. package/dist/lib/environment.d.mts.map +1 -0
  112. package/dist/lib/environment.mjs +67 -0
  113. package/dist/lib/environment.mjs.map +1 -0
  114. package/dist/lib/events.cjs +43 -0
  115. package/dist/lib/events.d.cts +10 -0
  116. package/dist/lib/events.d.cts.map +1 -0
  117. package/dist/lib/events.d.mts +10 -0
  118. package/dist/lib/events.d.mts.map +1 -0
  119. package/dist/lib/events.mjs +42 -0
  120. package/dist/lib/events.mjs.map +1 -0
  121. package/dist/lib/generate-types.cjs +371 -0
  122. package/dist/lib/generate-types.d.cts +67 -0
  123. package/dist/lib/generate-types.d.cts.map +1 -0
  124. package/dist/lib/generate-types.d.mts +67 -0
  125. package/dist/lib/generate-types.d.mts.map +1 -0
  126. package/dist/lib/generate-types.mjs +368 -0
  127. package/dist/lib/generate-types.mjs.map +1 -0
  128. package/dist/lib/hooks.cjs +152 -0
  129. package/dist/lib/hooks.d.cts +28 -0
  130. package/dist/lib/hooks.d.cts.map +1 -0
  131. package/dist/lib/hooks.d.mts +28 -0
  132. package/dist/lib/hooks.d.mts.map +1 -0
  133. package/dist/lib/hooks.mjs +147 -0
  134. package/dist/lib/hooks.mjs.map +1 -0
  135. package/dist/lib/index.cjs +64 -9
  136. package/dist/lib/index.d.cts +15 -3
  137. package/dist/lib/index.d.mts +15 -3
  138. package/dist/lib/index.mjs +19 -5
  139. package/dist/lib/install-dependencies.cjs +25 -0
  140. package/dist/lib/install-dependencies.d.cts +12 -0
  141. package/dist/lib/install-dependencies.d.cts.map +1 -0
  142. package/dist/lib/install-dependencies.d.mts +12 -0
  143. package/dist/lib/install-dependencies.d.mts.map +1 -0
  144. package/dist/lib/install-dependencies.mjs +24 -0
  145. package/dist/lib/install-dependencies.mjs.map +1 -0
  146. package/dist/lib/meta.cjs +57 -0
  147. package/dist/lib/meta.d.cts +34 -0
  148. package/dist/lib/meta.d.cts.map +1 -0
  149. package/dist/lib/meta.d.mts +34 -0
  150. package/dist/lib/meta.d.mts.map +1 -0
  151. package/dist/lib/meta.mjs +54 -0
  152. package/dist/lib/meta.mjs.map +1 -0
  153. package/dist/lib/plugins.cjs +150 -0
  154. package/dist/lib/plugins.d.cts +40 -0
  155. package/dist/lib/plugins.d.cts.map +1 -0
  156. package/dist/lib/plugins.d.mts +40 -0
  157. package/dist/lib/plugins.d.mts.map +1 -0
  158. package/dist/lib/plugins.mjs +146 -0
  159. package/dist/lib/plugins.mjs.map +1 -0
  160. package/dist/lib/resolver.cjs +35 -0
  161. package/dist/lib/resolver.d.cts +21 -0
  162. package/dist/lib/resolver.d.cts.map +1 -0
  163. package/dist/lib/resolver.d.mts +21 -0
  164. package/dist/lib/resolver.d.mts.map +1 -0
  165. package/dist/lib/resolver.mjs +33 -0
  166. package/dist/lib/resolver.mjs.map +1 -0
  167. package/dist/lib/schemas.cjs +9 -0
  168. package/dist/lib/schemas.d.cts +2 -0
  169. package/dist/lib/schemas.d.mts +2 -0
  170. package/dist/lib/schemas.mjs +3 -0
  171. package/dist/lib/streaming-channel.cjs +260 -0
  172. package/dist/lib/streaming-channel.d.cts +133 -0
  173. package/dist/lib/streaming-channel.d.cts.map +1 -0
  174. package/dist/lib/streaming-channel.d.mts +133 -0
  175. package/dist/lib/streaming-channel.d.mts.map +1 -0
  176. package/dist/lib/streaming-channel.mjs +258 -0
  177. package/dist/lib/streaming-channel.mjs.map +1 -0
  178. package/dist/lib/typescript/index.cjs +16 -0
  179. package/dist/lib/typescript/index.d.cts +3 -0
  180. package/dist/lib/typescript/index.d.mts +3 -0
  181. package/dist/lib/typescript/index.mjs +4 -0
  182. package/dist/lib/typescript/ts-morph.cjs +105 -0
  183. package/dist/lib/typescript/ts-morph.d.cts +38 -0
  184. package/dist/lib/typescript/ts-morph.d.cts.map +1 -0
  185. package/dist/lib/typescript/ts-morph.d.mts +38 -0
  186. package/dist/lib/typescript/ts-morph.d.mts.map +1 -0
  187. package/dist/lib/typescript/ts-morph.mjs +102 -0
  188. package/dist/lib/typescript/ts-morph.mjs.map +1 -0
  189. package/dist/lib/typescript/tsconfig.cjs +253 -0
  190. package/dist/lib/typescript/tsconfig.d.cts +77 -0
  191. package/dist/lib/typescript/tsconfig.d.cts.map +1 -0
  192. package/dist/lib/typescript/tsconfig.d.mts +77 -0
  193. package/dist/lib/typescript/tsconfig.d.mts.map +1 -0
  194. package/dist/lib/typescript/tsconfig.mjs +240 -0
  195. package/dist/lib/typescript/tsconfig.mjs.map +1 -0
  196. package/dist/lib/unplugin/helpers.cjs +2 -2
  197. package/dist/lib/unplugin/module-resolution.cjs +18 -18
  198. package/dist/lib/unplugin/module-resolution.mjs +18 -18
  199. package/dist/lib/unplugin/module-resolution.mjs.map +1 -1
  200. package/dist/lib/unplugin/plugin.cjs +55 -62
  201. package/dist/lib/unplugin/plugin.d.cts +10 -11
  202. package/dist/lib/unplugin/plugin.d.cts.map +1 -1
  203. package/dist/lib/unplugin/plugin.d.mts +10 -11
  204. package/dist/lib/unplugin/plugin.d.mts.map +1 -1
  205. package/dist/lib/unplugin/plugin.mjs +55 -62
  206. package/dist/lib/unplugin/plugin.mjs.map +1 -1
  207. package/dist/lib/utilities/file-header.cjs +2 -2
  208. package/dist/lib/utilities/file-header.mjs +2 -2
  209. package/dist/lib/utilities/file-header.mjs.map +1 -1
  210. package/dist/lib/utilities/format.cjs +1 -1
  211. package/dist/lib/utilities/format.mjs +1 -1
  212. package/dist/lib/utilities/index.cjs +2 -2
  213. package/dist/lib/utilities/index.mjs +2 -2
  214. package/dist/lib/utilities/write-file.cjs +1 -2
  215. package/dist/lib/utilities/write-file.d.cts +1 -1
  216. package/dist/lib/utilities/write-file.d.cts.map +1 -1
  217. package/dist/lib/utilities/write-file.d.mts +1 -1
  218. package/dist/lib/utilities/write-file.d.mts.map +1 -1
  219. package/dist/lib/utilities/write-file.mjs +1 -2
  220. package/dist/lib/utilities/write-file.mjs.map +1 -1
  221. package/dist/lib/vfs.cjs +1104 -0
  222. package/dist/lib/vfs.d.cts +321 -0
  223. package/dist/lib/vfs.d.cts.map +1 -0
  224. package/dist/lib/vfs.d.mts +321 -0
  225. package/dist/lib/vfs.d.mts.map +1 -0
  226. package/dist/lib/vfs.mjs +1102 -0
  227. package/dist/lib/vfs.mjs.map +1 -0
  228. package/dist/plugin-base.cjs +1 -1
  229. package/dist/plugin-base.mjs +1 -1
  230. package/dist/plugin-base.mjs.map +1 -1
  231. package/dist/plugin-utils/build-helpers.cjs +2 -2
  232. package/dist/plugin-utils/build-helpers.mjs +2 -2
  233. package/dist/plugin-utils/build-helpers.mjs.map +1 -1
  234. package/dist/plugin-utils/context-helpers.cjs +22 -12
  235. package/dist/plugin-utils/context-helpers.d.cts +9 -1
  236. package/dist/plugin-utils/context-helpers.d.cts.map +1 -1
  237. package/dist/plugin-utils/context-helpers.d.mts +9 -1
  238. package/dist/plugin-utils/context-helpers.d.mts.map +1 -1
  239. package/dist/plugin-utils/context-helpers.mjs +22 -13
  240. package/dist/plugin-utils/context-helpers.mjs.map +1 -1
  241. package/dist/plugin-utils/filter.cjs +13 -5
  242. package/dist/plugin-utils/filter.d.cts +2 -1
  243. package/dist/plugin-utils/filter.d.cts.map +1 -1
  244. package/dist/plugin-utils/filter.d.mts +2 -1
  245. package/dist/plugin-utils/filter.d.mts.map +1 -1
  246. package/dist/plugin-utils/filter.mjs +13 -6
  247. package/dist/plugin-utils/filter.mjs.map +1 -1
  248. package/dist/plugin-utils/format.cjs +44 -0
  249. package/dist/plugin-utils/format.d.cts +11 -0
  250. package/dist/plugin-utils/format.d.cts.map +1 -0
  251. package/dist/plugin-utils/format.d.mts +11 -0
  252. package/dist/plugin-utils/format.d.mts.map +1 -0
  253. package/dist/plugin-utils/format.mjs +43 -0
  254. package/dist/plugin-utils/format.mjs.map +1 -0
  255. package/dist/plugin-utils/helpers.cjs +6 -6
  256. package/dist/plugin-utils/helpers.d.cts +15 -15
  257. package/dist/plugin-utils/helpers.d.cts.map +1 -1
  258. package/dist/plugin-utils/helpers.d.mts +15 -15
  259. package/dist/plugin-utils/helpers.d.mts.map +1 -1
  260. package/dist/plugin-utils/helpers.mjs +1 -1
  261. package/dist/plugin-utils/helpers.mjs.map +1 -1
  262. package/dist/plugin-utils/index.cjs +34 -4
  263. package/dist/plugin-utils/index.d.cts +7 -4
  264. package/dist/plugin-utils/index.d.mts +7 -4
  265. package/dist/plugin-utils/index.mjs +9 -6
  266. package/dist/plugin-utils/install.cjs +47 -0
  267. package/dist/plugin-utils/install.d.cts +23 -0
  268. package/dist/plugin-utils/install.d.cts.map +1 -0
  269. package/dist/plugin-utils/install.d.mts +23 -0
  270. package/dist/plugin-utils/install.d.mts.map +1 -0
  271. package/dist/plugin-utils/install.mjs +45 -0
  272. package/dist/plugin-utils/install.mjs.map +1 -0
  273. package/dist/plugin-utils/logging.cjs +588 -1
  274. package/dist/plugin-utils/logging.d.cts +93 -1
  275. package/dist/plugin-utils/logging.d.cts.map +1 -1
  276. package/dist/plugin-utils/logging.d.mts +93 -1
  277. package/dist/plugin-utils/logging.d.mts.map +1 -1
  278. package/dist/plugin-utils/logging.mjs +572 -1
  279. package/dist/plugin-utils/logging.mjs.map +1 -1
  280. package/dist/plugin-utils/merge.cjs +1 -1
  281. package/dist/plugin-utils/merge.mjs +1 -1
  282. package/dist/plugin-utils/modules.cjs +1 -1
  283. package/dist/plugin-utils/modules.mjs +1 -1
  284. package/dist/plugin-utils/modules.mjs.map +1 -1
  285. package/dist/plugin-utils/paths.cjs +6 -2
  286. package/dist/plugin-utils/paths.mjs +6 -2
  287. package/dist/plugin-utils/paths.mjs.map +1 -1
  288. package/dist/plugin-utils/virtual.cjs +80 -0
  289. package/dist/plugin-utils/virtual.d.cts +69 -0
  290. package/dist/plugin-utils/virtual.d.cts.map +1 -0
  291. package/dist/plugin-utils/virtual.d.mts +69 -0
  292. package/dist/plugin-utils/virtual.d.mts.map +1 -0
  293. package/dist/plugin-utils/virtual.mjs +73 -0
  294. package/dist/plugin-utils/virtual.mjs.map +1 -0
  295. package/dist/schemas/fs.cjs +232 -0
  296. package/dist/schemas/fs.d.cts +127 -0
  297. package/dist/schemas/fs.d.cts.map +1 -0
  298. package/dist/schemas/fs.d.mts +127 -0
  299. package/dist/schemas/fs.d.mts.map +1 -0
  300. package/dist/schemas/fs.mjs +226 -0
  301. package/dist/schemas/fs.mjs.map +1 -0
  302. package/dist/storage/base.cjs +216 -0
  303. package/dist/storage/base.d.cts +201 -0
  304. package/dist/storage/base.d.cts.map +1 -0
  305. package/dist/storage/base.d.mts +201 -0
  306. package/dist/storage/base.d.mts.map +1 -0
  307. package/dist/storage/base.mjs +215 -0
  308. package/dist/storage/base.mjs.map +1 -0
  309. package/dist/storage/file-system.cjs +180 -0
  310. package/dist/storage/file-system.d.cts +129 -0
  311. package/dist/storage/file-system.d.cts.map +1 -0
  312. package/dist/storage/file-system.d.mts +129 -0
  313. package/dist/storage/file-system.d.mts.map +1 -0
  314. package/dist/storage/file-system.mjs +179 -0
  315. package/dist/storage/file-system.mjs.map +1 -0
  316. package/dist/storage/helpers.cjs +37 -0
  317. package/dist/storage/helpers.d.cts +25 -0
  318. package/dist/storage/helpers.d.cts.map +1 -0
  319. package/dist/storage/helpers.d.mts +25 -0
  320. package/dist/storage/helpers.d.mts.map +1 -0
  321. package/dist/storage/helpers.mjs +34 -0
  322. package/dist/storage/helpers.mjs.map +1 -0
  323. package/dist/storage/index.cjs +12 -0
  324. package/dist/storage/index.d.cts +5 -0
  325. package/dist/storage/index.d.mts +5 -0
  326. package/dist/storage/index.mjs +6 -0
  327. package/dist/storage/virtual.cjs +98 -0
  328. package/dist/storage/virtual.d.cts +80 -0
  329. package/dist/storage/virtual.d.cts.map +1 -0
  330. package/dist/storage/virtual.d.mts +80 -0
  331. package/dist/storage/virtual.d.mts.map +1 -0
  332. package/dist/storage/virtual.mjs +97 -0
  333. package/dist/storage/virtual.mjs.map +1 -0
  334. package/dist/types/api.d.cts +18 -152
  335. package/dist/types/api.d.cts.map +1 -1
  336. package/dist/types/api.d.mts +18 -152
  337. package/dist/types/api.d.mts.map +1 -1
  338. package/dist/types/config.d.cts +194 -135
  339. package/dist/types/config.d.cts.map +1 -1
  340. package/dist/types/config.d.mts +195 -136
  341. package/dist/types/config.d.mts.map +1 -1
  342. package/dist/types/context.d.cts +152 -128
  343. package/dist/types/context.d.cts.map +1 -1
  344. package/dist/types/context.d.mts +155 -131
  345. package/dist/types/context.d.mts.map +1 -1
  346. package/dist/types/fs.d.mts +1 -1
  347. package/dist/types/index.d.cts +5 -6
  348. package/dist/types/index.d.mts +5 -6
  349. package/dist/types/logging.d.cts +161 -0
  350. package/dist/types/logging.d.cts.map +1 -0
  351. package/dist/types/logging.d.mts +161 -0
  352. package/dist/types/logging.d.mts.map +1 -0
  353. package/dist/types/plugin.d.cts +6 -9
  354. package/dist/types/plugin.d.cts.map +1 -1
  355. package/dist/types/plugin.d.mts +6 -9
  356. package/dist/types/plugin.d.mts.map +1 -1
  357. package/dist/types/tsconfig.d.mts +1 -1
  358. package/dist/types/unplugin.d.cts +5 -26
  359. package/dist/types/unplugin.d.cts.map +1 -1
  360. package/dist/types/unplugin.d.mts +5 -26
  361. package/dist/types/unplugin.d.mts.map +1 -1
  362. package/package.json +259 -457
  363. package/schemas/fs.capnp +42 -0
  364. package/dist/constants/virtual-modules.cjs +0 -8
  365. package/dist/constants/virtual-modules.d.cts +0 -6
  366. package/dist/constants/virtual-modules.d.cts.map +0 -1
  367. package/dist/constants/virtual-modules.d.mts +0 -6
  368. package/dist/constants/virtual-modules.d.mts.map +0 -1
  369. package/dist/constants/virtual-modules.mjs +0 -7
  370. package/dist/constants/virtual-modules.mjs.map +0 -1
  371. package/dist/lib/logger.cjs +0 -99
  372. package/dist/lib/logger.d.cts +0 -53
  373. package/dist/lib/logger.d.cts.map +0 -1
  374. package/dist/lib/logger.d.mts +0 -53
  375. package/dist/lib/logger.d.mts.map +0 -1
  376. package/dist/lib/logger.mjs +0 -93
  377. package/dist/lib/logger.mjs.map +0 -1
  378. package/dist/types/_internal.cjs +0 -0
  379. package/dist/types/_internal.d.cts +0 -106
  380. package/dist/types/_internal.d.cts.map +0 -1
  381. package/dist/types/_internal.d.mts +0 -106
  382. package/dist/types/_internal.d.mts.map +0 -1
  383. package/dist/types/_internal.mjs +0 -1
  384. package/dist/types/commands.d.cts +0 -16
  385. package/dist/types/commands.d.cts.map +0 -1
  386. package/dist/types/commands.d.mts +0 -16
  387. package/dist/types/commands.d.mts.map +0 -1
  388. package/dist/types/utils.d.cts +0 -9
  389. package/dist/types/utils.d.cts.map +0 -1
  390. package/dist/types/utils.d.mts +0 -9
  391. package/dist/types/utils.d.mts.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.mjs","names":["#tsconfig","#fs","#checksum","#buildId","#releaseId","#configProxy","#parserCache","#requestCache"],"sources":["../../src/context/context.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 { toArray } from \"@stryke/convert/to-array\";\nimport { EnvPaths, getEnvPaths } from \"@stryke/env/get-env-paths\";\nimport { relativeToWorkspaceRoot } from \"@stryke/fs/get-workspace-root\";\nimport { murmurhash } from \"@stryke/hash\";\nimport { hashDirectory } from \"@stryke/hash/node\";\nimport { getUnique, getUniqueBy } from \"@stryke/helpers/get-unique\";\nimport { omit } from \"@stryke/helpers/omit\";\nimport { fetchRequest } from \"@stryke/http/fetch\";\nimport { appendPath } from \"@stryke/path/append\";\nimport {\n findFileDotExtensionSafe,\n findFileExtensionSafe\n} from \"@stryke/path/file-path-fns\";\nimport { isEqual } from \"@stryke/path/is-equal\";\nimport { isParentPath } from \"@stryke/path/is-parent-path\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { replacePath } from \"@stryke/path/replace\";\nimport { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { isFunction } from \"@stryke/type-checks/is-function\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport { isUndefined } from \"@stryke/type-checks/is-undefined\";\nimport { TypeDefinition } from \"@stryke/types/configuration\";\nimport { PackageJson } from \"@stryke/types/package-json\";\nimport { uuid } from \"@stryke/unique-id/uuid\";\nimport { match, tsconfigPathsToRegExp } from \"bundle-require\";\nimport { resolveCompatibilityDates } from \"compatx\";\nimport defu from \"defu\";\nimport { create, FlatCache } from \"flat-cache\";\nimport { existsSync } from \"node:fs\";\nimport { parse, ParseResult } from \"oxc-parser\";\nimport { Range } from \"semver\";\nimport {\n Agent,\n BodyInit,\n interceptors,\n RequestInfo,\n Response,\n setGlobalDispatcher\n} from \"undici\";\nimport { UnpluginBuildContext } from \"unplugin\";\nimport {\n CACHE_HASH_LENGTH,\n DEFAULT_DEVELOPMENT_LOG_LEVEL,\n DEFAULT_PRODUCTION_LOG_LEVEL,\n DEFAULT_TEST_LOG_LEVEL,\n ROOT_HASH_LENGTH\n} from \"../constants\";\nimport {\n getDefaultMode,\n loadParsedConfig,\n resolvePackageConfigs\n} from \"../lib/config\";\nimport { getConfigProps } from \"../lib/context-helpers\";\nimport {\n getUniqueInputs,\n isTypeDefinition,\n resolveInputsSync\n} from \"../lib/entry\";\nimport { callHook } from \"../lib/hooks\";\nimport { getPrefixedRootHash } from \"../lib/meta\";\nimport { createResolver } from \"../lib/resolver\";\nimport { getTsconfigFilePath } from \"../lib/typescript/tsconfig\";\nimport { VirtualFileSystem } from \"../lib/vfs\";\nimport {\n getPackageJsonOrganization,\n getWorkspaceName\n} from \"../plugin-utils/context-helpers\";\nimport { formatConfig } from \"../plugin-utils/format\";\nimport { isDuplicate, isPlugin } from \"../plugin-utils/helpers\";\nimport { createLogger, resolveLogLevel } from \"../plugin-utils/logging\";\nimport { mergeConfig } from \"../plugin-utils/merge\";\nimport { replacePathTokens } from \"../plugin-utils/paths\";\nimport {\n CopyConfig,\n ExecutionOptions,\n FrameworkOptions,\n InferOverridableConfig,\n ParsedUserConfig,\n PluginConfig,\n ResolvedAssetGlob,\n ResolvedConfig,\n ResolvedCopyConfig,\n ResolvedEntryTypeDefinition,\n ResolvedOutputConfig\n} from \"../types/config\";\nimport {\n Context,\n EmitEntryOptions,\n EmitOptions,\n EnvironmentContext,\n ExecutionContext,\n FetchOptions,\n MetaInfo,\n ParseOptions,\n PluginContext,\n Resolver,\n ResolveResult,\n TransformResult\n} from \"../types/context\";\nimport {\n ResolveOptions,\n VirtualFile,\n VirtualFileSystemInterface\n} from \"../types/fs\";\nimport {\n CallHookOptions,\n InferHookParameters,\n InferHookReturnType\n} from \"../types/hooks\";\nimport {\n Logger,\n LoggerOptions,\n LogLevelResolvedConfig\n} from \"../types/logging\";\nimport { ParsedTypeScriptConfig } from \"../types/tsconfig\";\nimport { PowerlinesBaseContext } from \"./base-context\";\n\nconst agent = new Agent({ keepAliveTimeout: 10000 });\nsetGlobalDispatcher(\n agent.compose(\n interceptors.retry({\n maxRetries: 3,\n minTimeout: 1000,\n maxTimeout: 10000,\n timeoutFactor: 2,\n retryAfter: true\n })\n )\n);\n\nconst UNRESOLVED_CONFIG_NAMES = [\n \"userConfig\",\n \"inlineConfig\",\n \"pluginConfig\",\n \"environmentConfig\"\n];\n\nexport class PowerlinesContext<\n TResolvedConfig extends ResolvedConfig = ResolvedConfig,\n TSystemContext = unknown\n>\n extends PowerlinesBaseContext<TSystemContext>\n implements Context<TResolvedConfig, TSystemContext>\n{\n #checksum: string | null = null;\n\n #buildId: string = uuid();\n\n #releaseId: string = uuid();\n\n #fs!: VirtualFileSystemInterface;\n\n #tsconfig!: ParsedTypeScriptConfig;\n\n #parserCache!: FlatCache;\n\n #requestCache!: FlatCache;\n\n #configProxy!: TResolvedConfig;\n\n public resolver!: Resolver;\n\n /**\n * The parsed `package.json` file for the project\n */\n public packageJson!: PackageJson;\n\n /**\n * The parsed `project.json` file for the project\n */\n public projectJson: Record<string, any> | undefined = undefined;\n\n /**\n * The parsed configuration file for the project\n */\n public configFile!: ParsedUserConfig;\n\n /**\n * An object containing the dependencies that should be installed for the project\n */\n public dependencies: Record<string, string | Range> = {};\n\n /**\n * An object containing the development dependencies that should be installed for the project\n */\n public devDependencies: Record<string, string | Range> = {};\n\n /**\n * The persisted meta information about the current build\n */\n public persistedMeta: MetaInfo | undefined = undefined;\n\n /**\n * The resolved tsconfig file paths for the project\n */\n public resolvePatterns: RegExp[] = [];\n\n /**\n * The resolved configuration for this context\n */\n protected resolvedConfig: TResolvedConfig = {} as TResolvedConfig;\n\n /**\n * The configuration options that were overridden by plugins during the build process, which may include additional properties or modifications made during the configuration loading process.\n */\n protected overriddenConfig: InferOverridableConfig<TResolvedConfig> =\n {} as InferOverridableConfig<TResolvedConfig>;\n\n /**\n * The configuration options provided inline during execution, such as CLI flags or other parameters that may be relevant to the command being executed. These options can be used to override or supplement the configuration options defined in a configuration file on disk, and are typically provided as part of the execution context when running a Powerlines command.\n */\n protected inlineConfig: TResolvedConfig[\"inlineConfig\"] =\n {} as TResolvedConfig[\"inlineConfig\"];\n\n /**\n * The configuration options read from a configuration file on disk, which may be used to resolve the final configuration for the context. This typically includes the user configuration options defined in the `powerlines.config.ts` file, as well as any inline configuration options provided during execution.\n */\n protected userConfig: TResolvedConfig[\"userConfig\"] =\n {} as TResolvedConfig[\"userConfig\"];\n\n /**\n * The configuration options provided by plugins added by the user (and other plugins)\n */\n protected pluginConfig: TResolvedConfig[\"pluginConfig\"] = {};\n\n /**\n * The configuration options provided by the environment\n */\n protected environmentConfig: any = {};\n\n /**\n * The resolved entry type definitions for the project\n */\n public get entry(): ResolvedEntryTypeDefinition[] {\n const entry = this.resolvedEntry;\n\n return resolveInputsSync(\n this,\n entry && entry.length > 0\n ? entry\n : Array.isArray(this.config.input) ||\n (isSetObject(this.config.input) &&\n !isTypeDefinition(this.config.input))\n ? this.config.input\n : toArray(this.config.input).flat()\n );\n }\n\n /**\n * The TypeScript configuration parsed from the tsconfig file\n */\n public get tsconfig(): ParsedTypeScriptConfig {\n if (!this.#tsconfig) {\n this.tsconfig = {\n tsconfigFilePath: this.config.tsconfig\n } as ParsedTypeScriptConfig;\n }\n\n return this.#tsconfig;\n }\n\n /**\n * Sets the TypeScript configuration parsed from the tsconfig file\n */\n public set tsconfig(value: ParsedTypeScriptConfig) {\n this.#tsconfig = value;\n this.resolvePatterns = tsconfigPathsToRegExp(value?.options?.paths ?? {});\n }\n\n /**\n * The virtual file system interface for the project\n */\n public get fs(): VirtualFileSystemInterface {\n if (!this.#fs) {\n this.#fs = VirtualFileSystem.createSync(this);\n }\n\n return this.#fs;\n }\n\n /**\n * Get the checksum of the project's current state\n */\n public get checksum(): string | null {\n return this.#checksum;\n }\n\n /**\n * Invokes the configured plugin hooks\n *\n * @remarks\n * By default, it will call the `\"pre\"`, `\"normal\"`, and `\"post\"` ordered hooks in sequence\n *\n * @param hook - The hook to call\n * @param options - The options to provide to the hook\n * @param args - The arguments to pass to the hook\n * @returns The result of the hook call\n */\n public callHook = async <TKey extends string>(\n hook: TKey,\n options: CallHookOptions & {\n environment?: string | EnvironmentContext<any>;\n },\n ...args: InferHookParameters<PluginContext<any>, TKey>\n ): Promise<InferHookReturnType<PluginContext<any>, TKey> | undefined> =>\n callHook<TKey, TResolvedConfig>(\n this as unknown as ExecutionContext<TResolvedConfig>,\n hook,\n options,\n ...args\n );\n\n /**\n * The meta information about the current build\n */\n public get meta() {\n return {\n executionId: this.#buildId,\n releaseId: this.#releaseId,\n checksum: this.#checksum,\n timestamp: this.timestamp,\n rootHash: murmurhash(\n {\n workspaceRoot: this.config?.cwd,\n root: this.config?.root\n },\n {\n maxLength: ROOT_HASH_LENGTH\n }\n ),\n configHash: murmurhash(this.config, {\n maxLength: CACHE_HASH_LENGTH\n })\n } as MetaInfo;\n }\n\n /**\n * The resolved configuration options\n */\n public get config(): TResolvedConfig {\n if (!this.#configProxy) {\n this.#configProxy = this.createConfigProxy();\n }\n\n return this.#configProxy;\n }\n\n /**\n * Get the path to the artifacts directory for the project\n */\n public get artifactsPath(): string {\n return joinPaths(\n this.config.cwd,\n this.config.root,\n this.config.output?.artifactsPath ||\n `.${this.config.framework?.name || \"powerlines\"}`\n );\n }\n\n /**\n * Get the path to the builtin modules used by the project\n */\n public get builtinsPath(): string {\n return joinPaths(this.artifactsPath, \"builtins\");\n }\n\n /**\n * Get the path to the entry directory for the project\n */\n public get entryPath(): string {\n return joinPaths(this.artifactsPath, \"entry\");\n }\n\n /**\n * Get the path to the infrastructure modules used by the project\n */\n public get infrastructurePath(): string {\n return joinPaths(this.artifactsPath, \"infrastructure\");\n }\n\n /**\n * Get the path to the data directory for the project\n */\n public get dataPath(): string {\n return joinPaths(\n this.envPaths.data,\n \"projects\",\n getPrefixedRootHash(this.config.name, this.meta.rootHash)\n );\n }\n\n /**\n * Get the path to the cache directory for the project\n */\n public get cachePath(): string {\n return joinPaths(\n this.envPaths.cache,\n \"projects\",\n murmurhash(\n {\n checksum: this.#checksum,\n config: this.meta.configHash\n },\n {\n maxLength: CACHE_HASH_LENGTH\n }\n )\n );\n }\n\n /**\n * Get the path to the generated declaration file for the project\n */\n public get typesPath(): string {\n return this.config.output.types\n ? appendPath(this.config.output.types, this.config.cwd)\n : joinPaths(this.config.cwd, this.config.root, \"powerlines.d.ts\");\n }\n\n /**\n * Get the project root relative to the workspace root\n */\n public get relativeToWorkspaceRoot() {\n return relativeToWorkspaceRoot(this.config.root);\n }\n\n /**\n * The builtin module id that exist in the Powerlines virtual file system\n */\n public get builtins(): string[] {\n return Object.values(this.fs.metadata)\n .filter(meta => meta && meta.type === \"builtin\")\n .map(meta => meta?.id)\n .filter(Boolean);\n }\n\n /**\n * Additional arguments provided during execution of the command, such as CLI flags or other parameters that may be relevant to the command being executed.\n */\n public get additionalArgs(): Record<string, string | string[]> {\n return Object.entries(this.config.inlineConfig.additionalArgs ?? {}).reduce(\n (ret, [key, value]) => {\n const formattedKey = key.replace(/^--?/, \"\");\n\n if (ret[formattedKey]) {\n if (Array.isArray(ret[formattedKey])) {\n if (Array.isArray(value)) {\n ret[formattedKey] = [...toArray(ret[formattedKey]), ...value];\n } else {\n ret[formattedKey] = [...toArray(ret[formattedKey]), value];\n }\n } else {\n ret[formattedKey] = [\n ret[formattedKey],\n ...(Array.isArray(value) ? value : [value])\n ];\n }\n } else {\n ret[formattedKey] = value;\n }\n return ret;\n },\n {} as Record<string, string | string[]>\n );\n }\n\n /**\n * The alias mappings for the project used during module resolution\n *\n * @remarks\n * This includes both the built-in module aliases as well as any custom aliases defined in the build configuration.\n */\n public get alias(): Record<string, string> {\n return this.builtins.reduce(\n (ret, id) => {\n const moduleId = `${\n this.config?.framework?.name || \"powerlines\"\n }:${id.replace(/^.*:/, \"\")}`;\n if (!ret[moduleId]) {\n const path = this.fs.paths[id];\n if (path) {\n ret[moduleId] = path;\n }\n }\n\n return ret;\n },\n this.config.resolve.alias\n ? Array.isArray(this.config.resolve.alias)\n ? this.config.resolve.alias.reduce(\n (ret, alias) => {\n if (!ret[alias.find.toString()]) {\n ret[alias.find.toString()] = alias.replacement;\n }\n\n return ret;\n },\n {} as Record<string, string>\n )\n : this.config.resolve.alias\n : {}\n );\n }\n\n public override get logger(): Logger {\n return this.createLogger();\n }\n\n /**\n * The log level for the context, which determines the minimum level of log messages that will be emitted by the logger. This is resolved based on the configuration options provided by the user, and can be set to different levels for development, production, and test environments. The log level can also be overridden by plugins or other parts of the build process to provide more granular control over logging output.\n */\n public get logLevel(): LogLevelResolvedConfig {\n return resolveLogLevel(this.config.logLevel, this.config.mode);\n }\n\n /**\n * The environment paths for the project, which provide the locations of various directories and files used by the Powerlines framework. These paths are resolved based on the organization ID, application ID, and workspace root directory, and can be used to access configuration files, cache directories, and other resources in a consistent manner.\n */\n public override get envPaths(): EnvPaths {\n return getEnvPaths({\n orgId: kebabCase(this.config.framework?.orgId || \"storm-software\"),\n appId: kebabCase(this.config.framework?.name || \"powerlines\"),\n workspaceRoot: this.config.cwd\n });\n }\n\n /**\n * Gets the parser cache.\n */\n protected get parserCache(): FlatCache {\n if (!this.#parserCache) {\n this.#parserCache = create({\n cacheId: \"parser\",\n cacheDir: this.cachePath,\n ttl: 2 * 60 * 60 * 1000,\n lruSize: 5000,\n persistInterval: 250\n });\n }\n\n return this.#parserCache;\n }\n\n /**\n * Gets the request cache.\n */\n protected get requestCache(): FlatCache {\n if (!this.#requestCache) {\n this.#requestCache = create({\n cacheId: \"http\",\n cacheDir: this.cachePath,\n ttl: 6 * 60 * 60 * 1000,\n lruSize: 5000,\n persistInterval: 250\n });\n }\n\n return this.#requestCache;\n }\n\n /**\n * The entry points that exist in the Powerlines virtual file system\n */\n protected get resolvedEntry(): ResolvedEntryTypeDefinition[] {\n return Object.entries(this.fs.metadata)\n .filter(([, meta]) => meta && meta.type === \"entry\")\n .map(([path, meta]) => {\n const typeDefinition = {\n file: path\n } as ResolvedEntryTypeDefinition;\n\n if (meta.properties) {\n if (isSetString(meta.properties.file)) {\n typeDefinition.file = meta.properties.file;\n }\n if (isSetString(meta.properties.name)) {\n typeDefinition.name = meta.properties.name;\n }\n if (\n isSetString(meta.properties[\"input.file\"]) ||\n isSetString(meta.properties[\"input.name\"])\n ) {\n typeDefinition.input ??= {} as TypeDefinition;\n if (isSetString(meta.properties[\"input.file\"])) {\n typeDefinition.input.file = meta.properties[\"input.file\"];\n }\n if (isSetString(meta.properties[\"input.name\"])) {\n typeDefinition.input.name = meta.properties[\"input.name\"];\n }\n }\n if (isSetString(meta.properties.output)) {\n typeDefinition.output = meta.properties.output;\n }\n }\n\n return typeDefinition;\n })\n .filter(Boolean);\n }\n\n /**\n * Creates a new Context instance.\n *\n * @param options - The options to use for creating the context, including the resolved configuration and workspace settings.\n */\n protected constructor(public override options: ExecutionOptions) {\n super(options);\n }\n\n public override createLogger(options: LoggerOptions = {}) {\n return createLogger(\n this.config.name || this.options.root,\n {\n logLevel: this.logLevel,\n ...options\n },\n this.options.logFn\n );\n }\n\n /**\n * A function to perform HTTP fetch requests\n *\n * @remarks\n * This function uses a caching layer to avoid duplicate requests during the Powerlines process.\n *\n * @example\n * ```ts\n * const response = await context.fetch(\"https://api.example.com/data\");\n * const data = await response.json();\n * ```\n *\n * @see https://github.com/nodejs/undici\n *\n * @param input - The URL to fetch.\n * @param options - The fetch request options.\n * @returns A promise that resolves to a response returned by the fetch.\n */\n public async fetch(\n input: RequestInfo,\n options: FetchOptions = {}\n ): Promise<Response> {\n const cacheKey = murmurhash({\n input: input.toString(),\n options: JSON.stringify(options)\n });\n\n if (!this.config.skipCache && !options.skipCache) {\n const cached = this.requestCache.get<\n {\n body: BodyInit;\n } & Pick<Response, \"status\" | \"statusText\" | \"headers\">\n >(cacheKey);\n if (cached) {\n return new Response(cached.body, {\n status: cached.status,\n statusText: cached.statusText,\n headers: cached.headers\n });\n }\n }\n\n const logger = this.extendLogger({ category: \"communication\" });\n const startTime = Date.now();\n\n logger.trace(\n `Sending fetch request (${\n options.method?.toUpperCase() || \"GET\"\n }): ${input.toString()}`\n );\n\n const response = await fetchRequest(input, { timeout: 12_000, ...options });\n const result = {\n body: await response.text(),\n status: response.status,\n statusText: response.statusText,\n headers: Object.fromEntries(response.headers.entries())\n };\n\n if (!this.config.skipCache && !options.skipCache) {\n try {\n this.requestCache.set(cacheKey, result);\n } catch {\n // Do nothing\n }\n }\n\n logger.trace(\n `Fetch request (${\n options.method?.toUpperCase() || \"GET\"\n }) completed in ${Date.now() - startTime}ms: ${input.toString()} - ${\n response.status\n } / ${response.statusText} \\n - Response Headers: ${JSON.stringify(\n result.headers\n )}\\n - Response Body: ${\n typeof result.body === \"string\"\n ? result.body.length > 1000\n ? `${result.body.slice(0, 1000)}... (truncated, total length: ${\n result.body.length\n })`\n : result.body\n : \"[Non-string body]\"\n }`\n );\n\n return new Response(result.body, {\n status: result.status,\n statusText: result.statusText,\n headers: result.headers\n });\n }\n\n /**\n * Parse code using [Oxc-Parser](https://github.com/oxc/oxc) into an (ESTree-compatible)[https://github.com/estree/estree] AST object.\n *\n * @remarks\n * This function can be used to parse TypeScript code into an AST for further analysis or transformation.\n *\n * @example\n * ```ts\n * const ast = context.parse(\"const x: number = 42;\");\n * ```\n *\n * @see https://rollupjs.org/plugin-development/#this-parse\n * @see https://github.com/oxc/oxc\n *\n * @param code - The source code to parse.\n * @param options - The options to pass to the parser.\n * @returns An (ESTree-compatible)[https://github.com/estree/estree] AST object.\n */\n public async parse(code: string, options: ParseOptions = {}) {\n const cacheKey = murmurhash({\n code,\n options\n });\n\n let result!: ParseResult;\n if (!this.config.skipCache) {\n result = this.parserCache.get<ParseResult>(cacheKey);\n if (result) {\n return result;\n }\n }\n\n result = await parse(`source.${options.lang || \"ts\"}`, code, {\n ...options,\n sourceType: \"module\",\n showSemanticErrors: this.config.mode === \"development\"\n });\n\n if (!this.config.skipCache) {\n this.parserCache.set(cacheKey, result);\n }\n\n return result;\n }\n\n /**\n * A helper function to resolve modules in the Virtual File System\n *\n * @remarks\n * This function can be used to resolve modules relative to the project root directory.\n *\n * @example\n * ```ts\n * const resolved = await context.resolve(\"some-module\", \"/path/to/importer\");\n * ```\n *\n * @param id - The module to resolve.\n * @param importer - An optional path to the importer module.\n * @param options - Additional resolution options.\n * @returns A promise that resolves to the resolved module path.\n */\n public async resolve(\n id: string,\n importer?: string,\n options: ResolveOptions = {}\n ): Promise<ResolveResult | undefined> {\n let moduleId = id;\n if (this.config.resolve.alias) {\n if (Array.isArray(this.config.resolve.alias)) {\n const alias = this.config.resolve.alias.find(a =>\n match(moduleId, [a.find])\n );\n if (alias) {\n moduleId = alias.replacement;\n }\n } else if (\n isSetObject(this.config.resolve.alias) &&\n this.config.resolve.alias[id]\n ) {\n moduleId = this.config.resolve.alias[id];\n }\n }\n\n if (\n this.fs.isResolvableId(moduleId) ||\n (importer && this.fs.isResolvableId(importer))\n ) {\n let resolvedImporter = importer;\n if (importer && this.fs.isResolvableId(importer)) {\n resolvedImporter = await this.fs.resolve(\n importer,\n undefined,\n defu(\n {\n conditions: this.config.resolve.conditions,\n extensions: this.config.resolve.extensions\n },\n options\n )\n );\n }\n\n const result = await this.fs.resolve(\n moduleId,\n resolvedImporter,\n defu(\n {\n conditions: this.config.resolve.conditions,\n extensions: this.config.resolve.extensions\n },\n options\n )\n );\n if (!result) {\n return undefined;\n }\n\n const external = Boolean(\n !match(moduleId, this.config.resolve.noExternal) &&\n (match(moduleId, this.config.resolve.external) ||\n moduleId.startsWith(\"node:\") ||\n ((!this.fs.isVirtual(moduleId, importer, options) ||\n (this.fs.isVirtual(moduleId, importer, options) &&\n this.config.projectType !== \"application\")) &&\n this.config.resolve.skipNodeModulesBundle &&\n !/^[A-Z]:[/\\\\]|^\\.{0,2}\\/|^\\.{1,2}$/.test(moduleId)))\n );\n\n return {\n id: result,\n external,\n virtual: !external\n };\n }\n\n if (this.config.resolve.skipNodeModulesBundle) {\n if (\n match(moduleId, this.resolvePatterns) ||\n match(moduleId, this.config.resolve.noExternal)\n ) {\n return undefined;\n }\n\n if (\n match(moduleId, this.config.resolve.external) ||\n moduleId.startsWith(\"node:\")\n ) {\n return { id: moduleId, external: true, virtual: false };\n }\n\n // Exclude any other import that looks like a Node module\n if (!/^[A-Z]:[/\\\\]|^\\.{0,2}\\/|^\\.{1,2}$/.test(moduleId)) {\n return {\n id: moduleId,\n external: true,\n virtual: false\n };\n }\n } else {\n if (match(moduleId, this.config.resolve.noExternal)) {\n return undefined;\n }\n\n if (\n match(moduleId, this.config.resolve.external) ||\n moduleId.startsWith(\"node:\")\n ) {\n return { id: moduleId, external: true, virtual: false };\n }\n }\n\n return undefined;\n }\n\n /**\n * A helper function to load modules from the Virtual File System\n *\n * @remarks\n * This function can be used to load modules relative to the project root directory.\n *\n * @example\n * ```ts\n * const module = await context.load(\"some-module\", \"/path/to/importer\");\n * ```\n *\n * @param id - The module to load.\n * @returns A promise that resolves to the loaded module.\n */\n public async load(id: string): Promise<TransformResult | undefined> {\n const resolvedId = await this.fs.resolve(id);\n if (!resolvedId) {\n return undefined;\n }\n\n const code = await this.fs.read(resolvedId);\n if (!code) {\n return undefined;\n }\n\n return { code, map: null };\n }\n\n /**\n * Get the builtin virtual files that exist in the Powerlines virtual file system\n */\n public async getBuiltins() {\n return Promise.all(\n Object.entries(this.fs.metadata)\n .filter(([, meta]) => meta && meta.type === \"builtin\")\n .map(async ([id, meta]) => {\n const code = await this.fs.read(id);\n const path = this.fs.paths[id];\n\n return { ...meta, path, code } as VirtualFile;\n })\n );\n }\n\n /**\n * Resolves a file and writes it to the VFS if it does not already exist\n *\n * @param code - The source code of the file\n * @param path - The path to write the file to\n * @param options - Additional options for writing the file\n */\n public async emit(\n code: string,\n path: string,\n options: EmitOptions = {}\n ): Promise<void> {\n const filePath = options.extension\n ? findFileExtensionSafe(path)\n ? options.extension.startsWith(\".\")\n ? path.replace(findFileDotExtensionSafe(path), options.extension)\n : path.replace(findFileExtensionSafe(path), options.extension)\n : options.extension.startsWith(\".\")\n ? `${path}${options.extension}`\n : `${path}.${options.extension}`\n : findFileExtensionSafe(path)\n ? path\n : `${path}.ts`;\n\n if (\n isFunction((this as unknown as UnpluginBuildContext).emitFile) &&\n options.emitWithBundler\n ) {\n return (this as unknown as UnpluginBuildContext).emitFile({\n needsCodeReference: options.needsCodeReference,\n originalFileName: options.originalFileName,\n fileName: filePath,\n source: code,\n type: \"asset\"\n });\n }\n\n return this.fs.write(filePath, code, options);\n }\n\n /**\n * Synchronously resolves a file and writes it to the VFS if it does not already exist\n *\n * @param code - The source code of the file\n * @param path - The path to write the file to\n * @param options - Additional options for writing the file\n */\n public emitSync(code: string, path: string, options: EmitOptions = {}) {\n const filePath = options.extension\n ? findFileExtensionSafe(path)\n ? options.extension.startsWith(\".\")\n ? path.replace(findFileDotExtensionSafe(path), options.extension)\n : path.replace(findFileExtensionSafe(path), options.extension)\n : options.extension.startsWith(\".\")\n ? `${path}${options.extension}`\n : `${path}.${options.extension}`\n : findFileExtensionSafe(path)\n ? path\n : `${path}.ts`;\n\n if (\n isFunction((this as unknown as UnpluginBuildContext).emitFile) &&\n options.emitWithBundler\n ) {\n return (this as unknown as UnpluginBuildContext).emitFile({\n needsCodeReference: options.needsCodeReference,\n originalFileName: options.originalFileName,\n fileName: filePath,\n source: code,\n type: \"asset\"\n });\n }\n\n return this.fs.writeSync(filePath, code, options);\n }\n\n /**\n * Resolves a entry virtual file and writes it to the VFS if it does not already exist\n *\n * @param code - The source code of the entry file\n * @param path - A path to write the entry file to\n * @param options - Optional write file options\n */\n public async emitEntry(\n code: string,\n path: string,\n options: EmitEntryOptions = {}\n ): Promise<void> {\n return this.emit(\n code,\n appendPath(path, this.entryPath),\n defu(\n {\n meta: {\n type: \"entry\",\n properties: {\n file: appendPath(path, this.entryPath),\n name: options?.name,\n output: options?.output,\n \"input.file\": options?.input?.file,\n \"input.name\": options?.input?.name\n }\n }\n },\n omit(options, [\"name\"])\n )\n );\n }\n\n /**\n * Synchronously resolves a entry virtual file and writes it to the VFS if it does not already exist\n *\n * @param code - The source code of the entry file\n * @param path - A path to write the entry file to\n * @param options - Optional write file options\n */\n public emitEntrySync(\n code: string,\n path: string,\n options: EmitEntryOptions = {}\n ): void {\n return this.emitSync(\n code,\n appendPath(path, this.entryPath),\n defu(\n {\n meta: {\n type: \"entry\",\n properties: {\n file: appendPath(path, this.entryPath),\n name: options?.name,\n output: options?.output,\n \"input.file\": options?.input?.file,\n \"input.name\": options?.input?.name\n }\n }\n },\n omit(options, [\"name\"])\n )\n );\n }\n\n /**\n * Resolves a builtin virtual file and writes it to the VFS if it does not already exist\n *\n * @param code - The source code of the builtin file\n * @param id - The unique identifier of the builtin file\n * @param options - Optional write file options\n */\n public async emitBuiltin(\n code: string,\n id: string,\n options: EmitOptions = {}\n ): Promise<void> {\n if (!this.builtinsPath) {\n throw new Error(\n `The builtins path is not set. Cannot emit builtin file with id \"${id}\".`\n );\n }\n\n if (!isSetString(id)) {\n throw new Error(\n `The builtin id must be a non-empty string. Received: ${String(id)}`\n );\n }\n\n return this.emit(\n code,\n appendPath(id, this.builtinsPath),\n defu(options, { meta: { type: \"builtin\", id } })\n );\n }\n\n /**\n * Synchronously resolves a builtin virtual file and writes it to the VFS if it does not already exist\n *\n * @param code - The source code of the builtin file\n * @param id - The unique identifier of the builtin file\n * @param options - Optional write file options\n */\n public emitBuiltinSync(code: string, id: string, options: EmitOptions = {}) {\n if (!this.builtinsPath) {\n throw new Error(\n `The builtins path is not set. Cannot emit builtin file with id \"${id}\".`\n );\n }\n\n if (!isSetString(id)) {\n throw new Error(\n `The builtin id must be a non-empty string. Received: ${String(id)}`\n );\n }\n\n return this.emitSync(\n code,\n appendPath(id, this.builtinsPath),\n defu(options, { meta: { type: \"builtin\", id } })\n );\n }\n\n /**\n * Resolves a builtin virtual file and writes it to the VFS if it does not already exist\n *\n * @param code - The source code of the builtin file\n * @param id - The unique identifier of the builtin file\n * @param options - Optional write file options\n */\n public async emitInfrastructure(\n code: string,\n id: string,\n options: EmitOptions = {}\n ): Promise<void> {\n if (!this.infrastructurePath) {\n throw new Error(\n `The infrastructure path is not set. Cannot emit infrastructure file with id \"${id}\".`\n );\n }\n\n if (!isSetString(id)) {\n throw new Error(\n `The infrastructure id must be a non-empty string. Received: ${String(id)}`\n );\n }\n\n return this.emit(\n code,\n appendPath(id, this.infrastructurePath),\n defu(options, { meta: { type: \"infrastructure\", id } })\n );\n }\n\n /**\n * Synchronously resolves an infrastructure virtual file and writes it to the VFS if it does not already exist\n *\n * @param code - The source code of the infrastructure file\n * @param id - The unique identifier of the infrastructure file\n * @param options - Optional write file options\n */\n public emitInfrastructureSync(\n code: string,\n id: string,\n options: EmitOptions = {}\n ) {\n if (!this.infrastructurePath) {\n throw new Error(\n `The infrastructure path is not set. Cannot emit infrastructure file with id \"${id}\".`\n );\n }\n\n if (!isSetString(id)) {\n throw new Error(\n `The infrastructure id must be a non-empty string. Received: ${String(id)}`\n );\n }\n\n return this.emitSync(\n code,\n appendPath(id, this.infrastructurePath),\n defu(options, { meta: { type: \"infrastructure\", id } })\n );\n }\n\n /**\n * Generates a checksum representing the current context state\n *\n * @param path - The root directory of the project to generate the checksum for\n * @returns A promise that resolves to a string representing the checksum\n */\n public async generateChecksum(path?: string): Promise<string> {\n return hashDirectory(\n path || appendPath(this.options.root, this.options.cwd)\n );\n }\n\n /**\n * A setter function to populate the inline config values provided during execution of the command, such as CLI flags or other parameters that may be relevant to the command being executed. This function can be used to update the context with the inline configuration values, which may be used during the configuration resolution process to ensure that the final configuration reflects both the user configuration and any inline configuration provided during execution.\n *\n * @param config - The inline configuration values to set.\n * @returns A promise that resolves when the inline configuration values have been set.\n */\n public async setInlineConfig(\n config: TResolvedConfig[\"inlineConfig\"]\n ): Promise<void> {\n this.logger.debug({\n meta: { category: \"config\" },\n message: `Updating inline configuration object: \\n${formatConfig(config)}`\n });\n\n this.inlineConfig = config;\n this.#checksum = await this.generateChecksum();\n\n this.configFile = await loadParsedConfig(\n this.options.cwd,\n this.options.root,\n this.options.framework?.name || \"powerlines\",\n this.options.framework?.orgId || \"storm-software\",\n config\n );\n\n const result =\n this.configFile.config &&\n toArray(this.configFile.config).length > this.options.configIndex\n ? toArray(this.configFile.config)[this.options.configIndex]!\n : this.configFile.config;\n if (!result) {\n this.logger.warn(\n `No configuration found in ${\n this.options.configFile\n } for execution index ${this.options.configIndex}.`\n );\n } else {\n await this.setUserConfig(\n (isFunction(result)\n ? await Promise.resolve(\n result({\n cwd: this.cwd,\n root: this.options.root,\n mode:\n this.inlineConfig.mode ||\n (await getDefaultMode(this.cwd, this.options.root)),\n command: this.inlineConfig.command\n })\n )\n : result) as TResolvedConfig[\"userConfig\"]\n );\n }\n\n await this.resolveConfig();\n }\n\n /**\n * A setter function to populate the plugin config values provided during execution of the command, such as CLI flags or other parameters that may be relevant to the command being executed. This function can be used to update the context with the plugin configuration values, which may be used during the configuration resolution process to ensure that the final configuration reflects both the user configuration and any plugin configuration provided during execution.\n *\n * @param config - The plugin configuration values to set.\n * @returns A promise that resolves when the plugin configuration values have been set.\n */\n public async setPluginConfig(\n config: TResolvedConfig[\"pluginConfig\"]\n ): Promise<void> {\n this.logger.debug({\n meta: { category: \"config\" },\n message: `Updating plugin configuration object: \\n${formatConfig(config)}`\n });\n\n this.pluginConfig = config;\n await this.resolveConfig();\n }\n\n /**\n * A function to merge the various configuration objects (initial, user, inline, and plugin) into a single resolved configuration object that can be used throughout the Powerlines process. This function takes into account the different sources of configuration and their respective priorities, ensuring that the final configuration reflects the intended settings for the project. The merged configuration is then returned as a new object that can be accessed through the `config` property of the context.\n *\n * @returns The merged configuration object that combines the initial, user, inline, and plugin configurations.\n */\n protected mergeConfig(): TResolvedConfig {\n return mergeConfig(\n {\n inlineConfig: this.inlineConfig,\n userConfig: this.userConfig,\n pluginConfig: this.pluginConfig,\n environmentConfig: this.environmentConfig\n },\n getConfigProps<TResolvedConfig>(this.overriddenConfig),\n this.options,\n getConfigProps<TResolvedConfig>(this.inlineConfig),\n getConfigProps<TResolvedConfig>(this.userConfig),\n getConfigProps<TResolvedConfig>(this.pluginConfig),\n {\n version: this.packageJson?.version,\n description: this.packageJson?.description,\n environments: {},\n resolve: {}\n }\n ) as TResolvedConfig;\n }\n\n /**\n * A setter function to populate the user config values provided during execution of the command, such as CLI flags or other parameters that may be relevant to the command being executed. This function can be used to update the context with the user configuration values, which may be used during the configuration resolution process to ensure that the final configuration reflects both the user configuration and any inline configuration provided during execution.\n *\n * @param config - The user configuration values to set.\n * @returns A promise that resolves when the user configuration values have been set.\n */\n protected async setUserConfig(\n config: TResolvedConfig[\"userConfig\"]\n ): Promise<void> {\n this.logger.debug({\n meta: { category: \"config\" },\n message: `Updating user configuration object: \\n${formatConfig(config)}`\n });\n\n this.userConfig = config;\n await this.resolveConfig();\n }\n\n /**\n * Initialize the context with the provided configuration options\n */\n protected async resolveConfig(): Promise<void> {\n const mergedConfig = this.mergeConfig();\n\n this.logger.trace({\n meta: { category: \"config\" },\n message: `Pre-setup Powerlines configuration object: \\n --- Merged Config --- \\n${formatConfig(\n mergedConfig\n )} \\n\\n --- User Config --- \\n${formatConfig(\n this.userConfig\n )} \\n\\n --- Inline Config --- \\n${formatConfig(\n this.inlineConfig\n )} \\n\\n --- Plugin Config --- \\n${formatConfig(\n this.pluginConfig\n )} \\n\\n --- Environment Config --- \\n${formatConfig(\n this.environmentConfig\n )} \\n\\n --- Overridden Config --- \\n${formatConfig(\n this.overriddenConfig\n )}`\n });\n\n mergedConfig.output = defu(mergedConfig.output ?? {}, {\n copy: {\n assets: [\n {\n glob: \"LICENSE\"\n },\n {\n input: mergedConfig.root,\n glob: \"*.md\"\n },\n {\n input: mergedConfig.root,\n glob: \"package.json\"\n }\n ]\n },\n dts: true\n }) as ResolvedOutputConfig;\n\n if (isUndefined(mergedConfig.mode)) {\n mergedConfig.mode = await getDefaultMode(this.cwd, mergedConfig.root);\n }\n\n if (\n isUndefined(mergedConfig.framework) ||\n !isSetString(mergedConfig.framework.name)\n ) {\n mergedConfig.framework ??= {} as FrameworkOptions;\n mergedConfig.framework.name ??=\n (await getWorkspaceName(this)) || \"powerlines\";\n }\n\n if (isUndefined(mergedConfig.platform)) {\n mergedConfig.platform = \"neutral\";\n }\n\n mergedConfig.compatibilityDate = resolveCompatibilityDates(\n mergedConfig.compatibilityDate,\n \"latest\"\n );\n\n if (\n (!this.packageJson &&\n existsSync(\n joinPaths(\n appendPath(mergedConfig.root, mergedConfig.cwd),\n \"package.json\"\n )\n )) ||\n (!this.projectJson &&\n existsSync(\n joinPaths(\n appendPath(mergedConfig.root, mergedConfig.cwd),\n \"project.json\"\n )\n ))\n ) {\n const result = await resolvePackageConfigs(\n mergedConfig.cwd,\n mergedConfig.root\n );\n if (result) {\n if (result.packageJson) {\n this.packageJson = result.packageJson;\n }\n if (result.projectJson) {\n this.projectJson = result.projectJson;\n }\n\n if (this.packageJson) {\n mergedConfig.framework ??= {} as FrameworkOptions;\n mergedConfig.framework.name ??=\n (await getWorkspaceName(this)) || \"powerlines\";\n mergedConfig.framework.orgId ??=\n getPackageJsonOrganization(this.packageJson) || \"storm-software\";\n }\n }\n }\n\n if (isUndefined(mergedConfig.projectType)) {\n mergedConfig.projectType = this.projectJson?.projectType || \"application\";\n }\n\n this.resolvedConfig = mergedConfig;\n this.#configProxy = this.createConfigProxy();\n\n mergedConfig.input = getUniqueInputs(mergedConfig.input);\n\n if (\n mergedConfig.name?.startsWith(\"@\") &&\n mergedConfig.name.split(\"/\").filter(Boolean).length > 1\n ) {\n mergedConfig.name = mergedConfig.name.split(\"/\").filter(Boolean)[1]!;\n }\n\n mergedConfig.title ??= titleCase(mergedConfig.name);\n\n if (mergedConfig.resolve.external) {\n mergedConfig.resolve.external = getUnique(mergedConfig.resolve.external);\n }\n if (mergedConfig.resolve.noExternal) {\n mergedConfig.resolve.noExternal = getUnique(\n mergedConfig.resolve.noExternal\n );\n }\n\n mergedConfig.plugins = (mergedConfig.plugins ?? [])\n .flatMap(plugin => toArray(plugin))\n .filter(Boolean)\n .reduce((ret, plugin) => {\n if (\n isPlugin(plugin) &&\n isDuplicate(\n plugin,\n ret.filter(p => isPlugin(p))\n )\n ) {\n return ret;\n }\n\n ret.push(plugin);\n\n return ret;\n }, [] as PluginConfig[]);\n\n if (isUndefined(mergedConfig.logLevel)) {\n if (mergedConfig.mode === \"development\") {\n mergedConfig.logLevel = DEFAULT_DEVELOPMENT_LOG_LEVEL;\n } else if (mergedConfig.mode === \"test\") {\n mergedConfig.logLevel = DEFAULT_TEST_LOG_LEVEL;\n } else {\n mergedConfig.logLevel = DEFAULT_PRODUCTION_LOG_LEVEL;\n }\n }\n\n mergedConfig.logLevel = resolveLogLevel(mergedConfig.logLevel);\n\n if (isSetString(mergedConfig.tsconfig)) {\n mergedConfig.tsconfig = replacePath(\n replacePathTokens(this, mergedConfig.tsconfig),\n mergedConfig.cwd\n );\n } else {\n mergedConfig.tsconfig = getTsconfigFilePath(\n mergedConfig.cwd,\n mergedConfig.root\n );\n }\n\n // #region Configure output\n\n mergedConfig.output.format = getUnique(\n toArray(\n mergedConfig.output?.format ??\n (mergedConfig.projectType === \"library\" ? [\"cjs\", \"esm\"] : [\"esm\"])\n )\n );\n\n if (isSetString(mergedConfig.output.path)) {\n mergedConfig.output.path = appendPath(\n replacePathTokens(this, mergedConfig.output.path),\n mergedConfig.cwd\n );\n } else {\n mergedConfig.output.path = appendPath(\n joinPaths(mergedConfig.root, \"dist\"),\n mergedConfig.cwd\n );\n }\n\n mergedConfig.output.copy ??= {} as ResolvedCopyConfig;\n if (mergedConfig.output.copy !== false) {\n if (!mergedConfig.root.replace(/^\\.\\/?/, \"\")) {\n mergedConfig.output.copy.path = isSetString(\n mergedConfig.output.copy.path\n )\n ? appendPath(\n replacePathTokens(this, mergedConfig.output.copy.path),\n mergedConfig.cwd\n )\n : mergedConfig.output.path;\n } else {\n mergedConfig.output.copy.path = appendPath(\n replacePathTokens(\n this,\n isSetString(mergedConfig.output.copy.path)\n ? mergedConfig.output.copy.path\n : joinPaths(\"dist\", mergedConfig.root)\n ),\n mergedConfig.cwd\n );\n }\n }\n\n if (mergedConfig.output.types !== false) {\n mergedConfig.output.types = appendPath(\n replacePathTokens(\n this,\n mergedConfig.output.types ||\n joinPaths(\n mergedConfig.root,\n `${mergedConfig.framework?.name ?? \"powerlines\"}.d.ts`\n )\n ),\n mergedConfig.cwd\n );\n }\n\n if (\n mergedConfig.output.copy &&\n mergedConfig.output.copy.path &&\n mergedConfig.output.copy.assets &&\n Array.isArray(mergedConfig.output.copy.assets)\n ) {\n mergedConfig.output.copy.assets = getUniqueBy(\n mergedConfig.output.copy.assets.map(asset => {\n return {\n glob: isSetObject(asset) ? asset.glob : asset,\n input:\n isString(asset) ||\n !asset.input ||\n asset.input === \".\" ||\n asset.input === \"/\" ||\n asset.input === \"./\"\n ? mergedConfig.cwd\n : isParentPath(asset.input, mergedConfig.cwd) ||\n isEqual(asset.input, mergedConfig.cwd)\n ? asset.input\n : appendPath(asset.input, mergedConfig.cwd),\n output:\n isSetObject(asset) && asset.output\n ? isParentPath(asset.output, mergedConfig.cwd)\n ? asset.output\n : appendPath(\n joinPaths(\n (mergedConfig.output.copy as CopyConfig).path,\n replacePath(\n replacePath(\n asset.output,\n replacePath(\n (mergedConfig.output.copy as CopyConfig).path,\n mergedConfig.cwd\n )\n ),\n (mergedConfig.output.copy as CopyConfig).path\n )\n ),\n mergedConfig.cwd\n )\n : appendPath(\n (mergedConfig.output.copy as CopyConfig).path,\n mergedConfig.cwd\n ),\n ignore:\n isSetObject(asset) && asset.ignore\n ? toArray(asset.ignore)\n : undefined\n };\n }),\n (a: ResolvedAssetGlob) => `${a.input}-${a.glob}-${a.output}`\n );\n }\n\n if (isUndefined(mergedConfig.output?.sourceMap)) {\n if (mergedConfig.mode === \"development\") {\n mergedConfig.output.sourceMap = true;\n } else {\n mergedConfig.output.sourceMap = false;\n }\n }\n\n if (isUndefined(mergedConfig.output?.minify)) {\n if (mergedConfig.mode === \"production\") {\n mergedConfig.output.minify = true;\n } else {\n mergedConfig.output.minify = false;\n }\n }\n\n if (isUndefined(mergedConfig.output?.artifactsPath)) {\n mergedConfig.output.artifactsPath = `.${\n mergedConfig.framework?.name ?? \"powerlines\"\n }`;\n }\n\n if (mergedConfig.output.copy && mergedConfig.output.copy.assets) {\n mergedConfig.output.copy.assets = mergedConfig.output.copy.assets.map(\n asset => ({\n ...asset,\n glob: replacePathTokens(this, asset.glob),\n ignore: asset.ignore\n ? asset.ignore.map(ignore => replacePathTokens(this, ignore))\n : undefined,\n input: replacePathTokens(this, asset.input),\n output: replacePathTokens(this, asset.output)\n })\n );\n }\n\n if (\n (isSetString(mergedConfig.output?.storage) &&\n mergedConfig.output.storage === \"virtual\") ||\n (isSetObject(mergedConfig.output?.storage) &&\n Object.values(mergedConfig.output.storage).every(\n adapter => adapter.preset === \"virtual\"\n ))\n ) {\n mergedConfig.output.overwrite = true;\n }\n\n // #endregion Configure output\n\n this.resolvedConfig = mergedConfig;\n this.#configProxy = this.createConfigProxy();\n\n this.resolver = createResolver({\n cwd: this.resolvedConfig.cwd,\n root: this.resolvedConfig.root,\n cacheDir: this.envPaths.cache,\n mode: this.resolvedConfig.mode\n });\n\n this.logger.info({\n meta: { category: \"config\" },\n message: `Resolved Powerlines configuration object: \\n${formatConfig(\n this.resolvedConfig\n )}`\n });\n\n this.#fs ??= await VirtualFileSystem.create(this);\n }\n\n private createConfigProxy(): TResolvedConfig {\n return new Proxy(this.resolvedConfig, {\n /**\n * A trap for the `delete` operator.\n * @param target - The original object which is being proxied.\n * @param key - The name or `Symbol` of the property to delete.\n * @returns A `boolean` indicating whether or not the property was deleted.\n */\n deleteProperty: (target: TResolvedConfig, key) => {\n if (UNRESOLVED_CONFIG_NAMES.includes(key.toString())) {\n throw new Error(\n `Cannot delete property ${key.toString()} from config - it is only intended to be used as a reference.`\n );\n }\n\n Reflect.deleteProperty(this.overriddenConfig, key);\n return Reflect.deleteProperty(target, key);\n },\n\n /**\n * A trap for getting a property value.\n * @param target - The original object which is being proxied.\n * @param key - The name or `Symbol` of the property to get.\n * @param receiver - The proxy or an object that inherits from the proxy.\n */\n get: (target: TResolvedConfig, key, receiver) => {\n if (UNRESOLVED_CONFIG_NAMES.includes(key.toString())) {\n if (key === \"cwd\") {\n return this.cwd;\n }\n if (key === \"userConfig\") {\n return this.userConfig;\n }\n if (key === \"inlineConfig\") {\n return this.inlineConfig;\n }\n if (key === \"pluginConfig\") {\n return this.pluginConfig;\n }\n if (key === \"environmentConfig\") {\n return this.environmentConfig;\n }\n }\n\n return Reflect.get(target, key, receiver);\n },\n\n /**\n * A trap for the `in` operator.\n * @param target - The original object which is being proxied.\n * @param key - The name or `Symbol` of the property to check for existence.\n */\n has: (target: TResolvedConfig, key: string | symbol): boolean => {\n return (\n Reflect.has(target, key) ||\n UNRESOLVED_CONFIG_NAMES.includes(key.toString())\n );\n },\n\n /**\n * A trap for `Reflect.ownKeys()`.\n * @param target - The original object which is being proxied.\n */\n ownKeys: (target: TResolvedConfig): ArrayLike<string | symbol> => {\n return getUnique([\n ...Reflect.ownKeys(target),\n ...UNRESOLVED_CONFIG_NAMES\n ]);\n },\n\n /**\n * A trap for setting a property value.\n * @param target - The original object which is being proxied.\n * @param key - The name or `Symbol` of the property to set.\n * @param newValue - The new value to assign to the property.\n * @param receiver - The object to which the assignment was originally directed.\n * @returns A `boolean` indicating whether or not the property was set.\n */\n set: (\n target: TResolvedConfig,\n key: string | symbol,\n newValue: any,\n receiver: any\n ): boolean => {\n if (UNRESOLVED_CONFIG_NAMES.includes(key.toString())) {\n throw new Error(\n `Cannot change property ${key.toString()} from config - it is only intended to be used as a reference.`\n );\n }\n\n Reflect.set(this.overriddenConfig, key, newValue, receiver);\n return Reflect.set(target, key, newValue, receiver);\n }\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2IA,oBACE,IAFgB,MAAM,EAAE,kBAAkB,KAAO,CAE5C,CAAC,QACJ,aAAa,MAAM;CACjB,YAAY;CACZ,YAAY;CACZ,YAAY;CACZ,eAAe;CACf,YAAY;CACb,CAAC,CACH,CACF;AAED,MAAM,0BAA0B;CAC9B;CACA;CACA;CACA;CACD;AAED,IAAa,oBAAb,cAIU,sBAEV;CACE,YAA2B;CAE3B,WAAmB,MAAM;CAEzB,aAAqB,MAAM;CAE3B;CAEA;CAEA;CAEA;CAEA;CAEA,AAAO;;;;CAKP,AAAO;;;;CAKP,AAAO,cAA+C;;;;CAKtD,AAAO;;;;CAKP,AAAO,eAA+C,EAAE;;;;CAKxD,AAAO,kBAAkD,EAAE;;;;CAK3D,AAAO,gBAAsC;;;;CAK7C,AAAO,kBAA4B,EAAE;;;;CAKrC,AAAU,iBAAkC,EAAE;;;;CAK9C,AAAU,mBACR,EAAE;;;;CAKJ,AAAU,eACR,EAAE;;;;CAKJ,AAAU,aACR,EAAE;;;;CAKJ,AAAU,eAAgD,EAAE;;;;CAK5D,AAAU,oBAAyB,EAAE;;;;CAKrC,IAAW,QAAuC;EAChD,MAAM,QAAQ,KAAK;AAEnB,SAAO,kBACL,MACA,SAAS,MAAM,SAAS,IACpB,QACA,MAAM,QAAQ,KAAK,OAAO,MAAM,IAC7B,YAAY,KAAK,OAAO,MAAM,IAC7B,CAAC,iBAAiB,KAAK,OAAO,MAAM,GACtC,KAAK,OAAO,QACZ,QAAQ,KAAK,OAAO,MAAM,CAAC,MAA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S;AAC3D,WAAO,QAAQ,IAAI,QAAQ,KAAK,UAAU,SAAS;;GAEtD,CAAC"}
@@ -0,0 +1,219 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
+ const require_constants_environments = require('../constants/environments.cjs');
4
+ const require_constants_plugin = require('../constants/plugin.cjs');
5
+ const require_plugin_utils_helpers = require('../plugin-utils/helpers.cjs');
6
+ const require_plugin_utils_merge = require('../plugin-utils/merge.cjs');
7
+ const require_plugin_utils_format = require('../plugin-utils/format.cjs');
8
+ require('../plugin-utils/index.cjs');
9
+ const require_lib_hooks = require('../lib/hooks.cjs');
10
+ require('../constants/index.cjs');
11
+ const require_lib_plugins = require('../lib/plugins.cjs');
12
+ const require_context_context = require('./context.cjs');
13
+ const require_context_plugin_context = require('./plugin-context.cjs');
14
+ let _stryke_type_checks_is_function = require("@stryke/type-checks/is-function");
15
+ let _stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
16
+ let _stryke_unique_id_uuid = require("@stryke/unique-id/uuid");
17
+ let _stryke_type_checks_is_object = require("@stryke/type-checks/is-object");
18
+ let _stryke_helpers_omit = require("@stryke/helpers/omit");
19
+
20
+ //#region src/context/environment-context.ts
21
+ var PowerlinesEnvironmentContext = class PowerlinesEnvironmentContext extends require_context_context.PowerlinesContext {
22
+ /**
23
+ * The hooks registered by plugins in this environment
24
+ */
25
+ #hooks = {};
26
+ /**
27
+ * The execution context associated with this environment, which provides access to the project configuration, environment, and utility functions for performing the build. The execution context is used to manage the state and behavior of the build process across multiple environments, allowing for hooks to be called at different stages of the build and for environment-specific configurations to be applied.
28
+ */
29
+ #execution;
30
+ /**
31
+ * Create a new context from the config.
32
+ *
33
+ * @param execution - 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.
34
+ * @param options - The resolved execution options.
35
+ * @param config - The user configuration options.
36
+ * @param overriddenConfig - The configuration options that should override all other configuration sources, such as CLI flags or environment variables. This is used to ensure that certain configuration values take precedence over any other settings defined in the user configuration or environment configuration, allowing for dynamic overrides based on the execution context.
37
+ * @returns A promise that resolves to an instance of the PowerlinesEnvironmentContext class, initialized with the provided configuration and environment data.
38
+ */
39
+ static async from(execution, options, config, overriddenConfig) {
40
+ const context = new PowerlinesEnvironmentContext(execution, options, config, overriddenConfig);
41
+ await context.init();
42
+ return context;
43
+ }
44
+ /**
45
+ * The configuration options provided by plugins added by the user (and other plugins)
46
+ */
47
+ environmentConfig = {};
48
+ /**
49
+ * The list of plugins applied to this environment
50
+ */
51
+ plugins = [];
52
+ /**
53
+ * The unique identifier of the environment associated with this context, which can be used for logging and other purposes to distinguish between different environments in the same process.
54
+ */
55
+ get id() {
56
+ return this.config.environment.id;
57
+ }
58
+ /**
59
+ * The hooks registered by plugins in this environment
60
+ */
61
+ get hooks() {
62
+ return this.#hooks;
63
+ }
64
+ /**
65
+ * The execution context associated with this environment, which provides access to the project configuration, environment, and utility functions for performing the build. The execution context is used to manage the state and behavior of the build process across multiple environments, allowing for hooks to be called at different stages of the build and for environment-specific configurations to be applied.
66
+ *
67
+ * @danger
68
+ * This field is for internal use only and should not be accessed or modified directly. It is unstable and can be changed at anytime.
69
+ *
70
+ * @internal
71
+ */
72
+ get unstable_execution() {
73
+ return this.#execution;
74
+ }
75
+ /**
76
+ * A setter function to populate the environment config values provided during execution of the command, such as CLI flags or other parameters that may be relevant to the command being executed. This function can be used to update the context with the environment configuration values, which may be used during the configuration resolution process to ensure that the final configuration reflects both the user configuration and any environment configuration provided during execution.
77
+ *
78
+ * @param config - The environment configuration values to set.
79
+ * @returns A promise that resolves when the environment configuration values have been set.
80
+ */
81
+ async setEnvironmentConfig(config) {
82
+ this.logger.debug({
83
+ meta: { category: "config" },
84
+ message: `Updating environment configuration object: \n${require_plugin_utils_format.formatConfig(config)}`
85
+ });
86
+ this.environmentConfig = config;
87
+ await this.resolveConfig();
88
+ }
89
+ /**
90
+ * Create a new logger instance
91
+ *
92
+ * @param options - The configuration options to use for the logger instance, which can be used to customize the appearance and behavior of the log messages generated by the logger. This is typically the name of the plugin or module that is creating the logger instance.
93
+ * @returns A logger client instance that can be used to generate log messages with consistent formatting and metadata.
94
+ */
95
+ createLogger(options) {
96
+ return super.createLogger({
97
+ ...options,
98
+ environment: this.environmentConfig?.name || this.config.environment?.name
99
+ });
100
+ }
101
+ /**
102
+ * Extend the base logger with additional configuration options
103
+ *
104
+ * @param options - The configuration options to extend the base logger with, which can be used to add additional metadata or customize the appearance of log messages generated by the logger. This is typically the name of the plugin or module that is creating the logger instance, as well as any additional metadata such as the plugin category or environment.
105
+ * @returns A new logger client instance that extends the base logger with the provided configuration options.
106
+ */
107
+ extendLogger(options) {
108
+ return super.extendLogger({
109
+ ...options,
110
+ environment: this.environmentConfig?.name || this.config.environment?.name
111
+ });
112
+ }
113
+ /**
114
+ * A function used internally to add a plugin to the context and update the configuration options
115
+ *
116
+ * @danger
117
+ * This field is for internal use only and should not be accessed or modified directly. It is unstable and can be changed at anytime.
118
+ *
119
+ * @internal
120
+ */
121
+ async unstable_addPlugin(plugin) {
122
+ const plugins = await require_lib_plugins.resolvePlugins(this, plugin);
123
+ for (const plugin of plugins) {
124
+ let resolvedPlugin = plugin;
125
+ if ((0, _stryke_type_checks_is_function.isFunction)(plugin.applyToEnvironment)) {
126
+ const result = await Promise.resolve(plugin.applyToEnvironment(this.config.environment));
127
+ if (!result || (0, _stryke_type_checks_is_object.isObject)(result) && Object.keys(result).length === 0) return;
128
+ if (require_plugin_utils_helpers.isPluginConfig(result)) return this.unstable_addPlugin(result);
129
+ resolvedPlugin = require_plugin_utils_helpers.isPlugin(result) ? result : plugin;
130
+ }
131
+ const id = (0, _stryke_unique_id_uuid.uuid)();
132
+ const context = require_context_plugin_context.createPluginContext(id, resolvedPlugin, this);
133
+ resolvedPlugin.$$internal = {
134
+ id,
135
+ context
136
+ };
137
+ this.plugins.push(resolvedPlugin);
138
+ this.#hooks = Object.entries(Object.keys(resolvedPlugin).filter((key) => key !== "$$internal" && !require_constants_plugin.PLUGIN_NON_HOOK_FIELDS.includes(key)).reduce((ret, key) => require_lib_hooks.extractHooks(context, ret, resolvedPlugin, key), this.hooks)).reduce((ret, [key, value]) => {
139
+ if ((0, _stryke_type_checks_is_set_object.isSetObject)(value)) Object.entries(value).forEach(([type, list]) => {
140
+ ret[key] ??= {};
141
+ ret[key][type] = require_plugin_utils_helpers.dedupeHooklist(list);
142
+ });
143
+ return ret;
144
+ }, {});
145
+ }
146
+ }
147
+ /**
148
+ * Retrieves the hook handlers for a specific hook name
149
+ */
150
+ selectHooks(key, options) {
151
+ const result = [];
152
+ if (require_plugin_utils_helpers.isPluginHookField(key) && this.hooks[key]) {
153
+ if (this.hooks[key]) if (options?.order) {
154
+ const mapHooksToResult = (hooksList) => hooksList.map((hook) => {
155
+ const plugin = this.plugins.find((p) => p.name === hook.plugin.name);
156
+ if (!plugin) throw new Error(`Could not find plugin context for plugin "${hook.plugin.name}".`);
157
+ return {
158
+ handler: hook.handler,
159
+ plugin: hook.plugin,
160
+ context: plugin.$$internal.context
161
+ };
162
+ });
163
+ if (options?.order === "pre") {
164
+ result.push(...mapHooksToResult(this.hooks[key].preOrdered ?? []));
165
+ result.push(...mapHooksToResult(this.hooks[key].preEnforced ?? []));
166
+ } else if (options?.order === "post") {
167
+ result.push(...mapHooksToResult(this.hooks[key].postOrdered ?? []));
168
+ result.push(...mapHooksToResult(this.hooks[key].postEnforced ?? []));
169
+ } else result.push(...mapHooksToResult(this.hooks[key].normal ?? []));
170
+ } else {
171
+ result.push(...this.selectHooks(key, { order: "pre" }));
172
+ result.push(...this.selectHooks(key, { order: "normal" }));
173
+ result.push(...this.selectHooks(key, { order: "post" }));
174
+ }
175
+ }
176
+ return result;
177
+ }
178
+ /**
179
+ * A function to add a plugin to the context and update the configuration options. This function is used internally when applying plugins to the environment, and it ensures that the plugin is added to the list of plugins in the context and that any hooks or configuration options provided by the plugin are properly integrated into the context's state.
180
+ *
181
+ * @remarks
182
+ * This function is used internally when applying plugins to the environment, and it ensures that the plugin is added to the list of plugins in the context and that any hooks or configuration options provided by the plugin are properly integrated into the context's state. It should not be called directly by external code, as it is intended for internal use only and may be subject to change without warning.
183
+ *
184
+ * @param execution - 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.
185
+ * @param options - The configuration options for the plugin, which may include properties such as the plugin name, hooks, and any other relevant metadata or settings that should be associated with the plugin when it is added to the context.
186
+ * @param config - The resolved configuration for the environment, which may include properties such as the environment name, SSR settings, and other relevant configuration options that may affect how the plugin is applied to the environment.
187
+ * @param overriddenConfig - The configuration options that should override all other configuration sources, such as CLI flags or environment variables. This is used to ensure that certain configuration values take precedence over any other settings defined in the user configuration or environment configuration, allowing for dynamic overrides based on the execution context.
188
+ * @returns A promise that resolves when the plugin has been added to the context and the configuration has been updated accordingly.
189
+ */
190
+ constructor(execution, options, config, overriddenConfig) {
191
+ super(options);
192
+ this.#execution = execution;
193
+ this.userConfig = config.userConfig ?? {};
194
+ this.inlineConfig = config.inlineConfig ?? {};
195
+ this.pluginConfig = config.pluginConfig ?? {};
196
+ this.overriddenConfig = overriddenConfig;
197
+ }
198
+ /**
199
+ * A function to merge the various configuration objects (initial, user, inline, and plugin) into a single resolved configuration object that can be used throughout the Powerlines process. This function takes into account the different sources of configuration and their respective priorities, ensuring that the final configuration reflects the intended settings for the project. The merged configuration is then returned as a new object that can be accessed through the `config` property of the context.
200
+ *
201
+ * @returns The merged configuration object that combines the initial, user, inline, and plugin configurations.
202
+ */
203
+ mergeConfig() {
204
+ return require_plugin_utils_merge.mergeConfig({
205
+ ...(0, _stryke_helpers_omit.omit)(this.environmentConfig ?? {}, [
206
+ "name",
207
+ "ssr",
208
+ "preview",
209
+ "consumer",
210
+ "runtime"
211
+ ]),
212
+ environment: { name: this.environmentConfig?.name || "default" },
213
+ environmentConfig: this.environmentConfig ?? {}
214
+ }, super.mergeConfig());
215
+ }
216
+ };
217
+
218
+ //#endregion
219
+ exports.PowerlinesEnvironmentContext = PowerlinesEnvironmentContext;
@@ -0,0 +1,100 @@
1
+ import { HooksList } from "../types/hooks.cjs";
2
+ import { Logger, LoggerOptions } from "../types/logging.cjs";
3
+ import { EnvironmentContext, EnvironmentPlugin, ExecutionContext, PluginContext, SelectHookResult, SelectHooksOptions } from "../types/context.cjs";
4
+ import { EnvironmentResolvedConfig, ExecutionOptions, InferOverridableConfig, PluginConfig, ResolvedConfig } from "../types/config.cjs";
5
+ import { PowerlinesContext } from "./context.cjs";
6
+ //#region src/context/environment-context.d.ts
7
+ declare class PowerlinesEnvironmentContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig, TSystemContext = unknown> extends PowerlinesContext<EnvironmentResolvedConfig<TResolvedConfig>, TSystemContext> implements EnvironmentContext<TResolvedConfig, TSystemContext> {
8
+ #private;
9
+ /**
10
+ * Create a new context from the config.
11
+ *
12
+ * @param execution - 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.
13
+ * @param options - The resolved execution options.
14
+ * @param config - The user configuration options.
15
+ * @param overriddenConfig - The configuration options that should override all other configuration sources, such as CLI flags or environment variables. This is used to ensure that certain configuration values take precedence over any other settings defined in the user configuration or environment configuration, allowing for dynamic overrides based on the execution context.
16
+ * @returns A promise that resolves to an instance of the PowerlinesEnvironmentContext class, initialized with the provided configuration and environment data.
17
+ */
18
+ static from<TResolvedConfig extends ResolvedConfig = ResolvedConfig, TSystemContext = unknown>(execution: ExecutionContext<TResolvedConfig, TSystemContext>, options: ExecutionOptions, config: TResolvedConfig, overriddenConfig: InferOverridableConfig<EnvironmentResolvedConfig<TResolvedConfig>>): Promise<PowerlinesEnvironmentContext<TResolvedConfig, TSystemContext>>;
19
+ /**
20
+ * The configuration options provided by plugins added by the user (and other plugins)
21
+ */
22
+ protected environmentConfig: EnvironmentResolvedConfig<TResolvedConfig>["environment"];
23
+ /**
24
+ * The list of plugins applied to this environment
25
+ */
26
+ plugins: EnvironmentPlugin<TResolvedConfig, TSystemContext>[];
27
+ /**
28
+ * The unique identifier of the environment associated with this context, which can be used for logging and other purposes to distinguish between different environments in the same process.
29
+ */
30
+ get id(): string;
31
+ /**
32
+ * The hooks registered by plugins in this environment
33
+ */
34
+ get hooks(): Record<string, HooksList<PluginContext<TResolvedConfig, TSystemContext>>>;
35
+ /**
36
+ * The execution context associated with this environment, which provides access to the project configuration, environment, and utility functions for performing the build. The execution context is used to manage the state and behavior of the build process across multiple environments, allowing for hooks to be called at different stages of the build and for environment-specific configurations to be applied.
37
+ *
38
+ * @danger
39
+ * This field is for internal use only and should not be accessed or modified directly. It is unstable and can be changed at anytime.
40
+ *
41
+ * @internal
42
+ */
43
+ get unstable_execution(): ExecutionContext<TResolvedConfig, TSystemContext>;
44
+ /**
45
+ * A setter function to populate the environment config values provided during execution of the command, such as CLI flags or other parameters that may be relevant to the command being executed. This function can be used to update the context with the environment configuration values, which may be used during the configuration resolution process to ensure that the final configuration reflects both the user configuration and any environment configuration provided during execution.
46
+ *
47
+ * @param config - The environment configuration values to set.
48
+ * @returns A promise that resolves when the environment configuration values have been set.
49
+ */
50
+ setEnvironmentConfig(config: EnvironmentResolvedConfig<TResolvedConfig>["environment"]): Promise<void>;
51
+ /**
52
+ * Create a new logger instance
53
+ *
54
+ * @param options - The configuration options to use for the logger instance, which can be used to customize the appearance and behavior of the log messages generated by the logger. This is typically the name of the plugin or module that is creating the logger instance.
55
+ * @returns A logger client instance that can be used to generate log messages with consistent formatting and metadata.
56
+ */
57
+ createLogger(options: LoggerOptions): Logger;
58
+ /**
59
+ * Extend the base logger with additional configuration options
60
+ *
61
+ * @param options - The configuration options to extend the base logger with, which can be used to add additional metadata or customize the appearance of log messages generated by the logger. This is typically the name of the plugin or module that is creating the logger instance, as well as any additional metadata such as the plugin category or environment.
62
+ * @returns A new logger client instance that extends the base logger with the provided configuration options.
63
+ */
64
+ extendLogger(options: LoggerOptions): Logger;
65
+ /**
66
+ * A function used internally to add a plugin to the context and update the configuration options
67
+ *
68
+ * @danger
69
+ * This field is for internal use only and should not be accessed or modified directly. It is unstable and can be changed at anytime.
70
+ *
71
+ * @internal
72
+ */
73
+ unstable_addPlugin(plugin: PluginConfig<PluginContext<TResolvedConfig, TSystemContext>>): Promise<void>;
74
+ /**
75
+ * Retrieves the hook handlers for a specific hook name
76
+ */
77
+ selectHooks<TKey extends string>(key: TKey, options?: SelectHooksOptions): SelectHookResult<PluginContext<TResolvedConfig, TSystemContext>, TKey>;
78
+ /**
79
+ * A function to add a plugin to the context and update the configuration options. This function is used internally when applying plugins to the environment, and it ensures that the plugin is added to the list of plugins in the context and that any hooks or configuration options provided by the plugin are properly integrated into the context's state.
80
+ *
81
+ * @remarks
82
+ * This function is used internally when applying plugins to the environment, and it ensures that the plugin is added to the list of plugins in the context and that any hooks or configuration options provided by the plugin are properly integrated into the context's state. It should not be called directly by external code, as it is intended for internal use only and may be subject to change without warning.
83
+ *
84
+ * @param execution - 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.
85
+ * @param options - The configuration options for the plugin, which may include properties such as the plugin name, hooks, and any other relevant metadata or settings that should be associated with the plugin when it is added to the context.
86
+ * @param config - The resolved configuration for the environment, which may include properties such as the environment name, SSR settings, and other relevant configuration options that may affect how the plugin is applied to the environment.
87
+ * @param overriddenConfig - The configuration options that should override all other configuration sources, such as CLI flags or environment variables. This is used to ensure that certain configuration values take precedence over any other settings defined in the user configuration or environment configuration, allowing for dynamic overrides based on the execution context.
88
+ * @returns A promise that resolves when the plugin has been added to the context and the configuration has been updated accordingly.
89
+ */
90
+ protected constructor(execution: ExecutionContext<TResolvedConfig, TSystemContext>, options: ExecutionOptions, config: TResolvedConfig, overriddenConfig: InferOverridableConfig<EnvironmentResolvedConfig<TResolvedConfig>>);
91
+ /**
92
+ * A function to merge the various configuration objects (initial, user, inline, and plugin) into a single resolved configuration object that can be used throughout the Powerlines process. This function takes into account the different sources of configuration and their respective priorities, ensuring that the final configuration reflects the intended settings for the project. The merged configuration is then returned as a new object that can be accessed through the `config` property of the context.
93
+ *
94
+ * @returns The merged configuration object that combines the initial, user, inline, and plugin configurations.
95
+ */
96
+ protected mergeConfig(): EnvironmentResolvedConfig<TResolvedConfig>;
97
+ }
98
+ //#endregion
99
+ export { PowerlinesEnvironmentContext };
100
+ //# sourceMappingURL=environment-context.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"environment-context.d.cts","names":[],"sources":["../../src/context/environment-context.ts"],"mappings":";;;;;;cAuDa,4BAAA,yBACa,cAAA,GAAiB,cAAA,oCAGjC,iBAAA,CACN,yBAAA,CAA0B,eAAA,GAC1B,cAAA,aAES,kBAAA,CAAmB,eAAA,EAAiB,cAAA;EAAA;;;;;AARjD;;;;;SAgCsB,IAAA,yBACM,cAAA,GAAiB,cAAA,2BAAA,CAGzC,SAAA,EAAW,gBAAA,CAAiB,eAAA,EAAiB,cAAA,GAC7C,OAAA,EAAS,gBAAA,EACT,MAAA,EAAQ,eAAA,EACR,gBAAA,EAAkB,sBAAA,CAChB,yBAAA,CAA0B,eAAA,KAE3B,OAAA,CAAQ,4BAAA,CAA6B,eAAA,EAAiB,cAAA;EArCvD;;;EAAA,UAkDiB,iBAAA,EAAmB,yBAAA,CAA0B,eAAA;EAtBtC;;;EA4BnB,OAAA,EAAS,iBAAA,CAAkB,eAAA,EAAiB,cAAA;EAzBtC;;;EAAA,IA8BF,EAAA,CAAA;EA1BP;;;EAAA,IAiCO,KAAA,CAAA,GAAS,MAAA,SAElB,SAAA,CAAU,aAAA,CAAc,eAAA,EAAiB,cAAA;EAjChC;;;;;;;;EAAA,IA8CA,kBAAA,CAAA,GAAsB,gBAAA,CAC/B,eAAA,EACA,cAAA;EAfU;;;;;;EA0BC,oBAAA,CACX,MAAA,EAAQ,yBAAA,CAA0B,eAAA,mBACjC,OAAA;EADO;;;;;;EAiBM,YAAA,CAAa,OAAA,EAAS,aAAA,GAAgB,MAAA;EA6BA;;;;;;EAhBtC,YAAA,CAAa,OAAA,EAAS,aAAA,GAAgB,MAAA;EAgHH;;;;;;;;EAjGtC,kBAAA,CACX,MAAA,EAAQ,YAAA,CAAa,aAAA,CAAc,eAAA,EAAiB,cAAA,KACnD,OAAA;EA8K2B;;;EAlFvB,WAAA,qBAAA,CACL,GAAA,EAAK,IAAA,EACL,OAAA,GAAU,kBAAA,GACT,gBAAA,CAAiB,aAAA,CAAc,eAAA,EAAiB,cAAA,GAAiB,IAAA;EAkGlC;;;;;;;;;;;;EAAA,UAxBzB,WAAA,CACP,SAAA,EAAW,gBAAA,CAAiB,eAAA,EAAiB,cAAA,GAC7C,OAAA,EAAS,gBAAA,EACT,MAAA,EAAQ,eAAA,EACR,gBAAA,EAAkB,sBAAA,CAChB,yBAAA,CAA0B,eAAA;EA3TnB;;;;;EAAA,UA8UQ,WAAA,CAAA,GAAe,yBAAA,CAA0B,eAAA;AAAA"}
@@ -0,0 +1,100 @@
1
+ import { HooksList } from "../types/hooks.mjs";
2
+ import { Logger, LoggerOptions } from "../types/logging.mjs";
3
+ import { EnvironmentContext, EnvironmentPlugin, ExecutionContext, PluginContext, SelectHookResult, SelectHooksOptions } from "../types/context.mjs";
4
+ import { EnvironmentResolvedConfig, ExecutionOptions, InferOverridableConfig, PluginConfig, ResolvedConfig } from "../types/config.mjs";
5
+ import { PowerlinesContext } from "./context.mjs";
6
+ //#region src/context/environment-context.d.ts
7
+ declare class PowerlinesEnvironmentContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig, TSystemContext = unknown> extends PowerlinesContext<EnvironmentResolvedConfig<TResolvedConfig>, TSystemContext> implements EnvironmentContext<TResolvedConfig, TSystemContext> {
8
+ #private;
9
+ /**
10
+ * Create a new context from the config.
11
+ *
12
+ * @param execution - 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.
13
+ * @param options - The resolved execution options.
14
+ * @param config - The user configuration options.
15
+ * @param overriddenConfig - The configuration options that should override all other configuration sources, such as CLI flags or environment variables. This is used to ensure that certain configuration values take precedence over any other settings defined in the user configuration or environment configuration, allowing for dynamic overrides based on the execution context.
16
+ * @returns A promise that resolves to an instance of the PowerlinesEnvironmentContext class, initialized with the provided configuration and environment data.
17
+ */
18
+ static from<TResolvedConfig extends ResolvedConfig = ResolvedConfig, TSystemContext = unknown>(execution: ExecutionContext<TResolvedConfig, TSystemContext>, options: ExecutionOptions, config: TResolvedConfig, overriddenConfig: InferOverridableConfig<EnvironmentResolvedConfig<TResolvedConfig>>): Promise<PowerlinesEnvironmentContext<TResolvedConfig, TSystemContext>>;
19
+ /**
20
+ * The configuration options provided by plugins added by the user (and other plugins)
21
+ */
22
+ protected environmentConfig: EnvironmentResolvedConfig<TResolvedConfig>["environment"];
23
+ /**
24
+ * The list of plugins applied to this environment
25
+ */
26
+ plugins: EnvironmentPlugin<TResolvedConfig, TSystemContext>[];
27
+ /**
28
+ * The unique identifier of the environment associated with this context, which can be used for logging and other purposes to distinguish between different environments in the same process.
29
+ */
30
+ get id(): string;
31
+ /**
32
+ * The hooks registered by plugins in this environment
33
+ */
34
+ get hooks(): Record<string, HooksList<PluginContext<TResolvedConfig, TSystemContext>>>;
35
+ /**
36
+ * The execution context associated with this environment, which provides access to the project configuration, environment, and utility functions for performing the build. The execution context is used to manage the state and behavior of the build process across multiple environments, allowing for hooks to be called at different stages of the build and for environment-specific configurations to be applied.
37
+ *
38
+ * @danger
39
+ * This field is for internal use only and should not be accessed or modified directly. It is unstable and can be changed at anytime.
40
+ *
41
+ * @internal
42
+ */
43
+ get unstable_execution(): ExecutionContext<TResolvedConfig, TSystemContext>;
44
+ /**
45
+ * A setter function to populate the environment config values provided during execution of the command, such as CLI flags or other parameters that may be relevant to the command being executed. This function can be used to update the context with the environment configuration values, which may be used during the configuration resolution process to ensure that the final configuration reflects both the user configuration and any environment configuration provided during execution.
46
+ *
47
+ * @param config - The environment configuration values to set.
48
+ * @returns A promise that resolves when the environment configuration values have been set.
49
+ */
50
+ setEnvironmentConfig(config: EnvironmentResolvedConfig<TResolvedConfig>["environment"]): Promise<void>;
51
+ /**
52
+ * Create a new logger instance
53
+ *
54
+ * @param options - The configuration options to use for the logger instance, which can be used to customize the appearance and behavior of the log messages generated by the logger. This is typically the name of the plugin or module that is creating the logger instance.
55
+ * @returns A logger client instance that can be used to generate log messages with consistent formatting and metadata.
56
+ */
57
+ createLogger(options: LoggerOptions): Logger;
58
+ /**
59
+ * Extend the base logger with additional configuration options
60
+ *
61
+ * @param options - The configuration options to extend the base logger with, which can be used to add additional metadata or customize the appearance of log messages generated by the logger. This is typically the name of the plugin or module that is creating the logger instance, as well as any additional metadata such as the plugin category or environment.
62
+ * @returns A new logger client instance that extends the base logger with the provided configuration options.
63
+ */
64
+ extendLogger(options: LoggerOptions): Logger;
65
+ /**
66
+ * A function used internally to add a plugin to the context and update the configuration options
67
+ *
68
+ * @danger
69
+ * This field is for internal use only and should not be accessed or modified directly. It is unstable and can be changed at anytime.
70
+ *
71
+ * @internal
72
+ */
73
+ unstable_addPlugin(plugin: PluginConfig<PluginContext<TResolvedConfig, TSystemContext>>): Promise<void>;
74
+ /**
75
+ * Retrieves the hook handlers for a specific hook name
76
+ */
77
+ selectHooks<TKey extends string>(key: TKey, options?: SelectHooksOptions): SelectHookResult<PluginContext<TResolvedConfig, TSystemContext>, TKey>;
78
+ /**
79
+ * A function to add a plugin to the context and update the configuration options. This function is used internally when applying plugins to the environment, and it ensures that the plugin is added to the list of plugins in the context and that any hooks or configuration options provided by the plugin are properly integrated into the context's state.
80
+ *
81
+ * @remarks
82
+ * This function is used internally when applying plugins to the environment, and it ensures that the plugin is added to the list of plugins in the context and that any hooks or configuration options provided by the plugin are properly integrated into the context's state. It should not be called directly by external code, as it is intended for internal use only and may be subject to change without warning.
83
+ *
84
+ * @param execution - 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.
85
+ * @param options - The configuration options for the plugin, which may include properties such as the plugin name, hooks, and any other relevant metadata or settings that should be associated with the plugin when it is added to the context.
86
+ * @param config - The resolved configuration for the environment, which may include properties such as the environment name, SSR settings, and other relevant configuration options that may affect how the plugin is applied to the environment.
87
+ * @param overriddenConfig - The configuration options that should override all other configuration sources, such as CLI flags or environment variables. This is used to ensure that certain configuration values take precedence over any other settings defined in the user configuration or environment configuration, allowing for dynamic overrides based on the execution context.
88
+ * @returns A promise that resolves when the plugin has been added to the context and the configuration has been updated accordingly.
89
+ */
90
+ protected constructor(execution: ExecutionContext<TResolvedConfig, TSystemContext>, options: ExecutionOptions, config: TResolvedConfig, overriddenConfig: InferOverridableConfig<EnvironmentResolvedConfig<TResolvedConfig>>);
91
+ /**
92
+ * A function to merge the various configuration objects (initial, user, inline, and plugin) into a single resolved configuration object that can be used throughout the Powerlines process. This function takes into account the different sources of configuration and their respective priorities, ensuring that the final configuration reflects the intended settings for the project. The merged configuration is then returned as a new object that can be accessed through the `config` property of the context.
93
+ *
94
+ * @returns The merged configuration object that combines the initial, user, inline, and plugin configurations.
95
+ */
96
+ protected mergeConfig(): EnvironmentResolvedConfig<TResolvedConfig>;
97
+ }
98
+ //#endregion
99
+ export { PowerlinesEnvironmentContext };
100
+ //# sourceMappingURL=environment-context.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"environment-context.d.mts","names":[],"sources":["../../src/context/environment-context.ts"],"mappings":";;;;;;cAuDa,4BAAA,yBACa,cAAA,GAAiB,cAAA,oCAGjC,iBAAA,CACN,yBAAA,CAA0B,eAAA,GAC1B,cAAA,aAES,kBAAA,CAAmB,eAAA,EAAiB,cAAA;EA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