@powerlines/plugin-alloy 0.26.237 → 0.26.239

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 (334) hide show
  1. package/dist/core/components/index.cjs +1 -9
  2. package/dist/core/components/index.d.cts +1 -5
  3. package/dist/core/components/index.d.mts +1 -5
  4. package/dist/core/components/index.mjs +1 -5
  5. package/dist/core/components/infrastructure-file.cjs +6 -3
  6. package/dist/core/components/infrastructure-file.d.cts +1 -1
  7. package/dist/core/components/infrastructure-file.d.cts.map +1 -1
  8. package/dist/core/components/infrastructure-file.d.mts +1 -1
  9. package/dist/core/components/infrastructure-file.mjs +5 -2
  10. package/dist/core/contexts/index.cjs +1 -11
  11. package/dist/core/contexts/index.d.cts +1 -3
  12. package/dist/core/contexts/index.d.mts +1 -3
  13. package/dist/core/contexts/index.mjs +1 -3
  14. package/dist/core/index.cjs +2 -23
  15. package/dist/core/index.d.cts +2 -10
  16. package/dist/core/index.d.mts +2 -10
  17. package/dist/core/index.mjs +2 -10
  18. package/dist/helpers/capnp.cjs +29 -29
  19. package/dist/helpers/capnp.d.cts +1 -1
  20. package/dist/helpers/capnp.d.cts.map +1 -1
  21. package/dist/helpers/capnp.d.mts +1 -1
  22. package/dist/helpers/capnp.mjs +3 -3
  23. package/dist/index.cjs +10 -2
  24. package/dist/index.d.cts +10 -4
  25. package/dist/index.d.cts.map +1 -1
  26. package/dist/index.d.mts +10 -4
  27. package/dist/index.mjs +10 -2
  28. package/dist/render.cjs +69 -52
  29. package/dist/render.d.cts +34 -5
  30. package/dist/render.d.cts.map +1 -1
  31. package/dist/render.d.mts +34 -5
  32. package/dist/render.mjs +70 -53
  33. package/dist/types/index.d.cts +2 -3
  34. package/dist/types/index.d.mts +2 -3
  35. package/dist/types/plugin.d.cts +7 -4
  36. package/dist/types/plugin.d.cts.map +1 -1
  37. package/dist/types/plugin.d.mts +7 -4
  38. package/dist/typescript/components/builtin-file.cjs +6 -6
  39. package/dist/typescript/components/builtin-file.d.cts +2 -2
  40. package/dist/typescript/components/builtin-file.d.cts.map +1 -1
  41. package/dist/typescript/components/builtin-file.d.mts +2 -2
  42. package/dist/typescript/components/builtin-file.mjs +2 -2
  43. package/dist/typescript/components/entry-file.cjs +2 -2
  44. package/dist/typescript/components/entry-file.d.cts +1 -1
  45. package/dist/typescript/components/entry-file.d.cts.map +1 -1
  46. package/dist/typescript/components/entry-file.d.mts +1 -1
  47. package/dist/typescript/components/entry-file.mjs +1 -1
  48. package/dist/typescript/components/index.cjs +1 -56
  49. package/dist/typescript/components/index.d.cts +1 -12
  50. package/dist/typescript/components/index.d.mts +1 -12
  51. package/dist/typescript/components/index.mjs +1 -12
  52. package/dist/typescript/index.cjs +1 -64
  53. package/dist/typescript/index.d.cts +1 -17
  54. package/dist/typescript/index.d.mts +1 -17
  55. package/dist/typescript/index.mjs +1 -17
  56. package/package.json +20 -641
  57. package/dist/core/components/output.cjs +0 -40
  58. package/dist/core/components/output.d.cts +0 -22
  59. package/dist/core/components/output.d.cts.map +0 -1
  60. package/dist/core/components/output.d.mts +0 -22
  61. package/dist/core/components/output.d.mts.map +0 -1
  62. package/dist/core/components/output.mjs +0 -40
  63. package/dist/core/components/output.mjs.map +0 -1
  64. package/dist/core/components/single-line-comment.cjs +0 -22
  65. package/dist/core/components/single-line-comment.d.cts +0 -19
  66. package/dist/core/components/single-line-comment.d.cts.map +0 -1
  67. package/dist/core/components/single-line-comment.d.mts +0 -19
  68. package/dist/core/components/single-line-comment.d.mts.map +0 -1
  69. package/dist/core/components/single-line-comment.mjs +0 -22
  70. package/dist/core/components/single-line-comment.mjs.map +0 -1
  71. package/dist/core/components/source-file.cjs +0 -64
  72. package/dist/core/components/source-file.d.cts +0 -30
  73. package/dist/core/components/source-file.d.cts.map +0 -1
  74. package/dist/core/components/source-file.d.mts +0 -30
  75. package/dist/core/components/source-file.d.mts.map +0 -1
  76. package/dist/core/components/source-file.mjs +0 -62
  77. package/dist/core/components/source-file.mjs.map +0 -1
  78. package/dist/core/components/spacing.cjs +0 -19
  79. package/dist/core/components/spacing.d.cts +0 -19
  80. package/dist/core/components/spacing.d.cts.map +0 -1
  81. package/dist/core/components/spacing.d.mts +0 -19
  82. package/dist/core/components/spacing.d.mts.map +0 -1
  83. package/dist/core/components/spacing.mjs +0 -19
  84. package/dist/core/components/spacing.mjs.map +0 -1
  85. package/dist/core/contexts/meta.cjs +0 -40
  86. package/dist/core/contexts/meta.d.cts +0 -46
  87. package/dist/core/contexts/meta.d.cts.map +0 -1
  88. package/dist/core/contexts/meta.d.mts +0 -46
  89. package/dist/core/contexts/meta.d.mts.map +0 -1
  90. package/dist/core/contexts/meta.mjs +0 -37
  91. package/dist/core/contexts/meta.mjs.map +0 -1
  92. package/dist/core/contexts/schema.cjs +0 -38
  93. package/dist/core/contexts/schema.d.cts +0 -26
  94. package/dist/core/contexts/schema.d.cts.map +0 -1
  95. package/dist/core/contexts/schema.d.mts +0 -26
  96. package/dist/core/contexts/schema.d.mts.map +0 -1
  97. package/dist/core/contexts/schema.mjs +0 -35
  98. package/dist/core/contexts/schema.mjs.map +0 -1
  99. package/dist/core/helpers/code.cjs +0 -33
  100. package/dist/core/helpers/code.d.cts +0 -28
  101. package/dist/core/helpers/code.d.cts.map +0 -1
  102. package/dist/core/helpers/code.d.mts +0 -28
  103. package/dist/core/helpers/code.d.mts.map +0 -1
  104. package/dist/core/helpers/code.mjs +0 -33
  105. package/dist/core/helpers/code.mjs.map +0 -1
  106. package/dist/core/helpers/index.cjs +0 -4
  107. package/dist/core/helpers/index.d.cts +0 -2
  108. package/dist/core/helpers/index.d.mts +0 -2
  109. package/dist/core/helpers/index.mjs +0 -3
  110. package/dist/hcl/components/block-declaration.cjs +0 -33
  111. package/dist/hcl/components/block-declaration.d.cts +0 -19
  112. package/dist/hcl/components/block-declaration.d.cts.map +0 -1
  113. package/dist/hcl/components/block-declaration.d.mts +0 -19
  114. package/dist/hcl/components/block-declaration.d.mts.map +0 -1
  115. package/dist/hcl/components/block-declaration.mjs +0 -33
  116. package/dist/hcl/components/block-declaration.mjs.map +0 -1
  117. package/dist/hcl/components/hcl-file.cjs +0 -82
  118. package/dist/hcl/components/hcl-file.d.cts +0 -25
  119. package/dist/hcl/components/hcl-file.d.cts.map +0 -1
  120. package/dist/hcl/components/hcl-file.d.mts +0 -25
  121. package/dist/hcl/components/hcl-file.d.mts.map +0 -1
  122. package/dist/hcl/components/hcl-file.mjs +0 -81
  123. package/dist/hcl/components/hcl-file.mjs.map +0 -1
  124. package/dist/hcl/components/index.cjs +0 -11
  125. package/dist/hcl/components/index.d.cts +0 -5
  126. package/dist/hcl/components/index.d.mts +0 -5
  127. package/dist/hcl/components/index.mjs +0 -6
  128. package/dist/hcl/components/packer-file.cjs +0 -28
  129. package/dist/hcl/components/packer-file.d.cts +0 -16
  130. package/dist/hcl/components/packer-file.d.cts.map +0 -1
  131. package/dist/hcl/components/packer-file.d.mts +0 -16
  132. package/dist/hcl/components/packer-file.d.mts.map +0 -1
  133. package/dist/hcl/components/packer-file.mjs +0 -28
  134. package/dist/hcl/components/packer-file.mjs.map +0 -1
  135. package/dist/hcl/components/terraform-file.cjs +0 -29
  136. package/dist/hcl/components/terraform-file.d.cts +0 -17
  137. package/dist/hcl/components/terraform-file.d.cts.map +0 -1
  138. package/dist/hcl/components/terraform-file.d.mts +0 -17
  139. package/dist/hcl/components/terraform-file.d.mts.map +0 -1
  140. package/dist/hcl/components/terraform-file.mjs +0 -29
  141. package/dist/hcl/components/terraform-file.mjs.map +0 -1
  142. package/dist/hcl/index.cjs +0 -12
  143. package/dist/hcl/index.d.cts +0 -6
  144. package/dist/hcl/index.d.mts +0 -6
  145. package/dist/hcl/index.mjs +0 -7
  146. package/dist/markdown/components/alert.cjs +0 -74
  147. package/dist/markdown/components/alert.d.cts +0 -52
  148. package/dist/markdown/components/alert.d.cts.map +0 -1
  149. package/dist/markdown/components/alert.d.mts +0 -52
  150. package/dist/markdown/components/alert.d.mts.map +0 -1
  151. package/dist/markdown/components/alert.mjs +0 -69
  152. package/dist/markdown/components/alert.mjs.map +0 -1
  153. package/dist/markdown/components/front-matter.cjs +0 -30
  154. package/dist/markdown/components/front-matter.d.cts +0 -13
  155. package/dist/markdown/components/front-matter.d.cts.map +0 -1
  156. package/dist/markdown/components/front-matter.d.mts +0 -13
  157. package/dist/markdown/components/front-matter.d.mts.map +0 -1
  158. package/dist/markdown/components/front-matter.mjs +0 -30
  159. package/dist/markdown/components/front-matter.mjs.map +0 -1
  160. package/dist/markdown/components/heading.cjs +0 -23
  161. package/dist/markdown/components/heading.d.cts +0 -17
  162. package/dist/markdown/components/heading.d.cts.map +0 -1
  163. package/dist/markdown/components/heading.d.mts +0 -17
  164. package/dist/markdown/components/heading.d.mts.map +0 -1
  165. package/dist/markdown/components/heading.mjs +0 -23
  166. package/dist/markdown/components/heading.mjs.map +0 -1
  167. package/dist/markdown/components/index.cjs +0 -20
  168. package/dist/markdown/components/index.d.cts +0 -6
  169. package/dist/markdown/components/index.d.mts +0 -6
  170. package/dist/markdown/components/index.mjs +0 -7
  171. package/dist/markdown/components/markdown-file.cjs +0 -146
  172. package/dist/markdown/components/markdown-file.d.cts +0 -25
  173. package/dist/markdown/components/markdown-file.d.cts.map +0 -1
  174. package/dist/markdown/components/markdown-file.d.mts +0 -25
  175. package/dist/markdown/components/markdown-file.d.mts.map +0 -1
  176. package/dist/markdown/components/markdown-file.mjs +0 -145
  177. package/dist/markdown/components/markdown-file.mjs.map +0 -1
  178. package/dist/markdown/components/markdown-table.cjs +0 -106
  179. package/dist/markdown/components/markdown-table.d.cts +0 -37
  180. package/dist/markdown/components/markdown-table.d.cts.map +0 -1
  181. package/dist/markdown/components/markdown-table.d.mts +0 -37
  182. package/dist/markdown/components/markdown-table.d.mts.map +0 -1
  183. package/dist/markdown/components/markdown-table.mjs +0 -104
  184. package/dist/markdown/components/markdown-table.mjs.map +0 -1
  185. package/dist/markdown/contexts/index.cjs +0 -7
  186. package/dist/markdown/contexts/index.d.cts +0 -2
  187. package/dist/markdown/contexts/index.d.mts +0 -2
  188. package/dist/markdown/contexts/index.mjs +0 -3
  189. package/dist/markdown/contexts/markdown-table.cjs +0 -37
  190. package/dist/markdown/contexts/markdown-table.d.cts +0 -35
  191. package/dist/markdown/contexts/markdown-table.d.cts.map +0 -1
  192. package/dist/markdown/contexts/markdown-table.d.mts +0 -35
  193. package/dist/markdown/contexts/markdown-table.d.mts.map +0 -1
  194. package/dist/markdown/contexts/markdown-table.mjs +0 -34
  195. package/dist/markdown/contexts/markdown-table.mjs.map +0 -1
  196. package/dist/markdown/index.cjs +0 -27
  197. package/dist/markdown/index.d.cts +0 -9
  198. package/dist/markdown/index.d.mts +0 -9
  199. package/dist/markdown/index.mjs +0 -10
  200. package/dist/types/components.cjs +0 -9
  201. package/dist/types/components.d.cts +0 -137
  202. package/dist/types/components.d.cts.map +0 -1
  203. package/dist/types/components.d.mts +0 -137
  204. package/dist/types/components.d.mts.map +0 -1
  205. package/dist/types/components.mjs +0 -10
  206. package/dist/types/components.mjs.map +0 -1
  207. package/dist/typescript/components/class-declaration.cjs +0 -305
  208. package/dist/typescript/components/class-declaration.d.cts +0 -139
  209. package/dist/typescript/components/class-declaration.d.cts.map +0 -1
  210. package/dist/typescript/components/class-declaration.d.mts +0 -139
  211. package/dist/typescript/components/class-declaration.d.mts.map +0 -1
  212. package/dist/typescript/components/class-declaration.mjs +0 -300
  213. package/dist/typescript/components/class-declaration.mjs.map +0 -1
  214. package/dist/typescript/components/dynamic-import-statement.cjs +0 -25
  215. package/dist/typescript/components/dynamic-import-statement.d.cts +0 -30
  216. package/dist/typescript/components/dynamic-import-statement.d.cts.map +0 -1
  217. package/dist/typescript/components/dynamic-import-statement.d.mts +0 -30
  218. package/dist/typescript/components/dynamic-import-statement.d.mts.map +0 -1
  219. package/dist/typescript/components/dynamic-import-statement.mjs +0 -25
  220. package/dist/typescript/components/dynamic-import-statement.mjs.map +0 -1
  221. package/dist/typescript/components/interface-declaration.cjs +0 -257
  222. package/dist/typescript/components/interface-declaration.d.cts +0 -78
  223. package/dist/typescript/components/interface-declaration.d.cts.map +0 -1
  224. package/dist/typescript/components/interface-declaration.d.mts +0 -78
  225. package/dist/typescript/components/interface-declaration.d.mts.map +0 -1
  226. package/dist/typescript/components/interface-declaration.mjs +0 -254
  227. package/dist/typescript/components/interface-declaration.mjs.map +0 -1
  228. package/dist/typescript/components/object-declaration.cjs +0 -131
  229. package/dist/typescript/components/object-declaration.d.cts +0 -24
  230. package/dist/typescript/components/object-declaration.d.cts.map +0 -1
  231. package/dist/typescript/components/object-declaration.d.mts +0 -24
  232. package/dist/typescript/components/object-declaration.d.mts.map +0 -1
  233. package/dist/typescript/components/object-declaration.mjs +0 -130
  234. package/dist/typescript/components/object-declaration.mjs.map +0 -1
  235. package/dist/typescript/components/property-name.cjs +0 -31
  236. package/dist/typescript/components/property-name.d.cts +0 -21
  237. package/dist/typescript/components/property-name.d.cts.map +0 -1
  238. package/dist/typescript/components/property-name.d.mts +0 -21
  239. package/dist/typescript/components/property-name.d.mts.map +0 -1
  240. package/dist/typescript/components/property-name.mjs +0 -31
  241. package/dist/typescript/components/property-name.mjs.map +0 -1
  242. package/dist/typescript/components/record-expression.cjs +0 -12
  243. package/dist/typescript/components/record-expression.d.cts +0 -9
  244. package/dist/typescript/components/record-expression.d.cts.map +0 -1
  245. package/dist/typescript/components/record-expression.d.mts +0 -9
  246. package/dist/typescript/components/record-expression.d.mts.map +0 -1
  247. package/dist/typescript/components/record-expression.mjs +0 -12
  248. package/dist/typescript/components/record-expression.mjs.map +0 -1
  249. package/dist/typescript/components/tsdoc-schema.cjs +0 -166
  250. package/dist/typescript/components/tsdoc-schema.d.cts +0 -21
  251. package/dist/typescript/components/tsdoc-schema.d.cts.map +0 -1
  252. package/dist/typescript/components/tsdoc-schema.d.mts +0 -21
  253. package/dist/typescript/components/tsdoc-schema.d.mts.map +0 -1
  254. package/dist/typescript/components/tsdoc-schema.mjs +0 -165
  255. package/dist/typescript/components/tsdoc-schema.mjs.map +0 -1
  256. package/dist/typescript/components/tsdoc.cjs +0 -486
  257. package/dist/typescript/components/tsdoc.d.cts +0 -163
  258. package/dist/typescript/components/tsdoc.d.cts.map +0 -1
  259. package/dist/typescript/components/tsdoc.d.mts +0 -163
  260. package/dist/typescript/components/tsdoc.d.mts.map +0 -1
  261. package/dist/typescript/components/tsdoc.mjs +0 -465
  262. package/dist/typescript/components/tsdoc.mjs.map +0 -1
  263. package/dist/typescript/components/type-declaration.cjs +0 -38
  264. package/dist/typescript/components/type-declaration.d.cts +0 -15
  265. package/dist/typescript/components/type-declaration.d.cts.map +0 -1
  266. package/dist/typescript/components/type-declaration.d.mts +0 -15
  267. package/dist/typescript/components/type-declaration.d.mts.map +0 -1
  268. package/dist/typescript/components/type-declaration.mjs +0 -38
  269. package/dist/typescript/components/type-declaration.mjs.map +0 -1
  270. package/dist/typescript/components/type-parameters.cjs +0 -82
  271. package/dist/typescript/components/type-parameters.d.cts +0 -22
  272. package/dist/typescript/components/type-parameters.d.cts.map +0 -1
  273. package/dist/typescript/components/type-parameters.d.mts +0 -22
  274. package/dist/typescript/components/type-parameters.d.mts.map +0 -1
  275. package/dist/typescript/components/type-parameters.mjs +0 -82
  276. package/dist/typescript/components/type-parameters.mjs.map +0 -1
  277. package/dist/typescript/components/typescript-file.cjs +0 -231
  278. package/dist/typescript/components/typescript-file.d.cts +0 -46
  279. package/dist/typescript/components/typescript-file.d.cts.map +0 -1
  280. package/dist/typescript/components/typescript-file.d.mts +0 -46
  281. package/dist/typescript/components/typescript-file.d.mts.map +0 -1
  282. package/dist/typescript/components/typescript-file.mjs +0 -229
  283. package/dist/typescript/components/typescript-file.mjs.map +0 -1
  284. package/dist/typescript/contexts/index.cjs +0 -4
  285. package/dist/typescript/contexts/index.d.cts +0 -2
  286. package/dist/typescript/contexts/index.d.mts +0 -2
  287. package/dist/typescript/contexts/index.mjs +0 -3
  288. package/dist/typescript/contexts/lexical-scope.cjs +0 -25
  289. package/dist/typescript/contexts/lexical-scope.d.cts +0 -12
  290. package/dist/typescript/contexts/lexical-scope.d.cts.map +0 -1
  291. package/dist/typescript/contexts/lexical-scope.d.mts +0 -12
  292. package/dist/typescript/contexts/lexical-scope.d.mts.map +0 -1
  293. package/dist/typescript/contexts/lexical-scope.mjs +0 -25
  294. package/dist/typescript/contexts/lexical-scope.mjs.map +0 -1
  295. package/dist/typescript/contexts/member-scope.cjs +0 -23
  296. package/dist/typescript/contexts/member-scope.d.cts +0 -18
  297. package/dist/typescript/contexts/member-scope.d.cts.map +0 -1
  298. package/dist/typescript/contexts/member-scope.d.mts +0 -18
  299. package/dist/typescript/contexts/member-scope.d.mts.map +0 -1
  300. package/dist/typescript/contexts/member-scope.mjs +0 -23
  301. package/dist/typescript/contexts/member-scope.mjs.map +0 -1
  302. package/dist/typescript/helpers/get-call-signature-props.cjs +0 -25
  303. package/dist/typescript/helpers/get-call-signature-props.d.cts +0 -13
  304. package/dist/typescript/helpers/get-call-signature-props.d.cts.map +0 -1
  305. package/dist/typescript/helpers/get-call-signature-props.d.mts +0 -13
  306. package/dist/typescript/helpers/get-call-signature-props.d.mts.map +0 -1
  307. package/dist/typescript/helpers/get-call-signature-props.mjs +0 -25
  308. package/dist/typescript/helpers/get-call-signature-props.mjs.map +0 -1
  309. package/dist/typescript/helpers/index.cjs +0 -6
  310. package/dist/typescript/helpers/index.d.cts +0 -3
  311. package/dist/typescript/helpers/index.d.mts +0 -3
  312. package/dist/typescript/helpers/index.mjs +0 -4
  313. package/dist/typescript/helpers/utilities.cjs +0 -15
  314. package/dist/typescript/helpers/utilities.d.cts +0 -11
  315. package/dist/typescript/helpers/utilities.d.cts.map +0 -1
  316. package/dist/typescript/helpers/utilities.d.mts +0 -11
  317. package/dist/typescript/helpers/utilities.d.mts.map +0 -1
  318. package/dist/typescript/helpers/utilities.mjs +0 -14
  319. package/dist/typescript/helpers/utilities.mjs.map +0 -1
  320. package/dist/yaml/components/index.cjs +0 -5
  321. package/dist/yaml/components/index.d.cts +0 -2
  322. package/dist/yaml/components/index.d.mts +0 -2
  323. package/dist/yaml/components/index.mjs +0 -3
  324. package/dist/yaml/components/yaml-file.cjs +0 -148
  325. package/dist/yaml/components/yaml-file.d.cts +0 -31
  326. package/dist/yaml/components/yaml-file.d.cts.map +0 -1
  327. package/dist/yaml/components/yaml-file.d.mts +0 -31
  328. package/dist/yaml/components/yaml-file.d.mts.map +0 -1
  329. package/dist/yaml/components/yaml-file.mjs +0 -147
  330. package/dist/yaml/components/yaml-file.mjs.map +0 -1
  331. package/dist/yaml/index.cjs +0 -6
  332. package/dist/yaml/index.d.cts +0 -3
  333. package/dist/yaml/index.d.mts +0 -3
  334. package/dist/yaml/index.mjs +0 -4
package/dist/render.cjs CHANGED
@@ -1,16 +1,24 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_core_components_output = require('./core/components/output.cjs');
3
- require('./core/index.cjs');
2
+ const require_core_contexts_context = require('./core/contexts/context.cjs');
4
3
  let _stryke_path_file_path_fns = require("@stryke/path/file-path-fns");
5
4
  let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
6
5
  let _alloy_js_core = require("@alloy-js/core");
7
- let _stryke_helpers_noop = require("@stryke/helpers/noop");
6
+ let _power_plant_alloy_js_generate = require("@power-plant/alloy-js/generate");
8
7
  let _stryke_path_replace = require("@stryke/path/replace");
9
8
  let _stryke_string_format_list = require("@stryke/string-format/list");
10
9
 
11
10
  //#region src/render.tsx
11
+ function getDocumentMeta(document) {
12
+ return document.meta ?? document.chunks?.[0]?.meta ?? {};
13
+ }
14
+ function getDocumentContents(document) {
15
+ return (document.chunks ?? []).map((chunk) => chunk.content ?? "").join("");
16
+ }
12
17
  /**
13
- * A function to render children components within the [Alloy](https://alloy-framework.github.io) context, and write any saved content to the file system.
18
+ * A function to render Alloy-js template components within the [Alloy-js](https://alloy-framework.github.io) context, and write any saved content to the file system.
19
+ *
20
+ * @remarks
21
+ * Uses Power Plant's {@link generate | `generate`} entry point to create an execution context and render Alloy-js templates, then emits the resulting documents through the Powerlines plugin context.
14
22
  *
15
23
  * @example
16
24
  * ```tsx
@@ -19,56 +27,58 @@ let _stryke_string_format_list = require("@stryke/string-format/list");
19
27
  * await render(context, <> ... </>);
20
28
  * ```
21
29
  *
30
+ * @see https://github.com/storm-software/power-plant/blob/main/packages/generators/alloy-js/src/generate.ts
31
+ *
22
32
  * @param context - The Powerlines plugin context.
23
- * @param children - The children components to render.
33
+ * @param template - The children components to render.
24
34
  * @returns A promise that resolves when rendering is complete.
25
35
  */
26
- async function render(context, children) {
27
- const meta = {};
28
- const output = await (0, _alloy_js_core.renderAsync)((0, _alloy_js_core_jsx_runtime.createComponent)(require_core_components_output.Output, {
29
- context,
30
- meta,
31
- children
32
- }));
33
- const files = [];
34
- await (0, _alloy_js_core.traverseOutput)(output, {
35
- visitDirectory: _stryke_helpers_noop.noop,
36
- visitFile: (file) => files.push(file)
36
+ async function render(context, template) {
37
+ const documents = await (0, _power_plant_alloy_js_generate.generate)((0, _alloy_js_core_jsx_runtime.createComponent)(require_core_contexts_context.PowerlinesContext.Provider, {
38
+ value: context,
39
+ children: template
40
+ }), {}, {
41
+ cwd: context.config.cwd,
42
+ logger: {
43
+ debug: (message) => context.debug(message),
44
+ info: (message) => context.info(message),
45
+ warn: (message) => context.warn(message),
46
+ error: (message) => context.error(message)
47
+ },
48
+ settings: { skipStorage: true }
37
49
  });
38
- if (!files.length) context.debug("No output files were rendered by the Alloy-js components.");
39
- else {
40
- context.debug(`Rendering ${files.length} output files from Alloy-js components: ${(0, _stryke_string_format_list.list)(files.map((file) => `${(0, _stryke_path_replace.replacePath)(file.path, context.config.cwd)}${meta[file.path]?.kind === "builtin" || meta[file.path]?.kind === "infrastructure" ? ` (${meta[file.path]?.kind === "builtin" ? "Builtin" : "Infrastructure"})` : ""}`))}.`);
41
- await (0, _alloy_js_core.traverseOutput)(output, {
42
- visitDirectory: (directory) => {
43
- if (context.fs.existsSync(directory.path)) return;
44
- context.fs.mkdirSync(directory.path);
45
- },
46
- visitFile: (file) => {
47
- if ("contents" in file) {
48
- const metadata = meta[file.path] ?? {};
49
- if (metadata.kind === "builtin") {
50
- if (!metadata.id) throw new Error(`Built-in file "${file.path}" is missing its ID in the render metadata.`);
51
- context.emitBuiltinSync(file.contents, metadata.id, {
52
- skipFormat: metadata.skipFormat,
53
- storage: metadata.storage,
54
- extension: (0, _stryke_path_file_path_fns.findFileExtension)(file.path)
55
- });
56
- } else if (metadata.kind === "entry") context.emitEntrySync(file.contents, file.path, {
57
- skipFormat: metadata.skipFormat,
58
- storage: metadata.storage,
59
- ...metadata.typeDefinition ?? {}
60
- });
61
- else if (metadata.kind === "infrastructure") {
62
- if (!metadata.id) throw new Error(`Infrastructure file "${file.path}" is missing its ID in the render metadata.`);
63
- context.emitInfrastructureSync(file.contents, metadata.id, {
64
- skipFormat: metadata.skipFormat,
65
- storage: metadata.storage,
66
- extension: (0, _stryke_path_file_path_fns.findFileExtension)(file.path)
67
- });
68
- } else context.emitSync(file.contents, file.path, metadata);
69
- } else context.fs.copySync(file.sourcePath, file.path);
70
- }
50
+ const entries = Object.values(documents);
51
+ if (!entries.length) {
52
+ context.debug("No output files were rendered by the Alloy-js components.");
53
+ return;
54
+ }
55
+ context.debug(`Emitting ${entries.length} output files from Alloy-js components: ${(0, _stryke_string_format_list.list)(entries.map((document) => {
56
+ const metadata = getDocumentMeta(document);
57
+ return `${(0, _stryke_path_replace.replacePath)(document.path, context.config.cwd)}${metadata.kind === "builtin" || metadata.kind === "infrastructure" ? ` (${metadata.kind === "builtin" ? "Builtin" : "Infrastructure"})` : ""}`;
58
+ }))}.`);
59
+ for (const document of entries) {
60
+ const metadata = getDocumentMeta(document);
61
+ const contents = getDocumentContents(document);
62
+ if (metadata.kind === "builtin") {
63
+ if (!metadata.id) throw new Error(`Built-in file "${document.path}" is missing its ID in the render metadata.`);
64
+ context.emitBuiltinSync(contents, metadata.id, {
65
+ skipFormat: metadata.skipFormat,
66
+ storage: metadata.storage,
67
+ extension: (0, _stryke_path_file_path_fns.findFileExtension)(document.path)
68
+ });
69
+ } else if (metadata.kind === "entry") context.emitEntrySync(contents, document.path, {
70
+ skipFormat: metadata.skipFormat,
71
+ storage: metadata.storage,
72
+ ...metadata.typeDefinition ?? {}
71
73
  });
74
+ else if (metadata.kind === "infrastructure") {
75
+ if (!metadata.id) throw new Error(`Infrastructure file "${document.path}" is missing its ID in the render metadata.`);
76
+ context.emitInfrastructureSync(contents, metadata.id, {
77
+ skipFormat: metadata.skipFormat,
78
+ storage: metadata.storage,
79
+ extension: (0, _stryke_path_file_path_fns.findFileExtension)(document.path)
80
+ });
81
+ } else context.emitSync(contents, document.path, metadata);
72
82
  }
73
83
  }
74
84
  /**
@@ -87,9 +97,16 @@ async function render(context, children) {
87
97
  * @returns The rendered output as a string.
88
98
  */
89
99
  function renderString(context, children, options) {
90
- return (0, _alloy_js_core.printTree)((0, _alloy_js_core.renderTree)((0, _alloy_js_core_jsx_runtime.createComponent)(require_core_components_output.Output, {
91
- context,
92
- children
100
+ return (0, _alloy_js_core.printTree)((0, _alloy_js_core.renderTree)((0, _alloy_js_core_jsx_runtime.createComponent)(require_core_contexts_context.PowerlinesContext.Provider, {
101
+ value: context,
102
+ get children() {
103
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Output, {
104
+ get basePath() {
105
+ return context.config.cwd;
106
+ },
107
+ children
108
+ });
109
+ }
93
110
  })), options);
94
111
  }
95
112
 
package/dist/render.d.cts CHANGED
@@ -1,8 +1,35 @@
1
1
  import { Children, PrintTreeOptions } from "@alloy-js/core";
2
- import { PluginContext } from "powerlines";
2
+ import { PluginContext, StoragePreset } from "powerlines";
3
+ import { MetaConfig } from "@power-plant/core";
3
4
  //#region src/render.d.ts
5
+ interface MetaItem extends MetaConfig {
6
+ /**
7
+ * The kind of metadata item.
8
+ */
9
+ kind?: "builtin" | "entry" | "infrastructure" | string;
10
+ /**
11
+ * Whether to skip formatting for this output.
12
+ */
13
+ skipFormat?: boolean;
14
+ /**
15
+ * The storage preset or adapter name for the output files.
16
+ */
17
+ storage?: StoragePreset | string;
18
+ /**
19
+ * Built-in / infrastructure module id.
20
+ */
21
+ id?: string;
22
+ /**
23
+ * Entry type definition metadata.
24
+ */
25
+ typeDefinition?: Record<string, unknown>;
26
+ [key: string]: any;
27
+ }
4
28
  /**
5
- * A function to render children components within the [Alloy](https://alloy-framework.github.io) context, and write any saved content to the file system.
29
+ * A function to render Alloy-js template components within the [Alloy-js](https://alloy-framework.github.io) context, and write any saved content to the file system.
30
+ *
31
+ * @remarks
32
+ * Uses Power Plant's {@link generate | `generate`} entry point to create an execution context and render Alloy-js templates, then emits the resulting documents through the Powerlines plugin context.
6
33
  *
7
34
  * @example
8
35
  * ```tsx
@@ -11,11 +38,13 @@ import { PluginContext } from "powerlines";
11
38
  * await render(context, <> ... </>);
12
39
  * ```
13
40
  *
41
+ * @see https://github.com/storm-software/power-plant/blob/main/packages/generators/alloy-js/src/generate.ts
42
+ *
14
43
  * @param context - The Powerlines plugin context.
15
- * @param children - The children components to render.
44
+ * @param template - The children components to render.
16
45
  * @returns A promise that resolves when rendering is complete.
17
46
  */
18
- declare function render<TContext extends PluginContext>(context: TContext, children: Children): Promise<void>;
47
+ declare function render<TContext extends PluginContext>(context: TContext, template: Children): Promise<void>;
19
48
  /**
20
49
  * A function to render children components within the [Alloy](https://alloy-framework.github.io) context and return the rendered output as a string.
21
50
  *
@@ -33,5 +62,5 @@ declare function render<TContext extends PluginContext>(context: TContext, child
33
62
  */
34
63
  declare function renderString<TContext extends PluginContext>(context: TContext, children: Children, options?: PrintTreeOptions): string;
35
64
  //#endregion
36
- export { render, renderString };
65
+ export { MetaItem, render, renderString };
37
66
  //# sourceMappingURL=render.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"render.d.cts","names":[],"sources":["../src/render.tsx"],"mappings":";;;;;;;;;;;;;;;;;iBAgDsB,OAAO,iBAAiB,eAC5C,SAAS,UACT,UAAU,WAAQ;;;;;;;;;;;;;;;;iBA2GJ,aAAa,iBAAiB,eAC5C,SAAS,UACT,UAAU,UACV,UAAU"}
1
+ {"version":3,"file":"render.d.cts","names":[],"sources":["../src/render.tsx"],"mappings":";;;;UA4BiB,iBAAiB;;;;EAIhC;;;;EAKA;;;;EAKA,UAAU;;;;EAKV;;;;EAKA,iBAAiB;GAEhB;;;;;;;;;;;;;;;;;;;;;iBA8BmB,OAAO,iBAAiB,eAC5C,SAAS,UACT,UAAU,WAAQ;;;;;;;;;;;;;;;;iBAqGJ,aAAa,iBAAiB,eAC5C,SAAS,UACT,UAAU,UACV,UAAU"}
package/dist/render.d.mts CHANGED
@@ -1,8 +1,35 @@
1
1
  import { Children, PrintTreeOptions } from "@alloy-js/core";
2
- import { PluginContext } from "powerlines";
2
+ import { PluginContext, StoragePreset } from "powerlines";
3
+ import { MetaConfig } from "@power-plant/core";
3
4
  //#region src/render.d.ts
5
+ interface MetaItem extends MetaConfig {
6
+ /**
7
+ * The kind of metadata item.
8
+ */
9
+ kind?: "builtin" | "entry" | "infrastructure" | string;
10
+ /**
11
+ * Whether to skip formatting for this output.
12
+ */
13
+ skipFormat?: boolean;
14
+ /**
15
+ * The storage preset or adapter name for the output files.
16
+ */
17
+ storage?: StoragePreset | string;
18
+ /**
19
+ * Built-in / infrastructure module id.
20
+ */
21
+ id?: string;
22
+ /**
23
+ * Entry type definition metadata.
24
+ */
25
+ typeDefinition?: Record<string, unknown>;
26
+ [key: string]: any;
27
+ }
4
28
  /**
5
- * A function to render children components within the [Alloy](https://alloy-framework.github.io) context, and write any saved content to the file system.
29
+ * A function to render Alloy-js template components within the [Alloy-js](https://alloy-framework.github.io) context, and write any saved content to the file system.
30
+ *
31
+ * @remarks
32
+ * Uses Power Plant's {@link generate | `generate`} entry point to create an execution context and render Alloy-js templates, then emits the resulting documents through the Powerlines plugin context.
6
33
  *
7
34
  * @example
8
35
  * ```tsx
@@ -11,11 +38,13 @@ import { PluginContext } from "powerlines";
11
38
  * await render(context, <> ... </>);
12
39
  * ```
13
40
  *
41
+ * @see https://github.com/storm-software/power-plant/blob/main/packages/generators/alloy-js/src/generate.ts
42
+ *
14
43
  * @param context - The Powerlines plugin context.
15
- * @param children - The children components to render.
44
+ * @param template - The children components to render.
16
45
  * @returns A promise that resolves when rendering is complete.
17
46
  */
18
- declare function render<TContext extends PluginContext>(context: TContext, children: Children): Promise<void>;
47
+ declare function render<TContext extends PluginContext>(context: TContext, template: Children): Promise<void>;
19
48
  /**
20
49
  * A function to render children components within the [Alloy](https://alloy-framework.github.io) context and return the rendered output as a string.
21
50
  *
@@ -33,5 +62,5 @@ declare function render<TContext extends PluginContext>(context: TContext, child
33
62
  */
34
63
  declare function renderString<TContext extends PluginContext>(context: TContext, children: Children, options?: PrintTreeOptions): string;
35
64
  //#endregion
36
- export { render, renderString };
65
+ export { MetaItem, render, renderString };
37
66
  //# sourceMappingURL=render.d.mts.map
package/dist/render.mjs CHANGED
@@ -1,15 +1,23 @@
1
- import { Output as Output$1 } from "./core/components/output.mjs";
2
- import "./core/index.mjs";
1
+ import { PowerlinesContext } from "./core/contexts/context.mjs";
3
2
  import { findFileExtension } from "@stryke/path/file-path-fns";
4
3
  import { createComponent } from "@alloy-js/core/jsx-runtime";
5
- import { printTree, renderAsync, renderTree, traverseOutput } from "@alloy-js/core";
6
- import { noop } from "@stryke/helpers/noop";
4
+ import { Output, printTree, renderTree } from "@alloy-js/core";
5
+ import { generate } from "@power-plant/alloy-js/generate";
7
6
  import { replacePath } from "@stryke/path/replace";
8
7
  import { list } from "@stryke/string-format/list";
9
8
 
10
9
  //#region src/render.tsx
10
+ function getDocumentMeta(document) {
11
+ return document.meta ?? document.chunks?.[0]?.meta ?? {};
12
+ }
13
+ function getDocumentContents(document) {
14
+ return (document.chunks ?? []).map((chunk) => chunk.content ?? "").join("");
15
+ }
11
16
  /**
12
- * A function to render children components within the [Alloy](https://alloy-framework.github.io) context, and write any saved content to the file system.
17
+ * A function to render Alloy-js template components within the [Alloy-js](https://alloy-framework.github.io) context, and write any saved content to the file system.
18
+ *
19
+ * @remarks
20
+ * Uses Power Plant's {@link generate | `generate`} entry point to create an execution context and render Alloy-js templates, then emits the resulting documents through the Powerlines plugin context.
13
21
  *
14
22
  * @example
15
23
  * ```tsx
@@ -18,56 +26,58 @@ import { list } from "@stryke/string-format/list";
18
26
  * await render(context, <> ... </>);
19
27
  * ```
20
28
  *
29
+ * @see https://github.com/storm-software/power-plant/blob/main/packages/generators/alloy-js/src/generate.ts
30
+ *
21
31
  * @param context - The Powerlines plugin context.
22
- * @param children - The children components to render.
32
+ * @param template - The children components to render.
23
33
  * @returns A promise that resolves when rendering is complete.
24
34
  */
25
- async function render(context, children) {
26
- const meta = {};
27
- const output = await renderAsync(createComponent(Output$1, {
28
- context,
29
- meta,
30
- children
31
- }));
32
- const files = [];
33
- await traverseOutput(output, {
34
- visitDirectory: noop,
35
- visitFile: (file) => files.push(file)
35
+ async function render(context, template) {
36
+ const documents = await generate(createComponent(PowerlinesContext.Provider, {
37
+ value: context,
38
+ children: template
39
+ }), {}, {
40
+ cwd: context.config.cwd,
41
+ logger: {
42
+ debug: (message) => context.debug(message),
43
+ info: (message) => context.info(message),
44
+ warn: (message) => context.warn(message),
45
+ error: (message) => context.error(message)
46
+ },
47
+ settings: { skipStorage: true }
36
48
  });
37
- if (!files.length) context.debug("No output files were rendered by the Alloy-js components.");
38
- else {
39
- context.debug(`Rendering ${files.length} output files from Alloy-js components: ${list(files.map((file) => `${replacePath(file.path, context.config.cwd)}${meta[file.path]?.kind === "builtin" || meta[file.path]?.kind === "infrastructure" ? ` (${meta[file.path]?.kind === "builtin" ? "Builtin" : "Infrastructure"})` : ""}`))}.`);
40
- await traverseOutput(output, {
41
- visitDirectory: (directory) => {
42
- if (context.fs.existsSync(directory.path)) return;
43
- context.fs.mkdirSync(directory.path);
44
- },
45
- visitFile: (file) => {
46
- if ("contents" in file) {
47
- const metadata = meta[file.path] ?? {};
48
- if (metadata.kind === "builtin") {
49
- if (!metadata.id) throw new Error(`Built-in file "${file.path}" is missing its ID in the render metadata.`);
50
- context.emitBuiltinSync(file.contents, metadata.id, {
51
- skipFormat: metadata.skipFormat,
52
- storage: metadata.storage,
53
- extension: findFileExtension(file.path)
54
- });
55
- } else if (metadata.kind === "entry") context.emitEntrySync(file.contents, file.path, {
56
- skipFormat: metadata.skipFormat,
57
- storage: metadata.storage,
58
- ...metadata.typeDefinition ?? {}
59
- });
60
- else if (metadata.kind === "infrastructure") {
61
- if (!metadata.id) throw new Error(`Infrastructure file "${file.path}" is missing its ID in the render metadata.`);
62
- context.emitInfrastructureSync(file.contents, metadata.id, {
63
- skipFormat: metadata.skipFormat,
64
- storage: metadata.storage,
65
- extension: findFileExtension(file.path)
66
- });
67
- } else context.emitSync(file.contents, file.path, metadata);
68
- } else context.fs.copySync(file.sourcePath, file.path);
69
- }
49
+ const entries = Object.values(documents);
50
+ if (!entries.length) {
51
+ context.debug("No output files were rendered by the Alloy-js components.");
52
+ return;
53
+ }
54
+ context.debug(`Emitting ${entries.length} output files from Alloy-js components: ${list(entries.map((document) => {
55
+ const metadata = getDocumentMeta(document);
56
+ return `${replacePath(document.path, context.config.cwd)}${metadata.kind === "builtin" || metadata.kind === "infrastructure" ? ` (${metadata.kind === "builtin" ? "Builtin" : "Infrastructure"})` : ""}`;
57
+ }))}.`);
58
+ for (const document of entries) {
59
+ const metadata = getDocumentMeta(document);
60
+ const contents = getDocumentContents(document);
61
+ if (metadata.kind === "builtin") {
62
+ if (!metadata.id) throw new Error(`Built-in file "${document.path}" is missing its ID in the render metadata.`);
63
+ context.emitBuiltinSync(contents, metadata.id, {
64
+ skipFormat: metadata.skipFormat,
65
+ storage: metadata.storage,
66
+ extension: findFileExtension(document.path)
67
+ });
68
+ } else if (metadata.kind === "entry") context.emitEntrySync(contents, document.path, {
69
+ skipFormat: metadata.skipFormat,
70
+ storage: metadata.storage,
71
+ ...metadata.typeDefinition ?? {}
70
72
  });
73
+ else if (metadata.kind === "infrastructure") {
74
+ if (!metadata.id) throw new Error(`Infrastructure file "${document.path}" is missing its ID in the render metadata.`);
75
+ context.emitInfrastructureSync(contents, metadata.id, {
76
+ skipFormat: metadata.skipFormat,
77
+ storage: metadata.storage,
78
+ extension: findFileExtension(document.path)
79
+ });
80
+ } else context.emitSync(contents, document.path, metadata);
71
81
  }
72
82
  }
73
83
  /**
@@ -86,9 +96,16 @@ async function render(context, children) {
86
96
  * @returns The rendered output as a string.
87
97
  */
88
98
  function renderString(context, children, options) {
89
- return printTree(renderTree(createComponent(Output$1, {
90
- context,
91
- children
99
+ return printTree(renderTree(createComponent(PowerlinesContext.Provider, {
100
+ value: context,
101
+ get children() {
102
+ return createComponent(Output, {
103
+ get basePath() {
104
+ return context.config.cwd;
105
+ },
106
+ children
107
+ });
108
+ }
92
109
  })), options);
93
110
  }
94
111
 
@@ -1,3 +1,2 @@
1
- import { BuiltinSourceFileContext, ComponentProps, ComponentPropsWithChildren, CopyFileOutputContext, CopyOutputFile, OutputDirectory, OutputFile, ReflectionOverrideInterface, RenderBuiltinContext, RenderContext, RenderEntryContext, RenderOutputContext, SourceFileHeaderProps, TypescriptFileImportItem, TypescriptFileImports, WriteOutputFile } from "./components.cjs";
2
- import { AlloyPluginContext, AlloyPluginOptions, AlloyPluginResolvedConfig, AlloyPluginUserConfig } from "./plugin.cjs";
3
- export { AlloyPluginContext, AlloyPluginOptions, AlloyPluginResolvedConfig, AlloyPluginUserConfig, BuiltinSourceFileContext, ComponentProps, ComponentPropsWithChildren, CopyFileOutputContext, CopyOutputFile, OutputDirectory, OutputFile, ReflectionOverrideInterface, RenderBuiltinContext, RenderContext, RenderEntryContext, RenderOutputContext, SourceFileHeaderProps, TypescriptFileImportItem, TypescriptFileImports, WriteOutputFile };
1
+ import { AlloyPluginContext, AlloyPluginOptions, AlloyPluginResolvedConfig, AlloyPluginUserConfig, PowerPlantAlloyOptions } from "./plugin.cjs";
2
+ export { AlloyPluginContext, AlloyPluginOptions, AlloyPluginResolvedConfig, AlloyPluginUserConfig, PowerPlantAlloyOptions };
@@ -1,3 +1,2 @@
1
- import { BuiltinSourceFileContext, ComponentProps, ComponentPropsWithChildren, CopyFileOutputContext, CopyOutputFile, OutputDirectory, OutputFile, ReflectionOverrideInterface, RenderBuiltinContext, RenderContext, RenderEntryContext, RenderOutputContext, SourceFileHeaderProps, TypescriptFileImportItem, TypescriptFileImports, WriteOutputFile } from "./components.mjs";
2
- import { AlloyPluginContext, AlloyPluginOptions, AlloyPluginResolvedConfig, AlloyPluginUserConfig } from "./plugin.mjs";
3
- export { AlloyPluginContext, AlloyPluginOptions, AlloyPluginResolvedConfig, AlloyPluginUserConfig, BuiltinSourceFileContext, ComponentProps, ComponentPropsWithChildren, CopyFileOutputContext, CopyOutputFile, OutputDirectory, OutputFile, ReflectionOverrideInterface, RenderBuiltinContext, RenderContext, RenderEntryContext, RenderOutputContext, SourceFileHeaderProps, TypescriptFileImportItem, TypescriptFileImports, WriteOutputFile };
1
+ import { AlloyPluginContext, AlloyPluginOptions, AlloyPluginResolvedConfig, AlloyPluginUserConfig, PowerPlantAlloyOptions } from "./plugin.mjs";
2
+ export { AlloyPluginContext, AlloyPluginOptions, AlloyPluginResolvedConfig, AlloyPluginUserConfig, PowerPlantAlloyOptions };
@@ -1,15 +1,18 @@
1
1
  import { PrintTreeOptions } from "@alloy-js/core";
2
2
  import { PluginContext } from "powerlines";
3
+ import { Options } from "@power-plant/alloy-js";
3
4
  import { BabelPluginResolvedConfig, BabelPluginUserConfig } from "@powerlines/plugin-babel/types/plugin";
5
+ import { PowerPlantPluginContext, PowerPlantPluginResolvedConfig } from "@powerlines/plugin-power-plant/types/plugin";
4
6
  //#region src/types/plugin.d.ts
5
- type AlloyPluginOptions = Partial<PrintTreeOptions>;
7
+ type PowerPlantAlloyOptions = Options;
8
+ type AlloyPluginOptions = Partial<Options> & Partial<PrintTreeOptions>;
6
9
  type AlloyPluginUserConfig = BabelPluginUserConfig & {
7
10
  alloy?: AlloyPluginOptions;
8
11
  };
9
- type AlloyPluginResolvedConfig = BabelPluginResolvedConfig & {
12
+ type AlloyPluginResolvedConfig = BabelPluginResolvedConfig & Partial<PowerPlantPluginResolvedConfig<Record<string, unknown>, PowerPlantAlloyOptions>> & {
10
13
  alloy: AlloyPluginOptions;
11
14
  };
12
- type AlloyPluginContext<TResolvedConfig extends AlloyPluginResolvedConfig = AlloyPluginResolvedConfig> = PluginContext<TResolvedConfig>;
15
+ type AlloyPluginContext<TResolvedConfig extends AlloyPluginResolvedConfig = AlloyPluginResolvedConfig> = PluginContext<TResolvedConfig> & Partial<PowerPlantPluginContext<Record<string, unknown>, PowerPlantAlloyOptions, TResolvedConfig & PowerPlantPluginResolvedConfig<Record<string, unknown>, PowerPlantAlloyOptions>>>;
13
16
  //#endregion
14
- export { AlloyPluginContext, AlloyPluginOptions, AlloyPluginResolvedConfig, AlloyPluginUserConfig };
17
+ export { AlloyPluginContext, AlloyPluginOptions, AlloyPluginResolvedConfig, AlloyPluginUserConfig, PowerPlantAlloyOptions };
15
18
  //# sourceMappingURL=plugin.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;KAyBY,qBAAqB,QAAQ;KAE7B,wBAAwB;EAClC,QAAQ;;KAGE,4BAA4B;EACtC,OAAO;;KAGG,mBACV,wBAAwB,4BAA4B,6BAClD,cAAc"}
1
+ {"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;;;KA8BY,yBAAyB;KAEzB,qBAAqB,QAAQ,WACvC,QAAQ;KAEE,wBAAwB;EAClC,QAAQ;;KAGE,4BAA4B,4BACtC,QACE,+BAA+B,yBAAyB;EAExD,OAAO;;KAGC,mBACV,wBAAwB,4BAA4B,6BAClD,cAAc,mBAChB,QACE,wBACE,yBACA,wBACA,kBACE,+BACE,yBACA"}
@@ -1,15 +1,18 @@
1
1
  import { PrintTreeOptions } from "@alloy-js/core";
2
2
  import { PluginContext } from "powerlines";
3
+ import { Options } from "@power-plant/alloy-js";
3
4
  import { BabelPluginResolvedConfig, BabelPluginUserConfig } from "@powerlines/plugin-babel/types/plugin";
5
+ import { PowerPlantPluginContext, PowerPlantPluginResolvedConfig } from "@powerlines/plugin-power-plant/types/plugin";
4
6
  //#region src/types/plugin.d.ts
5
- type AlloyPluginOptions = Partial<PrintTreeOptions>;
7
+ type PowerPlantAlloyOptions = Options;
8
+ type AlloyPluginOptions = Partial<Options> & Partial<PrintTreeOptions>;
6
9
  type AlloyPluginUserConfig = BabelPluginUserConfig & {
7
10
  alloy?: AlloyPluginOptions;
8
11
  };
9
- type AlloyPluginResolvedConfig = BabelPluginResolvedConfig & {
12
+ type AlloyPluginResolvedConfig = BabelPluginResolvedConfig & Partial<PowerPlantPluginResolvedConfig<Record<string, unknown>, PowerPlantAlloyOptions>> & {
10
13
  alloy: AlloyPluginOptions;
11
14
  };
12
- type AlloyPluginContext<TResolvedConfig extends AlloyPluginResolvedConfig = AlloyPluginResolvedConfig> = PluginContext<TResolvedConfig>;
15
+ type AlloyPluginContext<TResolvedConfig extends AlloyPluginResolvedConfig = AlloyPluginResolvedConfig> = PluginContext<TResolvedConfig> & Partial<PowerPlantPluginContext<Record<string, unknown>, PowerPlantAlloyOptions, TResolvedConfig & PowerPlantPluginResolvedConfig<Record<string, unknown>, PowerPlantAlloyOptions>>>;
13
16
  //#endregion
14
- export { AlloyPluginContext, AlloyPluginOptions, AlloyPluginResolvedConfig, AlloyPluginUserConfig };
17
+ export { AlloyPluginContext, AlloyPluginOptions, AlloyPluginResolvedConfig, AlloyPluginUserConfig, PowerPlantAlloyOptions };
15
18
  //# sourceMappingURL=plugin.d.mts.map
@@ -1,11 +1,11 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_core_contexts_context = require('../../core/contexts/context.cjs');
3
- const require_typescript_components_tsdoc = require('./tsdoc.cjs');
4
- const require_typescript_components_typescript_file = require('./typescript-file.cjs');
5
3
  let _stryke_path_file_path_fns = require("@stryke/path/file-path-fns");
6
4
  let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
7
5
  let _alloy_js_core = require("@alloy-js/core");
8
6
  let _stryke_path_replace = require("@stryke/path/replace");
7
+ let _power_plant_alloy_js_typescript_components_typescript_file = require("@power-plant/alloy-js/typescript/components/typescript-file");
8
+ let _power_plant_alloy_js_typescript_components_tsdoc = require("@power-plant/alloy-js/typescript/components/tsdoc");
9
9
  let _stryke_type_checks_is_set = require("@stryke/type-checks/is-set");
10
10
 
11
11
  //#region src/typescript/components/builtin-file.tsx
@@ -27,17 +27,17 @@ function BuiltinFile(props) {
27
27
  ]);
28
28
  const context = require_core_contexts_context.usePowerlinesSafe();
29
29
  const path = (0, _alloy_js_core.computed)(() => (0, _stryke_path_replace.replacePath)(`${!(0, _stryke_type_checks_is_set.isSet)(tsx) ? id : (0, _stryke_path_replace.replaceExtension)(id)}${(0, _stryke_path_file_path_fns.hasFileExtension)(id) && !(0, _stryke_type_checks_is_set.isSet)(tsx) ? "" : tsx ? ".tsx" : ".ts"}`, context?.builtinsPath));
30
- return (0, _alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_typescript_file.TypescriptFile, (0, _alloy_js_core_jsx_runtime.mergeProps)({
30
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_typescript_file.TypescriptFile, (0, _alloy_js_core_jsx_runtime.mergeProps)({
31
31
  get header() {
32
- return (0, _alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_typescript_file.TypescriptFileHeader, {
32
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_typescript_file.TypescriptFileHeader, {
33
33
  get header() {
34
- return (0, _alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_tsdoc.TSDocModule, {
34
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDocModule, {
35
35
  name: id,
36
36
  children: description
37
37
  });
38
38
  },
39
39
  get children() {
40
- return (0, _alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_typescript_file.TypescriptFileHeaderImports, {
40
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_typescript_file.TypescriptFileHeaderImports, {
41
41
  imports,
42
42
  builtinImports
43
43
  });
@@ -1,5 +1,5 @@
1
- import { TSDocModuleProps } from "./tsdoc.cjs";
2
- import { TypescriptFileProps } from "./typescript-file.cjs";
1
+ import { TypescriptFileProps } from "@power-plant/alloy-js/typescript/components/typescript-file";
2
+ import { TSDocModuleProps } from "@power-plant/alloy-js/typescript/components/tsdoc";
3
3
  //#region src/typescript/components/builtin-file.d.ts
4
4
  type BuiltinFileProps = Omit<TypescriptFileProps, "path"> & Omit<TSDocModuleProps, "name"> & {
5
5
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"builtin-file.d.cts","names":[],"sources":["../../../src/typescript/components/builtin-file.tsx"],"mappings":";;;KAgCY,mBAAmB,KAAK,+BAClC,KAAK;;;;;;;EAOH;;;;EAKA;;;;;;EAOA;;;;;;EAOA;;;;;;;;iBASY,YAAY,OAAO,4CAAgB"}
1
+ {"version":3,"file":"builtin-file.d.cts","names":[],"sources":["../../../src/typescript/components/builtin-file.tsx"],"mappings":";;;KAkCY,mBAAmB,KAAK,+BAClC,KAAK;;;;;;;EAOH;;;;EAKA;;;;;;EAOA;;;;;;EAOA;;;;;;;;iBASY,YAAY,OAAO,4CAAgB"}
@@ -1,5 +1,5 @@
1
- import { TSDocModuleProps } from "./tsdoc.mjs";
2
- import { TypescriptFileProps } from "./typescript-file.mjs";
1
+ import { TypescriptFileProps } from "@power-plant/alloy-js/typescript/components/typescript-file";
2
+ import { TSDocModuleProps } from "@power-plant/alloy-js/typescript/components/tsdoc";
3
3
  //#region src/typescript/components/builtin-file.d.ts
4
4
  type BuiltinFileProps = Omit<TypescriptFileProps, "path"> & Omit<TSDocModuleProps, "name"> & {
5
5
  /**
@@ -1,10 +1,10 @@
1
1
  import { usePowerlinesSafe } from "../../core/contexts/context.mjs";
2
- import { TSDocModule } from "./tsdoc.mjs";
3
- import { TypescriptFile, TypescriptFileHeader, TypescriptFileHeaderImports } from "./typescript-file.mjs";
4
2
  import { hasFileExtension } from "@stryke/path/file-path-fns";
5
3
  import { createComponent, mergeProps } from "@alloy-js/core/jsx-runtime";
6
4
  import { computed, splitProps } from "@alloy-js/core";
7
5
  import { replaceExtension, replacePath } from "@stryke/path/replace";
6
+ import { TypescriptFile, TypescriptFileHeader, TypescriptFileHeaderImports } from "@power-plant/alloy-js/typescript/components/typescript-file";
7
+ import { TSDocModule } from "@power-plant/alloy-js/typescript/components/tsdoc";
8
8
  import { isSet } from "@stryke/type-checks/is-set";
9
9
 
10
10
  //#region src/typescript/components/builtin-file.tsx
@@ -1,7 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
3
3
  const require_core_contexts_context = require('../../core/contexts/context.cjs');
4
- const require_typescript_components_typescript_file = require('./typescript-file.cjs');
5
4
  let _stryke_path_file_path_fns = require("@stryke/path/file-path-fns");
6
5
  let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
7
6
  let _alloy_js_core = require("@alloy-js/core");
@@ -9,6 +8,7 @@ let _stryke_path_replace = require("@stryke/path/replace");
9
8
  let _stryke_path_append = require("@stryke/path/append");
10
9
  let defu = require("defu");
11
10
  defu = require_runtime.__toESM(defu, 1);
11
+ let _power_plant_alloy_js_typescript_components_typescript_file = require("@power-plant/alloy-js/typescript/components/typescript-file");
12
12
  let _stryke_type_checks_is_set = require("@stryke/type-checks/is-set");
13
13
 
14
14
  //#region src/typescript/components/entry-file.tsx
@@ -28,7 +28,7 @@ function EntryFile(props) {
28
28
  ]);
29
29
  const context = require_core_contexts_context.usePowerlinesSafe();
30
30
  const fullPath = (0, _alloy_js_core.computed)(() => context ? (0, _stryke_path_append.appendPath)(`${!(0, _stryke_type_checks_is_set.isSet)(tsx) ? path : (0, _stryke_path_replace.replaceExtension)(path)}${tsx ? ".tsx" : (0, _stryke_path_file_path_fns.hasFileExtension)(path) ? "" : ".ts"}`, (0, _stryke_path_replace.replacePath)(context.entryPath, context.config.cwd)) : path);
31
- return (0, _alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_typescript_file.TypescriptFile, (0, _alloy_js_core_jsx_runtime.mergeProps)(rest, {
31
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_typescript_file.TypescriptFile, (0, _alloy_js_core_jsx_runtime.mergeProps)(rest, {
32
32
  get path() {
33
33
  return fullPath.value;
34
34
  },
@@ -1,5 +1,5 @@
1
- import { TypescriptFileProps } from "./typescript-file.cjs";
2
1
  import { ResolvedEntryFileReference } from "powerlines";
2
+ import { TypescriptFileProps } from "@power-plant/alloy-js/typescript/components/typescript-file";
3
3
  //#region src/typescript/components/entry-file.d.ts
4
4
  type EntryFileProps = TypescriptFileProps & {
5
5
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"entry-file.d.cts","names":[],"sources":["../../../src/typescript/components/entry-file.tsx"],"mappings":";;;KA4BY,iBAAiB;;;;;;EAM3B;;;;EAKA,iBAAiB;;;;;;;;iBASH,UAAU,OAAO,0CAAc"}
1
+ {"version":3,"file":"entry-file.d.cts","names":[],"sources":["../../../src/typescript/components/entry-file.tsx"],"mappings":";;;KA+BY,iBAAiB;;;;;;EAM3B;;;;EAKA,iBAAiB;;;;;;;;iBASH,UAAU,OAAO,0CAAc"}
@@ -1,4 +1,4 @@
1
- import { TypescriptFileProps } from "./typescript-file.mjs";
1
+ import { TypescriptFileProps } from "@power-plant/alloy-js/typescript/components/typescript-file";
2
2
  import { ResolvedEntryFileReference } from "powerlines";
3
3
  //#region src/typescript/components/entry-file.d.ts
4
4
  type EntryFileProps = TypescriptFileProps & {