@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,369 @@
1
+ import { ResolveOptions, VirtualFile, VirtualFileSystemInterface } from "../types/fs.cjs";
2
+ import { CallHookOptions, InferHookParameters, InferHookReturnType } from "../types/hooks.cjs";
3
+ import { LogLevelResolvedConfig, Logger, LoggerOptions } from "../types/logging.cjs";
4
+ import { ParsedTypeScriptConfig } from "../types/tsconfig.cjs";
5
+ import { Context, EmitEntryOptions, EmitOptions, EnvironmentContext, FetchOptions, MetaInfo, ParseOptions, PluginContext, ResolveResult, Resolver, TransformResult } from "../types/context.cjs";
6
+ import { ExecutionOptions, InferOverridableConfig, ParsedUserConfig, ResolvedConfig, ResolvedEntryTypeDefinition } from "../types/config.cjs";
7
+ import { PowerlinesBaseContext } from "./base-context.cjs";
8
+ import { EnvPaths } from "@stryke/env/get-env-paths";
9
+ import { PackageJson } from "@stryke/types/package-json";
10
+ import { ParseResult } from "oxc-parser";
11
+ import { Range } from "semver";
12
+ import { RequestInfo, Response } from "undici";
13
+ import { FlatCache } from "flat-cache";
14
+
15
+ //#region src/context/context.d.ts
16
+ declare class PowerlinesContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig, TSystemContext = unknown> extends PowerlinesBaseContext<TSystemContext> implements Context<TResolvedConfig, TSystemContext> {
17
+ #private;
18
+ options: ExecutionOptions;
19
+ resolver: Resolver;
20
+ /**
21
+ * The parsed `package.json` file for the project
22
+ */
23
+ packageJson: PackageJson;
24
+ /**
25
+ * The parsed `project.json` file for the project
26
+ */
27
+ projectJson: Record<string, any> | undefined;
28
+ /**
29
+ * The parsed configuration file for the project
30
+ */
31
+ configFile: ParsedUserConfig;
32
+ /**
33
+ * An object containing the dependencies that should be installed for the project
34
+ */
35
+ dependencies: Record<string, string | Range>;
36
+ /**
37
+ * An object containing the development dependencies that should be installed for the project
38
+ */
39
+ devDependencies: Record<string, string | Range>;
40
+ /**
41
+ * The persisted meta information about the current build
42
+ */
43
+ persistedMeta: MetaInfo | undefined;
44
+ /**
45
+ * The resolved tsconfig file paths for the project
46
+ */
47
+ resolvePatterns: RegExp[];
48
+ /**
49
+ * The resolved configuration for this context
50
+ */
51
+ protected resolvedConfig: TResolvedConfig;
52
+ /**
53
+ * 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.
54
+ */
55
+ protected overriddenConfig: InferOverridableConfig<TResolvedConfig>;
56
+ /**
57
+ * 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.
58
+ */
59
+ protected inlineConfig: TResolvedConfig["inlineConfig"];
60
+ /**
61
+ * 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.
62
+ */
63
+ protected userConfig: TResolvedConfig["userConfig"];
64
+ /**
65
+ * The configuration options provided by plugins added by the user (and other plugins)
66
+ */
67
+ protected pluginConfig: TResolvedConfig["pluginConfig"];
68
+ /**
69
+ * The configuration options provided by the environment
70
+ */
71
+ protected environmentConfig: any;
72
+ /**
73
+ * The resolved entry type definitions for the project
74
+ */
75
+ get entry(): ResolvedEntryTypeDefinition[];
76
+ /**
77
+ * The TypeScript configuration parsed from the tsconfig file
78
+ */
79
+ get tsconfig(): ParsedTypeScriptConfig;
80
+ /**
81
+ * Sets the TypeScript configuration parsed from the tsconfig file
82
+ */
83
+ set tsconfig(value: ParsedTypeScriptConfig);
84
+ /**
85
+ * The virtual file system interface for the project
86
+ */
87
+ get fs(): VirtualFileSystemInterface;
88
+ /**
89
+ * Get the checksum of the project's current state
90
+ */
91
+ get checksum(): string | null;
92
+ /**
93
+ * Invokes the configured plugin hooks
94
+ *
95
+ * @remarks
96
+ * By default, it will call the `"pre"`, `"normal"`, and `"post"` ordered hooks in sequence
97
+ *
98
+ * @param hook - The hook to call
99
+ * @param options - The options to provide to the hook
100
+ * @param args - The arguments to pass to the hook
101
+ * @returns The result of the hook call
102
+ */
103
+ callHook: <TKey extends string>(hook: TKey, options: CallHookOptions & {
104
+ environment?: string | EnvironmentContext<any>;
105
+ }, ...args: InferHookParameters<PluginContext<any>, TKey>) => Promise<InferHookReturnType<PluginContext<any>, TKey> | undefined>;
106
+ /**
107
+ * The meta information about the current build
108
+ */
109
+ get meta(): MetaInfo;
110
+ /**
111
+ * The resolved configuration options
112
+ */
113
+ get config(): TResolvedConfig;
114
+ /**
115
+ * Get the path to the artifacts directory for the project
116
+ */
117
+ get artifactsPath(): string;
118
+ /**
119
+ * Get the path to the builtin modules used by the project
120
+ */
121
+ get builtinsPath(): string;
122
+ /**
123
+ * Get the path to the entry directory for the project
124
+ */
125
+ get entryPath(): string;
126
+ /**
127
+ * Get the path to the infrastructure modules used by the project
128
+ */
129
+ get infrastructurePath(): string;
130
+ /**
131
+ * Get the path to the data directory for the project
132
+ */
133
+ get dataPath(): string;
134
+ /**
135
+ * Get the path to the cache directory for the project
136
+ */
137
+ get cachePath(): string;
138
+ /**
139
+ * Get the path to the generated declaration file for the project
140
+ */
141
+ get typesPath(): string;
142
+ /**
143
+ * Get the project root relative to the workspace root
144
+ */
145
+ get relativeToWorkspaceRoot(): string;
146
+ /**
147
+ * The builtin module id that exist in the Powerlines virtual file system
148
+ */
149
+ get builtins(): string[];
150
+ /**
151
+ * Additional arguments provided during execution of the command, such as CLI flags or other parameters that may be relevant to the command being executed.
152
+ */
153
+ get additionalArgs(): Record<string, string | string[]>;
154
+ /**
155
+ * The alias mappings for the project used during module resolution
156
+ *
157
+ * @remarks
158
+ * This includes both the built-in module aliases as well as any custom aliases defined in the build configuration.
159
+ */
160
+ get alias(): Record<string, string>;
161
+ get logger(): Logger;
162
+ /**
163
+ * 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.
164
+ */
165
+ get logLevel(): LogLevelResolvedConfig;
166
+ /**
167
+ * 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.
168
+ */
169
+ get envPaths(): EnvPaths;
170
+ /**
171
+ * Gets the parser cache.
172
+ */
173
+ protected get parserCache(): FlatCache;
174
+ /**
175
+ * Gets the request cache.
176
+ */
177
+ protected get requestCache(): FlatCache;
178
+ /**
179
+ * The entry points that exist in the Powerlines virtual file system
180
+ */
181
+ protected get resolvedEntry(): ResolvedEntryTypeDefinition[];
182
+ /**
183
+ * Creates a new Context instance.
184
+ *
185
+ * @param options - The options to use for creating the context, including the resolved configuration and workspace settings.
186
+ */
187
+ protected constructor(options: ExecutionOptions);
188
+ createLogger(options?: LoggerOptions): Logger;
189
+ /**
190
+ * A function to perform HTTP fetch requests
191
+ *
192
+ * @remarks
193
+ * This function uses a caching layer to avoid duplicate requests during the Powerlines process.
194
+ *
195
+ * @example
196
+ * ```ts
197
+ * const response = await context.fetch("https://api.example.com/data");
198
+ * const data = await response.json();
199
+ * ```
200
+ *
201
+ * @see https://github.com/nodejs/undici
202
+ *
203
+ * @param input - The URL to fetch.
204
+ * @param options - The fetch request options.
205
+ * @returns A promise that resolves to a response returned by the fetch.
206
+ */
207
+ fetch(input: RequestInfo, options?: FetchOptions): Promise<Response>;
208
+ /**
209
+ * Parse code using [Oxc-Parser](https://github.com/oxc/oxc) into an (ESTree-compatible)[https://github.com/estree/estree] AST object.
210
+ *
211
+ * @remarks
212
+ * This function can be used to parse TypeScript code into an AST for further analysis or transformation.
213
+ *
214
+ * @example
215
+ * ```ts
216
+ * const ast = context.parse("const x: number = 42;");
217
+ * ```
218
+ *
219
+ * @see https://rollupjs.org/plugin-development/#this-parse
220
+ * @see https://github.com/oxc/oxc
221
+ *
222
+ * @param code - The source code to parse.
223
+ * @param options - The options to pass to the parser.
224
+ * @returns An (ESTree-compatible)[https://github.com/estree/estree] AST object.
225
+ */
226
+ parse(code: string, options?: ParseOptions): Promise<ParseResult>;
227
+ /**
228
+ * A helper function to resolve modules in the Virtual File System
229
+ *
230
+ * @remarks
231
+ * This function can be used to resolve modules relative to the project root directory.
232
+ *
233
+ * @example
234
+ * ```ts
235
+ * const resolved = await context.resolve("some-module", "/path/to/importer");
236
+ * ```
237
+ *
238
+ * @param id - The module to resolve.
239
+ * @param importer - An optional path to the importer module.
240
+ * @param options - Additional resolution options.
241
+ * @returns A promise that resolves to the resolved module path.
242
+ */
243
+ resolve(id: string, importer?: string, options?: ResolveOptions): Promise<ResolveResult | undefined>;
244
+ /**
245
+ * A helper function to load modules from the Virtual File System
246
+ *
247
+ * @remarks
248
+ * This function can be used to load modules relative to the project root directory.
249
+ *
250
+ * @example
251
+ * ```ts
252
+ * const module = await context.load("some-module", "/path/to/importer");
253
+ * ```
254
+ *
255
+ * @param id - The module to load.
256
+ * @returns A promise that resolves to the loaded module.
257
+ */
258
+ load(id: string): Promise<TransformResult | undefined>;
259
+ /**
260
+ * Get the builtin virtual files that exist in the Powerlines virtual file system
261
+ */
262
+ getBuiltins(): Promise<VirtualFile[]>;
263
+ /**
264
+ * Resolves a file and writes it to the VFS if it does not already exist
265
+ *
266
+ * @param code - The source code of the file
267
+ * @param path - The path to write the file to
268
+ * @param options - Additional options for writing the file
269
+ */
270
+ emit(code: string, path: string, options?: EmitOptions): Promise<void>;
271
+ /**
272
+ * Synchronously resolves a file and writes it to the VFS if it does not already exist
273
+ *
274
+ * @param code - The source code of the file
275
+ * @param path - The path to write the file to
276
+ * @param options - Additional options for writing the file
277
+ */
278
+ emitSync(code: string, path: string, options?: EmitOptions): void;
279
+ /**
280
+ * Resolves a entry virtual file and writes it to the VFS if it does not already exist
281
+ *
282
+ * @param code - The source code of the entry file
283
+ * @param path - A path to write the entry file to
284
+ * @param options - Optional write file options
285
+ */
286
+ emitEntry(code: string, path: string, options?: EmitEntryOptions): Promise<void>;
287
+ /**
288
+ * Synchronously resolves a entry virtual file and writes it to the VFS if it does not already exist
289
+ *
290
+ * @param code - The source code of the entry file
291
+ * @param path - A path to write the entry file to
292
+ * @param options - Optional write file options
293
+ */
294
+ emitEntrySync(code: string, path: string, options?: EmitEntryOptions): void;
295
+ /**
296
+ * Resolves a builtin virtual file and writes it to the VFS if it does not already exist
297
+ *
298
+ * @param code - The source code of the builtin file
299
+ * @param id - The unique identifier of the builtin file
300
+ * @param options - Optional write file options
301
+ */
302
+ emitBuiltin(code: string, id: string, options?: EmitOptions): Promise<void>;
303
+ /**
304
+ * Synchronously resolves a builtin virtual file and writes it to the VFS if it does not already exist
305
+ *
306
+ * @param code - The source code of the builtin file
307
+ * @param id - The unique identifier of the builtin file
308
+ * @param options - Optional write file options
309
+ */
310
+ emitBuiltinSync(code: string, id: string, options?: EmitOptions): void;
311
+ /**
312
+ * Resolves a builtin virtual file and writes it to the VFS if it does not already exist
313
+ *
314
+ * @param code - The source code of the builtin file
315
+ * @param id - The unique identifier of the builtin file
316
+ * @param options - Optional write file options
317
+ */
318
+ emitInfrastructure(code: string, id: string, options?: EmitOptions): Promise<void>;
319
+ /**
320
+ * Synchronously resolves an infrastructure virtual file and writes it to the VFS if it does not already exist
321
+ *
322
+ * @param code - The source code of the infrastructure file
323
+ * @param id - The unique identifier of the infrastructure file
324
+ * @param options - Optional write file options
325
+ */
326
+ emitInfrastructureSync(code: string, id: string, options?: EmitOptions): void;
327
+ /**
328
+ * Generates a checksum representing the current context state
329
+ *
330
+ * @param path - The root directory of the project to generate the checksum for
331
+ * @returns A promise that resolves to a string representing the checksum
332
+ */
333
+ generateChecksum(path?: string): Promise<string>;
334
+ /**
335
+ * 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.
336
+ *
337
+ * @param config - The inline configuration values to set.
338
+ * @returns A promise that resolves when the inline configuration values have been set.
339
+ */
340
+ setInlineConfig(config: TResolvedConfig["inlineConfig"]): Promise<void>;
341
+ /**
342
+ * 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.
343
+ *
344
+ * @param config - The plugin configuration values to set.
345
+ * @returns A promise that resolves when the plugin configuration values have been set.
346
+ */
347
+ setPluginConfig(config: TResolvedConfig["pluginConfig"]): Promise<void>;
348
+ /**
349
+ * 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.
350
+ *
351
+ * @returns The merged configuration object that combines the initial, user, inline, and plugin configurations.
352
+ */
353
+ protected mergeConfig(): TResolvedConfig;
354
+ /**
355
+ * 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.
356
+ *
357
+ * @param config - The user configuration values to set.
358
+ * @returns A promise that resolves when the user configuration values have been set.
359
+ */
360
+ protected setUserConfig(config: TResolvedConfig["userConfig"]): Promise<void>;
361
+ /**
362
+ * Initialize the context with the provided configuration options
363
+ */
364
+ protected resolveConfig(): Promise<void>;
365
+ private createConfigProxy;
366
+ }
367
+ //#endregion
368
+ export { PowerlinesContext };
369
+ //# sourceMappingURL=context.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.cts","names":[],"sources":["../../src/context/context.ts"],"mappings":";;;;;;;;;;;;;;;cA8Ja,iBAAA,yBACa,cAAA,GAAiB,cAAA,oCAGjC,qBAAA,CAAsB,cAAA,aACnB,OAAA,CAAQ,eAAA,EAAiB,cAAA;EAAA;EA+cE,OAAA,EAAS,gBAAA;EA7bxC,QAAA,EAAW,QAAA;EAvBU;;;EA4BrB,WAAA,EAAc,WAAA;EAvBF;;;EA4B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