@powerlines/core 0.47.4 → 0.48.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 (437) hide show
  1. package/dist/constants/api.cjs +5 -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 +1 -1
  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/extensions.cjs +21 -0
  21. package/dist/constants/extensions.d.cts +5 -0
  22. package/dist/constants/extensions.d.cts.map +1 -0
  23. package/dist/constants/extensions.d.mts +5 -0
  24. package/dist/constants/extensions.d.mts.map +1 -0
  25. package/dist/constants/extensions.mjs +20 -0
  26. package/dist/constants/extensions.mjs.map +1 -0
  27. package/dist/constants/fs.mjs.map +1 -1
  28. package/dist/constants/hooks.mjs.map +1 -1
  29. package/dist/constants/index.cjs +16 -4
  30. package/dist/constants/index.d.cts +4 -2
  31. package/dist/constants/index.d.mts +4 -2
  32. package/dist/constants/index.mjs +6 -4
  33. package/dist/constants/log-level.cjs +10 -10
  34. package/dist/constants/log-level.d.cts +10 -10
  35. package/dist/constants/log-level.d.mts +10 -10
  36. package/dist/constants/log-level.mjs +10 -10
  37. package/dist/constants/log-level.mjs.map +1 -1
  38. package/dist/constants/plugin.d.cts +2 -2
  39. package/dist/constants/plugin.d.mts +2 -2
  40. package/dist/constants/plugin.mjs.map +1 -1
  41. package/dist/context/base-context.cjs +121 -0
  42. package/dist/context/base-context.d.cts +81 -0
  43. package/dist/context/base-context.d.cts.map +1 -0
  44. package/dist/context/base-context.d.mts +81 -0
  45. package/dist/context/base-context.d.mts.map +1 -0
  46. package/dist/context/base-context.mjs +119 -0
  47. package/dist/context/base-context.mjs.map +1 -0
  48. package/dist/context/context.cjs +935 -0
  49. package/dist/context/context.d.cts +369 -0
  50. package/dist/context/context.d.cts.map +1 -0
  51. package/dist/context/context.d.mts +369 -0
  52. package/dist/context/context.d.mts.map +1 -0
  53. package/dist/context/context.mjs +933 -0
  54. package/dist/context/context.mjs.map +1 -0
  55. package/dist/context/environment-context.cjs +218 -0
  56. package/dist/context/environment-context.d.cts +100 -0
  57. package/dist/context/environment-context.d.cts.map +1 -0
  58. package/dist/context/environment-context.d.mts +100 -0
  59. package/dist/context/environment-context.d.mts.map +1 -0
  60. package/dist/context/environment-context.mjs +218 -0
  61. package/dist/context/environment-context.mjs.map +1 -0
  62. package/dist/context/execution-context.cjs +236 -0
  63. package/dist/context/execution-context.d.cts +106 -0
  64. package/dist/context/execution-context.d.cts.map +1 -0
  65. package/dist/context/execution-context.d.mts +106 -0
  66. package/dist/context/execution-context.d.mts.map +1 -0
  67. package/dist/context/execution-context.mjs +234 -0
  68. package/dist/context/execution-context.mjs.map +1 -0
  69. package/dist/context/index.cjs +12 -0
  70. package/dist/context/index.d.cts +6 -0
  71. package/dist/context/index.d.mts +6 -0
  72. package/dist/context/index.mjs +7 -0
  73. package/dist/context/plugin-context.cjs +82 -0
  74. package/dist/context/plugin-context.d.cts +18 -0
  75. package/dist/context/plugin-context.d.cts.map +1 -0
  76. package/dist/context/plugin-context.d.mts +18 -0
  77. package/dist/context/plugin-context.d.mts.map +1 -0
  78. package/dist/context/plugin-context.mjs +82 -0
  79. package/dist/context/plugin-context.mjs.map +1 -0
  80. package/dist/index.cjs +62 -3
  81. package/dist/index.d.cts +27 -16
  82. package/dist/index.d.mts +27 -16
  83. package/dist/index.mjs +17 -4
  84. package/dist/lib/config.cjs +160 -21
  85. package/dist/lib/config.d.cts +116 -12
  86. package/dist/lib/config.d.cts.map +1 -1
  87. package/dist/lib/config.d.mts +116 -12
  88. package/dist/lib/config.d.mts.map +1 -1
  89. package/dist/lib/config.mjs +154 -22
  90. package/dist/lib/config.mjs.map +1 -1
  91. package/dist/lib/context-helpers.cjs +42 -0
  92. package/dist/lib/context-helpers.d.cts +16 -0
  93. package/dist/lib/context-helpers.d.cts.map +1 -0
  94. package/dist/lib/context-helpers.d.mts +16 -0
  95. package/dist/lib/context-helpers.d.mts.map +1 -0
  96. package/dist/lib/context-helpers.mjs +41 -0
  97. package/dist/lib/context-helpers.mjs.map +1 -0
  98. package/dist/lib/entry.cjs +5 -6
  99. package/dist/lib/entry.d.cts +5 -5
  100. package/dist/lib/entry.d.cts.map +1 -1
  101. package/dist/lib/entry.d.mts +5 -5
  102. package/dist/lib/entry.d.mts.map +1 -1
  103. package/dist/lib/entry.mjs +5 -5
  104. package/dist/lib/entry.mjs.map +1 -1
  105. package/dist/lib/environment.cjs +72 -0
  106. package/dist/lib/environment.d.cts +12 -0
  107. package/dist/lib/environment.d.cts.map +1 -0
  108. package/dist/lib/environment.d.mts +12 -0
  109. package/dist/lib/environment.d.mts.map +1 -0
  110. package/dist/lib/environment.mjs +67 -0
  111. package/dist/lib/environment.mjs.map +1 -0
  112. package/dist/lib/events.cjs +43 -0
  113. package/dist/lib/events.d.cts +10 -0
  114. package/dist/lib/events.d.cts.map +1 -0
  115. package/dist/lib/events.d.mts +10 -0
  116. package/dist/lib/events.d.mts.map +1 -0
  117. package/dist/lib/events.mjs +42 -0
  118. package/dist/lib/events.mjs.map +1 -0
  119. package/dist/lib/generate-types.cjs +370 -0
  120. package/dist/lib/generate-types.d.cts +66 -0
  121. package/dist/lib/generate-types.d.cts.map +1 -0
  122. package/dist/lib/generate-types.d.mts +66 -0
  123. package/dist/lib/generate-types.d.mts.map +1 -0
  124. package/dist/lib/generate-types.mjs +368 -0
  125. package/dist/lib/generate-types.mjs.map +1 -0
  126. package/dist/lib/hooks.cjs +152 -0
  127. package/dist/lib/hooks.d.cts +28 -0
  128. package/dist/lib/hooks.d.cts.map +1 -0
  129. package/dist/lib/hooks.d.mts +28 -0
  130. package/dist/lib/hooks.d.mts.map +1 -0
  131. package/dist/lib/hooks.mjs +147 -0
  132. package/dist/lib/hooks.mjs.map +1 -0
  133. package/dist/lib/index.cjs +64 -3
  134. package/dist/lib/index.d.cts +18 -5
  135. package/dist/lib/index.d.mts +18 -5
  136. package/dist/lib/index.mjs +19 -4
  137. package/dist/lib/install-dependencies.cjs +24 -0
  138. package/dist/lib/install-dependencies.d.cts +12 -0
  139. package/dist/lib/install-dependencies.d.cts.map +1 -0
  140. package/dist/lib/install-dependencies.d.mts +12 -0
  141. package/dist/lib/install-dependencies.d.mts.map +1 -0
  142. package/dist/lib/install-dependencies.mjs +24 -0
  143. package/dist/lib/install-dependencies.mjs.map +1 -0
  144. package/dist/lib/meta.cjs +56 -0
  145. package/dist/lib/meta.d.cts +33 -0
  146. package/dist/lib/meta.d.cts.map +1 -0
  147. package/dist/lib/meta.d.mts +33 -0
  148. package/dist/lib/meta.d.mts.map +1 -0
  149. package/dist/lib/meta.mjs +54 -0
  150. package/dist/lib/meta.mjs.map +1 -0
  151. package/dist/lib/plugins.cjs +150 -0
  152. package/dist/lib/plugins.d.cts +39 -0
  153. package/dist/lib/plugins.d.cts.map +1 -0
  154. package/dist/lib/plugins.d.mts +39 -0
  155. package/dist/lib/plugins.d.mts.map +1 -0
  156. package/dist/lib/plugins.mjs +146 -0
  157. package/dist/lib/plugins.mjs.map +1 -0
  158. package/dist/lib/resolver.cjs +35 -0
  159. package/dist/lib/resolver.d.cts +20 -0
  160. package/dist/lib/resolver.d.cts.map +1 -0
  161. package/dist/lib/resolver.d.mts +20 -0
  162. package/dist/lib/resolver.d.mts.map +1 -0
  163. package/dist/lib/resolver.mjs +33 -0
  164. package/dist/lib/resolver.mjs.map +1 -0
  165. package/dist/lib/schemas.cjs +9 -0
  166. package/dist/lib/schemas.d.cts +2 -0
  167. package/dist/lib/schemas.d.mts +2 -0
  168. package/dist/lib/schemas.mjs +3 -0
  169. package/dist/lib/streaming-channel.cjs +259 -0
  170. package/dist/lib/streaming-channel.d.cts +126 -0
  171. package/dist/lib/streaming-channel.d.cts.map +1 -0
  172. package/dist/lib/streaming-channel.d.mts +126 -0
  173. package/dist/lib/streaming-channel.d.mts.map +1 -0
  174. package/dist/lib/streaming-channel.mjs +258 -0
  175. package/dist/lib/streaming-channel.mjs.map +1 -0
  176. package/dist/lib/typescript/index.cjs +16 -0
  177. package/dist/lib/typescript/index.d.cts +3 -0
  178. package/dist/lib/typescript/index.d.mts +3 -0
  179. package/dist/lib/typescript/index.mjs +4 -0
  180. package/dist/lib/typescript/ts-morph.cjs +105 -0
  181. package/dist/lib/typescript/ts-morph.d.cts +38 -0
  182. package/dist/lib/typescript/ts-morph.d.cts.map +1 -0
  183. package/dist/lib/typescript/ts-morph.d.mts +38 -0
  184. package/dist/lib/typescript/ts-morph.d.mts.map +1 -0
  185. package/dist/lib/typescript/ts-morph.mjs +102 -0
  186. package/dist/lib/typescript/ts-morph.mjs.map +1 -0
  187. package/dist/lib/typescript/tsconfig.cjs +253 -0
  188. package/dist/lib/typescript/tsconfig.d.cts +77 -0
  189. package/dist/lib/typescript/tsconfig.d.cts.map +1 -0
  190. package/dist/lib/typescript/tsconfig.d.mts +77 -0
  191. package/dist/lib/typescript/tsconfig.d.mts.map +1 -0
  192. package/dist/lib/typescript/tsconfig.mjs +240 -0
  193. package/dist/lib/typescript/tsconfig.mjs.map +1 -0
  194. package/dist/lib/unplugin/helpers.cjs +0 -1
  195. package/dist/lib/unplugin/helpers.d.cts.map +1 -1
  196. package/dist/lib/unplugin/helpers.d.mts.map +1 -1
  197. package/dist/lib/unplugin/helpers.mjs.map +1 -1
  198. package/dist/lib/unplugin/index.d.cts +3 -3
  199. package/dist/lib/unplugin/index.d.mts +3 -3
  200. package/dist/lib/unplugin/module-resolution.cjs +8 -9
  201. package/dist/lib/unplugin/module-resolution.d.cts +3 -4
  202. package/dist/lib/unplugin/module-resolution.d.cts.map +1 -1
  203. package/dist/lib/unplugin/module-resolution.d.mts +3 -4
  204. package/dist/lib/unplugin/module-resolution.d.mts.map +1 -1
  205. package/dist/lib/unplugin/module-resolution.mjs +8 -9
  206. package/dist/lib/unplugin/module-resolution.mjs.map +1 -1
  207. package/dist/lib/unplugin/plugin.cjs +54 -61
  208. package/dist/lib/unplugin/plugin.d.cts +5 -7
  209. package/dist/lib/unplugin/plugin.d.cts.map +1 -1
  210. package/dist/lib/unplugin/plugin.d.mts +5 -7
  211. package/dist/lib/unplugin/plugin.d.mts.map +1 -1
  212. package/dist/lib/unplugin/plugin.mjs +54 -60
  213. package/dist/lib/unplugin/plugin.mjs.map +1 -1
  214. package/dist/lib/utilities/file-header.cjs +2 -3
  215. package/dist/lib/utilities/file-header.d.cts +1 -2
  216. package/dist/lib/utilities/file-header.d.cts.map +1 -1
  217. package/dist/lib/utilities/file-header.d.mts +1 -2
  218. package/dist/lib/utilities/file-header.d.mts.map +1 -1
  219. package/dist/lib/utilities/file-header.mjs +2 -2
  220. package/dist/lib/utilities/file-header.mjs.map +1 -1
  221. package/dist/lib/utilities/format.cjs +1 -1
  222. package/dist/lib/utilities/format.d.cts.map +1 -1
  223. package/dist/lib/utilities/format.d.mts.map +1 -1
  224. package/dist/lib/utilities/format.mjs +1 -1
  225. package/dist/lib/utilities/format.mjs.map +1 -1
  226. package/dist/lib/utilities/index.cjs +1 -1
  227. package/dist/lib/utilities/index.d.cts +2 -2
  228. package/dist/lib/utilities/index.d.mts +2 -2
  229. package/dist/lib/utilities/index.mjs +1 -1
  230. package/dist/lib/utilities/source-file.d.cts.map +1 -1
  231. package/dist/lib/utilities/source-file.d.mts.map +1 -1
  232. package/dist/lib/utilities/source-file.mjs.map +1 -1
  233. package/dist/lib/utilities/source-map.d.cts.map +1 -1
  234. package/dist/lib/utilities/source-map.d.mts.map +1 -1
  235. package/dist/lib/utilities/source-map.mjs.map +1 -1
  236. package/dist/lib/utilities/write-file.cjs +0 -1
  237. package/dist/lib/utilities/write-file.mjs.map +1 -1
  238. package/dist/lib/vfs.cjs +1104 -0
  239. package/dist/lib/vfs.d.cts +321 -0
  240. package/dist/lib/vfs.d.cts.map +1 -0
  241. package/dist/lib/vfs.d.mts +321 -0
  242. package/dist/lib/vfs.d.mts.map +1 -0
  243. package/dist/lib/vfs.mjs +1102 -0
  244. package/dist/lib/vfs.mjs.map +1 -0
  245. package/dist/plugin-base.cjs +1 -2
  246. package/dist/plugin-base.d.cts +1 -5
  247. package/dist/plugin-base.d.cts.map +1 -1
  248. package/dist/plugin-base.d.mts +1 -5
  249. package/dist/plugin-base.d.mts.map +1 -1
  250. package/dist/plugin-base.mjs +1 -1
  251. package/dist/plugin-base.mjs.map +1 -1
  252. package/dist/plugin-utils/build-helpers.cjs +2 -3
  253. package/dist/plugin-utils/build-helpers.d.cts +3 -4
  254. package/dist/plugin-utils/build-helpers.d.cts.map +1 -1
  255. package/dist/plugin-utils/build-helpers.d.mts +3 -4
  256. package/dist/plugin-utils/build-helpers.d.mts.map +1 -1
  257. package/dist/plugin-utils/build-helpers.mjs +2 -2
  258. package/dist/plugin-utils/build-helpers.mjs.map +1 -1
  259. package/dist/plugin-utils/combine-plugins.cjs +0 -1
  260. package/dist/plugin-utils/combine-plugins.d.cts +7 -9
  261. package/dist/plugin-utils/combine-plugins.d.cts.map +1 -1
  262. package/dist/plugin-utils/combine-plugins.d.mts +7 -9
  263. package/dist/plugin-utils/combine-plugins.d.mts.map +1 -1
  264. package/dist/plugin-utils/combine-plugins.mjs.map +1 -1
  265. package/dist/plugin-utils/context-helpers.cjs +0 -1
  266. package/dist/plugin-utils/context-helpers.d.cts.map +1 -1
  267. package/dist/plugin-utils/context-helpers.d.mts.map +1 -1
  268. package/dist/plugin-utils/context-helpers.mjs.map +1 -1
  269. package/dist/plugin-utils/docs-helper.cjs +0 -1
  270. package/dist/plugin-utils/docs-helper.d.cts.map +1 -1
  271. package/dist/plugin-utils/docs-helper.d.mts.map +1 -1
  272. package/dist/plugin-utils/docs-helper.mjs.map +1 -1
  273. package/dist/plugin-utils/enable-plugin.cjs +33 -0
  274. package/dist/plugin-utils/enable-plugin.d.cts +29 -0
  275. package/dist/plugin-utils/enable-plugin.d.cts.map +1 -0
  276. package/dist/plugin-utils/enable-plugin.d.mts +29 -0
  277. package/dist/plugin-utils/enable-plugin.d.mts.map +1 -0
  278. package/dist/plugin-utils/enable-plugin.mjs +33 -0
  279. package/dist/plugin-utils/enable-plugin.mjs.map +1 -0
  280. package/dist/plugin-utils/extend.cjs +0 -1
  281. package/dist/plugin-utils/extend.mjs.map +1 -1
  282. package/dist/plugin-utils/filter.cjs +2 -2
  283. package/dist/plugin-utils/filter.d.cts.map +1 -1
  284. package/dist/plugin-utils/filter.d.mts.map +1 -1
  285. package/dist/plugin-utils/filter.mjs +2 -2
  286. package/dist/plugin-utils/filter.mjs.map +1 -1
  287. package/dist/plugin-utils/format-package-json.cjs +0 -1
  288. package/dist/plugin-utils/format-package-json.mjs.map +1 -1
  289. package/dist/plugin-utils/format.cjs +14 -7
  290. package/dist/plugin-utils/format.d.cts.map +1 -1
  291. package/dist/plugin-utils/format.d.mts.map +1 -1
  292. package/dist/plugin-utils/format.mjs +14 -6
  293. package/dist/plugin-utils/format.mjs.map +1 -1
  294. package/dist/plugin-utils/get-config-path.cjs +0 -1
  295. package/dist/plugin-utils/get-config-path.d.cts.map +1 -1
  296. package/dist/plugin-utils/get-config-path.d.mts.map +1 -1
  297. package/dist/plugin-utils/get-config-path.mjs.map +1 -1
  298. package/dist/plugin-utils/helpers.cjs +1 -2
  299. package/dist/plugin-utils/helpers.d.cts +18 -23
  300. package/dist/plugin-utils/helpers.d.cts.map +1 -1
  301. package/dist/plugin-utils/helpers.d.mts +18 -23
  302. package/dist/plugin-utils/helpers.d.mts.map +1 -1
  303. package/dist/plugin-utils/helpers.mjs +1 -1
  304. package/dist/plugin-utils/helpers.mjs.map +1 -1
  305. package/dist/plugin-utils/index.cjs +7 -2
  306. package/dist/plugin-utils/index.d.cts +8 -6
  307. package/dist/plugin-utils/index.d.mts +8 -6
  308. package/dist/plugin-utils/index.mjs +5 -3
  309. package/dist/plugin-utils/install.cjs +46 -0
  310. package/dist/plugin-utils/install.d.cts +23 -0
  311. package/dist/plugin-utils/install.d.cts.map +1 -0
  312. package/dist/plugin-utils/install.d.mts +23 -0
  313. package/dist/plugin-utils/install.d.mts.map +1 -0
  314. package/dist/plugin-utils/install.mjs +45 -0
  315. package/dist/plugin-utils/install.mjs.map +1 -0
  316. package/dist/plugin-utils/logging.cjs +50 -47
  317. package/dist/plugin-utils/logging.d.cts +3 -2
  318. package/dist/plugin-utils/logging.d.cts.map +1 -1
  319. package/dist/plugin-utils/logging.d.mts +3 -2
  320. package/dist/plugin-utils/logging.d.mts.map +1 -1
  321. package/dist/plugin-utils/logging.mjs +50 -47
  322. package/dist/plugin-utils/logging.mjs.map +1 -1
  323. package/dist/plugin-utils/merge.cjs +1 -1
  324. package/dist/plugin-utils/merge.d.cts +1 -2
  325. package/dist/plugin-utils/merge.d.cts.map +1 -1
  326. package/dist/plugin-utils/merge.d.mts +1 -2
  327. package/dist/plugin-utils/merge.d.mts.map +1 -1
  328. package/dist/plugin-utils/merge.mjs +1 -1
  329. package/dist/plugin-utils/merge.mjs.map +1 -1
  330. package/dist/plugin-utils/modules.cjs +1 -1
  331. package/dist/plugin-utils/modules.d.cts.map +1 -1
  332. package/dist/plugin-utils/modules.d.mts.map +1 -1
  333. package/dist/plugin-utils/modules.mjs +1 -1
  334. package/dist/plugin-utils/modules.mjs.map +1 -1
  335. package/dist/plugin-utils/paths.cjs +1 -2
  336. package/dist/plugin-utils/paths.d.cts.map +1 -1
  337. package/dist/plugin-utils/paths.d.mts.map +1 -1
  338. package/dist/plugin-utils/paths.mjs +1 -1
  339. package/dist/plugin-utils/paths.mjs.map +1 -1
  340. package/dist/plugin-utils/virtual.d.cts +1 -2
  341. package/dist/plugin-utils/virtual.d.cts.map +1 -1
  342. package/dist/plugin-utils/virtual.d.mts +1 -2
  343. package/dist/plugin-utils/virtual.d.mts.map +1 -1
  344. package/dist/plugin-utils/virtual.mjs.map +1 -1
  345. package/dist/schemas/fs.cjs +232 -0
  346. package/dist/schemas/fs.d.cts +127 -0
  347. package/dist/schemas/fs.d.cts.map +1 -0
  348. package/dist/schemas/fs.d.mts +127 -0
  349. package/dist/schemas/fs.d.mts.map +1 -0
  350. package/dist/schemas/fs.mjs +226 -0
  351. package/dist/schemas/fs.mjs.map +1 -0
  352. package/dist/storage/base.cjs +216 -0
  353. package/dist/storage/base.d.cts +200 -0
  354. package/dist/storage/base.d.cts.map +1 -0
  355. package/dist/storage/base.d.mts +200 -0
  356. package/dist/storage/base.d.mts.map +1 -0
  357. package/dist/storage/base.mjs +216 -0
  358. package/dist/storage/base.mjs.map +1 -0
  359. package/dist/storage/file-system.cjs +179 -0
  360. package/dist/storage/file-system.d.cts +127 -0
  361. package/dist/storage/file-system.d.cts.map +1 -0
  362. package/dist/storage/file-system.d.mts +127 -0
  363. package/dist/storage/file-system.d.mts.map +1 -0
  364. package/dist/storage/file-system.mjs +179 -0
  365. package/dist/storage/file-system.mjs.map +1 -0
  366. package/dist/storage/helpers.cjs +36 -0
  367. package/dist/storage/helpers.d.cts +25 -0
  368. package/dist/storage/helpers.d.cts.map +1 -0
  369. package/dist/storage/helpers.d.mts +25 -0
  370. package/dist/storage/helpers.d.mts.map +1 -0
  371. package/dist/storage/helpers.mjs +34 -0
  372. package/dist/storage/helpers.mjs.map +1 -0
  373. package/dist/storage/index.cjs +12 -0
  374. package/dist/storage/index.d.cts +5 -0
  375. package/dist/storage/index.d.mts +5 -0
  376. package/dist/storage/index.mjs +6 -0
  377. package/dist/storage/virtual.cjs +97 -0
  378. package/dist/storage/virtual.d.cts +80 -0
  379. package/dist/storage/virtual.d.cts.map +1 -0
  380. package/dist/storage/virtual.d.mts +80 -0
  381. package/dist/storage/virtual.d.mts.map +1 -0
  382. package/dist/storage/virtual.mjs +97 -0
  383. package/dist/storage/virtual.mjs.map +1 -0
  384. package/dist/types/api.d.cts +10 -162
  385. package/dist/types/api.d.cts.map +1 -1
  386. package/dist/types/api.d.mts +10 -162
  387. package/dist/types/api.d.mts.map +1 -1
  388. package/dist/types/config.d.cts +144 -181
  389. package/dist/types/config.d.cts.map +1 -1
  390. package/dist/types/config.d.mts +145 -182
  391. package/dist/types/config.d.mts.map +1 -1
  392. package/dist/types/context.d.cts +120 -184
  393. package/dist/types/context.d.cts.map +1 -1
  394. package/dist/types/context.d.mts +123 -187
  395. package/dist/types/context.d.mts.map +1 -1
  396. package/dist/types/fs.d.cts +1 -12
  397. package/dist/types/fs.d.cts.map +1 -1
  398. package/dist/types/fs.d.mts +2 -13
  399. package/dist/types/fs.d.mts.map +1 -1
  400. package/dist/types/hooks.d.cts +1 -12
  401. package/dist/types/hooks.d.cts.map +1 -1
  402. package/dist/types/hooks.d.mts +1 -12
  403. package/dist/types/hooks.d.mts.map +1 -1
  404. package/dist/types/index.d.cts +9 -11
  405. package/dist/types/index.d.mts +9 -11
  406. package/dist/types/logging.d.cts +5 -20
  407. package/dist/types/logging.d.cts.map +1 -1
  408. package/dist/types/logging.d.mts +5 -20
  409. package/dist/types/logging.d.mts.map +1 -1
  410. package/dist/types/plugin.d.cts +5 -15
  411. package/dist/types/plugin.d.cts.map +1 -1
  412. package/dist/types/plugin.d.mts +5 -15
  413. package/dist/types/plugin.d.mts.map +1 -1
  414. package/dist/types/tsconfig.d.cts +1 -8
  415. package/dist/types/tsconfig.d.cts.map +1 -1
  416. package/dist/types/tsconfig.d.mts +2 -9
  417. package/dist/types/tsconfig.d.mts.map +1 -1
  418. package/dist/types/unplugin.d.cts +6 -31
  419. package/dist/types/unplugin.d.cts.map +1 -1
  420. package/dist/types/unplugin.d.mts +6 -31
  421. package/dist/types/unplugin.d.mts.map +1 -1
  422. package/package.json +158 -25
  423. package/schemas/fs.capnp +42 -0
  424. package/dist/types/_internal.cjs +0 -0
  425. package/dist/types/_internal.d.cts +0 -91
  426. package/dist/types/_internal.d.cts.map +0 -1
  427. package/dist/types/_internal.d.mts +0 -91
  428. package/dist/types/_internal.d.mts.map +0 -1
  429. package/dist/types/_internal.mjs +0 -1
  430. package/dist/types/commands.d.cts +0 -16
  431. package/dist/types/commands.d.cts.map +0 -1
  432. package/dist/types/commands.d.mts +0 -16
  433. package/dist/types/commands.d.mts.map +0 -1
  434. package/dist/types/utils.d.cts +0 -9
  435. package/dist/types/utils.d.cts.map +0 -1
  436. package/dist/types/utils.d.mts +0 -9
  437. package/dist/types/utils.d.mts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"module-resolution.mjs","names":[],"sources":["../../../src/lib/unplugin/module-resolution.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 { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport defu from \"defu\";\nimport { LoadResult } from \"rollup\";\nimport type {\n UnpluginBuildContext,\n UnpluginContext,\n UnpluginOptions\n} from \"unplugin\";\nimport {\n addVirtualPrefix,\n removeVirtualPrefix,\n VIRTUAL_MODULE_PREFIX_REGEX\n} from \"../../plugin-utils\";\nimport { Unstable_PluginContext } from \"../../types/_internal\";\nimport { PluginContext, ResolveResult } from \"../../types/context\";\nimport { ResolveOptions } from \"../../types/fs\";\n\nexport interface CreateUnpluginModuleResolutionFunctionsOptions {\n /**\n * An indicator of whether to prefix virtual module IDs with a specific string. This is useful for ensuring that virtual modules are only processed by the plugin and not by other plugins or the bundler itself.\n *\n * @remarks\n * - If set to `true`, virtual module IDs will be prefixed with the string `__powerlines-virtual:`.\n * - If set to `false`, no prefix will be added to virtual module IDs.\n *\n * @defaultValue true\n */\n prefix?: boolean;\n\n /**\n * Optional overrides for the module resolution configuration.\n *\n * @remarks\n * This allows you to customize the behavior of the module resolution hooks by providing specific configuration options.\n */\n overrides?: Partial<ResolveOptions>;\n}\n\n/**\n * Creates the module resolution hook functions for a Powerlines unplugin plugin instance.\n *\n * @remarks\n * This includes the `resolveId` and `load` hooks.\n *\n * @see https://rollupjs.org/plugin-development/#resolveid\n * @see https://rollupjs.org/plugin-development/#load\n *\n * @param context - The plugin context.\n * @param options - Options for creating the module resolution functions.\n * @returns The module resolution hooks (`resolveId` and `load`).\n */\nexport function createUnpluginModuleResolutionFunctions<\n TContext extends PluginContext = PluginContext\n>(\n context: TContext,\n options: CreateUnpluginModuleResolutionFunctionsOptions = {}\n): Pick<UnpluginOptions, \"resolveId\" | \"load\"> {\n const ctx = context as unknown as Unstable_PluginContext;\n\n return {\n async resolveId(\n this: UnpluginBuildContext & UnpluginContext,\n id: string,\n importer?: string,\n opts: {\n isEntry: boolean;\n } = { isEntry: false }\n ): Promise<string | ResolveResult | null | undefined> {\n const normalizedId = removeVirtualPrefix(id);\n const normalizedImporter = importer\n ? removeVirtualPrefix(importer)\n : undefined;\n\n let result = await ctx.api.callHook(\n \"resolveId\",\n {\n sequential: true,\n result: \"first\",\n order: \"pre\"\n },\n normalizedId,\n normalizedImporter,\n opts\n );\n if (isSetString(result)) {\n return result;\n } else if (isSetObject(result)) {\n return {\n ...result,\n id:\n result.virtual && options.prefix !== false\n ? addVirtualPrefix(result.id)\n : result.id\n };\n }\n\n result = await ctx.api.callHook(\n \"resolveId\",\n {\n sequential: true,\n result: \"first\",\n order: \"normal\"\n },\n normalizedId,\n normalizedImporter,\n opts\n );\n if (isSetString(result)) {\n return result;\n } else if (isSetObject(result)) {\n return {\n ...result,\n id:\n result.virtual && options.prefix !== false\n ? addVirtualPrefix(result.id)\n : result.id\n };\n }\n\n result = await ctx.resolve(\n normalizedId,\n normalizedImporter,\n defu(options.overrides ?? {}, {\n isFile: true,\n ...opts\n })\n );\n if (isSetObject(result)) {\n return {\n ...result,\n id:\n result.virtual && options.prefix !== false\n ? addVirtualPrefix(result.id)\n : result.id\n };\n }\n\n result = await ctx.api.callHook(\n \"resolveId\",\n {\n sequential: true,\n result: \"first\",\n order: \"post\"\n },\n normalizedId,\n normalizedImporter,\n opts\n );\n if (isSetString(result)) {\n return result;\n } else if (isSetObject(result)) {\n return {\n ...result,\n id:\n result.virtual && options.prefix !== false\n ? addVirtualPrefix(result.id)\n : result.id\n };\n }\n\n return null;\n },\n load: {\n filter:\n options.prefix !== false\n ? {\n id: VIRTUAL_MODULE_PREFIX_REGEX\n }\n : undefined,\n async handler(\n this: UnpluginBuildContext & UnpluginContext,\n id: string\n ): Promise<LoadResult | null | undefined> {\n const normalizedId = removeVirtualPrefix(id);\n\n let result = await ctx.api.callHook(\n \"load\",\n {\n sequential: true,\n result: \"first\",\n order: \"pre\"\n },\n normalizedId\n );\n if (result) {\n return result;\n }\n\n result = await ctx.api.callHook(\n \"load\",\n {\n sequential: true,\n result: \"first\",\n order: \"normal\"\n },\n normalizedId\n );\n if (result) {\n return result;\n }\n\n result = await ctx.load(normalizedId);\n if (result) {\n return result;\n }\n\n return ctx.api.callHook(\n \"load\",\n {\n sequential: true,\n result: \"first\",\n order: \"post\"\n },\n normalizedId\n );\n }\n }\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAsEA,SAAgB,wCAGd,SACA,UAA0D,EAAE,EACf;CAC7C,MAAM,MAAM;AAEZ,QAAO;EACL,MAAM,UAEJ,IACA,UACA,OAEI,EAAE,SAAS,OAAO,EAC8B;GACpD,MAAM,eAAe,oBAAoB,GAAG;GAC5C,MAAM,qBAAqB,WACvB,oBAAoB,SAAS,GAC7B;GAEJ,IAAI,SAAS,MAAM,IAAI,IAAI,SACzB,aACA;IACE,YAAY;IACZ,QAAQ;IACR,OAAO;IACR,EACD,cACA,oBACA,KACD;AACD,OAAI,YAAY,OAAO,CACrB,QAAO;YACE,YAAY,OAAO,CAC5B,QAAO;IACL,GAAG;IACH,IACE,OAAO,WAAW,QAAQ,WAAW,QACjC,iBAAiB,OAAO,GAAG,GAC3B,OAAO;IACd;AAGH,YAAS,MAAM,IAAI,IAAI,SACrB,aACA;IACE,YAAY;IACZ,QAAQ;IACR,OAAO;IACR,EACD,cACA,oBACA,KACD;AACD,OAAI,YAAY,OAAO,CACrB,QAAO;YACE,YAAY,OAAO,CAC5B,QAAO;IACL,GAAG;IACH,IACE,OAAO,WAAW,QAAQ,WAAW,QACjC,iBAAiB,OAAO,GAAG,GAC3B,OAAO;IACd;AAGH,YAAS,MAAM,IAAI,QACjB,cACA,oBACA,KAAK,QAAQ,aAAa,EAAE,EAAE;IAC5B,QAAQ;IACR,GAAG;IACJ,CAAC,CACH;AACD,OAAI,YAAY,OAAO,CACrB,QAAO;IACL,GAAG;IACH,IACE,OAAO,WAAW,QAAQ,WAAW,QACjC,iBAAiB,OAAO,GAAG,GAC3B,OAAO;IACd;AAGH,YAAS,MAAM,IAAI,IAAI,SACrB,aACA;IACE,YAAY;IACZ,QAAQ;IACR,OAAO;IACR,EACD,cACA,oBACA,KACD;AACD,OAAI,YAAY,OAAO,CACrB,QAAO;YACE,YAAY,OAAO,CAC5B,QAAO;IACL,GAAG;IACH,IACE,OAAO,WAAW,QAAQ,WAAW,QACjC,iBAAiB,OAAO,GAAG,GAC3B,OAAO;IACd;AAGH,UAAO;;EAET,MAAM;GACJ,QACE,QAAQ,WAAW,QACf,EACE,IAAI,6BACL,GACD;GACN,MAAM,QAEJ,IACwC;IACxC,MAAM,eAAe,oBAAoB,GAAG;IAE5C,IAAI,SAAS,MAAM,IAAI,IAAI,SACzB,QACA;KACE,YAAY;KACZ,QAAQ;KACR,OAAO;KACR,EACD,aACD;AACD,QAAI,OACF,QAAO;AAGT,aAAS,MAAM,IAAI,IAAI,SACrB,QACA;KACE,YAAY;KACZ,QAAQ;KACR,OAAO;KACR,EACD,aACD;AACD,QAAI,OACF,QAAO;AAGT,aAAS,MAAM,IAAI,KAAK,aAAa;AACrC,QAAI,OACF,QAAO;AAGT,WAAO,IAAI,IAAI,SACb,QACA;KACE,YAAY;KACZ,QAAQ;KACR,OAAO;KACR,EACD,aACD;;GAEJ;EACF"}
1
+ {"version":3,"file":"module-resolution.mjs","names":[],"sources":["../../../src/lib/unplugin/module-resolution.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 { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport defu from \"defu\";\nimport { LoadResult } from \"rollup\";\nimport type {\n UnpluginBuildContext,\n UnpluginContext,\n UnpluginOptions\n} from \"unplugin\";\nimport {\n addVirtualPrefix,\n removeVirtualPrefix,\n VIRTUAL_MODULE_PREFIX_REGEX\n} from \"../../plugin-utils\";\nimport { ResolveResult, UnresolvedContext } from \"../../types/context\";\nimport { ResolveOptions } from \"../../types/fs\";\n\nexport interface CreateUnpluginModuleResolutionFunctionsOptions {\n /**\n * An indicator of whether to prefix virtual module IDs with a specific string. This is useful for ensuring that virtual modules are only processed by the plugin and not by other plugins or the bundler itself.\n *\n * @remarks\n * - If set to `true`, virtual module IDs will be prefixed with the string `__powerlines-virtual:`.\n * - If set to `false`, no prefix will be added to virtual module IDs.\n *\n * @defaultValue true\n */\n prefix?: boolean;\n\n /**\n * Optional overrides for the module resolution configuration.\n *\n * @remarks\n * This allows you to customize the behavior of the module resolution hooks by providing specific configuration options.\n */\n overrides?: Partial<ResolveOptions>;\n}\n\n/**\n * Creates the module resolution hook functions for a Powerlines unplugin plugin instance.\n *\n * @remarks\n * This includes the `resolveId` and `load` hooks.\n *\n * @see https://rollupjs.org/plugin-development/#resolveid\n * @see https://rollupjs.org/plugin-development/#load\n *\n * @param context - The plugin context.\n * @param options - Options for creating the module resolution functions.\n * @returns The module resolution hooks (`resolveId` and `load`).\n */\nexport function createUnpluginModuleResolutionFunctions<\n TContext extends UnresolvedContext\n>(\n context: TContext,\n options: CreateUnpluginModuleResolutionFunctionsOptions = {}\n): Pick<UnpluginOptions, \"resolveId\" | \"load\"> {\n return {\n async resolveId(\n this: UnpluginBuildContext & UnpluginContext,\n id: string,\n importer?: string,\n opts: {\n isEntry: boolean;\n } = { isEntry: false }\n ): Promise<string | ResolveResult | null | undefined> {\n const normalizedId = removeVirtualPrefix(id);\n const normalizedImporter = importer\n ? removeVirtualPrefix(importer)\n : undefined;\n\n let result = await context.callHook(\n \"resolveId\",\n {\n sequential: true,\n result: \"first\",\n order: \"pre\"\n },\n normalizedId,\n normalizedImporter,\n opts\n );\n if (isSetString(result)) {\n return result;\n } else if (isSetObject(result)) {\n return {\n ...result,\n id:\n result.virtual && options.prefix !== false\n ? addVirtualPrefix(result.id)\n : result.id\n };\n }\n\n result = await context.callHook(\n \"resolveId\",\n {\n sequential: true,\n result: \"first\",\n order: \"normal\"\n },\n normalizedId,\n normalizedImporter,\n opts\n );\n if (isSetString(result)) {\n return result;\n } else if (isSetObject(result)) {\n return {\n ...result,\n id:\n result.virtual && options.prefix !== false\n ? addVirtualPrefix(result.id)\n : result.id\n };\n }\n\n result = await context.resolve(\n normalizedId,\n normalizedImporter,\n defu(options.overrides ?? {}, {\n isFile: true,\n ...opts\n })\n );\n if (isSetObject(result)) {\n return {\n ...result,\n id:\n result.virtual && options.prefix !== false\n ? addVirtualPrefix(result.id)\n : result.id\n };\n }\n\n result = await context.callHook(\n \"resolveId\",\n {\n sequential: true,\n result: \"first\",\n order: \"post\"\n },\n normalizedId,\n normalizedImporter,\n opts\n );\n if (isSetString(result)) {\n return result;\n } else if (isSetObject(result)) {\n return {\n ...result,\n id:\n result.virtual && options.prefix !== false\n ? addVirtualPrefix(result.id)\n : result.id\n };\n }\n\n return null;\n },\n load: {\n filter:\n options.prefix !== false\n ? {\n id: VIRTUAL_MODULE_PREFIX_REGEX\n }\n : undefined,\n async handler(\n this: UnpluginBuildContext & UnpluginContext,\n id: string\n ): Promise<LoadResult | null | undefined> {\n const normalizedId = removeVirtualPrefix(id);\n\n let result = await context.callHook(\n \"load\",\n {\n sequential: true,\n result: \"first\",\n order: \"pre\"\n },\n normalizedId\n );\n if (result) {\n return result;\n }\n\n result = await context.callHook(\n \"load\",\n {\n sequential: true,\n result: \"first\",\n order: \"normal\"\n },\n normalizedId\n );\n if (result) {\n return result;\n }\n\n result = await context.load(normalizedId);\n if (result) {\n return result;\n }\n\n return context.callHook(\n \"load\",\n {\n sequential: true,\n result: \"first\",\n order: \"post\"\n },\n normalizedId\n );\n }\n }\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAqEA,SAAgB,wCAGd,SACA,UAA0D,CAAC,GACd;CAC7C,OAAO;EACL,MAAM,UAEJ,IACA,UACA,OAEI,EAAE,SAAS,MAAM,GAC+B;GACpD,MAAM,eAAe,oBAAoB,EAAE;GAC3C,MAAM,qBAAqB,WACvB,oBAAoB,QAAQ,IAC5B;GAEJ,IAAI,SAAS,MAAM,QAAQ,SACzB,aACA;IACE,YAAY;IACZ,QAAQ;IACR,OAAO;GACT,GACA,cACA,oBACA,IACF;GACA,IAAI,YAAY,MAAM,GACpB,OAAO;QACF,IAAI,YAAY,MAAM,GAC3B,OAAO;IACL,GAAG;IACH,IACE,OAAO,WAAW,QAAQ,WAAW,QACjC,iBAAiB,OAAO,EAAE,IAC1B,OAAO;GACf;GAGF,SAAS,MAAM,QAAQ,SACrB,aACA;IACE,YAAY;IACZ,QAAQ;IACR,OAAO;GACT,GACA,cACA,oBACA,IACF;GACA,IAAI,YAAY,MAAM,GACpB,OAAO;QACF,IAAI,YAAY,MAAM,GAC3B,OAAO;IACL,GAAG;IACH,IACE,OAAO,WAAW,QAAQ,WAAW,QACjC,iBAAiB,OAAO,EAAE,IAC1B,OAAO;GACf;GAGF,SAAS,MAAM,QAAQ,QACrB,cACA,oBACA,KAAK,QAAQ,aAAa,CAAC,GAAG;IAC5B,QAAQ;IACR,GAAG;GACL,CAAC,CACH;GACA,IAAI,YAAY,MAAM,GACpB,OAAO;IACL,GAAG;IACH,IACE,OAAO,WAAW,QAAQ,WAAW,QACjC,iBAAiB,OAAO,EAAE,IAC1B,OAAO;GACf;GAGF,SAAS,MAAM,QAAQ,SACrB,aACA;IACE,YAAY;IACZ,QAAQ;IACR,OAAO;GACT,GACA,cACA,oBACA,IACF;GACA,IAAI,YAAY,MAAM,GACpB,OAAO;QACF,IAAI,YAAY,MAAM,GAC3B,OAAO;IACL,GAAG;IACH,IACE,OAAO,WAAW,QAAQ,WAAW,QACjC,iBAAiB,OAAO,EAAE,IAC1B,OAAO;GACf;GAGF,OAAO;EACT;EACA,MAAM;GACJ,QACE,QAAQ,WAAW,QACf,EACE,IAAI,4BACN,IACA;GACN,MAAM,QAEJ,IACwC;IACxC,MAAM,eAAe,oBAAoB,EAAE;IAE3C,IAAI,SAAS,MAAM,QAAQ,SACzB,QACA;KACE,YAAY;KACZ,QAAQ;KACR,OAAO;IACT,GACA,YACF;IACA,IAAI,QACF,OAAO;IAGT,SAAS,MAAM,QAAQ,SACrB,QACA;KACE,YAAY;KACZ,QAAQ;KACR,OAAO;IACT,GACA,YACF;IACA,IAAI,QACF,OAAO;IAGT,SAAS,MAAM,QAAQ,KAAK,YAAY;IACxC,IAAI,QACF,OAAO;IAGT,OAAO,QAAQ,SACb,QACA;KACE,YAAY;KACZ,QAAQ;KACR,OAAO;IACT,GACA,YACF;GACF;EACF;CACF;AACF"}
@@ -1,8 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
3
- const require_lib_unplugin_helpers = require('./helpers.cjs');
4
2
  const require_plugin_utils_virtual = require('../../plugin-utils/virtual.cjs');
5
3
  require('../../plugin-utils/index.cjs');
4
+ const require_lib_unplugin_helpers = require('./helpers.cjs');
6
5
  const require_lib_unplugin_module_resolution = require('./module-resolution.cjs');
7
6
  const require_lib_utilities_source_file = require('../utilities/source-file.cjs');
8
7
  let _stryke_string_format_kebab_case = require("@stryke/string-format/kebab-case");
@@ -17,25 +16,22 @@ let unplugin = require("unplugin");
17
16
  * @returns The unplugin instance.
18
17
  */
19
18
  function createUnpluginResolver(context, options = {}) {
20
- const ctx = context;
21
- (0, unplugin.setParseImpl)(ctx.parse);
19
+ (0, unplugin.setParseImpl)(context.parse);
22
20
  const name = options.name || "powerlines";
23
- return () => {
24
- const logger = ctx.extendLogger(!options.silenceHookLogging && name !== "powerlines" ? { source: name } : {});
25
- logger.debug(`Initializing ${(0, _stryke_string_format_title_case.titleCase)(name)} plugin`);
26
- try {
27
- const { resolveId, load } = require_lib_unplugin_module_resolution.createUnpluginModuleResolutionFunctions(context, options);
28
- return {
29
- name: name.toLowerCase() === "powerlines" ? "powerlines" : `powerlines:${(0, _stryke_string_format_kebab_case.kebabCase)(name)}`,
30
- api: ctx.$$internal.api,
31
- resolveId,
32
- load
33
- };
34
- } catch (error) {
35
- logger.error(error instanceof Error ? error.message : String(error));
36
- throw error;
37
- }
38
- };
21
+ const logger = context.extendLogger(!options.silenceHookLogging && name !== "powerlines" ? { source: name } : {});
22
+ logger.debug(`Initializing ${(0, _stryke_string_format_title_case.titleCase)(name)} plugin`);
23
+ try {
24
+ const { resolveId, load } = require_lib_unplugin_module_resolution.createUnpluginModuleResolutionFunctions(context, options);
25
+ return () => ({
26
+ name: name.toLowerCase() === "powerlines" ? "powerlines" : `powerlines:${(0, _stryke_string_format_kebab_case.kebabCase)(name)}`,
27
+ context,
28
+ resolveId,
29
+ load
30
+ });
31
+ } catch (error) {
32
+ logger.error(error instanceof Error ? error.message : String(error));
33
+ throw error;
34
+ }
39
35
  }
40
36
  /**
41
37
  * Creates a Powerlines unplugin instance.
@@ -44,50 +40,47 @@ function createUnpluginResolver(context, options = {}) {
44
40
  * @returns The unplugin instance.
45
41
  */
46
42
  function createUnplugin(context, options = {}) {
47
- const ctx = context;
48
- (0, unplugin.setParseImpl)(ctx.parse.bind(ctx));
43
+ (0, unplugin.setParseImpl)(context.parse.bind(context));
49
44
  const name = options.name || "powerlines";
50
- return () => {
51
- const logger = ctx.extendLogger(!options.silenceHookLogging && name !== "powerlines" ? { source: name } : {});
52
- logger.debug(`Initializing ${(0, _stryke_string_format_title_case.titleCase)(name)} plugin`);
53
- try {
54
- const { resolveId, load } = require_lib_unplugin_module_resolution.createUnpluginModuleResolutionFunctions(context, options);
55
- async function buildStart() {
56
- if (!options.silenceHookLogging) logger.debug("Powerlines build plugin starting...");
57
- await ctx.api.callHook("buildStart", { sequential: true });
58
- }
59
- async function transform(code, id) {
60
- let transformed = code;
61
- for (const hook of ctx.environment.selectHooks("transform")) {
62
- const result = await hook.handler.apply(require_lib_unplugin_helpers.combineContexts(ctx, this), [require_lib_utilities_source_file.getString(transformed), require_plugin_utils_virtual.removeVirtualPrefix(id)]);
63
- if (result) transformed = result;
64
- }
65
- return transformed;
66
- }
67
- async function buildEnd() {
68
- if (!options.silenceHookLogging) logger.debug("Powerlines build plugin finishing...");
69
- return ctx.api.callHook("buildEnd", { sequential: true });
70
- }
71
- async function writeBundle() {
72
- if (!options.silenceHookLogging) logger.debug("Finalizing Powerlines project output...");
73
- return ctx.api.callHook("writeBundle", { sequential: true });
45
+ const logger = context.extendLogger(!options.silenceHookLogging && name !== "powerlines" ? { source: name } : {});
46
+ logger.debug(`Initializing ${(0, _stryke_string_format_title_case.titleCase)(name)} plugin`);
47
+ try {
48
+ const { resolveId, load } = require_lib_unplugin_module_resolution.createUnpluginModuleResolutionFunctions(context, options);
49
+ async function buildStart() {
50
+ if (!options.silenceHookLogging) logger.debug("Powerlines build plugin starting...");
51
+ await context.callHook("buildStart", { sequential: true });
52
+ }
53
+ async function transform(code, id) {
54
+ let transformed = code;
55
+ for (const hook of context.environment.selectHooks("transform")) {
56
+ const result = await hook.handler.apply(require_lib_unplugin_helpers.combineContexts(context, this), [require_lib_utilities_source_file.getString(transformed), require_plugin_utils_virtual.removeVirtualPrefix(id)]);
57
+ if (result) transformed = result;
74
58
  }
75
- return {
76
- name: name.toLowerCase() === "powerlines" ? "powerlines" : `powerlines:${(0, _stryke_string_format_kebab_case.kebabCase)(name)}`,
77
- api: ctx.api,
78
- resolveId,
79
- load,
80
- transform,
81
- buildStart,
82
- buildEnd,
83
- writeBundle,
84
- vite: { sharedDuringBuild: true }
85
- };
86
- } catch (error) {
87
- logger.error(error instanceof Error ? error.message : String(error));
88
- throw error;
59
+ return transformed;
60
+ }
61
+ async function buildEnd() {
62
+ if (!options.silenceHookLogging) logger.debug("Powerlines build plugin finishing...");
63
+ return context.callHook("buildEnd", { sequential: true });
64
+ }
65
+ async function writeBundle() {
66
+ if (!options.silenceHookLogging) logger.debug("Finalizing Powerlines project output...");
67
+ return context.callHook("writeBundle", { sequential: true });
89
68
  }
90
- };
69
+ return () => ({
70
+ name: name.toLowerCase() === "powerlines" ? "powerlines" : `powerlines:${(0, _stryke_string_format_kebab_case.kebabCase)(name)}`,
71
+ context,
72
+ resolveId,
73
+ load,
74
+ transform,
75
+ buildStart,
76
+ buildEnd,
77
+ writeBundle,
78
+ vite: { sharedDuringBuild: true }
79
+ });
80
+ } catch (error) {
81
+ logger.error(error instanceof Error ? error.message : String(error));
82
+ throw error;
83
+ }
91
84
  }
92
85
 
93
86
  //#endregion
@@ -1,5 +1,5 @@
1
- import { UnpluginFactory } from "../../types/unplugin.cjs";
2
- import { PluginContext } from "../../types/context.cjs";
1
+ import { UnpluginOptions } from "../../types/unplugin.cjs";
2
+ import { PluginContext, UnresolvedContext } from "../../types/context.cjs";
3
3
  import { CreateUnpluginModuleResolutionFunctionsOptions } from "./module-resolution.cjs";
4
4
 
5
5
  //#region src/lib/unplugin/plugin.d.ts
@@ -26,7 +26,7 @@ interface CreateUnpluginResolverOptions extends CreateUnpluginModuleResolutionFu
26
26
  * @param context - The plugin context.
27
27
  * @returns The unplugin instance.
28
28
  */
29
- declare function createUnpluginResolver<TContext extends PluginContext = PluginContext>(context: TContext, options?: CreateUnpluginResolverOptions): UnpluginFactory<TContext>;
29
+ declare function createUnpluginResolver<TContext extends UnresolvedContext>(context: TContext, options?: CreateUnpluginResolverOptions): () => UnpluginOptions<TContext>;
30
30
  interface CreateUnpluginOptions extends CreateUnpluginResolverOptions {}
31
31
  /**
32
32
  * Creates a Powerlines unplugin instance.
@@ -34,9 +34,7 @@ interface CreateUnpluginOptions extends CreateUnpluginResolverOptions {}
34
34
  * @param context - The plugin context.
35
35
  * @returns The unplugin instance.
36
36
  */
37
- declare function createUnplugin<TContext extends PluginContext = PluginContext>(context: TContext, options?: CreateUnpluginOptions): UnpluginFactory<TContext>;
38
- declare type __ΩCreateUnpluginResolverOptions = any[];
39
- declare type __ΩCreateUnpluginOptions = any[];
37
+ declare function createUnplugin<TContext extends PluginContext = PluginContext>(context: TContext, options?: CreateUnpluginOptions): () => UnpluginOptions<TContext>;
40
38
  //#endregion
41
- export { CreateUnpluginOptions, CreateUnpluginResolverOptions, __ΩCreateUnpluginOptions, __ΩCreateUnpluginResolverOptions, createUnplugin, createUnpluginResolver };
39
+ export { CreateUnpluginOptions, CreateUnpluginResolverOptions, createUnplugin, createUnpluginResolver };
42
40
  //# sourceMappingURL=plugin.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.cts","names":[],"sources":["../../../src/lib/unplugin/plugin.ts"],"mappings":";;;;;UAqCiB,6BAAA,SAAsC,8CAAA;;AAAvD;;;;;;;EASE,IAAA;EAOkB;AASpB;;;;EATE,kBAAA;AAAA;;;;;;;iBASc,sBAAA,kBACG,aAAA,GAAgB,aAAA,CAAA,CAEjC,OAAA,EAAS,QAAA,EACT,OAAA,GAAS,6BAAA,GACR,eAAA,CAAgB,QAAA;AAAA,UAmCF,qBAAA,SAA8B,6BAAA;;;;;;;iBAQ/B,cAAA,kBAAgC,aAAA,GAAgB,aAAA,CAAA,CAC9D,OAAA,EAAS,QAAA,EACT,OAAA,GAAS,qBAAA,GACR,eAAA,CAAgB,QAAA;AAAA"}
1
+ {"version":3,"file":"plugin.d.cts","names":[],"sources":["../../../src/lib/unplugin/plugin.ts"],"mappings":";;;;;UAoCiB,6BAAA,SAAsC,8CAA8C;;AAArG;;;;;;;EASE,IAAA;EAOkB;AASpB;;;;EATE,kBAAA;AAAA;;;;;;;iBASc,sBAAA,kBAAwC,iBAAA,CAAA,CACtD,OAAA,EAAS,QAAA,EACT,OAAA,GAAS,6BAAA,SACF,eAAA,CAAgB,QAAA;AAAA,UA8BR,qBAAA,SAA8B,6BAA6B;;;;;AA9B3C;AA8BjC;iBAQgB,cAAA,kBAAgC,aAAA,GAAgB,aAAA,CAAA,CAC9D,OAAA,EAAS,QAAA,EACT,OAAA,GAAS,qBAAA,SACF,eAAA,CAAgB,QAAA"}
@@ -1,5 +1,5 @@
1
- import { UnpluginFactory } from "../../types/unplugin.mjs";
2
- import { PluginContext } from "../../types/context.mjs";
1
+ import { UnpluginOptions } from "../../types/unplugin.mjs";
2
+ import { PluginContext, UnresolvedContext } from "../../types/context.mjs";
3
3
  import { CreateUnpluginModuleResolutionFunctionsOptions } from "./module-resolution.mjs";
4
4
 
5
5
  //#region src/lib/unplugin/plugin.d.ts
@@ -26,7 +26,7 @@ interface CreateUnpluginResolverOptions extends CreateUnpluginModuleResolutionFu
26
26
  * @param context - The plugin context.
27
27
  * @returns The unplugin instance.
28
28
  */
29
- declare function createUnpluginResolver<TContext extends PluginContext = PluginContext>(context: TContext, options?: CreateUnpluginResolverOptions): UnpluginFactory<TContext>;
29
+ declare function createUnpluginResolver<TContext extends UnresolvedContext>(context: TContext, options?: CreateUnpluginResolverOptions): () => UnpluginOptions<TContext>;
30
30
  interface CreateUnpluginOptions extends CreateUnpluginResolverOptions {}
31
31
  /**
32
32
  * Creates a Powerlines unplugin instance.
@@ -34,9 +34,7 @@ interface CreateUnpluginOptions extends CreateUnpluginResolverOptions {}
34
34
  * @param context - The plugin context.
35
35
  * @returns The unplugin instance.
36
36
  */
37
- declare function createUnplugin<TContext extends PluginContext = PluginContext>(context: TContext, options?: CreateUnpluginOptions): UnpluginFactory<TContext>;
38
- declare type __ΩCreateUnpluginResolverOptions = any[];
39
- declare type __ΩCreateUnpluginOptions = any[];
37
+ declare function createUnplugin<TContext extends PluginContext = PluginContext>(context: TContext, options?: CreateUnpluginOptions): () => UnpluginOptions<TContext>;
40
38
  //#endregion
41
- export { CreateUnpluginOptions, CreateUnpluginResolverOptions, __ΩCreateUnpluginOptions, __ΩCreateUnpluginResolverOptions, createUnplugin, createUnpluginResolver };
39
+ export { CreateUnpluginOptions, CreateUnpluginResolverOptions, createUnplugin, createUnpluginResolver };
42
40
  //# sourceMappingURL=plugin.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.mts","names":[],"sources":["../../../src/lib/unplugin/plugin.ts"],"mappings":";;;;;UAqCiB,6BAAA,SAAsC,8CAAA;;AAAvD;;;;;;;EASE,IAAA;EAOkB;AASpB;;;;EATE,kBAAA;AAAA;;;;;;;iBASc,sBAAA,kBACG,aAAA,GAAgB,aAAA,CAAA,CAEjC,OAAA,EAAS,QAAA,EACT,OAAA,GAAS,6BAAA,GACR,eAAA,CAAgB,QAAA;AAAA,UAmCF,qBAAA,SAA8B,6BAAA;;;;;;;iBAQ/B,cAAA,kBAAgC,aAAA,GAAgB,aAAA,CAAA,CAC9D,OAAA,EAAS,QAAA,EACT,OAAA,GAAS,qBAAA,GACR,eAAA,CAAgB,QAAA;AAAA"}
1
+ {"version":3,"file":"plugin.d.mts","names":[],"sources":["../../../src/lib/unplugin/plugin.ts"],"mappings":";;;;;UAoCiB,6BAAA,SAAsC,8CAA8C;;AAArG;;;;;;;EASE,IAAA;EAOkB;AASpB;;;;EATE,kBAAA;AAAA;;;;;;;iBASc,sBAAA,kBAAwC,iBAAA,CAAA,CACtD,OAAA,EAAS,QAAA,EACT,OAAA,GAAS,6BAAA,SACF,eAAA,CAAgB,QAAA;AAAA,UA8BR,qBAAA,SAA8B,6BAA6B;;;;;AA9B3C;AA8BjC;iBAQgB,cAAA,kBAAgC,aAAA,GAAgB,aAAA,CAAA,CAC9D,OAAA,EAAS,QAAA,EACT,OAAA,GAAS,qBAAA,SACF,eAAA,CAAgB,QAAA"}
@@ -1,6 +1,6 @@
1
- import { combineContexts } from "./helpers.mjs";
2
1
  import { removeVirtualPrefix } from "../../plugin-utils/virtual.mjs";
3
2
  import "../../plugin-utils/index.mjs";
3
+ import { combineContexts } from "./helpers.mjs";
4
4
  import { createUnpluginModuleResolutionFunctions } from "./module-resolution.mjs";
5
5
  import { getString } from "../utilities/source-file.mjs";
6
6
  import { kebabCase } from "@stryke/string-format/kebab-case";
@@ -15,25 +15,22 @@ import { setParseImpl } from "unplugin";
15
15
  * @returns The unplugin instance.
16
16
  */
17
17
  function createUnpluginResolver(context, options = {}) {
18
- const ctx = context;
19
- setParseImpl(ctx.parse);
18
+ setParseImpl(context.parse);
20
19
  const name = options.name || "powerlines";
21
- return () => {
22
- const logger = ctx.extendLogger(!options.silenceHookLogging && name !== "powerlines" ? { source: name } : {});
23
- logger.debug(`Initializing ${titleCase(name)} plugin`);
24
- try {
25
- const { resolveId, load } = createUnpluginModuleResolutionFunctions(context, options);
26
- return {
27
- name: name.toLowerCase() === "powerlines" ? "powerlines" : `powerlines:${kebabCase(name)}`,
28
- api: ctx.$$internal.api,
29
- resolveId,
30
- load
31
- };
32
- } catch (error) {
33
- logger.error(error instanceof Error ? error.message : String(error));
34
- throw error;
35
- }
36
- };
20
+ const logger = context.extendLogger(!options.silenceHookLogging && name !== "powerlines" ? { source: name } : {});
21
+ logger.debug(`Initializing ${titleCase(name)} plugin`);
22
+ try {
23
+ const { resolveId, load } = createUnpluginModuleResolutionFunctions(context, options);
24
+ return () => ({
25
+ name: name.toLowerCase() === "powerlines" ? "powerlines" : `powerlines:${kebabCase(name)}`,
26
+ context,
27
+ resolveId,
28
+ load
29
+ });
30
+ } catch (error) {
31
+ logger.error(error instanceof Error ? error.message : String(error));
32
+ throw error;
33
+ }
37
34
  }
38
35
  /**
39
36
  * Creates a Powerlines unplugin instance.
@@ -42,50 +39,47 @@ function createUnpluginResolver(context, options = {}) {
42
39
  * @returns The unplugin instance.
43
40
  */
44
41
  function createUnplugin(context, options = {}) {
45
- const ctx = context;
46
- setParseImpl(ctx.parse.bind(ctx));
42
+ setParseImpl(context.parse.bind(context));
47
43
  const name = options.name || "powerlines";
48
- return () => {
49
- const logger = ctx.extendLogger(!options.silenceHookLogging && name !== "powerlines" ? { source: name } : {});
50
- logger.debug(`Initializing ${titleCase(name)} plugin`);
51
- try {
52
- const { resolveId, load } = createUnpluginModuleResolutionFunctions(context, options);
53
- async function buildStart() {
54
- if (!options.silenceHookLogging) logger.debug("Powerlines build plugin starting...");
55
- await ctx.api.callHook("buildStart", { sequential: true });
56
- }
57
- async function transform(code, id) {
58
- let transformed = code;
59
- for (const hook of ctx.environment.selectHooks("transform")) {
60
- const result = await hook.handler.apply(combineContexts(ctx, this), [getString(transformed), removeVirtualPrefix(id)]);
61
- if (result) transformed = result;
62
- }
63
- return transformed;
64
- }
65
- async function buildEnd() {
66
- if (!options.silenceHookLogging) logger.debug("Powerlines build plugin finishing...");
67
- return ctx.api.callHook("buildEnd", { sequential: true });
68
- }
69
- async function writeBundle() {
70
- if (!options.silenceHookLogging) logger.debug("Finalizing Powerlines project output...");
71
- return ctx.api.callHook("writeBundle", { sequential: true });
44
+ const logger = context.extendLogger(!options.silenceHookLogging && name !== "powerlines" ? { source: name } : {});
45
+ logger.debug(`Initializing ${titleCase(name)} plugin`);
46
+ try {
47
+ const { resolveId, load } = createUnpluginModuleResolutionFunctions(context, options);
48
+ async function buildStart() {
49
+ if (!options.silenceHookLogging) logger.debug("Powerlines build plugin starting...");
50
+ await context.callHook("buildStart", { sequential: true });
51
+ }
52
+ async function transform(code, id) {
53
+ let transformed = code;
54
+ for (const hook of context.environment.selectHooks("transform")) {
55
+ const result = await hook.handler.apply(combineContexts(context, this), [getString(transformed), removeVirtualPrefix(id)]);
56
+ if (result) transformed = result;
72
57
  }
73
- return {
74
- name: name.toLowerCase() === "powerlines" ? "powerlines" : `powerlines:${kebabCase(name)}`,
75
- api: ctx.api,
76
- resolveId,
77
- load,
78
- transform,
79
- buildStart,
80
- buildEnd,
81
- writeBundle,
82
- vite: { sharedDuringBuild: true }
83
- };
84
- } catch (error) {
85
- logger.error(error instanceof Error ? error.message : String(error));
86
- throw error;
58
+ return transformed;
59
+ }
60
+ async function buildEnd() {
61
+ if (!options.silenceHookLogging) logger.debug("Powerlines build plugin finishing...");
62
+ return context.callHook("buildEnd", { sequential: true });
63
+ }
64
+ async function writeBundle() {
65
+ if (!options.silenceHookLogging) logger.debug("Finalizing Powerlines project output...");
66
+ return context.callHook("writeBundle", { sequential: true });
87
67
  }
88
- };
68
+ return () => ({
69
+ name: name.toLowerCase() === "powerlines" ? "powerlines" : `powerlines:${kebabCase(name)}`,
70
+ context,
71
+ resolveId,
72
+ load,
73
+ transform,
74
+ buildStart,
75
+ buildEnd,
76
+ writeBundle,
77
+ vite: { sharedDuringBuild: true }
78
+ });
79
+ } catch (error) {
80
+ logger.error(error instanceof Error ? error.message : String(error));
81
+ throw error;
82
+ }
89
83
  }
90
84
 
91
85
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.mjs","names":[],"sources":["../../../src/lib/unplugin/plugin.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 { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport type {\n TransformResult,\n UnpluginBuildContext,\n UnpluginContext\n} from \"unplugin\";\nimport { setParseImpl } from \"unplugin\";\nimport { removeVirtualPrefix } from \"../../plugin-utils\";\nimport { Unstable_PluginContext } from \"../../types/_internal\";\nimport { PluginContext } from \"../../types/context\";\nimport { UnpluginFactory } from \"../../types/unplugin\";\nimport { getString } from \"../utilities/source-file\";\nimport { combineContexts } from \"./helpers\";\nimport {\n createUnpluginModuleResolutionFunctions,\n CreateUnpluginModuleResolutionFunctionsOptions\n} from \"./module-resolution\";\n\nexport interface CreateUnpluginResolverOptions extends CreateUnpluginModuleResolutionFunctionsOptions {\n /**\n * A name to use for the unplugin instance. This is used for logging and to generate the plugin name. It does not affect the functionality of the plugin.\n *\n * @remarks\n * If not provided, the plugin will be named \"powerlines\". If provided, the plugin will be named `${name} - Powerlines` (e.g., \"MyPlugin - Powerlines\").\n *\n * @defaultValue \"powerlines\"\n */\n name?: string;\n\n /**\n * Whether to silence logging for the plugin hooks. This can be useful for plugins that run frequently or have hooks that are called often, to reduce noise in the logs. When set to `true`, the plugin will not log any messages for its hooks. When set to `false` (the default), the plugin will log messages for its hooks as normal.\n *\n * @defaultValue false\n */\n silenceHookLogging?: boolean;\n}\n\n/**\n * Creates a Powerlines unplugin instance.\n *\n * @param context - The plugin context.\n * @returns The unplugin instance.\n */\nexport function createUnpluginResolver<\n TContext extends PluginContext = PluginContext\n>(\n context: TContext,\n options: CreateUnpluginResolverOptions = {}\n): UnpluginFactory<TContext> {\n const ctx = context as unknown as Unstable_PluginContext<any>;\n setParseImpl(ctx.parse);\n\n const name = options.name || \"powerlines\";\n\n return () => {\n const logger = ctx.extendLogger(\n !options.silenceHookLogging && name !== \"powerlines\"\n ? { source: name }\n : {}\n );\n logger.debug(`Initializing ${titleCase(name)} plugin`);\n\n try {\n const { resolveId, load } =\n createUnpluginModuleResolutionFunctions<TContext>(context, options);\n\n return {\n name:\n name.toLowerCase() === \"powerlines\"\n ? \"powerlines\"\n : `powerlines:${kebabCase(name)}`,\n api: ctx.$$internal.api,\n resolveId,\n load\n };\n } catch (error) {\n logger.error(error instanceof Error ? error.message : String(error));\n\n throw error;\n }\n };\n}\n\nexport interface CreateUnpluginOptions extends CreateUnpluginResolverOptions {}\n\n/**\n * Creates a Powerlines unplugin instance.\n *\n * @param context - The plugin context.\n * @returns The unplugin instance.\n */\nexport function createUnplugin<TContext extends PluginContext = PluginContext>(\n context: TContext,\n options: CreateUnpluginOptions = {}\n): UnpluginFactory<TContext> {\n const ctx = context as unknown as Unstable_PluginContext;\n setParseImpl(ctx.parse.bind(ctx));\n\n const name = options.name || \"powerlines\";\n\n return () => {\n const logger = ctx.extendLogger(\n !options.silenceHookLogging && name !== \"powerlines\"\n ? { source: name }\n : {}\n );\n logger.debug(`Initializing ${titleCase(name)} plugin`);\n\n try {\n const { resolveId, load } =\n createUnpluginModuleResolutionFunctions<TContext>(context, options);\n\n async function buildStart(this: UnpluginBuildContext) {\n if (!options.silenceHookLogging) {\n logger.debug(\"Powerlines build plugin starting...\");\n }\n\n await ctx.api.callHook(\"buildStart\", {\n sequential: true\n });\n }\n\n async function transform(\n this: UnpluginBuildContext & UnpluginContext,\n code: string,\n id: string\n ): Promise<TransformResult | null | undefined> {\n let transformed: TransformResult | string = code;\n\n for (const hook of ctx.environment.selectHooks(\"transform\")) {\n const result: TransformResult | string | undefined =\n await hook.handler.apply(combineContexts(ctx, this), [\n getString(transformed),\n removeVirtualPrefix(id)\n ] as [code: string, id: string]);\n if (result) {\n transformed = result;\n }\n }\n\n return transformed;\n }\n\n async function buildEnd(this: UnpluginBuildContext): Promise<void> {\n if (!options.silenceHookLogging) {\n logger.debug(\"Powerlines build plugin finishing...\");\n }\n\n return ctx.api.callHook(\"buildEnd\", {\n sequential: true\n });\n }\n\n async function writeBundle(): Promise<void> {\n if (!options.silenceHookLogging) {\n logger.debug(\"Finalizing Powerlines project output...\");\n }\n\n return ctx.api.callHook(\"writeBundle\", {\n sequential: true\n });\n }\n\n return {\n name:\n name.toLowerCase() === \"powerlines\"\n ? \"powerlines\"\n : `powerlines:${kebabCase(name)}`,\n api: ctx.api,\n resolveId,\n load,\n transform,\n buildStart,\n buildEnd,\n writeBundle,\n vite: {\n sharedDuringBuild: true\n }\n };\n } catch (error) {\n logger.error(error instanceof Error ? error.message : String(error));\n\n throw error;\n }\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA8DA,SAAgB,uBAGd,SACA,UAAyC,EAAE,EAChB;CAC3B,MAAM,MAAM;AACZ,cAAa,IAAI,MAAM;CAEvB,MAAM,OAAO,QAAQ,QAAQ;AAE7B,cAAa;EACX,MAAM,SAAS,IAAI,aACjB,CAAC,QAAQ,sBAAsB,SAAS,eACpC,EAAE,QAAQ,MAAM,GAChB,EAAE,CACP;AACD,SAAO,MAAM,gBAAgB,UAAU,KAAK,CAAC,SAAS;AAEtD,MAAI;GACF,MAAM,EAAE,WAAW,SACjB,wCAAkD,SAAS,QAAQ;AAErE,UAAO;IACL,MACE,KAAK,aAAa,KAAK,eACnB,eACA,cAAc,UAAU,KAAK;IACnC,KAAK,IAAI,WAAW;IACpB;IACA;IACD;WACM,OAAO;AACd,UAAO,MAAM,iBAAiB,QAAQ,MAAM,UAAU,OAAO,MAAM,CAAC;AAEpE,SAAM;;;;;;;;;;AAaZ,SAAgB,eACd,SACA,UAAiC,EAAE,EACR;CAC3B,MAAM,MAAM;AACZ,cAAa,IAAI,MAAM,KAAK,IAAI,CAAC;CAEjC,MAAM,OAAO,QAAQ,QAAQ;AAE7B,cAAa;EACX,MAAM,SAAS,IAAI,aACjB,CAAC,QAAQ,sBAAsB,SAAS,eACpC,EAAE,QAAQ,MAAM,GAChB,EAAE,CACP;AACD,SAAO,MAAM,gBAAgB,UAAU,KAAK,CAAC,SAAS;AAEtD,MAAI;GACF,MAAM,EAAE,WAAW,SACjB,wCAAkD,SAAS,QAAQ;GAErE,eAAe,aAAuC;AACpD,QAAI,CAAC,QAAQ,mBACX,QAAO,MAAM,sCAAsC;AAGrD,UAAM,IAAI,IAAI,SAAS,cAAc,EACnC,YAAY,MACb,CAAC;;GAGJ,eAAe,UAEb,MACA,IAC6C;IAC7C,IAAI,cAAwC;AAE5C,SAAK,MAAM,QAAQ,IAAI,YAAY,YAAY,YAAY,EAAE;KAC3D,MAAM,SACJ,MAAM,KAAK,QAAQ,MAAM,gBAAgB,KAAK,KAAK,EAAE,CACnD,UAAU,YAAY,EACtB,oBAAoB,GAAG,CACxB,CAA+B;AAClC,SAAI,OACF,eAAc;;AAIlB,WAAO;;GAGT,eAAe,WAAoD;AACjE,QAAI,CAAC,QAAQ,mBACX,QAAO,MAAM,uCAAuC;AAGtD,WAAO,IAAI,IAAI,SAAS,YAAY,EAClC,YAAY,MACb,CAAC;;GAGJ,eAAe,cAA6B;AAC1C,QAAI,CAAC,QAAQ,mBACX,QAAO,MAAM,0CAA0C;AAGzD,WAAO,IAAI,IAAI,SAAS,eAAe,EACrC,YAAY,MACb,CAAC;;AAGJ,UAAO;IACL,MACE,KAAK,aAAa,KAAK,eACnB,eACA,cAAc,UAAU,KAAK;IACnC,KAAK,IAAI;IACT;IACA;IACA;IACA;IACA;IACA;IACA,MAAM,EACJ,mBAAmB,MACpB;IACF;WACM,OAAO;AACd,UAAO,MAAM,iBAAiB,QAAQ,MAAM,UAAU,OAAO,MAAM,CAAC;AAEpE,SAAM"}
1
+ {"version":3,"file":"plugin.mjs","names":[],"sources":["../../../src/lib/unplugin/plugin.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 { kebabCase } from \"@stryke/string-format/kebab-case\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport type {\n TransformResult,\n UnpluginBuildContext,\n UnpluginContext\n} from \"unplugin\";\nimport { setParseImpl } from \"unplugin\";\nimport { removeVirtualPrefix } from \"../../plugin-utils\";\nimport type { PluginContext, UnresolvedContext } from \"../../types/context\";\nimport type { UnpluginOptions } from \"../../types/unplugin\";\nimport { getString } from \"../utilities/source-file\";\nimport { combineContexts } from \"./helpers\";\nimport {\n createUnpluginModuleResolutionFunctions,\n CreateUnpluginModuleResolutionFunctionsOptions\n} from \"./module-resolution\";\n\nexport interface CreateUnpluginResolverOptions extends CreateUnpluginModuleResolutionFunctionsOptions {\n /**\n * A name to use for the unplugin instance. This is used for logging and to generate the plugin name. It does not affect the functionality of the plugin.\n *\n * @remarks\n * If not provided, the plugin will be named \"powerlines\". If provided, the plugin will be named `${name} - Powerlines` (e.g., \"MyPlugin - Powerlines\").\n *\n * @defaultValue \"powerlines\"\n */\n name?: string;\n\n /**\n * Whether to silence logging for the plugin hooks. This can be useful for plugins that run frequently or have hooks that are called often, to reduce noise in the logs. When set to `true`, the plugin will not log any messages for its hooks. When set to `false` (the default), the plugin will log messages for its hooks as normal.\n *\n * @defaultValue false\n */\n silenceHookLogging?: boolean;\n}\n\n/**\n * Creates a Powerlines unplugin instance.\n *\n * @param context - The plugin context.\n * @returns The unplugin instance.\n */\nexport function createUnpluginResolver<TContext extends UnresolvedContext>(\n context: TContext,\n options: CreateUnpluginResolverOptions = {}\n): () => UnpluginOptions<TContext> {\n setParseImpl(context.parse);\n\n const name = options.name || \"powerlines\";\n\n const logger = context.extendLogger(\n !options.silenceHookLogging && name !== \"powerlines\" ? { source: name } : {}\n );\n logger.debug(`Initializing ${titleCase(name)} plugin`);\n\n try {\n const { resolveId, load } =\n createUnpluginModuleResolutionFunctions<TContext>(context, options);\n\n return () => ({\n name:\n name.toLowerCase() === \"powerlines\"\n ? \"powerlines\"\n : `powerlines:${kebabCase(name)}`,\n context,\n resolveId,\n load\n });\n } catch (error) {\n logger.error(error instanceof Error ? error.message : String(error));\n\n throw error;\n }\n}\n\nexport interface CreateUnpluginOptions extends CreateUnpluginResolverOptions {}\n\n/**\n * Creates a Powerlines unplugin instance.\n *\n * @param context - The plugin context.\n * @returns The unplugin instance.\n */\nexport function createUnplugin<TContext extends PluginContext = PluginContext>(\n context: TContext,\n options: CreateUnpluginOptions = {}\n): () => UnpluginOptions<TContext> {\n setParseImpl(context.parse.bind(context));\n\n const name = options.name || \"powerlines\";\n\n const logger = context.extendLogger(\n !options.silenceHookLogging && name !== \"powerlines\" ? { source: name } : {}\n );\n logger.debug(`Initializing ${titleCase(name)} plugin`);\n\n try {\n const { resolveId, load } =\n createUnpluginModuleResolutionFunctions<TContext>(context, options);\n\n async function buildStart(this: UnpluginBuildContext) {\n if (!options.silenceHookLogging) {\n logger.debug(\"Powerlines build plugin starting...\");\n }\n\n await context.callHook(\"buildStart\", {\n sequential: true\n });\n }\n\n async function transform(\n this: UnpluginBuildContext & UnpluginContext,\n code: string,\n id: string\n ): Promise<TransformResult | null | undefined> {\n let transformed: TransformResult | string = code;\n\n for (const hook of context.environment.selectHooks(\"transform\")) {\n const result: TransformResult | string | undefined =\n await hook.handler.apply(combineContexts(context, this), [\n getString(transformed),\n removeVirtualPrefix(id)\n ] as [code: string, id: string]);\n if (result) {\n transformed = result;\n }\n }\n\n return transformed;\n }\n\n async function buildEnd(this: UnpluginBuildContext): Promise<void> {\n if (!options.silenceHookLogging) {\n logger.debug(\"Powerlines build plugin finishing...\");\n }\n\n return context.callHook(\"buildEnd\", {\n sequential: true\n });\n }\n\n async function writeBundle(): Promise<void> {\n if (!options.silenceHookLogging) {\n logger.debug(\"Finalizing Powerlines project output...\");\n }\n\n return context.callHook(\"writeBundle\", {\n sequential: true\n });\n }\n\n return () => ({\n name:\n name.toLowerCase() === \"powerlines\"\n ? \"powerlines\"\n : `powerlines:${kebabCase(name)}`,\n context,\n resolveId,\n load,\n transform,\n buildStart,\n buildEnd,\n writeBundle,\n vite: {\n sharedDuringBuild: true\n }\n });\n } catch (error) {\n logger.error(error instanceof Error ? error.message : String(error));\n\n throw error;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA6DA,SAAgB,uBACd,SACA,UAAyC,CAAC,GACT;CACjC,aAAa,QAAQ,KAAK;CAE1B,MAAM,OAAO,QAAQ,QAAQ;CAE7B,MAAM,SAAS,QAAQ,aACrB,CAAC,QAAQ,sBAAsB,SAAS,eAAe,EAAE,QAAQ,KAAK,IAAI,CAAC,CAC7E;CACA,OAAO,MAAM,gBAAgB,UAAU,IAAI,EAAE,QAAQ;CAErD,IAAI;EACF,MAAM,EAAE,WAAW,SACjB,wCAAkD,SAAS,OAAO;EAEpE,cAAc;GACZ,MACE,KAAK,YAAY,MAAM,eACnB,eACA,cAAc,UAAU,IAAI;GAClC;GACA;GACA;EACF;CACF,SAAS,OAAO;EACd,OAAO,MAAM,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CAAC;EAEnE,MAAM;CACR;AACF;;;;;;;AAUA,SAAgB,eACd,SACA,UAAiC,CAAC,GACD;CACjC,aAAa,QAAQ,MAAM,KAAK,OAAO,CAAC;CAExC,MAAM,OAAO,QAAQ,QAAQ;CAE7B,MAAM,SAAS,QAAQ,aACrB,CAAC,QAAQ,sBAAsB,SAAS,eAAe,EAAE,QAAQ,KAAK,IAAI,CAAC,CAC7E;CACA,OAAO,MAAM,gBAAgB,UAAU,IAAI,EAAE,QAAQ;CAErD,IAAI;EACF,MAAM,EAAE,WAAW,SACjB,wCAAkD,SAAS,OAAO;EAEpE,eAAe,aAAuC;GACpD,IAAI,CAAC,QAAQ,oBACX,OAAO,MAAM,qCAAqC;GAGpD,MAAM,QAAQ,SAAS,cAAc,EACnC,YAAY,KACd,CAAC;EACH;EAEA,eAAe,UAEb,MACA,IAC6C;GAC7C,IAAI,cAAwC;GAE5C,KAAK,MAAM,QAAQ,QAAQ,YAAY,YAAY,WAAW,GAAG;IAC/D,MAAM,SACJ,MAAM,KAAK,QAAQ,MAAM,gBAAgB,SAAS,IAAI,GAAG,CACvD,UAAU,WAAW,GACrB,oBAAoB,EAAE,CACxB,CAA+B;IACjC,IAAI,QACF,cAAc;GAElB;GAEA,OAAO;EACT;EAEA,eAAe,WAAoD;GACjE,IAAI,CAAC,QAAQ,oBACX,OAAO,MAAM,sCAAsC;GAGrD,OAAO,QAAQ,SAAS,YAAY,EAClC,YAAY,KACd,CAAC;EACH;EAEA,eAAe,cAA6B;GAC1C,IAAI,CAAC,QAAQ,oBACX,OAAO,MAAM,yCAAyC;GAGxD,OAAO,QAAQ,SAAS,eAAe,EACrC,YAAY,KACd,CAAC;EACH;EAEA,cAAc;GACZ,MACE,KAAK,YAAY,MAAM,eACnB,eACA,cAAc,UAAU,IAAI;GAClC;GACA;GACA;GACA;GACA;GACA;GACA;GACA,MAAM,EACJ,mBAAmB,KACrB;EACF;CACF,SAAS,OAAO;EACd,OAAO,MAAM,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CAAC;EAEnE,MAAM;CACR;AACF"}
@@ -1,5 +1,4 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
3
2
  let _stryke_string_format_title_case = require("@stryke/string-format/title-case");
4
3
 
5
4
  //#region src/lib/utilities/file-header.ts
@@ -20,7 +19,7 @@ function getFileHeaderWarningText(overwrite = true, framework = "powerlines") {
20
19
  * @returns A string containing the file header warning message.
21
20
  */
22
21
  function getFileHeaderWarning(context) {
23
- return getFileHeaderWarningText(context.config.output?.overwrite, context.config.framework);
22
+ return getFileHeaderWarningText(context.config.output?.overwrite, context.config.framework?.name);
24
23
  }
25
24
  /**
26
25
  * Generates a file header comment for a generated source file, including a warning about automatic overwriting.
@@ -31,7 +30,7 @@ function getFileHeaderWarning(context) {
31
30
  */
32
31
  function getFileHeader(context, comment = "//") {
33
32
  return `
34
- ${comment} Generated by ${(0, _stryke_string_format_title_case.titleCase)(context.config.framework) || "Powerlines"}
33
+ ${comment} Generated by ${(0, _stryke_string_format_title_case.titleCase)(context.config.framework?.name) || "Powerlines"}
35
34
  ${comment} ${getFileHeaderWarning(context)}
36
35
  `;
37
36
  }
@@ -36,7 +36,6 @@ declare function getFileHeader(context: Context, comment?: string): string;
36
36
  * @returns A string containing the file header comment for a TypeScript file.
37
37
  */
38
38
  declare function getTypescriptFileHeader(context: Context, options?: FileHeaderOptions): string;
39
- declare type __ΩFileHeaderOptions = any[];
40
39
  //#endregion
41
- export { FileHeaderOptions, __ΩFileHeaderOptions, getFileHeader, getFileHeaderWarning, getFileHeaderWarningText, getTypescriptFileHeader };
40
+ export { FileHeaderOptions, getFileHeader, getFileHeaderWarning, getFileHeaderWarningText, getTypescriptFileHeader };
42
41
  //# sourceMappingURL=file-header.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"file-header.d.cts","names":[],"sources":["../../../src/lib/utilities/file-header.ts"],"mappings":";;;UAqBiB,iBAAA;EACf,SAAA;EACA,cAAA;AAAA;;;;AAUF;;;;iBAAgB,wBAAA,CACd,SAAA,YACA,SAAA;AAaF;;;;;AAcA;AAdA,iBAAgB,oBAAA,CAAqB,OAAA,EAAS,OAAA;;;;;;;;iBAc9B,aAAA,CAAc,OAAA,EAAS,OAAA,EAAS,OAAA;;;;;;;;iBAchC,uBAAA,CACd,OAAA,EAAS,OAAA,EACT,OAAA,GAAS,iBAAA;AAAA"}
1
+ {"version":3,"file":"file-header.d.cts","names":[],"sources":["../../../src/lib/utilities/file-header.ts"],"mappings":";;;UAqBiB,iBAAA;EACf,SAAA;EACA,cAAc;AAAA;;;AAAA;AAUhB;;;;iBAAgB,wBAAA,CACd,SAAA,YACA,SAAwB;AAa1B;;;;AAAqD;AAcrD;AAdA,iBAAgB,oBAAA,CAAqB,OAAgB,EAAP,OAAO;;;;;;;AAcS;iBAA9C,aAAA,CAAc,OAAA,EAAS,OAAO,EAAE,OAAA;;;;;;;;iBAchC,uBAAA,CACd,OAAA,EAAS,OAAA,EACT,OAAA,GAAS,iBAAsB"}
@@ -36,7 +36,6 @@ declare function getFileHeader(context: Context, comment?: string): string;
36
36
  * @returns A string containing the file header comment for a TypeScript file.
37
37
  */
38
38
  declare function getTypescriptFileHeader(context: Context, options?: FileHeaderOptions): string;
39
- declare type __ΩFileHeaderOptions = any[];
40
39
  //#endregion
41
- export { FileHeaderOptions, __ΩFileHeaderOptions, getFileHeader, getFileHeaderWarning, getFileHeaderWarningText, getTypescriptFileHeader };
40
+ export { FileHeaderOptions, getFileHeader, getFileHeaderWarning, getFileHeaderWarningText, getTypescriptFileHeader };
42
41
  //# sourceMappingURL=file-header.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"file-header.d.mts","names":[],"sources":["../../../src/lib/utilities/file-header.ts"],"mappings":";;;UAqBiB,iBAAA;EACf,SAAA;EACA,cAAA;AAAA;;;;AAUF;;;;iBAAgB,wBAAA,CACd,SAAA,YACA,SAAA;AAaF;;;;;AAcA;AAdA,iBAAgB,oBAAA,CAAqB,OAAA,EAAS,OAAA;;;;;;;;iBAc9B,aAAA,CAAc,OAAA,EAAS,OAAA,EAAS,OAAA;;;;;;;;iBAchC,uBAAA,CACd,OAAA,EAAS,OAAA,EACT,OAAA,GAAS,iBAAA;AAAA"}
1
+ {"version":3,"file":"file-header.d.mts","names":[],"sources":["../../../src/lib/utilities/file-header.ts"],"mappings":";;;UAqBiB,iBAAA;EACf,SAAA;EACA,cAAc;AAAA;;;AAAA;AAUhB;;;;iBAAgB,wBAAA,CACd,SAAA,YACA,SAAwB;AAa1B;;;;AAAqD;AAcrD;AAdA,iBAAgB,oBAAA,CAAqB,OAAgB,EAAP,OAAO;;;;;;;AAcS;iBAA9C,aAAA,CAAc,OAAA,EAAS,OAAO,EAAE,OAAA;;;;;;;;iBAchC,uBAAA,CACd,OAAA,EAAS,OAAA,EACT,OAAA,GAAS,iBAAsB"}
@@ -18,7 +18,7 @@ function getFileHeaderWarningText(overwrite = true, framework = "powerlines") {
18
18
  * @returns A string containing the file header warning message.
19
19
  */
20
20
  function getFileHeaderWarning(context) {
21
- return getFileHeaderWarningText(context.config.output?.overwrite, context.config.framework);
21
+ return getFileHeaderWarningText(context.config.output?.overwrite, context.config.framework?.name);
22
22
  }
23
23
  /**
24
24
  * Generates a file header comment for a generated source file, including a warning about automatic overwriting.
@@ -29,7 +29,7 @@ function getFileHeaderWarning(context) {
29
29
  */
30
30
  function getFileHeader(context, comment = "//") {
31
31
  return `
32
- ${comment} Generated by ${titleCase(context.config.framework) || "Powerlines"}
32
+ ${comment} Generated by ${titleCase(context.config.framework?.name) || "Powerlines"}
33
33
  ${comment} ${getFileHeaderWarning(context)}
34
34
  `;
35
35
  }
@@ -1 +1 @@
1
- {"version":3,"file":"file-header.mjs","names":[],"sources":["../../../src/lib/utilities/file-header.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 { titleCase } from \"@stryke/string-format/title-case\";\nimport { Context } from \"../../types/context\";\n\nexport interface FileHeaderOptions {\n directive?: string | null;\n prettierIgnore?: boolean;\n}\n\n/**\n * Generates a file header comment with a warning about automatic overwriting.\n *\n * @param overwrite - Whether the file will be automatically overwritten. If `false`, the warning will indicate that the file will not be overwritten. If `true` or omitted, the warning will indicate that the file will be overwritten.\n * @param framework - The name of the framework to include in the warning message. Defaults to \"powerlines\".\n * @returns A string containing the file header warning message.\n */\nexport function getFileHeaderWarningText(\n overwrite = true,\n framework = \"powerlines\"\n): string {\n return overwrite !== false\n ? `Do not edit this file manually - it will be overwritten automatically. Automatic overwrites can be disabled by using the \\`output.overwrite\\` option.`\n : `This file was generated on ${new Date().toLocaleString()} - it will not be overwritten by ${titleCase(framework)} while the \\`output.overwrite\\` option is set to \\`true\\`.`;\n}\n\n/**\n * Generates a file header warning message based on the provided context.\n *\n * @param context - The Powerlines context.\n * @returns A string containing the file header warning message.\n */\nexport function getFileHeaderWarning(context: Context): string {\n return getFileHeaderWarningText(\n context.config.output?.overwrite,\n context.config.framework\n );\n}\n\n/**\n * Generates a file header comment for a generated source file, including a warning about automatic overwriting.\n *\n * @param context - The Powerlines context.\n * @param comment - The comment syntax to use for the header (e.g., `//` for JavaScript/TypeScript, `#` for Python). Defaults to `//`.\n * @returns A string containing the file header comment.\n */\nexport function getFileHeader(context: Context, comment = \"//\"): string {\n return `\n${comment} Generated by ${titleCase(context.config.framework) || \"Powerlines\"}\n${comment} ${getFileHeaderWarning(context)}\n`;\n}\n\n/**\n * Generates a file header comment for a generated TypeScript source file, including a warning about automatic overwriting.\n *\n * @param context - The Powerlines context.\n * @param options - Additional options for generating the file header, such as a directive to include and whether to add a Prettier ignore comment.\n * @returns A string containing the file header comment for a TypeScript file.\n */\nexport function getTypescriptFileHeader(\n context: Context,\n options: FileHeaderOptions = {}\n): string {\n const { directive = null, prettierIgnore = false } = options;\n\n return `/* eslint-disable */\n// biome-ignore lint: disable\n${prettierIgnore ? `// prettier-ignore` : \"\"}${directive ? `\\n\\n${directive}\\n` : \"\\n\"}\n${getFileHeader(context)}\n\n`;\n}\n"],"mappings":";;;;;;;;;;AAiCA,SAAgB,yBACd,YAAY,MACZ,YAAY,cACJ;AACR,QAAO,cAAc,QACjB,0JACA,+CAA8B,IAAI,MAAM,EAAC,gBAAgB,CAAC,mCAAmC,UAAU,UAAU,CAAC;;;;;;;;AASxH,SAAgB,qBAAqB,SAA0B;AAC7D,QAAO,yBACL,QAAQ,OAAO,QAAQ,WACvB,QAAQ,OAAO,UAChB;;;;;;;;;AAUH,SAAgB,cAAc,SAAkB,UAAU,MAAc;AACtE,QAAO;EACP,QAAQ,gBAAgB,UAAU,QAAQ,OAAO,UAAU,IAAI,aAAa;EAC5E,QAAQ,GAAG,qBAAqB,QAAQ,CAAC;;;;;;;;;;AAW3C,SAAgB,wBACd,SACA,UAA6B,EAAE,EACvB;CACR,MAAM,EAAE,YAAY,MAAM,iBAAiB,UAAU;AAErD,QAAO;;EAEP,iBAAiB,uBAAuB,KAAK,YAAY,OAAO,UAAU,MAAM,KAAK;EACrF,cAAc,QAAQ,CAAC"}
1
+ {"version":3,"file":"file-header.mjs","names":[],"sources":["../../../src/lib/utilities/file-header.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 { titleCase } from \"@stryke/string-format/title-case\";\nimport { Context } from \"../../types/context\";\n\nexport interface FileHeaderOptions {\n directive?: string | null;\n prettierIgnore?: boolean;\n}\n\n/**\n * Generates a file header comment with a warning about automatic overwriting.\n *\n * @param overwrite - Whether the file will be automatically overwritten. If `false`, the warning will indicate that the file will not be overwritten. If `true` or omitted, the warning will indicate that the file will be overwritten.\n * @param framework - The name of the framework to include in the warning message. Defaults to \"powerlines\".\n * @returns A string containing the file header warning message.\n */\nexport function getFileHeaderWarningText(\n overwrite = true,\n framework = \"powerlines\"\n): string {\n return overwrite !== false\n ? `Do not edit this file manually - it will be overwritten automatically. Automatic overwrites can be disabled by using the \\`output.overwrite\\` option.`\n : `This file was generated on ${new Date().toLocaleString()} - it will not be overwritten by ${titleCase(framework)} while the \\`output.overwrite\\` option is set to \\`true\\`.`;\n}\n\n/**\n * Generates a file header warning message based on the provided context.\n *\n * @param context - The Powerlines context.\n * @returns A string containing the file header warning message.\n */\nexport function getFileHeaderWarning(context: Context): string {\n return getFileHeaderWarningText(\n context.config.output?.overwrite,\n context.config.framework?.name\n );\n}\n\n/**\n * Generates a file header comment for a generated source file, including a warning about automatic overwriting.\n *\n * @param context - The Powerlines context.\n * @param comment - The comment syntax to use for the header (e.g., `//` for JavaScript/TypeScript, `#` for Python). Defaults to `//`.\n * @returns A string containing the file header comment.\n */\nexport function getFileHeader(context: Context, comment = \"//\"): string {\n return `\n${comment} Generated by ${titleCase(context.config.framework?.name) || \"Powerlines\"}\n${comment} ${getFileHeaderWarning(context)}\n`;\n}\n\n/**\n * Generates a file header comment for a generated TypeScript source file, including a warning about automatic overwriting.\n *\n * @param context - The Powerlines context.\n * @param options - Additional options for generating the file header, such as a directive to include and whether to add a Prettier ignore comment.\n * @returns A string containing the file header comment for a TypeScript file.\n */\nexport function getTypescriptFileHeader(\n context: Context,\n options: FileHeaderOptions = {}\n): string {\n const { directive = null, prettierIgnore = false } = options;\n\n return `/* eslint-disable */\n// biome-ignore lint: disable\n${prettierIgnore ? `// prettier-ignore` : \"\"}${directive ? `\\n\\n${directive}\\n` : \"\\n\"}\n${getFileHeader(context)}\n\n`;\n}\n"],"mappings":";;;;;;;;;;AAiCA,SAAgB,yBACd,YAAY,MACZ,YAAY,cACJ;CACR,OAAO,cAAc,QACjB,0JACA,+CAA8B,IAAI,KAAK,GAAE,eAAe,EAAE,mCAAmC,UAAU,SAAS,EAAE;AACxH;;;;;;;AAQA,SAAgB,qBAAqB,SAA0B;CAC7D,OAAO,yBACL,QAAQ,OAAO,QAAQ,WACvB,QAAQ,OAAO,WAAW,IAC5B;AACF;;;;;;;;AASA,SAAgB,cAAc,SAAkB,UAAU,MAAc;CACtE,OAAO;EACP,QAAQ,gBAAgB,UAAU,QAAQ,OAAO,WAAW,IAAI,KAAK,aAAa;EAClF,QAAQ,GAAG,qBAAqB,OAAO,EAAE;;AAE3C;;;;;;;;AASA,SAAgB,wBACd,SACA,UAA6B,CAAC,GACtB;CACR,MAAM,EAAE,YAAY,MAAM,iBAAiB,UAAU;CAErD,OAAO;;EAEP,iBAAiB,uBAAuB,KAAK,YAAY,OAAO,UAAU,MAAM,KAAK;EACrF,cAAc,OAAO,EAAE;;;AAGzB"}
@@ -1,9 +1,9 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
3
3
  let _stryke_path_append = require("@stryke/path/append");
4
+ let _stryke_path_file_path_fns = require("@stryke/path/file-path-fns");
4
5
  let defu = require("defu");
5
6
  let _stryke_fs_list_files = require("@stryke/fs/list-files");
6
- let _stryke_path_file_path_fns = require("@stryke/path/file-path-fns");
7
7
  let _stryke_path_is_parent_path = require("@stryke/path/is-parent-path");
8
8
  let prettier = require("prettier");
9
9
  let prettier_plugin_organize_imports = require("prettier-plugin-organize-imports");
@@ -1 +1 @@
1
- {"version":3,"file":"format.d.cts","names":[],"sources":["../../../src/lib/utilities/format.ts"],"mappings":";;;;;AAoCA;;;;;;;iBAAsB,MAAA,CACpB,OAAA,EAAS,OAAA,EACT,IAAA,UACA,IAAA,UACA,KAAA,aACC,OAAA;;;;;AAoDH;;;iBAAsB,YAAA,CAAa,OAAA,EAAS,OAAA,EAAS,IAAA,WAAY,OAAA"}
1
+ {"version":3,"file":"format.d.cts","names":[],"sources":["../../../src/lib/utilities/format.ts"],"mappings":";;;;;AAoCA;;;;;;;iBAAsB,MAAA,CACpB,OAAA,EAAS,OAAA,EACT,IAAA,UACA,IAAA,UACA,KAAA,aACC,OAAO;;;;AAAA;AAoDV;;;iBAAsB,YAAA,CAAa,OAAA,EAAS,OAAA,EAAS,IAAA,WAAY,OAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"format.d.mts","names":[],"sources":["../../../src/lib/utilities/format.ts"],"mappings":";;;;;AAoCA;;;;;;;iBAAsB,MAAA,CACpB,OAAA,EAAS,OAAA,EACT,IAAA,UACA,IAAA,UACA,KAAA,aACC,OAAA;;;;;AAoDH;;;iBAAsB,YAAA,CAAa,OAAA,EAAS,OAAA,EAAS,IAAA,WAAY,OAAA"}
1
+ {"version":3,"file":"format.d.mts","names":[],"sources":["../../../src/lib/utilities/format.ts"],"mappings":";;;;;AAoCA;;;;;;;iBAAsB,MAAA,CACpB,OAAA,EAAS,OAAA,EACT,IAAA,UACA,IAAA,UACA,KAAA,aACC,OAAO;;;;AAAA;AAoDV;;;iBAAsB,YAAA,CAAa,OAAA,EAAS,OAAA,EAAS,IAAA,WAAY,OAAA"}
@@ -1,7 +1,7 @@
1
1
  import { appendPath } from "@stryke/path/append";
2
+ import { findFileExtension } from "@stryke/path/file-path-fns";
2
3
  import { defu as defu$1 } from "defu";
3
4
  import { listFiles } from "@stryke/fs/list-files";
4
- import { findFileExtension } from "@stryke/path/file-path-fns";
5
5
  import { isParentPath } from "@stryke/path/is-parent-path";
6
6
  import { format as format$1, resolveConfig } from "prettier";
7
7
  import importsPlugin from "prettier-plugin-organize-imports";