@powerlines/core 0.9.1 → 0.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (432) hide show
  1. package/dist/constants/api.cjs +18 -0
  2. package/dist/constants/api.d.cts +6 -0
  3. package/dist/constants/api.d.cts.map +1 -0
  4. package/dist/constants/api.d.mts +6 -0
  5. package/dist/constants/api.d.mts.map +1 -0
  6. package/dist/constants/api.mjs +16 -0
  7. package/dist/constants/api.mjs.map +1 -0
  8. package/dist/constants/commands.cjs +3 -11
  9. package/dist/constants/commands.d.cts +1 -1
  10. package/dist/constants/commands.d.cts.map +1 -1
  11. package/dist/constants/commands.d.mts +1 -1
  12. package/dist/constants/commands.d.mts.map +1 -1
  13. package/dist/constants/commands.mjs +3 -11
  14. package/dist/constants/commands.mjs.map +1 -1
  15. package/dist/constants/devtools.cjs +23 -0
  16. package/dist/constants/devtools.d.cts +13 -0
  17. package/dist/constants/devtools.d.cts.map +1 -0
  18. package/dist/constants/devtools.d.mts +13 -0
  19. package/dist/constants/devtools.d.mts.map +1 -0
  20. package/dist/constants/devtools.mjs +14 -0
  21. package/dist/constants/devtools.mjs.map +1 -0
  22. package/dist/constants/environments.cjs +1 -0
  23. package/dist/constants/extensions.cjs +21 -0
  24. package/dist/constants/extensions.d.cts +5 -0
  25. package/dist/constants/extensions.d.cts.map +1 -0
  26. package/dist/constants/extensions.d.mts +5 -0
  27. package/dist/constants/extensions.d.mts.map +1 -0
  28. package/dist/constants/extensions.mjs +20 -0
  29. package/dist/constants/extensions.mjs.map +1 -0
  30. package/dist/constants/fs.cjs +1 -0
  31. package/dist/constants/hooks.cjs +1 -0
  32. package/dist/constants/index.cjs +48 -24
  33. package/dist/constants/index.d.cts +5 -1
  34. package/dist/constants/index.d.mts +5 -1
  35. package/dist/constants/index.mjs +6 -2
  36. package/dist/constants/log-level.cjs +90 -0
  37. package/dist/constants/log-level.d.cts +63 -0
  38. package/dist/constants/log-level.d.cts.map +1 -0
  39. package/dist/constants/log-level.d.mts +63 -0
  40. package/dist/constants/log-level.d.mts.map +1 -0
  41. package/dist/constants/log-level.mjs +82 -0
  42. package/dist/constants/log-level.mjs.map +1 -0
  43. package/dist/constants/meta.cjs +1 -0
  44. package/dist/constants/plugin.cjs +3 -2
  45. package/dist/constants/plugin.d.cts +2 -2
  46. package/dist/constants/plugin.d.mts +2 -2
  47. package/dist/context/base-context.cjs +127 -0
  48. package/dist/context/base-context.d.cts +81 -0
  49. package/dist/context/base-context.d.cts.map +1 -0
  50. package/dist/context/base-context.d.mts +81 -0
  51. package/dist/context/base-context.d.mts.map +1 -0
  52. package/dist/context/base-context.mjs +125 -0
  53. package/dist/context/base-context.mjs.map +1 -0
  54. package/dist/context/context.cjs +934 -0
  55. package/dist/context/context.d.cts +369 -0
  56. package/dist/context/context.d.cts.map +1 -0
  57. package/dist/context/context.d.mts +369 -0
  58. package/dist/context/context.d.mts.map +1 -0
  59. package/dist/context/context.mjs +932 -0
  60. package/dist/context/context.mjs.map +1 -0
  61. package/dist/context/environment-context.cjs +219 -0
  62. package/dist/context/environment-context.d.cts +100 -0
  63. package/dist/context/environment-context.d.cts.map +1 -0
  64. package/dist/context/environment-context.d.mts +100 -0
  65. package/dist/context/environment-context.d.mts.map +1 -0
  66. package/dist/context/environment-context.mjs +218 -0
  67. package/dist/context/environment-context.mjs.map +1 -0
  68. package/dist/context/execution-context.cjs +230 -0
  69. package/dist/context/execution-context.d.cts +101 -0
  70. package/dist/context/execution-context.d.cts.map +1 -0
  71. package/dist/context/execution-context.d.mts +101 -0
  72. package/dist/context/execution-context.d.mts.map +1 -0
  73. package/dist/context/execution-context.mjs +228 -0
  74. package/dist/context/execution-context.mjs.map +1 -0
  75. package/dist/context/index.cjs +12 -0
  76. package/dist/context/index.d.cts +6 -0
  77. package/dist/context/index.d.mts +6 -0
  78. package/dist/context/index.mjs +7 -0
  79. package/dist/context/plugin-context.cjs +83 -0
  80. package/dist/context/plugin-context.d.cts +18 -0
  81. package/dist/context/plugin-context.d.cts.map +1 -0
  82. package/dist/context/plugin-context.d.mts +18 -0
  83. package/dist/context/plugin-context.d.mts.map +1 -0
  84. package/dist/context/plugin-context.mjs +82 -0
  85. package/dist/context/plugin-context.mjs.map +1 -0
  86. package/dist/index.cjs +62 -6
  87. package/dist/index.d.cts +23 -11
  88. package/dist/index.d.mts +23 -11
  89. package/dist/index.mjs +17 -5
  90. package/dist/lib/config.cjs +167 -28
  91. package/dist/lib/config.d.cts +95 -14
  92. package/dist/lib/config.d.cts.map +1 -1
  93. package/dist/lib/config.d.mts +95 -14
  94. package/dist/lib/config.d.mts.map +1 -1
  95. package/dist/lib/config.mjs +160 -28
  96. package/dist/lib/config.mjs.map +1 -1
  97. package/dist/lib/context-helpers.cjs +43 -0
  98. package/dist/lib/context-helpers.d.cts +19 -0
  99. package/dist/lib/context-helpers.d.cts.map +1 -0
  100. package/dist/lib/context-helpers.d.mts +19 -0
  101. package/dist/lib/context-helpers.d.mts.map +1 -0
  102. package/dist/lib/context-helpers.mjs +41 -0
  103. package/dist/lib/context-helpers.mjs.map +1 -0
  104. package/dist/lib/entry.cjs +9 -9
  105. package/dist/lib/entry.d.cts.map +1 -1
  106. package/dist/lib/entry.d.mts.map +1 -1
  107. package/dist/lib/entry.mjs +9 -9
  108. package/dist/lib/entry.mjs.map +1 -1
  109. package/dist/lib/environment.cjs +72 -0
  110. package/dist/lib/environment.d.cts +12 -0
  111. package/dist/lib/environment.d.cts.map +1 -0
  112. package/dist/lib/environment.d.mts +12 -0
  113. package/dist/lib/environment.d.mts.map +1 -0
  114. package/dist/lib/environment.mjs +67 -0
  115. package/dist/lib/environment.mjs.map +1 -0
  116. package/dist/lib/events.cjs +43 -0
  117. package/dist/lib/events.d.cts +10 -0
  118. package/dist/lib/events.d.cts.map +1 -0
  119. package/dist/lib/events.d.mts +10 -0
  120. package/dist/lib/events.d.mts.map +1 -0
  121. package/dist/lib/events.mjs +42 -0
  122. package/dist/lib/events.mjs.map +1 -0
  123. package/dist/lib/generate-types.cjs +371 -0
  124. package/dist/lib/generate-types.d.cts +67 -0
  125. package/dist/lib/generate-types.d.cts.map +1 -0
  126. package/dist/lib/generate-types.d.mts +67 -0
  127. package/dist/lib/generate-types.d.mts.map +1 -0
  128. package/dist/lib/generate-types.mjs +368 -0
  129. package/dist/lib/generate-types.mjs.map +1 -0
  130. package/dist/lib/hooks.cjs +152 -0
  131. package/dist/lib/hooks.d.cts +28 -0
  132. package/dist/lib/hooks.d.cts.map +1 -0
  133. package/dist/lib/hooks.d.mts +28 -0
  134. package/dist/lib/hooks.d.mts.map +1 -0
  135. package/dist/lib/hooks.mjs +147 -0
  136. package/dist/lib/hooks.mjs.map +1 -0
  137. package/dist/lib/index.cjs +64 -6
  138. package/dist/lib/index.d.cts +15 -3
  139. package/dist/lib/index.d.mts +15 -3
  140. package/dist/lib/index.mjs +19 -5
  141. package/dist/lib/install-dependencies.cjs +25 -0
  142. package/dist/lib/install-dependencies.d.cts +12 -0
  143. package/dist/lib/install-dependencies.d.cts.map +1 -0
  144. package/dist/lib/install-dependencies.d.mts +12 -0
  145. package/dist/lib/install-dependencies.d.mts.map +1 -0
  146. package/dist/lib/install-dependencies.mjs +24 -0
  147. package/dist/lib/install-dependencies.mjs.map +1 -0
  148. package/dist/lib/meta.cjs +57 -0
  149. package/dist/lib/meta.d.cts +34 -0
  150. package/dist/lib/meta.d.cts.map +1 -0
  151. package/dist/lib/meta.d.mts +34 -0
  152. package/dist/lib/meta.d.mts.map +1 -0
  153. package/dist/lib/meta.mjs +54 -0
  154. package/dist/lib/meta.mjs.map +1 -0
  155. package/dist/lib/plugins.cjs +150 -0
  156. package/dist/lib/plugins.d.cts +40 -0
  157. package/dist/lib/plugins.d.cts.map +1 -0
  158. package/dist/lib/plugins.d.mts +40 -0
  159. package/dist/lib/plugins.d.mts.map +1 -0
  160. package/dist/lib/plugins.mjs +146 -0
  161. package/dist/lib/plugins.mjs.map +1 -0
  162. package/dist/lib/resolver.cjs +35 -0
  163. package/dist/lib/resolver.d.cts +21 -0
  164. package/dist/lib/resolver.d.cts.map +1 -0
  165. package/dist/lib/resolver.d.mts +21 -0
  166. package/dist/lib/resolver.d.mts.map +1 -0
  167. package/dist/lib/resolver.mjs +33 -0
  168. package/dist/lib/resolver.mjs.map +1 -0
  169. package/dist/lib/schemas.cjs +9 -0
  170. package/dist/lib/schemas.d.cts +2 -0
  171. package/dist/lib/schemas.d.mts +2 -0
  172. package/dist/lib/schemas.mjs +3 -0
  173. package/dist/lib/streaming-channel.cjs +260 -0
  174. package/dist/lib/streaming-channel.d.cts +133 -0
  175. package/dist/lib/streaming-channel.d.cts.map +1 -0
  176. package/dist/lib/streaming-channel.d.mts +133 -0
  177. package/dist/lib/streaming-channel.d.mts.map +1 -0
  178. package/dist/lib/streaming-channel.mjs +258 -0
  179. package/dist/lib/streaming-channel.mjs.map +1 -0
  180. package/dist/lib/typescript/index.cjs +16 -0
  181. package/dist/lib/typescript/index.d.cts +3 -0
  182. package/dist/lib/typescript/index.d.mts +3 -0
  183. package/dist/lib/typescript/index.mjs +4 -0
  184. package/dist/lib/typescript/ts-morph.cjs +105 -0
  185. package/dist/lib/typescript/ts-morph.d.cts +38 -0
  186. package/dist/lib/typescript/ts-morph.d.cts.map +1 -0
  187. package/dist/lib/typescript/ts-morph.d.mts +38 -0
  188. package/dist/lib/typescript/ts-morph.d.mts.map +1 -0
  189. package/dist/lib/typescript/ts-morph.mjs +102 -0
  190. package/dist/lib/typescript/ts-morph.mjs.map +1 -0
  191. package/dist/lib/typescript/tsconfig.cjs +253 -0
  192. package/dist/lib/typescript/tsconfig.d.cts +77 -0
  193. package/dist/lib/typescript/tsconfig.d.cts.map +1 -0
  194. package/dist/lib/typescript/tsconfig.d.mts +77 -0
  195. package/dist/lib/typescript/tsconfig.d.mts.map +1 -0
  196. package/dist/lib/typescript/tsconfig.mjs +240 -0
  197. package/dist/lib/typescript/tsconfig.mjs.map +1 -0
  198. package/dist/lib/unplugin/helpers.cjs +2 -2
  199. package/dist/lib/unplugin/module-resolution.cjs +21 -20
  200. package/dist/lib/unplugin/module-resolution.d.cts +8 -0
  201. package/dist/lib/unplugin/module-resolution.d.cts.map +1 -1
  202. package/dist/lib/unplugin/module-resolution.d.mts +8 -0
  203. package/dist/lib/unplugin/module-resolution.d.mts.map +1 -1
  204. package/dist/lib/unplugin/module-resolution.mjs +20 -20
  205. package/dist/lib/unplugin/module-resolution.mjs.map +1 -1
  206. package/dist/lib/unplugin/plugin.cjs +57 -63
  207. package/dist/lib/unplugin/plugin.d.cts +11 -5
  208. package/dist/lib/unplugin/plugin.d.cts.map +1 -1
  209. package/dist/lib/unplugin/plugin.d.mts +11 -5
  210. package/dist/lib/unplugin/plugin.d.mts.map +1 -1
  211. package/dist/lib/unplugin/plugin.mjs +57 -63
  212. package/dist/lib/unplugin/plugin.mjs.map +1 -1
  213. package/dist/lib/utilities/file-header.cjs +2 -2
  214. package/dist/lib/utilities/file-header.mjs +2 -2
  215. package/dist/lib/utilities/file-header.mjs.map +1 -1
  216. package/dist/lib/utilities/format.cjs +16 -8
  217. package/dist/lib/utilities/format.d.cts.map +1 -1
  218. package/dist/lib/utilities/format.d.mts.map +1 -1
  219. package/dist/lib/utilities/format.mjs +15 -8
  220. package/dist/lib/utilities/format.mjs.map +1 -1
  221. package/dist/lib/utilities/index.cjs +2 -2
  222. package/dist/lib/utilities/index.mjs +2 -2
  223. package/dist/lib/utilities/source-file.cjs +1 -1
  224. package/dist/lib/utilities/source-map.cjs +1 -1
  225. package/dist/lib/utilities/write-file.cjs +1 -2
  226. package/dist/lib/utilities/write-file.d.cts +1 -1
  227. package/dist/lib/utilities/write-file.d.cts.map +1 -1
  228. package/dist/lib/utilities/write-file.d.mts +1 -1
  229. package/dist/lib/utilities/write-file.d.mts.map +1 -1
  230. package/dist/lib/utilities/write-file.mjs +1 -2
  231. package/dist/lib/utilities/write-file.mjs.map +1 -1
  232. package/dist/lib/vfs.cjs +1104 -0
  233. package/dist/lib/vfs.d.cts +321 -0
  234. package/dist/lib/vfs.d.cts.map +1 -0
  235. package/dist/lib/vfs.d.mts +321 -0
  236. package/dist/lib/vfs.d.mts.map +1 -0
  237. package/dist/lib/vfs.mjs +1102 -0
  238. package/dist/lib/vfs.mjs.map +1 -0
  239. package/dist/plugin-base.cjs +5 -9
  240. package/dist/plugin-base.mjs +5 -9
  241. package/dist/plugin-base.mjs.map +1 -1
  242. package/dist/plugin-utils/build-helpers.cjs +2 -2
  243. package/dist/plugin-utils/build-helpers.mjs +2 -2
  244. package/dist/plugin-utils/build-helpers.mjs.map +1 -1
  245. package/dist/plugin-utils/combine-plugins.d.cts +7 -8
  246. package/dist/plugin-utils/combine-plugins.d.cts.map +1 -1
  247. package/dist/plugin-utils/combine-plugins.d.mts +7 -8
  248. package/dist/plugin-utils/combine-plugins.d.mts.map +1 -1
  249. package/dist/plugin-utils/combine-plugins.mjs.map +1 -1
  250. package/dist/plugin-utils/context-helpers.cjs +29 -16
  251. package/dist/plugin-utils/context-helpers.d.cts +10 -2
  252. package/dist/plugin-utils/context-helpers.d.cts.map +1 -1
  253. package/dist/plugin-utils/context-helpers.d.mts +10 -2
  254. package/dist/plugin-utils/context-helpers.d.mts.map +1 -1
  255. package/dist/plugin-utils/context-helpers.mjs +29 -17
  256. package/dist/plugin-utils/context-helpers.mjs.map +1 -1
  257. package/dist/plugin-utils/docs-helper.cjs +17 -0
  258. package/dist/plugin-utils/docs-helper.d.cts +11 -0
  259. package/dist/plugin-utils/docs-helper.d.cts.map +1 -0
  260. package/dist/plugin-utils/docs-helper.d.mts +11 -0
  261. package/dist/plugin-utils/docs-helper.d.mts.map +1 -0
  262. package/dist/plugin-utils/docs-helper.mjs +16 -0
  263. package/dist/plugin-utils/docs-helper.mjs.map +1 -0
  264. package/dist/plugin-utils/extend.mjs.map +1 -1
  265. package/dist/plugin-utils/filter.cjs +101 -0
  266. package/dist/plugin-utils/filter.d.cts +16 -0
  267. package/dist/plugin-utils/filter.d.cts.map +1 -0
  268. package/dist/plugin-utils/filter.d.mts +16 -0
  269. package/dist/plugin-utils/filter.d.mts.map +1 -0
  270. package/dist/plugin-utils/filter.mjs +91 -0
  271. package/dist/plugin-utils/filter.mjs.map +1 -0
  272. package/dist/plugin-utils/format-package-json.cjs +1 -1
  273. package/dist/plugin-utils/format-package-json.mjs +1 -1
  274. package/dist/plugin-utils/format-package-json.mjs.map +1 -1
  275. package/dist/plugin-utils/format.cjs +44 -0
  276. package/dist/plugin-utils/format.d.cts +11 -0
  277. package/dist/plugin-utils/format.d.cts.map +1 -0
  278. package/dist/plugin-utils/format.d.mts +11 -0
  279. package/dist/plugin-utils/format.d.mts.map +1 -0
  280. package/dist/plugin-utils/format.mjs +43 -0
  281. package/dist/plugin-utils/format.mjs.map +1 -0
  282. package/dist/plugin-utils/get-config-path.cjs +34 -32
  283. package/dist/plugin-utils/get-config-path.d.cts +4 -1
  284. package/dist/plugin-utils/get-config-path.d.cts.map +1 -1
  285. package/dist/plugin-utils/get-config-path.d.mts +4 -1
  286. package/dist/plugin-utils/get-config-path.d.mts.map +1 -1
  287. package/dist/plugin-utils/get-config-path.mjs +34 -32
  288. package/dist/plugin-utils/get-config-path.mjs.map +1 -1
  289. package/dist/plugin-utils/helpers.cjs +25 -10
  290. package/dist/plugin-utils/helpers.d.cts +31 -24
  291. package/dist/plugin-utils/helpers.d.cts.map +1 -1
  292. package/dist/plugin-utils/helpers.d.mts +31 -24
  293. package/dist/plugin-utils/helpers.d.mts.map +1 -1
  294. package/dist/plugin-utils/helpers.mjs +22 -8
  295. package/dist/plugin-utils/helpers.mjs.map +1 -1
  296. package/dist/plugin-utils/index.cjs +48 -4
  297. package/dist/plugin-utils/index.d.cts +9 -3
  298. package/dist/plugin-utils/index.d.mts +9 -3
  299. package/dist/plugin-utils/index.mjs +11 -5
  300. package/dist/plugin-utils/install.cjs +47 -0
  301. package/dist/plugin-utils/install.d.cts +23 -0
  302. package/dist/plugin-utils/install.d.cts.map +1 -0
  303. package/dist/plugin-utils/install.d.mts +23 -0
  304. package/dist/plugin-utils/install.d.mts.map +1 -0
  305. package/dist/plugin-utils/install.mjs +45 -0
  306. package/dist/plugin-utils/install.mjs.map +1 -0
  307. package/dist/plugin-utils/logging.cjs +605 -0
  308. package/dist/plugin-utils/logging.d.cts +111 -0
  309. package/dist/plugin-utils/logging.d.cts.map +1 -0
  310. package/dist/plugin-utils/logging.d.mts +111 -0
  311. package/dist/plugin-utils/logging.d.mts.map +1 -0
  312. package/dist/plugin-utils/logging.mjs +588 -0
  313. package/dist/plugin-utils/logging.mjs.map +1 -0
  314. package/dist/plugin-utils/merge.cjs +4 -4
  315. package/dist/plugin-utils/merge.d.cts +0 -1
  316. package/dist/plugin-utils/merge.d.cts.map +1 -1
  317. package/dist/plugin-utils/merge.d.mts.map +1 -1
  318. package/dist/plugin-utils/merge.mjs +3 -3
  319. package/dist/plugin-utils/merge.mjs.map +1 -1
  320. package/dist/plugin-utils/modules.cjs +1 -1
  321. package/dist/plugin-utils/modules.mjs +1 -1
  322. package/dist/plugin-utils/modules.mjs.map +1 -1
  323. package/dist/plugin-utils/paths.cjs +18 -4
  324. package/dist/plugin-utils/paths.d.cts +12 -2
  325. package/dist/plugin-utils/paths.d.cts.map +1 -1
  326. package/dist/plugin-utils/paths.d.mts +12 -2
  327. package/dist/plugin-utils/paths.d.mts.map +1 -1
  328. package/dist/plugin-utils/paths.mjs +18 -4
  329. package/dist/plugin-utils/paths.mjs.map +1 -1
  330. package/dist/plugin-utils/virtual.cjs +80 -0
  331. package/dist/plugin-utils/virtual.d.cts +69 -0
  332. package/dist/plugin-utils/virtual.d.cts.map +1 -0
  333. package/dist/plugin-utils/virtual.d.mts +69 -0
  334. package/dist/plugin-utils/virtual.d.mts.map +1 -0
  335. package/dist/plugin-utils/virtual.mjs +73 -0
  336. package/dist/plugin-utils/virtual.mjs.map +1 -0
  337. package/dist/schemas/fs.cjs +232 -0
  338. package/dist/schemas/fs.d.cts +127 -0
  339. package/dist/schemas/fs.d.cts.map +1 -0
  340. package/dist/schemas/fs.d.mts +127 -0
  341. package/dist/schemas/fs.d.mts.map +1 -0
  342. package/dist/schemas/fs.mjs +226 -0
  343. package/dist/schemas/fs.mjs.map +1 -0
  344. package/dist/storage/base.cjs +216 -0
  345. package/dist/storage/base.d.cts +201 -0
  346. package/dist/storage/base.d.cts.map +1 -0
  347. package/dist/storage/base.d.mts +201 -0
  348. package/dist/storage/base.d.mts.map +1 -0
  349. package/dist/storage/base.mjs +215 -0
  350. package/dist/storage/base.mjs.map +1 -0
  351. package/dist/storage/file-system.cjs +180 -0
  352. package/dist/storage/file-system.d.cts +129 -0
  353. package/dist/storage/file-system.d.cts.map +1 -0
  354. package/dist/storage/file-system.d.mts +129 -0
  355. package/dist/storage/file-system.d.mts.map +1 -0
  356. package/dist/storage/file-system.mjs +179 -0
  357. package/dist/storage/file-system.mjs.map +1 -0
  358. package/dist/storage/helpers.cjs +37 -0
  359. package/dist/storage/helpers.d.cts +25 -0
  360. package/dist/storage/helpers.d.cts.map +1 -0
  361. package/dist/storage/helpers.d.mts +25 -0
  362. package/dist/storage/helpers.d.mts.map +1 -0
  363. package/dist/storage/helpers.mjs +34 -0
  364. package/dist/storage/helpers.mjs.map +1 -0
  365. package/dist/storage/index.cjs +12 -0
  366. package/dist/storage/index.d.cts +5 -0
  367. package/dist/storage/index.d.mts +5 -0
  368. package/dist/storage/index.mjs +6 -0
  369. package/dist/storage/virtual.cjs +98 -0
  370. package/dist/storage/virtual.d.cts +80 -0
  371. package/dist/storage/virtual.d.cts.map +1 -0
  372. package/dist/storage/virtual.d.mts +80 -0
  373. package/dist/storage/virtual.d.mts.map +1 -0
  374. package/dist/storage/virtual.mjs +97 -0
  375. package/dist/storage/virtual.mjs.map +1 -0
  376. package/dist/types/api.d.cts +18 -99
  377. package/dist/types/api.d.cts.map +1 -1
  378. package/dist/types/api.d.mts +18 -99
  379. package/dist/types/api.d.mts.map +1 -1
  380. package/dist/types/config.d.cts +239 -141
  381. package/dist/types/config.d.cts.map +1 -1
  382. package/dist/types/config.d.mts +240 -142
  383. package/dist/types/config.d.mts.map +1 -1
  384. package/dist/types/context.d.cts +228 -117
  385. package/dist/types/context.d.cts.map +1 -1
  386. package/dist/types/context.d.mts +231 -120
  387. package/dist/types/context.d.mts.map +1 -1
  388. package/dist/types/fs.d.cts +49 -5
  389. package/dist/types/fs.d.cts.map +1 -1
  390. package/dist/types/fs.d.mts +50 -6
  391. package/dist/types/fs.d.mts.map +1 -1
  392. package/dist/types/hooks.d.cts +26 -38
  393. package/dist/types/hooks.d.cts.map +1 -1
  394. package/dist/types/hooks.d.mts +26 -38
  395. package/dist/types/hooks.d.mts.map +1 -1
  396. package/dist/types/index.d.cts +9 -0
  397. package/dist/types/index.d.mts +8 -8
  398. package/dist/types/logging.d.cts +161 -0
  399. package/dist/types/logging.d.cts.map +1 -0
  400. package/dist/types/logging.d.mts +161 -0
  401. package/dist/types/logging.d.mts.map +1 -0
  402. package/dist/types/plugin.d.cts +23 -24
  403. package/dist/types/plugin.d.cts.map +1 -1
  404. package/dist/types/plugin.d.mts +23 -24
  405. package/dist/types/plugin.d.mts.map +1 -1
  406. package/dist/types/tsconfig.d.cts +15 -12
  407. package/dist/types/tsconfig.d.cts.map +1 -1
  408. package/dist/types/tsconfig.d.mts +16 -13
  409. package/dist/types/tsconfig.d.mts.map +1 -1
  410. package/dist/types/unplugin.d.cts +10 -23
  411. package/dist/types/unplugin.d.cts.map +1 -1
  412. package/dist/types/unplugin.d.mts +10 -23
  413. package/dist/types/unplugin.d.mts.map +1 -1
  414. package/package.json +270 -425
  415. package/schemas/fs.capnp +42 -0
  416. package/dist/lib/logger.cjs +0 -59
  417. package/dist/lib/logger.d.cts +0 -23
  418. package/dist/lib/logger.d.cts.map +0 -1
  419. package/dist/lib/logger.d.mts +0 -23
  420. package/dist/lib/logger.d.mts.map +0 -1
  421. package/dist/lib/logger.mjs +0 -56
  422. package/dist/lib/logger.mjs.map +0 -1
  423. package/dist/types/_internal.cjs +0 -0
  424. package/dist/types/_internal.d.cts +0 -106
  425. package/dist/types/_internal.d.cts.map +0 -1
  426. package/dist/types/_internal.d.mts +0 -106
  427. package/dist/types/_internal.d.mts.map +0 -1
  428. package/dist/types/_internal.mjs +0 -1
  429. package/dist/types/commands.d.cts +0 -13
  430. package/dist/types/commands.d.cts.map +0 -1
  431. package/dist/types/commands.d.mts +0 -13
  432. package/dist/types/commands.d.mts.map +0 -1
@@ -1,4 +1,5 @@
1
1
  import { UnresolvedContext } from "../types/context.mjs";
2
+ import { PackageJson } from "@stryke/types/package-json";
2
3
 
3
4
  //#region src/plugin-utils/context-helpers.d.ts
4
5
  /**
@@ -8,13 +9,20 @@ import { UnresolvedContext } from "../types/context.mjs";
8
9
  * @returns The organization name or undefined if not found.
9
10
  */
10
11
  declare function getOrganizationName(context: UnresolvedContext): string | undefined;
12
+ /**
13
+ * Get the organization name from the `package.json` file
14
+ *
15
+ * @param packageJson - The `package.json` object to extract the organization name from.
16
+ * @returns The organization name or undefined if not found.
17
+ */
18
+ declare function getPackageJsonOrganization(packageJson: PackageJson): string | undefined;
11
19
  /**
12
20
  * Get the organization name from the context
13
21
  *
14
22
  * @param context - The Powerlines plugin context.
15
23
  * @returns The organization name or undefined if not found.
16
24
  */
17
- declare function getWorkspaceName(context: UnresolvedContext): string | undefined;
25
+ declare function getWorkspaceName(context: UnresolvedContext): Promise<string | undefined>;
18
26
  //#endregion
19
- export { getOrganizationName, getWorkspaceName };
27
+ export { getOrganizationName, getPackageJsonOrganization, getWorkspaceName };
20
28
  //# sourceMappingURL=context-helpers.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"context-helpers.d.mts","names":[],"sources":["../../src/plugin-utils/context-helpers.ts"],"mappings":";;;;;AA4BA;;;;iBAAgB,mBAAA,CACd,OAAA,EAAS,iBAAA;AAsEX;;;;;;AAAA,iBAAgB,gBAAA,CACd,OAAA,EAAS,iBAAA"}
1
+ {"version":3,"file":"context-helpers.d.mts","names":[],"sources":["../../src/plugin-utils/context-helpers.ts"],"mappings":";;;;;;AA8BA;;;;iBAAgB,mBAAA,CACd,OAAA,EAAS,iBAAA;AAeX;;;;;AA8DA;AA9DA,iBAAgB,0BAAA,CACd,WAAA,EAAa,WAAA;;;;;;;iBA6DO,gBAAA,CACpB,OAAA,EAAS,iBAAA,GACR,OAAA"}
@@ -1,3 +1,4 @@
1
+ import { tryGetWorkspaceConfig } from "@storm-software/config-tools/get-config";
1
2
  import { isSetObject } from "@stryke/type-checks/is-set-object";
2
3
  import { isSetString } from "@stryke/type-checks/is-set-string";
3
4
 
@@ -9,23 +10,31 @@ import { isSetString } from "@stryke/type-checks/is-set-string";
9
10
  * @returns The organization name or undefined if not found.
10
11
  */
11
12
  function getOrganizationName(context) {
13
+ if (isSetString(context.config.organization)) return context.config.organization;
14
+ return getPackageJsonOrganization(context.packageJson);
15
+ }
16
+ /**
17
+ * Get the organization name from the `package.json` file
18
+ *
19
+ * @param packageJson - The `package.json` object to extract the organization name from.
20
+ * @returns The organization name or undefined if not found.
21
+ */
22
+ function getPackageJsonOrganization(packageJson) {
12
23
  let result;
13
- if (isSetObject(context.workspaceConfig.organization)) result = context.workspaceConfig.organization.name;
14
- if (!result && isSetString(context.workspaceConfig.organization)) result = context.workspaceConfig.organization;
15
- if (!result && Array.isArray(context.packageJson.maintainers) && context.packageJson.maintainers.length > 0) {
16
- if (isSetObject(context.packageJson.maintainers[0])) result = context.packageJson.maintainers[0].name;
17
- if (!result && isSetString(context.packageJson.maintainers[0])) result = context.packageJson.maintainers[0];
24
+ if (Array.isArray(packageJson.maintainers) && packageJson.maintainers.length > 0) {
25
+ if (isSetObject(packageJson.maintainers[0])) result = packageJson.maintainers[0].name;
26
+ if (!result && isSetString(packageJson.maintainers[0])) result = packageJson.maintainers[0];
18
27
  }
19
- if (!result && Array.isArray(context.packageJson.author) && context.packageJson.author.length > 0) {
20
- if (isSetObject(context.packageJson.author[0])) result = context.packageJson.author[0].name;
21
- if (!result && isSetString(context.packageJson.author[0])) result = context.packageJson.author[0];
28
+ if (!result && Array.isArray(packageJson.author) && packageJson.author.length > 0) {
29
+ if (isSetObject(packageJson.author[0])) result = packageJson.author[0].name;
30
+ if (!result && isSetString(packageJson.author[0])) result = packageJson.author[0];
22
31
  }
23
- if (!result && Array.isArray(context.packageJson.contributors) && context.packageJson.contributors.length > 0) {
24
- if (isSetObject(context.packageJson.contributors[0])) result = context.packageJson.contributors[0].name;
25
- if (!result && isSetString(context.packageJson.contributors[0])) result = context.packageJson.contributors[0];
32
+ if (!result && Array.isArray(packageJson.contributors) && packageJson.contributors.length > 0) {
33
+ if (isSetObject(packageJson.contributors[0])) result = packageJson.contributors[0].name;
34
+ if (!result && isSetString(packageJson.contributors[0])) result = packageJson.contributors[0];
26
35
  }
27
- if (!result && isSetString(context.packageJson.namespace)) result = context.packageJson.namespace.replace(/^@/, "");
28
- if (!result && isSetString(context.packageJson.name)) result = context.packageJson.name.replace(/^@/, "").replace(/\/.*$/, "");
36
+ if (!result && isSetString(packageJson.namespace)) result = packageJson.namespace?.replace(/^@/, "");
37
+ if (!result && isSetString(packageJson.name)) result = packageJson.name.replace(/^@/, "").replace(/\/.*$/, "");
29
38
  return result;
30
39
  }
31
40
  /**
@@ -34,15 +43,18 @@ function getOrganizationName(context) {
34
43
  * @param context - The Powerlines plugin context.
35
44
  * @returns The organization name or undefined if not found.
36
45
  */
37
- function getWorkspaceName(context) {
46
+ async function getWorkspaceName(context) {
38
47
  let result;
39
- if (isSetString(context.workspaceConfig.name)) result = context.workspaceConfig.name;
40
- if (!result && isSetString(context.workspaceConfig.namespace)) result = context.workspaceConfig.namespace.replace(/^@/, "");
48
+ const workspaceConfig = await tryGetWorkspaceConfig(true);
49
+ if (workspaceConfig) {
50
+ if (isSetString(workspaceConfig.name)) result = workspaceConfig.name;
51
+ if (!result && isSetString(workspaceConfig.namespace)) result = workspaceConfig.namespace.replace(/^@/, "");
52
+ }
41
53
  if (!result && isSetString(context.packageJson.namespace)) result = context.packageJson.namespace.replace(/^@/, "");
42
54
  if (!result && isSetString(context.packageJson.name)) result = context.packageJson.name.replace(/^@/, "").replace(/\/.*$/, "");
43
55
  return result;
44
56
  }
45
57
 
46
58
  //#endregion
47
- export { getOrganizationName, getWorkspaceName };
59
+ export { getOrganizationName, getPackageJsonOrganization, getWorkspaceName };
48
60
  //# sourceMappingURL=context-helpers.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"context-helpers.mjs","names":[],"sources":["../../src/plugin-utils/context-helpers.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 { UnresolvedContext } from \"../types/context\";\n\n/**\n * Get the organization name from the context\n *\n * @param context - The Powerlines plugin context.\n * @returns The organization name or undefined if not found.\n */\nexport function getOrganizationName(\n context: UnresolvedContext\n): string | undefined {\n let result: string | undefined;\n if (isSetObject(context.workspaceConfig.organization)) {\n result = context.workspaceConfig.organization.name;\n }\n\n if (!result && isSetString(context.workspaceConfig.organization)) {\n result = context.workspaceConfig.organization;\n }\n\n if (\n !result &&\n Array.isArray(context.packageJson.maintainers) &&\n context.packageJson.maintainers.length > 0\n ) {\n if (isSetObject(context.packageJson.maintainers[0])) {\n result = (context.packageJson.maintainers[0] as { name: string }).name;\n }\n\n if (!result && isSetString(context.packageJson.maintainers[0])) {\n result = context.packageJson.maintainers[0];\n }\n }\n\n if (\n !result &&\n Array.isArray(context.packageJson.author) &&\n context.packageJson.author.length > 0\n ) {\n if (isSetObject(context.packageJson.author[0])) {\n result = (context.packageJson.author[0] as { name: string }).name;\n }\n\n if (!result && isSetString(context.packageJson.author[0])) {\n result = context.packageJson.author[0];\n }\n }\n\n if (\n !result &&\n Array.isArray(context.packageJson.contributors) &&\n context.packageJson.contributors.length > 0\n ) {\n if (isSetObject(context.packageJson.contributors[0])) {\n result = (context.packageJson.contributors[0] as { name: string }).name;\n }\n\n if (!result && isSetString(context.packageJson.contributors[0])) {\n result = context.packageJson.contributors[0];\n }\n }\n\n if (!result && isSetString(context.packageJson.namespace)) {\n result = context.packageJson.namespace.replace(/^@/, \"\");\n }\n\n if (!result && isSetString(context.packageJson.name)) {\n result = context.packageJson.name.replace(/^@/, \"\").replace(/\\/.*$/, \"\");\n }\n\n return result;\n}\n\n/**\n * Get the organization name from the context\n *\n * @param context - The Powerlines plugin context.\n * @returns The organization name or undefined if not found.\n */\nexport function getWorkspaceName(\n context: UnresolvedContext\n): string | undefined {\n let result: string | undefined;\n if (isSetString(context.workspaceConfig.name)) {\n result = context.workspaceConfig.name;\n }\n\n if (!result && isSetString(context.workspaceConfig.namespace)) {\n result = context.workspaceConfig.namespace.replace(/^@/, \"\");\n }\n\n if (!result && isSetString(context.packageJson.namespace)) {\n result = context.packageJson.namespace.replace(/^@/, \"\");\n }\n\n if (!result && isSetString(context.packageJson.name)) {\n result = context.packageJson.name.replace(/^@/, \"\").replace(/\\/.*$/, \"\");\n }\n\n return result;\n}\n"],"mappings":";;;;;;;;;;AA4BA,SAAgB,oBACd,SACoB;CACpB,IAAI;AACJ,KAAI,YAAY,QAAQ,gBAAgB,aAAa,CACnD,UAAS,QAAQ,gBAAgB,aAAa;AAGhD,KAAI,CAAC,UAAU,YAAY,QAAQ,gBAAgB,aAAa,CAC9D,UAAS,QAAQ,gBAAgB;AAGnC,KACE,CAAC,UACD,MAAM,QAAQ,QAAQ,YAAY,YAAY,IAC9C,QAAQ,YAAY,YAAY,SAAS,GACzC;AACA,MAAI,YAAY,QAAQ,YAAY,YAAY,GAAG,CACjD,UAAU,QAAQ,YAAY,YAAY,GAAwB;AAGpE,MAAI,CAAC,UAAU,YAAY,QAAQ,YAAY,YAAY,GAAG,CAC5D,UAAS,QAAQ,YAAY,YAAY;;AAI7C,KACE,CAAC,UACD,MAAM,QAAQ,QAAQ,YAAY,OAAO,IACzC,QAAQ,YAAY,OAAO,SAAS,GACpC;AACA,MAAI,YAAY,QAAQ,YAAY,OAAO,GAAG,CAC5C,UAAU,QAAQ,YAAY,OAAO,GAAwB;AAG/D,MAAI,CAAC,UAAU,YAAY,QAAQ,YAAY,OAAO,GAAG,CACvD,UAAS,QAAQ,YAAY,OAAO;;AAIxC,KACE,CAAC,UACD,MAAM,QAAQ,QAAQ,YAAY,aAAa,IAC/C,QAAQ,YAAY,aAAa,SAAS,GAC1C;AACA,MAAI,YAAY,QAAQ,YAAY,aAAa,GAAG,CAClD,UAAU,QAAQ,YAAY,aAAa,GAAwB;AAGrE,MAAI,CAAC,UAAU,YAAY,QAAQ,YAAY,aAAa,GAAG,CAC7D,UAAS,QAAQ,YAAY,aAAa;;AAI9C,KAAI,CAAC,UAAU,YAAY,QAAQ,YAAY,UAAU,CACvD,UAAS,QAAQ,YAAY,UAAU,QAAQ,MAAM,GAAG;AAG1D,KAAI,CAAC,UAAU,YAAY,QAAQ,YAAY,KAAK,CAClD,UAAS,QAAQ,YAAY,KAAK,QAAQ,MAAM,GAAG,CAAC,QAAQ,SAAS,GAAG;AAG1E,QAAO;;;;;;;;AAST,SAAgB,iBACd,SACoB;CACpB,IAAI;AACJ,KAAI,YAAY,QAAQ,gBAAgB,KAAK,CAC3C,UAAS,QAAQ,gBAAgB;AAGnC,KAAI,CAAC,UAAU,YAAY,QAAQ,gBAAgB,UAAU,CAC3D,UAAS,QAAQ,gBAAgB,UAAU,QAAQ,MAAM,GAAG;AAG9D,KAAI,CAAC,UAAU,YAAY,QAAQ,YAAY,UAAU,CACvD,UAAS,QAAQ,YAAY,UAAU,QAAQ,MAAM,GAAG;AAG1D,KAAI,CAAC,UAAU,YAAY,QAAQ,YAAY,KAAK,CAClD,UAAS,QAAQ,YAAY,KAAK,QAAQ,MAAM,GAAG,CAAC,QAAQ,SAAS,GAAG;AAG1E,QAAO"}
1
+ {"version":3,"file":"context-helpers.mjs","names":[],"sources":["../../src/plugin-utils/context-helpers.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 { tryGetWorkspaceConfig } from \"@storm-software/config-tools/get-config\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { PackageJson } from \"@stryke/types/package-json\";\nimport { UnresolvedContext } from \"../types/context\";\n\n/**\n * Get the organization name from the context\n *\n * @param context - The Powerlines plugin context.\n * @returns The organization name or undefined if not found.\n */\nexport function getOrganizationName(\n context: UnresolvedContext\n): string | undefined {\n if (isSetString(context.config.organization)) {\n return context.config.organization;\n }\n\n return getPackageJsonOrganization(context.packageJson);\n}\n\n/**\n * Get the organization name from the `package.json` file\n *\n * @param packageJson - The `package.json` object to extract the organization name from.\n * @returns The organization name or undefined if not found.\n */\nexport function getPackageJsonOrganization(\n packageJson: PackageJson\n): string | undefined {\n let result: string | undefined;\n if (\n Array.isArray(packageJson.maintainers) &&\n packageJson.maintainers.length > 0\n ) {\n if (isSetObject(packageJson.maintainers[0])) {\n result = (packageJson.maintainers[0] as { name: string }).name;\n }\n\n if (!result && isSetString(packageJson.maintainers[0])) {\n result = packageJson.maintainers[0];\n }\n }\n\n if (\n !result &&\n Array.isArray(packageJson.author) &&\n packageJson.author.length > 0\n ) {\n if (isSetObject(packageJson.author[0])) {\n result = (packageJson.author[0] as { name: string }).name;\n }\n\n if (!result && isSetString(packageJson.author[0])) {\n result = packageJson.author[0];\n }\n }\n\n if (\n !result &&\n Array.isArray(packageJson.contributors) &&\n packageJson.contributors.length > 0\n ) {\n if (isSetObject(packageJson.contributors[0])) {\n result = (packageJson.contributors[0] as { name: string }).name;\n }\n\n if (!result && isSetString(packageJson.contributors[0])) {\n result = packageJson.contributors[0];\n }\n }\n\n if (!result && isSetString(packageJson.namespace)) {\n result = packageJson.namespace?.replace(/^@/, \"\");\n }\n\n if (!result && isSetString(packageJson.name)) {\n result = packageJson.name.replace(/^@/, \"\").replace(/\\/.*$/, \"\");\n }\n\n return result;\n}\n\n/**\n * Get the organization name from the context\n *\n * @param context - The Powerlines plugin context.\n * @returns The organization name or undefined if not found.\n */\nexport async function getWorkspaceName(\n context: UnresolvedContext\n): Promise<string | undefined> {\n let result: string | undefined;\n\n const workspaceConfig = await tryGetWorkspaceConfig(true);\n if (workspaceConfig) {\n if (isSetString(workspaceConfig.name)) {\n result = workspaceConfig.name;\n }\n\n if (!result && isSetString(workspaceConfig.namespace)) {\n result = workspaceConfig.namespace.replace(/^@/, \"\");\n }\n }\n\n if (!result && isSetString(context.packageJson.namespace)) {\n result = context.packageJson.namespace.replace(/^@/, \"\");\n }\n\n if (!result && isSetString(context.packageJson.name)) {\n result = context.packageJson.name.replace(/^@/, \"\").replace(/\\/.*$/, \"\");\n }\n\n return result;\n}\n"],"mappings":";;;;;;;;;;;AA8BA,SAAgB,oBACd,SACoB;AACpB,KAAI,YAAY,QAAQ,OAAO,aAAa,CAC1C,QAAO,QAAQ,OAAO;AAGxB,QAAO,2BAA2B,QAAQ,YAAY;;;;;;;;AASxD,SAAgB,2BACd,aACoB;CACpB,IAAI;AACJ,KACE,MAAM,QAAQ,YAAY,YAAY,IACtC,YAAY,YAAY,SAAS,GACjC;AACA,MAAI,YAAY,YAAY,YAAY,GAAG,CACzC,UAAU,YAAY,YAAY,GAAwB;AAG5D,MAAI,CAAC,UAAU,YAAY,YAAY,YAAY,GAAG,CACpD,UAAS,YAAY,YAAY;;AAIrC,KACE,CAAC,UACD,MAAM,QAAQ,YAAY,OAAO,IACjC,YAAY,OAAO,SAAS,GAC5B;AACA,MAAI,YAAY,YAAY,OAAO,GAAG,CACpC,UAAU,YAAY,OAAO,GAAwB;AAGvD,MAAI,CAAC,UAAU,YAAY,YAAY,OAAO,GAAG,CAC/C,UAAS,YAAY,OAAO;;AAIhC,KACE,CAAC,UACD,MAAM,QAAQ,YAAY,aAAa,IACvC,YAAY,aAAa,SAAS,GAClC;AACA,MAAI,YAAY,YAAY,aAAa,GAAG,CAC1C,UAAU,YAAY,aAAa,GAAwB;AAG7D,MAAI,CAAC,UAAU,YAAY,YAAY,aAAa,GAAG,CACrD,UAAS,YAAY,aAAa;;AAItC,KAAI,CAAC,UAAU,YAAY,YAAY,UAAU,CAC/C,UAAS,YAAY,WAAW,QAAQ,MAAM,GAAG;AAGnD,KAAI,CAAC,UAAU,YAAY,YAAY,KAAK,CAC1C,UAAS,YAAY,KAAK,QAAQ,MAAM,GAAG,CAAC,QAAQ,SAAS,GAAG;AAGlE,QAAO;;;;;;;;AAST,eAAsB,iBACpB,SAC6B;CAC7B,IAAI;CAEJ,MAAM,kBAAkB,MAAM,sBAAsB,KAAK;AACzD,KAAI,iBAAiB;AACnB,MAAI,YAAY,gBAAgB,KAAK,CACnC,UAAS,gBAAgB;AAG3B,MAAI,CAAC,UAAU,YAAY,gBAAgB,UAAU,CACnD,UAAS,gBAAgB,UAAU,QAAQ,MAAM,GAAG;;AAIxD,KAAI,CAAC,UAAU,YAAY,QAAQ,YAAY,UAAU,CACvD,UAAS,QAAQ,YAAY,UAAU,QAAQ,MAAM,GAAG;AAG1D,KAAI,CAAC,UAAU,YAAY,QAAQ,YAAY,KAAK,CAClD,UAAS,QAAQ,YAAY,KAAK,QAAQ,MAAM,GAAG,CAAC,QAAQ,SAAS,GAAG;AAG1E,QAAO"}
@@ -0,0 +1,17 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
+ let _stryke_path_join = require("@stryke/path/join");
4
+
5
+ //#region src/plugin-utils/docs-helper.ts
6
+ /**
7
+ * Gets the output path for the generated environment documentation.
8
+ *
9
+ * @param root - The root directory of the project.
10
+ * @returns The output path for the generated environment documentation.
11
+ */
12
+ function getDocsOutputPath(root) {
13
+ return (0, _stryke_path_join.joinPaths)(root, "docs", "reference");
14
+ }
15
+
16
+ //#endregion
17
+ exports.getDocsOutputPath = getDocsOutputPath;
@@ -0,0 +1,11 @@
1
+ //#region src/plugin-utils/docs-helper.d.ts
2
+ /**
3
+ * Gets the output path for the generated environment documentation.
4
+ *
5
+ * @param root - The root directory of the project.
6
+ * @returns The output path for the generated environment documentation.
7
+ */
8
+ declare function getDocsOutputPath(root: string): string;
9
+ //#endregion
10
+ export { getDocsOutputPath };
11
+ //# sourceMappingURL=docs-helper.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"docs-helper.d.cts","names":[],"sources":["../../src/plugin-utils/docs-helper.ts"],"mappings":";;AA0BA;;;;;iBAAgB,iBAAA,CAAkB,IAAA"}
@@ -0,0 +1,11 @@
1
+ //#region src/plugin-utils/docs-helper.d.ts
2
+ /**
3
+ * Gets the output path for the generated environment documentation.
4
+ *
5
+ * @param root - The root directory of the project.
6
+ * @returns The output path for the generated environment documentation.
7
+ */
8
+ declare function getDocsOutputPath(root: string): string;
9
+ //#endregion
10
+ export { getDocsOutputPath };
11
+ //# sourceMappingURL=docs-helper.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"docs-helper.d.mts","names":[],"sources":["../../src/plugin-utils/docs-helper.ts"],"mappings":";;AA0BA;;;;;iBAAgB,iBAAA,CAAkB,IAAA"}
@@ -0,0 +1,16 @@
1
+ import { joinPaths } from "@stryke/path/join";
2
+
3
+ //#region src/plugin-utils/docs-helper.ts
4
+ /**
5
+ * Gets the output path for the generated environment documentation.
6
+ *
7
+ * @param root - The root directory of the project.
8
+ * @returns The output path for the generated environment documentation.
9
+ */
10
+ function getDocsOutputPath(root) {
11
+ return joinPaths(root, "docs", "reference");
12
+ }
13
+
14
+ //#endregion
15
+ export { getDocsOutputPath };
16
+ //# sourceMappingURL=docs-helper.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"docs-helper.mjs","names":[],"sources":["../../src/plugin-utils/docs-helper.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { joinPaths } from \"@stryke/path/join\";\n\n/**\n * Gets the output path for the generated environment documentation.\n *\n * @param root - The root directory of the project.\n * @returns The output path for the generated environment documentation.\n */\nexport function getDocsOutputPath(root: string): string {\n return joinPaths(root, \"docs\", \"reference\");\n}\n"],"mappings":";;;;;;;;;AA0BA,SAAgB,kBAAkB,MAAsB;AACtD,QAAO,UAAU,MAAM,QAAQ,YAAY"}
@@ -1 +1 @@
1
- {"version":3,"file":"extend.mjs","names":[],"sources":["../../src/plugin-utils/extend.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { isFunction } from \"@stryke/type-checks/is-function\";\nimport {\n PartialPlugin,\n PartialPluginFactory,\n PluginFactory\n} from \"../types/config\";\nimport { PluginContext } from \"../types/context\";\nimport { Plugin } from \"../types/plugin\";\nimport { merge } from \"./merge\";\n\n/**\n * Adds additional helper functionality to a plugin via a plugin builder function.\n *\n * @param plugin - The base plugin object or factory function to extend.\n * @param extension - The plugin extension object or factory function. This function receives the plugin options and returns a plugin object.\n * @returns A function accepting the plugin options and returning the extended plugin.\n */\nexport function extend<\n TContext extends PluginContext = PluginContext,\n TPluginOptions = unknown,\n TExtensionOptions = unknown\n>(\n plugin: PluginFactory<TContext, TPluginOptions>,\n extension: PartialPluginFactory<TContext, TExtensionOptions>\n): PluginFactory<TContext, TPluginOptions & TExtensionOptions>;\nexport function extend<\n TContext extends PluginContext = PluginContext,\n TPluginOptions = unknown\n>(\n plugin: PluginFactory<TContext, TPluginOptions>,\n extension: PartialPlugin<TContext>\n): PluginFactory<TContext, TPluginOptions>;\nexport function extend<\n TContext extends PluginContext = PluginContext,\n TExtensionOptions = unknown\n>(\n plugin: Plugin<TContext> | Plugin<TContext>[],\n extension: PartialPluginFactory<TContext, TExtensionOptions>\n): PluginFactory<TContext, TExtensionOptions>;\nexport function extend<TContext extends PluginContext = PluginContext>(\n plugin: Plugin<TContext> | Plugin<TContext>[],\n extension: PartialPlugin<TContext>\n): Plugin<TContext>[];\nexport function extend<TContext extends PluginContext = PluginContext>(\n plugin: Plugin<TContext> | Plugin<TContext>[] | PluginFactory<TContext, any>,\n extension: PartialPlugin<TContext> | PartialPluginFactory<TContext, any>\n): PluginFactory<TContext, any> | Plugin<TContext>[] {\n if (isFunction(plugin)) {\n if (isFunction(extension)) {\n return async (options: any) => {\n const pluginResult = toArray(await Promise.resolve(plugin(options)));\n const extensionResult = toArray(\n await Promise.resolve(extension(options))\n );\n\n return pluginResult\n .map(p => extensionResult.map(e => merge(p, e) as Plugin<TContext>))\n .flat();\n };\n }\n\n return async (options: any) => {\n const result = toArray(await Promise.resolve(plugin(options)));\n\n return result.map(p => merge(p, extension) as Plugin<TContext>);\n };\n } else if (isFunction(extension)) {\n return async (options: any) => {\n const result = toArray(await Promise.resolve(extension(options)));\n\n return result\n .map(e => toArray(plugin).map(p => merge(p, e) as Plugin<TContext>))\n .flat();\n };\n }\n\n return toArray(plugin).map(p => merge(p, extension) as Plugin<TContext>);\n}\n"],"mappings":";;;;;AA8DA,SAAgB,OACd,QACA,WACmD;AACnD,KAAI,WAAW,OAAO,EAAE;AACtB,MAAI,WAAW,UAAU,CACvB,QAAO,OAAO,YAAiB;GAC7B,MAAM,eAAe,QAAQ,MAAM,QAAQ,QAAQ,OAAO,QAAQ,CAAC,CAAC;GACpE,MAAM,kBAAkB,QACtB,MAAM,QAAQ,QAAQ,UAAU,QAAQ,CAAC,CAC1C;AAED,UAAO,aACJ,KAAI,MAAK,gBAAgB,KAAI,MAAK,MAAM,GAAG,EAAE,CAAqB,CAAC,CACnE,MAAM;;AAIb,SAAO,OAAO,YAAiB;AAG7B,UAFe,QAAQ,MAAM,QAAQ,QAAQ,OAAO,QAAQ,CAAC,CAAC,CAEhD,KAAI,MAAK,MAAM,GAAG,UAAU,CAAqB;;YAExD,WAAW,UAAU,CAC9B,QAAO,OAAO,YAAiB;AAG7B,SAFe,QAAQ,MAAM,QAAQ,QAAQ,UAAU,QAAQ,CAAC,CAAC,CAG9D,KAAI,MAAK,QAAQ,OAAO,CAAC,KAAI,MAAK,MAAM,GAAG,EAAE,CAAqB,CAAC,CACnE,MAAM;;AAIb,QAAO,QAAQ,OAAO,CAAC,KAAI,MAAK,MAAM,GAAG,UAAU,CAAqB"}
1
+ {"version":3,"file":"extend.mjs","names":[],"sources":["../../src/plugin-utils/extend.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { isFunction } from \"@stryke/type-checks/is-function\";\nimport {\n PartialPlugin,\n PartialPluginFactory,\n PluginFactory\n} from \"../types/config\";\nimport { PluginContext } from \"../types/context\";\nimport { Plugin } from \"../types/plugin\";\nimport { merge } from \"./merge\";\n\n/**\n * Adds additional helper functionality to a plugin via a plugin builder function.\n *\n * @param plugin - The base plugin object or factory function to extend.\n * @param extension - The plugin extension object or factory function. This function receives the plugin options and returns a plugin object.\n * @returns A function accepting the plugin options and returning the extended plugin.\n */\nexport function extend<\n TContext extends PluginContext = PluginContext,\n TPluginOptions = unknown,\n TExtensionOptions = unknown\n>(\n plugin: PluginFactory<TContext, TPluginOptions>,\n extension: PartialPluginFactory<TContext, TExtensionOptions>\n): PluginFactory<TContext, TPluginOptions & TExtensionOptions>;\nexport function extend<\n TContext extends PluginContext = PluginContext,\n TPluginOptions = unknown\n>(\n plugin: PluginFactory<TContext, TPluginOptions>,\n extension: PartialPlugin<TContext>\n): PluginFactory<TContext, TPluginOptions>;\nexport function extend<\n TContext extends PluginContext = PluginContext,\n TExtensionOptions = unknown\n>(\n plugin: Plugin<TContext> | Plugin<TContext>[],\n extension: PartialPluginFactory<TContext, TExtensionOptions>\n): PluginFactory<TContext, TExtensionOptions>;\nexport function extend<TContext extends PluginContext = PluginContext>(\n plugin: Plugin<TContext> | Plugin<TContext>[],\n extension: PartialPlugin<TContext>\n): Plugin<TContext>[];\nexport function extend<TContext extends PluginContext = PluginContext>(\n plugin: Plugin<TContext> | Plugin<TContext>[] | PluginFactory<TContext, any>,\n extension: PartialPlugin<TContext> | PartialPluginFactory<TContext, any>\n): PluginFactory<TContext, any> | Plugin<TContext>[] {\n if (isFunction(plugin)) {\n if (isFunction(extension)) {\n return async (options: any) => {\n const pluginResult = toArray(await Promise.resolve(plugin(options)));\n const extensionResult = toArray(\n await Promise.resolve(extension(options))\n );\n\n return pluginResult\n .map(p => extensionResult.map(e => merge(p, e) as Plugin<TContext>))\n .flat();\n };\n }\n\n return async (options: any) => {\n const result = toArray(await Promise.resolve(plugin(options)));\n\n return result.map(p => merge(p, extension) as Plugin<TContext>);\n };\n } else if (isFunction(extension)) {\n return async (options: any) => {\n const result = toArray(await Promise.resolve(extension(options)));\n\n return result\n .map(e => toArray(plugin).map(p => merge(p, e) as Plugin<TContext>))\n .flat();\n };\n }\n\n return toArray(plugin).map(p => merge(p, extension) as Plugin<TContext>);\n}\n"],"mappings":";;;;;AA8DA,SAAgB,OACd,QACA,WACmD;AACnD,KAAI,WAAW,OAAO,EAAE;AACtB,MAAI,WAAW,UAAU,CACvB,QAAO,OAAO,YAAiB;GAC7B,MAAM,eAAe,QAAQ,MAAM,QAAQ,QAAQ,OAAO,QAAQ,CAAC,CAAC;GACpE,MAAM,kBAAkB,QACtB,MAAM,QAAQ,QAAQ,UAAU,QAAQ,CAAC,CAC1C;AAED,UAAO,aACJ,KAAI,MAAK,gBAAgB,KAAI,MAAK,MAAM,GAAG,EAAE,CAAqB,CAAC,CACnE,MAAM;;AAIb,SAAO,OAAO,YAAiB;AAG7B,UAFe,QAAQ,MAAM,QAAQ,QAAQ,OAAO,QAAQ,CAAC,CAEhD,CAAC,KAAI,MAAK,MAAM,GAAG,UAAU,CAAqB;;YAExD,WAAW,UAAU,CAC9B,QAAO,OAAO,YAAiB;AAG7B,SAFe,QAAQ,MAAM,QAAQ,QAAQ,UAAU,QAAQ,CAAC,CAEnD,CACV,KAAI,MAAK,QAAQ,OAAO,CAAC,KAAI,MAAK,MAAM,GAAG,EAAE,CAAqB,CAAC,CACnE,MAAM;;AAIb,QAAO,QAAQ,OAAO,CAAC,KAAI,MAAK,MAAM,GAAG,UAAU,CAAqB"}
@@ -0,0 +1,101 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
+ const require_plugin_utils_virtual = require('./virtual.cjs');
4
+ let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
5
+ let _stryke_convert_to_array = require("@stryke/convert/to-array");
6
+ let _stryke_type_checks_is_regexp = require("@stryke/type-checks/is-regexp");
7
+ let _stryke_path_is_type = require("@stryke/path/is-type");
8
+ let node_path = require("node:path");
9
+ let picomatch = require("picomatch");
10
+ picomatch = require_runtime.__toESM(picomatch, 1);
11
+
12
+ //#region src/plugin-utils/filter.ts
13
+ const BACKSLASH_REGEX = /\\/g;
14
+ function normalize(path) {
15
+ return require_plugin_utils_virtual.removeVirtualPrefix(path).replace(BACKSLASH_REGEX, "/");
16
+ }
17
+ function getMatcherString(glob, cwd) {
18
+ if (glob.startsWith("**") || (0, _stryke_path_is_type.isAbsolutePath)(glob)) return normalize(glob);
19
+ return normalize((0, node_path.resolve)(cwd, glob));
20
+ }
21
+ function patternToIdFilter(pattern) {
22
+ if (pattern instanceof RegExp) return (id) => {
23
+ const normalizedId = normalize(id);
24
+ const result = pattern.test(normalizedId);
25
+ pattern.lastIndex = 0;
26
+ return result;
27
+ };
28
+ const matcher = (0, picomatch.default)(getMatcherString(pattern, process.cwd()), { dot: true });
29
+ return (id) => {
30
+ return matcher(normalize(id));
31
+ };
32
+ }
33
+ function patternToCodeFilter(pattern) {
34
+ if (pattern instanceof RegExp) return (code) => {
35
+ const result = pattern.test(code);
36
+ pattern.lastIndex = 0;
37
+ return result;
38
+ };
39
+ return (code) => code.includes(pattern);
40
+ }
41
+ function createFilter(exclude, include) {
42
+ if (!exclude && !include) return;
43
+ return (input) => {
44
+ if (exclude?.some((filter) => filter(input))) return false;
45
+ if (include?.some((filter) => filter(input))) return true;
46
+ return !(include && include.length > 0);
47
+ };
48
+ }
49
+ function normalizeSingleFilter(filter) {
50
+ if ((0, _stryke_type_checks_is_set_string.isSetString)(filter)) return require_plugin_utils_virtual.removeVirtualPrefix(filter);
51
+ return filter;
52
+ }
53
+ function normalizeFilter(filter) {
54
+ if ((0, _stryke_type_checks_is_set_string.isSetString)(filter) || (0, _stryke_type_checks_is_regexp.isRegExp)(filter)) return { include: [normalizeSingleFilter(filter)] };
55
+ if (Array.isArray(filter)) return { include: filter.map(normalizeSingleFilter) };
56
+ return {
57
+ exclude: filter.exclude ? (0, _stryke_convert_to_array.toArray)(filter.exclude).map(normalizeSingleFilter) : void 0,
58
+ include: filter.include ? (0, _stryke_convert_to_array.toArray)(filter.include).map(normalizeSingleFilter) : void 0
59
+ };
60
+ }
61
+ function createIdFilter(filter) {
62
+ if (!filter) return;
63
+ const { exclude, include } = normalizeFilter(filter);
64
+ const excludeFilter = exclude?.map(patternToIdFilter);
65
+ const includeFilter = include?.map(patternToIdFilter);
66
+ return createFilter(excludeFilter, includeFilter);
67
+ }
68
+ function createCodeFilter(filter) {
69
+ if (!filter) return;
70
+ const { exclude, include } = normalizeFilter(filter);
71
+ const excludeFilter = exclude?.map(patternToCodeFilter);
72
+ const includeFilter = include?.map(patternToCodeFilter);
73
+ return createFilter(excludeFilter, includeFilter);
74
+ }
75
+ function createFilterForId(filter) {
76
+ const filterFunction = createIdFilter(filter);
77
+ return filterFunction ? (id) => !!filterFunction(id) : void 0;
78
+ }
79
+ function createFilterForTransform(idFilter, codeFilter) {
80
+ if (!idFilter && !codeFilter) return;
81
+ const idFilterFunction = createIdFilter(idFilter);
82
+ const codeFilterFunction = createCodeFilter(codeFilter);
83
+ return (id, code) => {
84
+ let fallback = true;
85
+ if (idFilterFunction) fallback &&= idFilterFunction(id);
86
+ if (!fallback) return false;
87
+ if (codeFilterFunction) fallback &&= codeFilterFunction(code);
88
+ return fallback;
89
+ };
90
+ }
91
+
92
+ //#endregion
93
+ exports.createCodeFilter = createCodeFilter;
94
+ exports.createFilter = createFilter;
95
+ exports.createFilterForId = createFilterForId;
96
+ exports.createFilterForTransform = createFilterForTransform;
97
+ exports.createIdFilter = createIdFilter;
98
+ exports.normalizeFilter = normalizeFilter;
99
+ exports.normalizeSingleFilter = normalizeSingleFilter;
100
+ exports.patternToCodeFilter = patternToCodeFilter;
101
+ exports.patternToIdFilter = patternToIdFilter;
@@ -0,0 +1,16 @@
1
+ import { NormalizedStringFilter, PluginFilter, TransformHookFilter } from "../types/hooks.cjs";
2
+ import { StringFilter, StringOrRegExp } from "unplugin";
3
+
4
+ //#region src/plugin-utils/filter.d.ts
5
+ declare function patternToIdFilter(pattern: StringOrRegExp): PluginFilter;
6
+ declare function patternToCodeFilter(pattern: StringOrRegExp): PluginFilter;
7
+ declare function createFilter(exclude: PluginFilter[] | undefined, include: PluginFilter[] | undefined): PluginFilter | undefined;
8
+ declare function normalizeSingleFilter(filter: string | RegExp): string | RegExp;
9
+ declare function normalizeFilter(filter: StringFilter): NormalizedStringFilter;
10
+ declare function createIdFilter(filter: StringFilter | undefined): PluginFilter | undefined;
11
+ declare function createCodeFilter(filter: StringFilter | undefined): PluginFilter | undefined;
12
+ declare function createFilterForId(filter: StringFilter | undefined): PluginFilter | undefined;
13
+ declare function createFilterForTransform(idFilter: StringFilter | undefined, codeFilter: StringFilter | undefined): TransformHookFilter | undefined;
14
+ //#endregion
15
+ export { createCodeFilter, createFilter, createFilterForId, createFilterForTransform, createIdFilter, normalizeFilter, normalizeSingleFilter, patternToCodeFilter, patternToIdFilter };
16
+ //# sourceMappingURL=filter.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filter.d.cts","names":[],"sources":["../../src/plugin-utils/filter.ts"],"mappings":";;;;iBA+CgB,iBAAA,CAAkB,OAAA,EAAS,cAAA,GAAiB,YAAA;AAAA,iBAoB5C,mBAAA,CAAoB,OAAA,EAAS,cAAA,GAAiB,YAAA;AAAA,iBAW9C,YAAA,CACd,OAAA,EAAS,YAAA,gBACT,OAAA,EAAS,YAAA,iBACR,YAAA;AAAA,iBAgBa,qBAAA,CACd,MAAA,WAAiB,MAAA,YACP,MAAA;AAAA,iBAQI,eAAA,CAAgB,MAAA,EAAQ,YAAA,GAAe,sBAAA;AAAA,iBAuBvC,cAAA,CACd,MAAA,EAAQ,YAAA,eACP,YAAA;AAAA,iBASa,gBAAA,CACd,MAAA,EAAQ,YAAA,eACP,YAAA;AAAA,iBASa,iBAAA,CACd,MAAA,EAAQ,YAAA,eACP,YAAA;AAAA,iBAMa,wBAAA,CACd,QAAA,EAAU,YAAA,cACV,UAAA,EAAY,YAAA,eACX,mBAAA"}
@@ -0,0 +1,16 @@
1
+ import { NormalizedStringFilter, PluginFilter, TransformHookFilter } from "../types/hooks.mjs";
2
+ import { StringFilter, StringOrRegExp } from "unplugin";
3
+
4
+ //#region src/plugin-utils/filter.d.ts
5
+ declare function patternToIdFilter(pattern: StringOrRegExp): PluginFilter;
6
+ declare function patternToCodeFilter(pattern: StringOrRegExp): PluginFilter;
7
+ declare function createFilter(exclude: PluginFilter[] | undefined, include: PluginFilter[] | undefined): PluginFilter | undefined;
8
+ declare function normalizeSingleFilter(filter: string | RegExp): string | RegExp;
9
+ declare function normalizeFilter(filter: StringFilter): NormalizedStringFilter;
10
+ declare function createIdFilter(filter: StringFilter | undefined): PluginFilter | undefined;
11
+ declare function createCodeFilter(filter: StringFilter | undefined): PluginFilter | undefined;
12
+ declare function createFilterForId(filter: StringFilter | undefined): PluginFilter | undefined;
13
+ declare function createFilterForTransform(idFilter: StringFilter | undefined, codeFilter: StringFilter | undefined): TransformHookFilter | undefined;
14
+ //#endregion
15
+ export { createCodeFilter, createFilter, createFilterForId, createFilterForTransform, createIdFilter, normalizeFilter, normalizeSingleFilter, patternToCodeFilter, patternToIdFilter };
16
+ //# sourceMappingURL=filter.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filter.d.mts","names":[],"sources":["../../src/plugin-utils/filter.ts"],"mappings":";;;;iBA+CgB,iBAAA,CAAkB,OAAA,EAAS,cAAA,GAAiB,YAAA;AAAA,iBAoB5C,mBAAA,CAAoB,OAAA,EAAS,cAAA,GAAiB,YAAA;AAAA,iBAW9C,YAAA,CACd,OAAA,EAAS,YAAA,gBACT,OAAA,EAAS,YAAA,iBACR,YAAA;AAAA,iBAgBa,qBAAA,CACd,MAAA,WAAiB,MAAA,YACP,MAAA;AAAA,iBAQI,eAAA,CAAgB,MAAA,EAAQ,YAAA,GAAe,sBAAA;AAAA,iBAuBvC,cAAA,CACd,MAAA,EAAQ,YAAA,eACP,YAAA;AAAA,iBASa,gBAAA,CACd,MAAA,EAAQ,YAAA,eACP,YAAA;AAAA,iBASa,iBAAA,CACd,MAAA,EAAQ,YAAA,eACP,YAAA;AAAA,iBAMa,wBAAA,CACd,QAAA,EAAU,YAAA,cACV,UAAA,EAAY,YAAA,eACX,mBAAA"}
@@ -0,0 +1,91 @@
1
+ import { removeVirtualPrefix } from "./virtual.mjs";
2
+ import { isSetString } from "@stryke/type-checks/is-set-string";
3
+ import { toArray } from "@stryke/convert/to-array";
4
+ import { isRegExp } from "@stryke/type-checks/is-regexp";
5
+ import { isAbsolutePath } from "@stryke/path/is-type";
6
+ import { resolve } from "node:path";
7
+ import picomatch from "picomatch";
8
+
9
+ //#region src/plugin-utils/filter.ts
10
+ const BACKSLASH_REGEX = /\\/g;
11
+ function normalize(path) {
12
+ return removeVirtualPrefix(path).replace(BACKSLASH_REGEX, "/");
13
+ }
14
+ function getMatcherString(glob, cwd) {
15
+ if (glob.startsWith("**") || isAbsolutePath(glob)) return normalize(glob);
16
+ return normalize(resolve(cwd, glob));
17
+ }
18
+ function patternToIdFilter(pattern) {
19
+ if (pattern instanceof RegExp) return (id) => {
20
+ const normalizedId = normalize(id);
21
+ const result = pattern.test(normalizedId);
22
+ pattern.lastIndex = 0;
23
+ return result;
24
+ };
25
+ const matcher = picomatch(getMatcherString(pattern, process.cwd()), { dot: true });
26
+ return (id) => {
27
+ return matcher(normalize(id));
28
+ };
29
+ }
30
+ function patternToCodeFilter(pattern) {
31
+ if (pattern instanceof RegExp) return (code) => {
32
+ const result = pattern.test(code);
33
+ pattern.lastIndex = 0;
34
+ return result;
35
+ };
36
+ return (code) => code.includes(pattern);
37
+ }
38
+ function createFilter(exclude, include) {
39
+ if (!exclude && !include) return;
40
+ return (input) => {
41
+ if (exclude?.some((filter) => filter(input))) return false;
42
+ if (include?.some((filter) => filter(input))) return true;
43
+ return !(include && include.length > 0);
44
+ };
45
+ }
46
+ function normalizeSingleFilter(filter) {
47
+ if (isSetString(filter)) return removeVirtualPrefix(filter);
48
+ return filter;
49
+ }
50
+ function normalizeFilter(filter) {
51
+ if (isSetString(filter) || isRegExp(filter)) return { include: [normalizeSingleFilter(filter)] };
52
+ if (Array.isArray(filter)) return { include: filter.map(normalizeSingleFilter) };
53
+ return {
54
+ exclude: filter.exclude ? toArray(filter.exclude).map(normalizeSingleFilter) : void 0,
55
+ include: filter.include ? toArray(filter.include).map(normalizeSingleFilter) : void 0
56
+ };
57
+ }
58
+ function createIdFilter(filter) {
59
+ if (!filter) return;
60
+ const { exclude, include } = normalizeFilter(filter);
61
+ const excludeFilter = exclude?.map(patternToIdFilter);
62
+ const includeFilter = include?.map(patternToIdFilter);
63
+ return createFilter(excludeFilter, includeFilter);
64
+ }
65
+ function createCodeFilter(filter) {
66
+ if (!filter) return;
67
+ const { exclude, include } = normalizeFilter(filter);
68
+ const excludeFilter = exclude?.map(patternToCodeFilter);
69
+ const includeFilter = include?.map(patternToCodeFilter);
70
+ return createFilter(excludeFilter, includeFilter);
71
+ }
72
+ function createFilterForId(filter) {
73
+ const filterFunction = createIdFilter(filter);
74
+ return filterFunction ? (id) => !!filterFunction(id) : void 0;
75
+ }
76
+ function createFilterForTransform(idFilter, codeFilter) {
77
+ if (!idFilter && !codeFilter) return;
78
+ const idFilterFunction = createIdFilter(idFilter);
79
+ const codeFilterFunction = createCodeFilter(codeFilter);
80
+ return (id, code) => {
81
+ let fallback = true;
82
+ if (idFilterFunction) fallback &&= idFilterFunction(id);
83
+ if (!fallback) return false;
84
+ if (codeFilterFunction) fallback &&= codeFilterFunction(code);
85
+ return fallback;
86
+ };
87
+ }
88
+
89
+ //#endregion
90
+ export { createCodeFilter, createFilter, createFilterForId, createFilterForTransform, createIdFilter, normalizeFilter, normalizeSingleFilter, patternToCodeFilter, patternToIdFilter };
91
+ //# sourceMappingURL=filter.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filter.mjs","names":[],"sources":["../../src/plugin-utils/filter.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { isAbsolutePath } from \"@stryke/path/is-type\";\nimport { isRegExp } from \"@stryke/type-checks/is-regexp\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { resolve } from \"node:path\";\nimport picomatch from \"picomatch\";\nimport type { StringFilter, StringOrRegExp } from \"unplugin\";\nimport {\n NormalizedStringFilter,\n PluginFilter,\n TransformHookFilter\n} from \"../types/hooks\";\nimport { removeVirtualPrefix } from \"./virtual\";\n\nconst BACKSLASH_REGEX = /\\\\/g;\nfunction normalize(path: string): string {\n return removeVirtualPrefix(path).replace(BACKSLASH_REGEX, \"/\");\n}\n\nfunction getMatcherString(glob: string, cwd: string) {\n if (glob.startsWith(\"**\") || isAbsolutePath(glob)) {\n return normalize(glob);\n }\n\n const resolved = resolve(cwd, glob);\n\n return normalize(resolved);\n}\n\nexport function patternToIdFilter(pattern: StringOrRegExp): PluginFilter {\n if (pattern instanceof RegExp) {\n return (id: string) => {\n const normalizedId = normalize(id);\n const result = pattern.test(normalizedId);\n pattern.lastIndex = 0;\n return result;\n };\n }\n const cwd = process.cwd();\n const glob = getMatcherString(pattern, cwd);\n const matcher = picomatch(glob, { dot: true });\n\n return (id: string) => {\n const normalizedId = normalize(id);\n\n return matcher(normalizedId);\n };\n}\n\nexport function patternToCodeFilter(pattern: StringOrRegExp): PluginFilter {\n if (pattern instanceof RegExp) {\n return (code: string) => {\n const result = pattern.test(code);\n pattern.lastIndex = 0;\n return result;\n };\n }\n return (code: string) => code.includes(pattern);\n}\n\nexport function createFilter(\n exclude: PluginFilter[] | undefined,\n include: PluginFilter[] | undefined\n): PluginFilter | undefined {\n if (!exclude && !include) {\n return;\n }\n\n return input => {\n if (exclude?.some(filter => filter(input))) {\n return false;\n }\n if (include?.some(filter => filter(input))) {\n return true;\n }\n return !(include && include.length > 0);\n };\n}\n\nexport function normalizeSingleFilter(\n filter: string | RegExp\n): string | RegExp {\n if (isSetString(filter)) {\n return removeVirtualPrefix(filter);\n }\n\n return filter;\n}\n\nexport function normalizeFilter(filter: StringFilter): NormalizedStringFilter {\n if (isSetString(filter) || isRegExp(filter)) {\n return {\n include: [normalizeSingleFilter(filter)]\n };\n }\n\n if (Array.isArray(filter)) {\n return {\n include: filter.map(normalizeSingleFilter)\n };\n }\n\n return {\n exclude: filter.exclude\n ? toArray(filter.exclude).map(normalizeSingleFilter)\n : undefined,\n include: filter.include\n ? toArray(filter.include).map(normalizeSingleFilter)\n : undefined\n };\n}\n\nexport function createIdFilter(\n filter: StringFilter | undefined\n): PluginFilter | undefined {\n if (!filter) return;\n const { exclude, include } = normalizeFilter(filter);\n const excludeFilter = exclude?.map(patternToIdFilter);\n const includeFilter = include?.map(patternToIdFilter);\n\n return createFilter(excludeFilter, includeFilter);\n}\n\nexport function createCodeFilter(\n filter: StringFilter | undefined\n): PluginFilter | undefined {\n if (!filter) return;\n const { exclude, include } = normalizeFilter(filter);\n const excludeFilter = exclude?.map(patternToCodeFilter);\n const includeFilter = include?.map(patternToCodeFilter);\n\n return createFilter(excludeFilter, includeFilter);\n}\n\nexport function createFilterForId(\n filter: StringFilter | undefined\n): PluginFilter | undefined {\n const filterFunction = createIdFilter(filter);\n\n return filterFunction ? id => !!filterFunction(id) : undefined;\n}\n\nexport function createFilterForTransform(\n idFilter: StringFilter | undefined,\n codeFilter: StringFilter | undefined\n): TransformHookFilter | undefined {\n if (!idFilter && !codeFilter) return;\n const idFilterFunction = createIdFilter(idFilter);\n const codeFilterFunction = createCodeFilter(codeFilter);\n\n return (id, code) => {\n let fallback = true;\n if (idFilterFunction) {\n fallback &&= idFilterFunction(id);\n }\n if (!fallback) {\n return false;\n }\n\n if (codeFilterFunction) {\n fallback &&= codeFilterFunction(code);\n }\n return fallback;\n };\n}\n"],"mappings":";;;;;;;;;AAgCA,MAAM,kBAAkB;AACxB,SAAS,UAAU,MAAsB;AACvC,QAAO,oBAAoB,KAAK,CAAC,QAAQ,iBAAiB,IAAI;;AAGhE,SAAS,iBAAiB,MAAc,KAAa;AACnD,KAAI,KAAK,WAAW,KAAK,IAAI,eAAe,KAAK,CAC/C,QAAO,UAAU,KAAK;AAKxB,QAAO,UAFU,QAAQ,KAAK,KAEL,CAAC;;AAG5B,SAAgB,kBAAkB,SAAuC;AACvE,KAAI,mBAAmB,OACrB,SAAQ,OAAe;EACrB,MAAM,eAAe,UAAU,GAAG;EAClC,MAAM,SAAS,QAAQ,KAAK,aAAa;AACzC,UAAQ,YAAY;AACpB,SAAO;;CAKX,MAAM,UAAU,UADH,iBAAiB,SADlB,QAAQ,KACsB,CACZ,EAAE,EAAE,KAAK,MAAM,CAAC;AAE9C,SAAQ,OAAe;AAGrB,SAAO,QAFc,UAAU,GAEJ,CAAC;;;AAIhC,SAAgB,oBAAoB,SAAuC;AACzE,KAAI,mBAAmB,OACrB,SAAQ,SAAiB;EACvB,MAAM,SAAS,QAAQ,KAAK,KAAK;AACjC,UAAQ,YAAY;AACpB,SAAO;;AAGX,SAAQ,SAAiB,KAAK,SAAS,QAAQ;;AAGjD,SAAgB,aACd,SACA,SAC0B;AAC1B,KAAI,CAAC,WAAW,CAAC,QACf;AAGF,SAAO,UAAS;AACd,MAAI,SAAS,MAAK,WAAU,OAAO,MAAM,CAAC,CACxC,QAAO;AAET,MAAI,SAAS,MAAK,WAAU,OAAO,MAAM,CAAC,CACxC,QAAO;AAET,SAAO,EAAE,WAAW,QAAQ,SAAS;;;AAIzC,SAAgB,sBACd,QACiB;AACjB,KAAI,YAAY,OAAO,CACrB,QAAO,oBAAoB,OAAO;AAGpC,QAAO;;AAGT,SAAgB,gBAAgB,QAA8C;AAC5E,KAAI,YAAY,OAAO,IAAI,SAAS,OAAO,CACzC,QAAO,EACL,SAAS,CAAC,sBAAsB,OAAO,CAAC,EACzC;AAGH,KAAI,MAAM,QAAQ,OAAO,CACvB,QAAO,EACL,SAAS,OAAO,IAAI,sBAAsB,EAC3C;AAGH,QAAO;EACL,SAAS,OAAO,UACZ,QAAQ,OAAO,QAAQ,CAAC,IAAI,sBAAsB,GAClD;EACJ,SAAS,OAAO,UACZ,QAAQ,OAAO,QAAQ,CAAC,IAAI,sBAAsB,GAClD;EACL;;AAGH,SAAgB,eACd,QAC0B;AAC1B,KAAI,CAAC,OAAQ;CACb,MAAM,EAAE,SAAS,YAAY,gBAAgB,OAAO;CACpD,MAAM,gBAAgB,SAAS,IAAI,kBAAkB;CACrD,MAAM,gBAAgB,SAAS,IAAI,kBAAkB;AAErD,QAAO,aAAa,eAAe,cAAc;;AAGnD,SAAgB,iBACd,QAC0B;AAC1B,KAAI,CAAC,OAAQ;CACb,MAAM,EAAE,SAAS,YAAY,gBAAgB,OAAO;CACpD,MAAM,gBAAgB,SAAS,IAAI,oBAAoB;CACvD,MAAM,gBAAgB,SAAS,IAAI,oBAAoB;AAEvD,QAAO,aAAa,eAAe,cAAc;;AAGnD,SAAgB,kBACd,QAC0B;CAC1B,MAAM,iBAAiB,eAAe,OAAO;AAE7C,QAAO,kBAAiB,OAAM,CAAC,CAAC,eAAe,GAAG,GAAG;;AAGvD,SAAgB,yBACd,UACA,YACiC;AACjC,KAAI,CAAC,YAAY,CAAC,WAAY;CAC9B,MAAM,mBAAmB,eAAe,SAAS;CACjD,MAAM,qBAAqB,iBAAiB,WAAW;AAEvD,SAAQ,IAAI,SAAS;EACnB,IAAI,WAAW;AACf,MAAI,iBACF,cAAa,iBAAiB,GAAG;AAEnC,MAAI,CAAC,SACH,QAAO;AAGT,MAAI,mBACF,cAAa,mBAAmB,KAAK;AAEvC,SAAO"}
@@ -11,7 +11,7 @@ let _stryke_path_join = require("@stryke/path/join");
11
11
  * @param context - The powerlines context.
12
12
  */
13
13
  async function formatPackageJson(context) {
14
- const packageJsonPath = (0, _stryke_path_join.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.root, "package.json");
14
+ const packageJsonPath = (0, _stryke_path_join.joinPaths)(context.config.cwd, context.config.root, "package.json");
15
15
  const packageJsonFile = await context.fs.read(packageJsonPath);
16
16
  if ((0, _stryke_type_checks_is_set_string.isSetString)(packageJsonFile)) await context.fs.write(packageJsonPath, await require_lib_utilities_format.format(context, packageJsonPath, packageJsonFile));
17
17
  }
@@ -9,7 +9,7 @@ import { joinPaths } from "@stryke/path/join";
9
9
  * @param context - The powerlines context.
10
10
  */
11
11
  async function formatPackageJson(context) {
12
- const packageJsonPath = joinPaths(context.workspaceConfig.workspaceRoot, context.config.root, "package.json");
12
+ const packageJsonPath = joinPaths(context.config.cwd, context.config.root, "package.json");
13
13
  const packageJsonFile = await context.fs.read(packageJsonPath);
14
14
  if (isSetString(packageJsonFile)) await context.fs.write(packageJsonPath, await format(context, packageJsonPath, packageJsonFile));
15
15
  }
@@ -1 +1 @@
1
- {"version":3,"file":"format-package-json.mjs","names":[],"sources":["../../src/plugin-utils/format-package-json.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { joinPaths } from \"@stryke/path/join\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { format } from \"../lib/utilities/format\";\nimport { Context } from \"../types/context\";\n\n/**\n * Formats the `package.json` file in the project root.\n *\n * @param context - The powerlines context.\n */\nexport async function formatPackageJson(context: Context) {\n const packageJsonPath = joinPaths(\n context.workspaceConfig.workspaceRoot,\n context.config.root,\n \"package.json\"\n );\n\n const packageJsonFile = await context.fs.read(packageJsonPath);\n if (isSetString(packageJsonFile)) {\n await context.fs.write(\n packageJsonPath,\n await format(context, packageJsonPath, packageJsonFile)\n );\n }\n}\n"],"mappings":";;;;;;;;;;AA4BA,eAAsB,kBAAkB,SAAkB;CACxD,MAAM,kBAAkB,UACtB,QAAQ,gBAAgB,eACxB,QAAQ,OAAO,MACf,eACD;CAED,MAAM,kBAAkB,MAAM,QAAQ,GAAG,KAAK,gBAAgB;AAC9D,KAAI,YAAY,gBAAgB,CAC9B,OAAM,QAAQ,GAAG,MACf,iBACA,MAAM,OAAO,SAAS,iBAAiB,gBAAgB,CACxD"}
1
+ {"version":3,"file":"format-package-json.mjs","names":[],"sources":["../../src/plugin-utils/format-package-json.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { joinPaths } from \"@stryke/path/join\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { format } from \"../lib/utilities/format\";\nimport { Context } from \"../types/context\";\n\n/**\n * Formats the `package.json` file in the project root.\n *\n * @param context - The powerlines context.\n */\nexport async function formatPackageJson(context: Context) {\n const packageJsonPath = joinPaths(\n context.config.cwd,\n context.config.root,\n \"package.json\"\n );\n\n const packageJsonFile = await context.fs.read(packageJsonPath);\n if (isSetString(packageJsonFile)) {\n await context.fs.write(\n packageJsonPath,\n await format(context, packageJsonPath, packageJsonFile)\n );\n }\n}\n"],"mappings":";;;;;;;;;;AA4BA,eAAsB,kBAAkB,SAAkB;CACxD,MAAM,kBAAkB,UACtB,QAAQ,OAAO,KACf,QAAQ,OAAO,MACf,eACD;CAED,MAAM,kBAAkB,MAAM,QAAQ,GAAG,KAAK,gBAAgB;AAC9D,KAAI,YAAY,gBAAgB,CAC9B,OAAM,QAAQ,GAAG,MACf,iBACA,MAAM,OAAO,SAAS,iBAAiB,gBAAgB,CACxD"}
@@ -0,0 +1,44 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
+ let _stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
4
+ let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
5
+ let _stryke_convert_to_array = require("@stryke/convert/to-array");
6
+ let _stryke_type_checks_is_regexp = require("@stryke/type-checks/is-regexp");
7
+ let _stryke_type_checks_is_set_array = require("@stryke/type-checks/is-set-array");
8
+ let _stryke_helpers_omit = require("@stryke/helpers/omit");
9
+
10
+ //#region src/plugin-utils/format.ts
11
+ /**
12
+ * Formats a configuration object into a human-readable string, omitting certain properties and simplifying others for better readability.
13
+ *
14
+ * @param config - The configuration object to format.
15
+ * @returns A formatted string representation of the configuration.
16
+ */
17
+ function formatConfig(config) {
18
+ return JSON.stringify(Object.fromEntries(Object.entries({
19
+ ...(0, _stryke_helpers_omit.omit)(config, [
20
+ "deps",
21
+ "resolve",
22
+ "plugins",
23
+ "initialConfig",
24
+ "userConfig",
25
+ "inlineConfig",
26
+ "pluginConfig",
27
+ "environmentConfig"
28
+ ]),
29
+ deps: (0, _stryke_type_checks_is_set_object.isSetObject)(config.deps) ? {
30
+ alwaysBundle: (0, _stryke_type_checks_is_set_array.isSetArray)(config.deps?.alwaysBundle) ? (config.deps?.alwaysBundle ?? []).filter(Boolean).map((alwaysBundle) => (0, _stryke_type_checks_is_set_string.isSetString)(alwaysBundle) ? alwaysBundle : (0, _stryke_type_checks_is_regexp.isRegExp)(alwaysBundle) ? alwaysBundle.source : "<unknown-bundle>") : void 0,
31
+ onlyBundle: (0, _stryke_type_checks_is_set_array.isSetArray)(config.deps?.onlyBundle) ? (config.deps?.onlyBundle ?? []).filter(Boolean).map((onlyBundle) => (0, _stryke_type_checks_is_set_string.isSetString)(onlyBundle) ? onlyBundle : (0, _stryke_type_checks_is_regexp.isRegExp)(onlyBundle) ? onlyBundle.source : "<unknown-bundle>") : void 0,
32
+ neverBundle: (0, _stryke_type_checks_is_set_array.isSetArray)(config.deps?.neverBundle) ? (config.deps?.neverBundle ?? []).filter(Boolean).map((neverBundle) => (0, _stryke_type_checks_is_set_string.isSetString)(neverBundle) ? neverBundle : (0, _stryke_type_checks_is_regexp.isRegExp)(neverBundle) ? neverBundle.source : "<unknown-bundle>") : void 0
33
+ } : void 0,
34
+ resolve: (0, _stryke_type_checks_is_set_object.isSetObject)(config.resolve) ? {
35
+ ...config.resolve,
36
+ external: (0, _stryke_type_checks_is_set_array.isSetArray)(config.resolve?.external) ? (config.resolve?.external ?? []).filter(Boolean).map((external) => (0, _stryke_type_checks_is_set_string.isSetString)(external) ? external : (0, _stryke_type_checks_is_regexp.isRegExp)(external) ? external.source : "<unknown-bundle>") : void 0,
37
+ noExternal: (0, _stryke_type_checks_is_set_array.isSetArray)(config.resolve?.noExternal) ? (config.resolve?.noExternal ?? []).filter(Boolean).map((noExternal) => (0, _stryke_type_checks_is_set_string.isSetString)(noExternal) ? noExternal : (0, _stryke_type_checks_is_regexp.isRegExp)(noExternal) ? noExternal.source : "<unknown-bundle>") : void 0
38
+ } : void 0,
39
+ plugins: (0, _stryke_type_checks_is_set_array.isSetArray)(config.plugins) ? (0, _stryke_convert_to_array.toArray)(config.plugins)?.flatMap((plugin) => (0, _stryke_convert_to_array.toArray)(plugin))?.map((plugin) => String((0, _stryke_type_checks_is_set_string.isSetString)(plugin) ? plugin : (0, _stryke_type_checks_is_set_object.isSetObject)(plugin) && (0, _stryke_type_checks_is_set_string.isSetString)(plugin.name) ? plugin.name : Array.isArray(plugin) && (0, _stryke_type_checks_is_set_string.isSetString)(plugin[0]) ? plugin[0] : "<function-plugin>")) : void 0
40
+ }).sort(([key1], [key2]) => key1.localeCompare(key2))), null, 4).replace(/"([^"]+)":/g, "$1:").replace(/,\s*$/g, "");
41
+ }
42
+
43
+ //#endregion
44
+ exports.formatConfig = formatConfig;
@@ -0,0 +1,11 @@
1
+ //#region src/plugin-utils/format.d.ts
2
+ /**
3
+ * Formats a configuration object into a human-readable string, omitting certain properties and simplifying others for better readability.
4
+ *
5
+ * @param config - The configuration object to format.
6
+ * @returns A formatted string representation of the configuration.
7
+ */
8
+ declare function formatConfig(config: Record<string, any>): string;
9
+ //#endregion
10
+ export { formatConfig };
11
+ //# sourceMappingURL=format.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format.d.cts","names":[],"sources":["../../src/plugin-utils/format.ts"],"mappings":";;AAgCA;;;;;iBAAgB,YAAA,CAAa,MAAA,EAAQ,MAAA"}
@@ -0,0 +1,11 @@
1
+ //#region src/plugin-utils/format.d.ts
2
+ /**
3
+ * Formats a configuration object into a human-readable string, omitting certain properties and simplifying others for better readability.
4
+ *
5
+ * @param config - The configuration object to format.
6
+ * @returns A formatted string representation of the configuration.
7
+ */
8
+ declare function formatConfig(config: Record<string, any>): string;
9
+ //#endregion
10
+ export { formatConfig };
11
+ //# sourceMappingURL=format.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format.d.mts","names":[],"sources":["../../src/plugin-utils/format.ts"],"mappings":";;AAgCA;;;;;iBAAgB,YAAA,CAAa,MAAA,EAAQ,MAAA"}