@powerlines/plugin-alloy 0.25.49 → 0.25.52

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/_virtual/_rolldown/runtime.cjs +29 -0
  2. package/dist/_virtual/_rolldown/runtime.mjs +3 -0
  3. package/dist/core/components/index.cjs +10 -0
  4. package/dist/core/components/index.d.cts +5 -0
  5. package/dist/core/components/index.d.mts +5 -0
  6. package/dist/core/components/index.mjs +6 -0
  7. package/dist/core/components/output.cjs +41 -0
  8. package/dist/core/components/output.d.cts +24 -0
  9. package/dist/core/components/output.d.cts.map +1 -0
  10. package/dist/core/components/output.d.mts +24 -0
  11. package/dist/core/components/output.d.mts.map +1 -0
  12. package/dist/core/components/output.mjs +40 -0
  13. package/dist/core/components/output.mjs.map +1 -0
  14. package/dist/core/components/single-line-comment.cjs +23 -0
  15. package/dist/core/components/single-line-comment.d.cts +23 -0
  16. package/dist/core/components/single-line-comment.d.cts.map +1 -0
  17. package/dist/core/components/single-line-comment.d.mts +23 -0
  18. package/dist/core/components/single-line-comment.d.mts.map +1 -0
  19. package/dist/core/components/single-line-comment.mjs +22 -0
  20. package/dist/core/components/single-line-comment.mjs.map +1 -0
  21. package/dist/core/components/source-file.cjs +64 -0
  22. package/dist/core/components/source-file.d.cts +33 -0
  23. package/dist/core/components/source-file.d.cts.map +1 -0
  24. package/dist/core/components/source-file.d.mts +33 -0
  25. package/dist/core/components/source-file.d.mts.map +1 -0
  26. package/dist/core/components/source-file.mjs +62 -0
  27. package/dist/core/components/source-file.mjs.map +1 -0
  28. package/dist/core/components/spacing.cjs +20 -0
  29. package/dist/core/components/spacing.d.cts +24 -0
  30. package/dist/core/components/spacing.d.cts.map +1 -0
  31. package/dist/core/components/spacing.d.mts +24 -0
  32. package/dist/core/components/spacing.d.mts.map +1 -0
  33. package/dist/core/components/spacing.mjs +19 -0
  34. package/dist/core/components/spacing.mjs.map +1 -0
  35. package/dist/core/contexts/context.cjs +41 -0
  36. package/dist/core/contexts/context.d.cts +29 -0
  37. package/dist/core/contexts/context.d.cts.map +1 -0
  38. package/dist/core/contexts/context.d.mts +29 -0
  39. package/dist/core/contexts/context.d.mts.map +1 -0
  40. package/dist/core/contexts/context.mjs +37 -0
  41. package/dist/core/contexts/context.mjs.map +1 -0
  42. package/dist/core/contexts/index.cjs +21 -0
  43. package/dist/core/contexts/index.d.cts +4 -0
  44. package/dist/core/contexts/index.d.mts +4 -0
  45. package/dist/core/contexts/index.mjs +5 -0
  46. package/dist/core/contexts/meta.cjs +41 -0
  47. package/dist/core/contexts/meta.d.cts +48 -0
  48. package/dist/core/contexts/meta.d.cts.map +1 -0
  49. package/dist/core/contexts/meta.d.mts +48 -0
  50. package/dist/core/contexts/meta.d.mts.map +1 -0
  51. package/dist/core/contexts/meta.mjs +37 -0
  52. package/dist/core/contexts/meta.mjs.map +1 -0
  53. package/dist/core/contexts/reflection.cjs +69 -0
  54. package/dist/core/contexts/reflection.d.cts +53 -0
  55. package/dist/core/contexts/reflection.d.cts.map +1 -0
  56. package/dist/core/contexts/reflection.d.mts +53 -0
  57. package/dist/core/contexts/reflection.d.mts.map +1 -0
  58. package/dist/core/contexts/reflection.mjs +61 -0
  59. package/dist/core/contexts/reflection.mjs.map +1 -0
  60. package/dist/core/helpers/code.cjs +34 -0
  61. package/dist/core/helpers/code.d.cts +29 -0
  62. package/dist/core/helpers/code.d.cts.map +1 -0
  63. package/dist/core/helpers/code.d.mts +29 -0
  64. package/dist/core/helpers/code.d.mts.map +1 -0
  65. package/dist/core/helpers/code.mjs +33 -0
  66. package/dist/core/helpers/code.mjs.map +1 -0
  67. package/dist/core/helpers/index.cjs +4 -0
  68. package/dist/core/helpers/index.d.cts +2 -0
  69. package/dist/core/helpers/index.d.mts +2 -0
  70. package/dist/core/helpers/index.mjs +3 -0
  71. package/dist/core/index.cjs +34 -0
  72. package/dist/core/index.d.cts +9 -0
  73. package/dist/core/index.d.mts +9 -0
  74. package/dist/core/index.mjs +13 -0
  75. package/dist/helpers/capnp.cjs +277 -0
  76. package/dist/helpers/capnp.d.cts +87 -0
  77. package/dist/helpers/capnp.d.cts.map +1 -0
  78. package/dist/helpers/capnp.d.mts +87 -0
  79. package/dist/helpers/capnp.d.mts.map +1 -0
  80. package/dist/helpers/capnp.mjs +260 -0
  81. package/dist/helpers/capnp.mjs.map +1 -0
  82. package/dist/helpers/create-builtin.cjs +20 -0
  83. package/dist/helpers/create-builtin.d.cts +16 -0
  84. package/dist/helpers/create-builtin.d.cts.map +1 -0
  85. package/dist/helpers/create-builtin.d.mts +16 -0
  86. package/dist/helpers/create-builtin.d.mts.map +1 -0
  87. package/dist/helpers/create-builtin.mjs +19 -0
  88. package/dist/helpers/create-builtin.mjs.map +1 -0
  89. package/dist/helpers/index.cjs +25 -0
  90. package/dist/helpers/index.d.cts +5 -0
  91. package/dist/helpers/index.d.mts +5 -0
  92. package/dist/helpers/index.mjs +6 -0
  93. package/dist/helpers/refkey.cjs +17 -0
  94. package/dist/helpers/refkey.d.cts +13 -0
  95. package/dist/helpers/refkey.d.cts.map +1 -0
  96. package/dist/helpers/refkey.d.mts +13 -0
  97. package/dist/helpers/refkey.d.mts.map +1 -0
  98. package/dist/helpers/refkey.mjs +16 -0
  99. package/dist/helpers/refkey.mjs.map +1 -0
  100. package/dist/helpers/typescript.cjs +47 -0
  101. package/dist/helpers/typescript.d.cts +26 -0
  102. package/dist/helpers/typescript.d.cts.map +1 -0
  103. package/dist/helpers/typescript.d.mts +26 -0
  104. package/dist/helpers/typescript.d.mts.map +1 -0
  105. package/dist/helpers/typescript.mjs +46 -0
  106. package/dist/helpers/typescript.mjs.map +1 -0
  107. package/dist/index.cjs +48 -0
  108. package/dist/index.d.cts +19 -0
  109. package/dist/index.d.cts.map +1 -0
  110. package/dist/index.d.mts +19 -0
  111. package/dist/index.d.mts.map +1 -0
  112. package/dist/index.mjs +45 -0
  113. package/dist/index.mjs.map +1 -0
  114. package/dist/markdown/components/front-matter.cjs +29 -0
  115. package/dist/markdown/components/front-matter.d.cts +16 -0
  116. package/dist/markdown/components/front-matter.d.cts.map +1 -0
  117. package/dist/markdown/components/front-matter.d.mts +16 -0
  118. package/dist/markdown/components/front-matter.d.mts.map +1 -0
  119. package/dist/markdown/components/front-matter.mjs +28 -0
  120. package/dist/markdown/components/front-matter.mjs.map +1 -0
  121. package/dist/markdown/components/index.cjs +11 -0
  122. package/dist/markdown/components/index.d.cts +4 -0
  123. package/dist/markdown/components/index.d.mts +4 -0
  124. package/dist/markdown/components/index.mjs +5 -0
  125. package/dist/markdown/components/markdown-file.cjs +135 -0
  126. package/dist/markdown/components/markdown-file.d.cts +29 -0
  127. package/dist/markdown/components/markdown-file.d.cts.map +1 -0
  128. package/dist/markdown/components/markdown-file.d.mts +29 -0
  129. package/dist/markdown/components/markdown-file.d.mts.map +1 -0
  130. package/dist/markdown/components/markdown-file.mjs +133 -0
  131. package/dist/markdown/components/markdown-file.mjs.map +1 -0
  132. package/dist/markdown/components/markdown-table.cjs +102 -0
  133. package/dist/markdown/components/markdown-table.d.cts +28 -0
  134. package/dist/markdown/components/markdown-table.d.cts.map +1 -0
  135. package/dist/markdown/components/markdown-table.d.mts +28 -0
  136. package/dist/markdown/components/markdown-table.d.mts.map +1 -0
  137. package/dist/markdown/components/markdown-table.mjs +99 -0
  138. package/dist/markdown/components/markdown-table.mjs.map +1 -0
  139. package/dist/markdown/contexts/index.cjs +7 -0
  140. package/dist/markdown/contexts/index.d.cts +2 -0
  141. package/dist/markdown/contexts/index.d.mts +2 -0
  142. package/dist/markdown/contexts/index.mjs +3 -0
  143. package/dist/markdown/contexts/markdown-table.cjs +38 -0
  144. package/dist/markdown/contexts/markdown-table.d.cts +38 -0
  145. package/dist/markdown/contexts/markdown-table.d.cts.map +1 -0
  146. package/dist/markdown/contexts/markdown-table.d.mts +38 -0
  147. package/dist/markdown/contexts/markdown-table.d.mts.map +1 -0
  148. package/dist/markdown/contexts/markdown-table.mjs +34 -0
  149. package/dist/markdown/contexts/markdown-table.mjs.map +1 -0
  150. package/dist/markdown/index.cjs +18 -0
  151. package/dist/markdown/index.d.cts +5 -0
  152. package/dist/markdown/index.d.mts +5 -0
  153. package/dist/markdown/index.mjs +8 -0
  154. package/dist/render.cjs +91 -0
  155. package/dist/render.d.cts +38 -0
  156. package/dist/render.d.cts.map +1 -0
  157. package/dist/render.d.mts +38 -0
  158. package/dist/render.d.mts.map +1 -0
  159. package/dist/render.mjs +89 -0
  160. package/dist/render.mjs.map +1 -0
  161. package/dist/types/components.cjs +0 -0
  162. package/dist/types/components.d.cts +142 -0
  163. package/dist/types/components.d.cts.map +1 -0
  164. package/dist/types/components.d.mts +142 -0
  165. package/dist/types/components.d.mts.map +1 -0
  166. package/dist/types/components.mjs +1 -0
  167. package/dist/types/index.cjs +0 -0
  168. package/dist/types/index.d.cts +3 -0
  169. package/dist/types/index.d.mts +3 -0
  170. package/dist/types/index.mjs +1 -0
  171. package/dist/types/plugin.cjs +0 -0
  172. package/dist/types/plugin.d.cts +39 -0
  173. package/dist/types/plugin.d.cts.map +1 -0
  174. package/dist/types/plugin.d.mts +39 -0
  175. package/dist/types/plugin.d.mts.map +1 -0
  176. package/dist/types/plugin.mjs +1 -0
  177. package/dist/typescript/components/builtin-file.cjs +63 -0
  178. package/dist/typescript/components/builtin-file.d.cts +35 -0
  179. package/dist/typescript/components/builtin-file.d.cts.map +1 -0
  180. package/dist/typescript/components/builtin-file.d.mts +35 -0
  181. package/dist/typescript/components/builtin-file.d.mts.map +1 -0
  182. package/dist/typescript/components/builtin-file.mjs +62 -0
  183. package/dist/typescript/components/builtin-file.mjs.map +1 -0
  184. package/dist/typescript/components/class-declaration.cjs +291 -0
  185. package/dist/typescript/components/class-declaration.d.cts +145 -0
  186. package/dist/typescript/components/class-declaration.d.cts.map +1 -0
  187. package/dist/typescript/components/class-declaration.d.mts +145 -0
  188. package/dist/typescript/components/class-declaration.d.mts.map +1 -0
  189. package/dist/typescript/components/class-declaration.mjs +285 -0
  190. package/dist/typescript/components/class-declaration.mjs.map +1 -0
  191. package/dist/typescript/components/dynamic-import-statement.cjs +26 -0
  192. package/dist/typescript/components/dynamic-import-statement.d.cts +33 -0
  193. package/dist/typescript/components/dynamic-import-statement.d.cts.map +1 -0
  194. package/dist/typescript/components/dynamic-import-statement.d.mts +33 -0
  195. package/dist/typescript/components/dynamic-import-statement.d.mts.map +1 -0
  196. package/dist/typescript/components/dynamic-import-statement.mjs +25 -0
  197. package/dist/typescript/components/dynamic-import-statement.mjs.map +1 -0
  198. package/dist/typescript/components/entry-file.cjs +43 -0
  199. package/dist/typescript/components/entry-file.d.cts +28 -0
  200. package/dist/typescript/components/entry-file.d.cts.map +1 -0
  201. package/dist/typescript/components/entry-file.d.mts +28 -0
  202. package/dist/typescript/components/entry-file.d.mts.map +1 -0
  203. package/dist/typescript/components/entry-file.mjs +41 -0
  204. package/dist/typescript/components/entry-file.mjs.map +1 -0
  205. package/dist/typescript/components/index.cjs +65 -0
  206. package/dist/typescript/components/index.d.cts +15 -0
  207. package/dist/typescript/components/index.d.mts +15 -0
  208. package/dist/typescript/components/index.mjs +16 -0
  209. package/dist/typescript/components/infrastructure-file.cjs +40 -0
  210. package/dist/typescript/components/infrastructure-file.d.cts +21 -0
  211. package/dist/typescript/components/infrastructure-file.d.cts.map +1 -0
  212. package/dist/typescript/components/infrastructure-file.d.mts +21 -0
  213. package/dist/typescript/components/infrastructure-file.d.mts.map +1 -0
  214. package/dist/typescript/components/infrastructure-file.mjs +38 -0
  215. package/dist/typescript/components/infrastructure-file.mjs.map +1 -0
  216. package/dist/typescript/components/interface-declaration.cjs +229 -0
  217. package/dist/typescript/components/interface-declaration.d.cts +86 -0
  218. package/dist/typescript/components/interface-declaration.d.cts.map +1 -0
  219. package/dist/typescript/components/interface-declaration.d.mts +86 -0
  220. package/dist/typescript/components/interface-declaration.d.mts.map +1 -0
  221. package/dist/typescript/components/interface-declaration.mjs +225 -0
  222. package/dist/typescript/components/interface-declaration.mjs.map +1 -0
  223. package/dist/typescript/components/object-declaration.cjs +128 -0
  224. package/dist/typescript/components/object-declaration.d.cts +30 -0
  225. package/dist/typescript/components/object-declaration.d.cts.map +1 -0
  226. package/dist/typescript/components/object-declaration.d.mts +30 -0
  227. package/dist/typescript/components/object-declaration.d.mts.map +1 -0
  228. package/dist/typescript/components/object-declaration.mjs +126 -0
  229. package/dist/typescript/components/object-declaration.mjs.map +1 -0
  230. package/dist/typescript/components/property-name.cjs +32 -0
  231. package/dist/typescript/components/property-name.d.cts +24 -0
  232. package/dist/typescript/components/property-name.d.cts.map +1 -0
  233. package/dist/typescript/components/property-name.d.mts +24 -0
  234. package/dist/typescript/components/property-name.d.mts.map +1 -0
  235. package/dist/typescript/components/property-name.mjs +31 -0
  236. package/dist/typescript/components/property-name.mjs.map +1 -0
  237. package/dist/typescript/components/record-expression.cjs +13 -0
  238. package/dist/typescript/components/record-expression.d.cts +13 -0
  239. package/dist/typescript/components/record-expression.d.cts.map +1 -0
  240. package/dist/typescript/components/record-expression.d.mts +13 -0
  241. package/dist/typescript/components/record-expression.d.mts.map +1 -0
  242. package/dist/typescript/components/record-expression.mjs +12 -0
  243. package/dist/typescript/components/record-expression.mjs.map +1 -0
  244. package/dist/typescript/components/tsdoc-reflection.cjs +310 -0
  245. package/dist/typescript/components/tsdoc-reflection.d.cts +44 -0
  246. package/dist/typescript/components/tsdoc-reflection.d.cts.map +1 -0
  247. package/dist/typescript/components/tsdoc-reflection.d.mts +44 -0
  248. package/dist/typescript/components/tsdoc-reflection.d.mts.map +1 -0
  249. package/dist/typescript/components/tsdoc-reflection.mjs +304 -0
  250. package/dist/typescript/components/tsdoc-reflection.mjs.map +1 -0
  251. package/dist/typescript/components/tsdoc.cjs +477 -0
  252. package/dist/typescript/components/tsdoc.d.cts +164 -0
  253. package/dist/typescript/components/tsdoc.d.cts.map +1 -0
  254. package/dist/typescript/components/tsdoc.d.mts +164 -0
  255. package/dist/typescript/components/tsdoc.d.mts.map +1 -0
  256. package/dist/typescript/components/tsdoc.mjs +457 -0
  257. package/dist/typescript/components/tsdoc.mjs.map +1 -0
  258. package/dist/typescript/components/type-declaration.cjs +39 -0
  259. package/dist/typescript/components/type-declaration.d.cts +18 -0
  260. package/dist/typescript/components/type-declaration.d.cts.map +1 -0
  261. package/dist/typescript/components/type-declaration.d.mts +18 -0
  262. package/dist/typescript/components/type-declaration.d.mts.map +1 -0
  263. package/dist/typescript/components/type-declaration.mjs +38 -0
  264. package/dist/typescript/components/type-declaration.mjs.map +1 -0
  265. package/dist/typescript/components/type-parameters.cjs +82 -0
  266. package/dist/typescript/components/type-parameters.d.cts +24 -0
  267. package/dist/typescript/components/type-parameters.d.cts.map +1 -0
  268. package/dist/typescript/components/type-parameters.d.mts +24 -0
  269. package/dist/typescript/components/type-parameters.d.mts.map +1 -0
  270. package/dist/typescript/components/type-parameters.mjs +81 -0
  271. package/dist/typescript/components/type-parameters.mjs.map +1 -0
  272. package/dist/typescript/components/typescript-file.cjs +221 -0
  273. package/dist/typescript/components/typescript-file.d.cts +50 -0
  274. package/dist/typescript/components/typescript-file.d.cts.map +1 -0
  275. package/dist/typescript/components/typescript-file.d.mts +50 -0
  276. package/dist/typescript/components/typescript-file.d.mts.map +1 -0
  277. package/dist/typescript/components/typescript-file.mjs +218 -0
  278. package/dist/typescript/components/typescript-file.mjs.map +1 -0
  279. package/dist/typescript/contexts/index.cjs +4 -0
  280. package/dist/typescript/contexts/index.d.cts +2 -0
  281. package/dist/typescript/contexts/index.d.mts +2 -0
  282. package/dist/typescript/contexts/index.mjs +3 -0
  283. package/dist/typescript/contexts/lexical-scope.cjs +26 -0
  284. package/dist/typescript/contexts/lexical-scope.d.cts +17 -0
  285. package/dist/typescript/contexts/lexical-scope.d.cts.map +1 -0
  286. package/dist/typescript/contexts/lexical-scope.d.mts +17 -0
  287. package/dist/typescript/contexts/lexical-scope.d.mts.map +1 -0
  288. package/dist/typescript/contexts/lexical-scope.mjs +25 -0
  289. package/dist/typescript/contexts/lexical-scope.mjs.map +1 -0
  290. package/dist/typescript/contexts/member-scope.cjs +24 -0
  291. package/dist/typescript/contexts/member-scope.d.cts +20 -0
  292. package/dist/typescript/contexts/member-scope.d.cts.map +1 -0
  293. package/dist/typescript/contexts/member-scope.d.mts +20 -0
  294. package/dist/typescript/contexts/member-scope.d.mts.map +1 -0
  295. package/dist/typescript/contexts/member-scope.mjs +23 -0
  296. package/dist/typescript/contexts/member-scope.mjs.map +1 -0
  297. package/dist/typescript/helpers/get-call-signature-props.cjs +26 -0
  298. package/dist/typescript/helpers/get-call-signature-props.d.cts +14 -0
  299. package/dist/typescript/helpers/get-call-signature-props.d.cts.map +1 -0
  300. package/dist/typescript/helpers/get-call-signature-props.d.mts +14 -0
  301. package/dist/typescript/helpers/get-call-signature-props.d.mts.map +1 -0
  302. package/dist/typescript/helpers/get-call-signature-props.mjs +25 -0
  303. package/dist/typescript/helpers/get-call-signature-props.mjs.map +1 -0
  304. package/dist/typescript/helpers/index.cjs +6 -0
  305. package/dist/typescript/helpers/index.d.cts +3 -0
  306. package/dist/typescript/helpers/index.d.mts +3 -0
  307. package/dist/typescript/helpers/index.mjs +4 -0
  308. package/dist/typescript/helpers/utilities.cjs +15 -0
  309. package/dist/typescript/helpers/utilities.d.cts +11 -0
  310. package/dist/typescript/helpers/utilities.d.cts.map +1 -0
  311. package/dist/typescript/helpers/utilities.d.mts +11 -0
  312. package/dist/typescript/helpers/utilities.d.mts.map +1 -0
  313. package/dist/typescript/helpers/utilities.mjs +14 -0
  314. package/dist/typescript/helpers/utilities.mjs.map +1 -0
  315. package/dist/typescript/index.cjs +74 -0
  316. package/dist/typescript/index.d.cts +18 -0
  317. package/dist/typescript/index.d.mts +18 -0
  318. package/dist/typescript/index.mjs +22 -0
  319. package/dist/yaml/components/index.cjs +5 -0
  320. package/dist/yaml/components/index.d.cts +2 -0
  321. package/dist/yaml/components/index.d.mts +2 -0
  322. package/dist/yaml/components/index.mjs +3 -0
  323. package/dist/yaml/components/yaml-file.cjs +149 -0
  324. package/dist/yaml/components/yaml-file.d.cts +34 -0
  325. package/dist/yaml/components/yaml-file.d.cts.map +1 -0
  326. package/dist/yaml/components/yaml-file.d.mts +34 -0
  327. package/dist/yaml/components/yaml-file.d.mts.map +1 -0
  328. package/dist/yaml/components/yaml-file.mjs +147 -0
  329. package/dist/yaml/components/yaml-file.mjs.map +1 -0
  330. package/dist/yaml/index.cjs +6 -0
  331. package/dist/yaml/index.d.cts +2 -0
  332. package/dist/yaml/index.d.mts +2 -0
  333. package/dist/yaml/index.mjs +4 -0
  334. package/package.json +7 -7
@@ -0,0 +1,38 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
3
+ let _alloy_js_core = require("@alloy-js/core");
4
+
5
+ //#region src/markdown/contexts/markdown-table.ts
6
+ /**
7
+ * The Powerlines context used in template rendering.
8
+ */
9
+ const MarkdownTableColumnContext = (0, _alloy_js_core.createNamedContext)("MarkdownTableColumn", {});
10
+ /**
11
+ * Hook to access the Powerlines Context.
12
+ *
13
+ * @returns The Context.
14
+ */
15
+ function useMarkdownTableColumn() {
16
+ return (0, _alloy_js_core.useContext)(MarkdownTableColumnContext);
17
+ }
18
+ /**
19
+ * The Powerlines context used in template rendering.
20
+ */
21
+ const MarkdownTableContext = (0, _alloy_js_core.createContext)({
22
+ columns: [],
23
+ data: []
24
+ });
25
+ /**
26
+ * Hook to access the Powerlines Context.
27
+ *
28
+ * @returns The Context.
29
+ */
30
+ function useMarkdownTable() {
31
+ return (0, _alloy_js_core.useContext)(MarkdownTableContext);
32
+ }
33
+
34
+ //#endregion
35
+ exports.MarkdownTableColumnContext = MarkdownTableColumnContext;
36
+ exports.MarkdownTableContext = MarkdownTableContext;
37
+ exports.useMarkdownTable = useMarkdownTable;
38
+ exports.useMarkdownTableColumn = useMarkdownTableColumn;
@@ -0,0 +1,38 @@
1
+ import { ComponentContext } from "@alloy-js/core";
2
+
3
+ //#region src/markdown/contexts/markdown-table.d.ts
4
+ interface MarkdownTableColumnContextInterface<T extends Record<string, any> = Record<string, any>> {
5
+ index: number;
6
+ name: keyof T;
7
+ align: "left" | "right" | "center";
8
+ width: number;
9
+ }
10
+ /**
11
+ * The Powerlines context used in template rendering.
12
+ */
13
+ declare const MarkdownTableColumnContext: ComponentContext<MarkdownTableColumnContextInterface>;
14
+ /**
15
+ * Hook to access the Powerlines Context.
16
+ *
17
+ * @returns The Context.
18
+ */
19
+ declare function useMarkdownTableColumn(): MarkdownTableColumnContextInterface<Record<string, any>> | undefined;
20
+ interface MarkdownTableContextInterface<T extends Record<string, any> = Record<string, any>> {
21
+ columns: MarkdownTableColumnContextInterface<T>[];
22
+ data: T[];
23
+ }
24
+ /**
25
+ * The Powerlines context used in template rendering.
26
+ */
27
+ declare const MarkdownTableContext: ComponentContext<MarkdownTableContextInterface>;
28
+ /**
29
+ * Hook to access the Powerlines Context.
30
+ *
31
+ * @returns The Context.
32
+ */
33
+ declare function useMarkdownTable(): MarkdownTableContextInterface<Record<string, any>> | undefined;
34
+ declare type __ΩMarkdownTableColumnContextInterface = any[];
35
+ declare type __ΩMarkdownTableContextInterface = any[];
36
+ //#endregion
37
+ export { MarkdownTableColumnContext, MarkdownTableColumnContextInterface, MarkdownTableContext, MarkdownTableContextInterface, __ΩMarkdownTableColumnContextInterface, __ΩMarkdownTableContextInterface, useMarkdownTable, useMarkdownTableColumn };
38
+ //# sourceMappingURL=markdown-table.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdown-table.d.cts","names":[],"sources":["../../../src/markdown/contexts/markdown-table.ts"],"mappings":";;;UAqBiB,mCAAA,WACL,MAAA,gBAAsB,MAAA;EAEhC,KAAA;EACA,IAAA,QAAY,CAAA;EACZ,KAAA;EACA,KAAA;AAAA;;;;cAMW,0BAAA,EAA4B,gBAAA,CAAiB,mCAAA;;;;;;iBAW1C,sBAAA,CAAA,GAAsB,mCAAA,CAAA,MAAA;AAAA,UAMrB,6BAAA,WACL,MAAA,gBAAsB,MAAA;EAEhC,OAAA,EAAS,mCAAA,CAAoC,CAAA;EAC7C,IAAA,EAAM,CAAA;AAAA;AArBR;;;AAAA,cA2Ba,oBAAA,EAAsB,gBAAA,CAAiB,6BAAA;;AAhBpD;;;;iBA2BgB,gBAAA,CAAA,GAAgB,6BAAA,CAAA,MAAA;AAAA"}
@@ -0,0 +1,38 @@
1
+ import { ComponentContext } from "@alloy-js/core";
2
+
3
+ //#region src/markdown/contexts/markdown-table.d.ts
4
+ interface MarkdownTableColumnContextInterface<T extends Record<string, any> = Record<string, any>> {
5
+ index: number;
6
+ name: keyof T;
7
+ align: "left" | "right" | "center";
8
+ width: number;
9
+ }
10
+ /**
11
+ * The Powerlines context used in template rendering.
12
+ */
13
+ declare const MarkdownTableColumnContext: ComponentContext<MarkdownTableColumnContextInterface>;
14
+ /**
15
+ * Hook to access the Powerlines Context.
16
+ *
17
+ * @returns The Context.
18
+ */
19
+ declare function useMarkdownTableColumn(): MarkdownTableColumnContextInterface<Record<string, any>> | undefined;
20
+ interface MarkdownTableContextInterface<T extends Record<string, any> = Record<string, any>> {
21
+ columns: MarkdownTableColumnContextInterface<T>[];
22
+ data: T[];
23
+ }
24
+ /**
25
+ * The Powerlines context used in template rendering.
26
+ */
27
+ declare const MarkdownTableContext: ComponentContext<MarkdownTableContextInterface>;
28
+ /**
29
+ * Hook to access the Powerlines Context.
30
+ *
31
+ * @returns The Context.
32
+ */
33
+ declare function useMarkdownTable(): MarkdownTableContextInterface<Record<string, any>> | undefined;
34
+ declare type __ΩMarkdownTableColumnContextInterface = any[];
35
+ declare type __ΩMarkdownTableContextInterface = any[];
36
+ //#endregion
37
+ export { MarkdownTableColumnContext, MarkdownTableColumnContextInterface, MarkdownTableContext, MarkdownTableContextInterface, __ΩMarkdownTableColumnContextInterface, __ΩMarkdownTableContextInterface, useMarkdownTable, useMarkdownTableColumn };
38
+ //# sourceMappingURL=markdown-table.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdown-table.d.mts","names":[],"sources":["../../../src/markdown/contexts/markdown-table.ts"],"mappings":";;;UAqBiB,mCAAA,WACL,MAAA,gBAAsB,MAAA;EAEhC,KAAA;EACA,IAAA,QAAY,CAAA;EACZ,KAAA;EACA,KAAA;AAAA;;;;cAMW,0BAAA,EAA4B,gBAAA,CAAiB,mCAAA;;;;;;iBAW1C,sBAAA,CAAA,GAAsB,mCAAA,CAAA,MAAA;AAAA,UAMrB,6BAAA,WACL,MAAA,gBAAsB,MAAA;EAEhC,OAAA,EAAS,mCAAA,CAAoC,CAAA;EAC7C,IAAA,EAAM,CAAA;AAAA;AArBR;;;AAAA,cA2Ba,oBAAA,EAAsB,gBAAA,CAAiB,6BAAA;;AAhBpD;;;;iBA2BgB,gBAAA,CAAA,GAAgB,6BAAA,CAAA,MAAA;AAAA"}
@@ -0,0 +1,34 @@
1
+ import { createContext, createNamedContext, useContext } from "@alloy-js/core";
2
+
3
+ //#region src/markdown/contexts/markdown-table.ts
4
+ /**
5
+ * The Powerlines context used in template rendering.
6
+ */
7
+ const MarkdownTableColumnContext = createNamedContext("MarkdownTableColumn", {});
8
+ /**
9
+ * Hook to access the Powerlines Context.
10
+ *
11
+ * @returns The Context.
12
+ */
13
+ function useMarkdownTableColumn() {
14
+ return useContext(MarkdownTableColumnContext);
15
+ }
16
+ /**
17
+ * The Powerlines context used in template rendering.
18
+ */
19
+ const MarkdownTableContext = createContext({
20
+ columns: [],
21
+ data: []
22
+ });
23
+ /**
24
+ * Hook to access the Powerlines Context.
25
+ *
26
+ * @returns The Context.
27
+ */
28
+ function useMarkdownTable() {
29
+ return useContext(MarkdownTableContext);
30
+ }
31
+
32
+ //#endregion
33
+ export { MarkdownTableColumnContext, MarkdownTableContext, useMarkdownTable, useMarkdownTableColumn };
34
+ //# sourceMappingURL=markdown-table.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdown-table.mjs","names":[],"sources":["../../../src/markdown/contexts/markdown-table.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 type { ComponentContext } from \"@alloy-js/core\";\nimport { createContext, createNamedContext, useContext } from \"@alloy-js/core\";\n\nexport interface MarkdownTableColumnContextInterface<\n T extends Record<string, any> = Record<string, any>\n> {\n index: number;\n name: keyof T;\n align: \"left\" | \"right\" | \"center\";\n width: number;\n}\n\n/**\n * The Powerlines context used in template rendering.\n */\nexport const MarkdownTableColumnContext: ComponentContext<MarkdownTableColumnContextInterface> =\n createNamedContext<MarkdownTableColumnContextInterface>(\n \"MarkdownTableColumn\",\n {} as MarkdownTableColumnContextInterface\n );\n\n/**\n * Hook to access the Powerlines Context.\n *\n * @returns The Context.\n */\nexport function useMarkdownTableColumn() {\n return useContext<MarkdownTableColumnContextInterface>(\n MarkdownTableColumnContext\n );\n}\n\nexport interface MarkdownTableContextInterface<\n T extends Record<string, any> = Record<string, any>\n> {\n columns: MarkdownTableColumnContextInterface<T>[];\n data: T[];\n}\n\n/**\n * The Powerlines context used in template rendering.\n */\nexport const MarkdownTableContext: ComponentContext<MarkdownTableContextInterface> =\n createContext<MarkdownTableContextInterface>({\n columns: [],\n data: []\n } as MarkdownTableContextInterface);\n\n/**\n * Hook to access the Powerlines Context.\n *\n * @returns The Context.\n */\nexport function useMarkdownTable() {\n return useContext<MarkdownTableContextInterface>(MarkdownTableContext);\n}\n"],"mappings":";;;;;;AAiCA,MAAa,6BACX,mBACE,uBACA,EAAE,CACH;;;;;;AAOH,SAAgB,yBAAyB;AACvC,QAAO,WACL,2BACD;;;;;AAaH,MAAa,uBACX,cAA6C;CAC3C,SAAS,EAAE;CACX,MAAM,EAAE;CACT,CAAkC;;;;;;AAOrC,SAAgB,mBAAmB;AACjC,QAAO,WAA0C,qBAAqB"}
@@ -0,0 +1,18 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_markdown_components_front_matter = require('./components/front-matter.cjs');
3
+ const require_markdown_components_markdown_file = require('./components/markdown-file.cjs');
4
+ const require_markdown_contexts_markdown_table = require('./contexts/markdown-table.cjs');
5
+ const require_markdown_components_markdown_table = require('./components/markdown-table.cjs');
6
+ require('./components/index.cjs');
7
+ require('./contexts/index.cjs');
8
+
9
+ exports.FrontMatter = require_markdown_components_front_matter.FrontMatter;
10
+ exports.MarkdownFile = require_markdown_components_markdown_file.MarkdownFile;
11
+ exports.MarkdownFileHeader = require_markdown_components_markdown_file.MarkdownFileHeader;
12
+ exports.MarkdownTable = require_markdown_components_markdown_table.MarkdownTable;
13
+ exports.MarkdownTableColumn = require_markdown_components_markdown_table.MarkdownTableColumn;
14
+ exports.MarkdownTableColumnContext = require_markdown_contexts_markdown_table.MarkdownTableColumnContext;
15
+ exports.MarkdownTableColumnHeader = require_markdown_components_markdown_table.MarkdownTableColumnHeader;
16
+ exports.MarkdownTableContext = require_markdown_contexts_markdown_table.MarkdownTableContext;
17
+ exports.useMarkdownTable = require_markdown_contexts_markdown_table.useMarkdownTable;
18
+ exports.useMarkdownTableColumn = require_markdown_contexts_markdown_table.useMarkdownTableColumn;
@@ -0,0 +1,5 @@
1
+ import { FrontMatter, FrontMatterProps, __ΩFrontMatterProps } from "./components/front-matter.cjs";
2
+ import { MarkdownFile, MarkdownFileHeader, MarkdownFileHeaderProps, MarkdownFileProps, __ΩMarkdownFileHeaderProps, __ΩMarkdownFileProps } from "./components/markdown-file.cjs";
3
+ import { MarkdownTableColumnContext, MarkdownTableColumnContextInterface, MarkdownTableContext, MarkdownTableContextInterface, __ΩMarkdownTableColumnContextInterface, __ΩMarkdownTableContextInterface, useMarkdownTable, useMarkdownTableColumn } from "./contexts/markdown-table.cjs";
4
+ import { MarkdownTable, MarkdownTableColumn, MarkdownTableColumnHeader, MarkdownTableColumnProps, MarkdownTableProps, __ΩMarkdownTableColumnProps, __ΩMarkdownTableProps } from "./components/markdown-table.cjs";
5
+ export { FrontMatter, FrontMatterProps, MarkdownFile, MarkdownFileHeader, MarkdownFileHeaderProps, MarkdownFileProps, MarkdownTable, MarkdownTableColumn, MarkdownTableColumnContext, MarkdownTableColumnContextInterface, MarkdownTableColumnHeader, MarkdownTableColumnProps, MarkdownTableContext, MarkdownTableContextInterface, MarkdownTableProps, __ΩFrontMatterProps, __ΩMarkdownFileHeaderProps, __ΩMarkdownFileProps, __ΩMarkdownTableColumnContextInterface, __ΩMarkdownTableColumnProps, __ΩMarkdownTableContextInterface, __ΩMarkdownTableProps, useMarkdownTable, useMarkdownTableColumn };
@@ -0,0 +1,5 @@
1
+ import { FrontMatter, FrontMatterProps, __ΩFrontMatterProps } from "./components/front-matter.mjs";
2
+ import { MarkdownFile, MarkdownFileHeader, MarkdownFileHeaderProps, MarkdownFileProps, __ΩMarkdownFileHeaderProps, __ΩMarkdownFileProps } from "./components/markdown-file.mjs";
3
+ import { MarkdownTableColumnContext, MarkdownTableColumnContextInterface, MarkdownTableContext, MarkdownTableContextInterface, __ΩMarkdownTableColumnContextInterface, __ΩMarkdownTableContextInterface, useMarkdownTable, useMarkdownTableColumn } from "./contexts/markdown-table.mjs";
4
+ import { MarkdownTable, MarkdownTableColumn, MarkdownTableColumnHeader, MarkdownTableColumnProps, MarkdownTableProps, __ΩMarkdownTableColumnProps, __ΩMarkdownTableProps } from "./components/markdown-table.mjs";
5
+ export { FrontMatter, FrontMatterProps, MarkdownFile, MarkdownFileHeader, MarkdownFileHeaderProps, MarkdownFileProps, MarkdownTable, MarkdownTableColumn, MarkdownTableColumnContext, MarkdownTableColumnContextInterface, MarkdownTableColumnHeader, MarkdownTableColumnProps, MarkdownTableContext, MarkdownTableContextInterface, MarkdownTableProps, __ΩFrontMatterProps, __ΩMarkdownFileHeaderProps, __ΩMarkdownFileProps, __ΩMarkdownTableColumnContextInterface, __ΩMarkdownTableColumnProps, __ΩMarkdownTableContextInterface, __ΩMarkdownTableProps, useMarkdownTable, useMarkdownTableColumn };
@@ -0,0 +1,8 @@
1
+ import { FrontMatter } from "./components/front-matter.mjs";
2
+ import { MarkdownFile, MarkdownFileHeader } from "./components/markdown-file.mjs";
3
+ import { MarkdownTableColumnContext, MarkdownTableContext, useMarkdownTable, useMarkdownTableColumn } from "./contexts/markdown-table.mjs";
4
+ import { MarkdownTable, MarkdownTableColumn, MarkdownTableColumnHeader } from "./components/markdown-table.mjs";
5
+ import "./components/index.mjs";
6
+ import "./contexts/index.mjs";
7
+
8
+ export { FrontMatter, MarkdownFile, MarkdownFileHeader, MarkdownTable, MarkdownTableColumn, MarkdownTableColumnContext, MarkdownTableColumnHeader, MarkdownTableContext, useMarkdownTable, useMarkdownTableColumn };
@@ -0,0 +1,91 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
3
+ const require_core_components_output = require('./core/components/output.cjs');
4
+ require('./core/index.cjs');
5
+ let _stryke_path_file_path_fns = require("@stryke/path/file-path-fns");
6
+ let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
7
+ let _alloy_js_core = require("@alloy-js/core");
8
+
9
+ //#region src/render.tsx
10
+ /**
11
+ * A function to render children components within the [Alloy](https://alloy-framework.github.io) context, and write any saved content to the file system.
12
+ *
13
+ * @example
14
+ * ```tsx
15
+ * import { render } from "@powerlines/plugin-alloy/render";
16
+ *
17
+ * await render(context, <> ... </>);
18
+ * ```
19
+ *
20
+ * @param context - The Powerlines plugin context.
21
+ * @param children - The children components to render.
22
+ * @returns A promise that resolves when rendering is complete.
23
+ */
24
+ async function render(context, children) {
25
+ const meta = {};
26
+ const output = await (0, _alloy_js_core.renderAsync)((0, _alloy_js_core_jsx_runtime.createComponent)(require_core_components_output.Output, {
27
+ context,
28
+ meta,
29
+ children
30
+ }));
31
+ if (!Object.keys(output).length) context.debug("No output files were rendered by Alloy-js component templates.");
32
+ else {
33
+ context.debug(`Processing ${Object.keys(output).length} rendered output files from Alloy-js component templates.`);
34
+ await (0, _alloy_js_core.traverseOutput)(output, {
35
+ visitDirectory: (directory) => {
36
+ if (context.fs.existsSync(directory.path)) return;
37
+ context.fs.mkdirSync(directory.path);
38
+ },
39
+ visitFile: (file) => {
40
+ if ("contents" in file) {
41
+ const metadata = meta[file.path] ?? {};
42
+ if (metadata.kind === "builtin") {
43
+ if (!metadata.id) throw new Error(`Built-in file "${file.path}" is missing its ID in the render metadata.`);
44
+ context.emitBuiltinSync(file.contents, metadata.id, {
45
+ skipFormat: metadata.skipFormat,
46
+ storage: metadata.storage,
47
+ extension: (0, _stryke_path_file_path_fns.findFileExtension)(file.path)
48
+ });
49
+ } else if (metadata.kind === "entry") context.emitEntrySync(file.contents, file.path, {
50
+ skipFormat: metadata.skipFormat,
51
+ storage: metadata.storage,
52
+ ...metadata.typeDefinition ?? {}
53
+ });
54
+ else if (metadata.kind === "infrastructure") {
55
+ if (!metadata.id) throw new Error(`Infrastructure file "${file.path}" is missing its ID in the render metadata.`);
56
+ context.emitInfrastructureSync(file.contents, metadata.id, {
57
+ skipFormat: metadata.skipFormat,
58
+ storage: metadata.storage,
59
+ extension: (0, _stryke_path_file_path_fns.findFileExtension)(file.path)
60
+ });
61
+ } else context.emitSync(file.contents, file.path, metadata);
62
+ } else context.fs.copySync(file.sourcePath, file.path);
63
+ }
64
+ });
65
+ }
66
+ }
67
+ /**
68
+ * A function to render children components within the [Alloy](https://alloy-framework.github.io) context and return the rendered output as a string.
69
+ *
70
+ * @example
71
+ * ```tsx
72
+ * import { renderString } from "@powerlines/plugin-alloy/render";
73
+ *
74
+ * const output = await renderString(context, <> ... </>);
75
+ * ```
76
+ *
77
+ * @param context - The Powerlines plugin context.
78
+ * @param children - The children components to render.
79
+ * @param options - Optional print tree options.
80
+ * @returns The rendered output as a string.
81
+ */
82
+ function renderString(context, children, options) {
83
+ return (0, _alloy_js_core.printTree)((0, _alloy_js_core.renderTree)((0, _alloy_js_core_jsx_runtime.createComponent)(require_core_components_output.Output, {
84
+ context,
85
+ children
86
+ })), options);
87
+ }
88
+
89
+ //#endregion
90
+ exports.render = render;
91
+ exports.renderString = renderString;
@@ -0,0 +1,38 @@
1
+ import { Children, PrintTreeOptions } from "@alloy-js/core";
2
+ import { PluginContext } from "powerlines";
3
+
4
+ //#region src/render.d.ts
5
+ /**
6
+ * A function to render children components within the [Alloy](https://alloy-framework.github.io) context, and write any saved content to the file system.
7
+ *
8
+ * @example
9
+ * ```tsx
10
+ * import { render } from "@powerlines/plugin-alloy/render";
11
+ *
12
+ * await render(context, <> ... </>);
13
+ * ```
14
+ *
15
+ * @param context - The Powerlines plugin context.
16
+ * @param children - The children components to render.
17
+ * @returns A promise that resolves when rendering is complete.
18
+ */
19
+ declare function render<TContext extends PluginContext>(context: TContext, children: Children): Promise<void>;
20
+ /**
21
+ * A function to render children components within the [Alloy](https://alloy-framework.github.io) context and return the rendered output as a string.
22
+ *
23
+ * @example
24
+ * ```tsx
25
+ * import { renderString } from "@powerlines/plugin-alloy/render";
26
+ *
27
+ * const output = await renderString(context, <> ... </>);
28
+ * ```
29
+ *
30
+ * @param context - The Powerlines plugin context.
31
+ * @param children - The children components to render.
32
+ * @param options - Optional print tree options.
33
+ * @returns The rendered output as a string.
34
+ */
35
+ declare function renderString<TContext extends PluginContext>(context: TContext, children: Children, options?: PrintTreeOptions): string;
36
+ //#endregion
37
+ export { render, renderString };
38
+ //# sourceMappingURL=render.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render.d.cts","names":[],"sources":["../src/render.tsx"],"mappings":";;;;;;AA4CA;;;;;;;;;;;;iBAAsB,MAAA,kBAAwB,aAAA,CAAA,CAC5C,OAAA,EAAS,QAAA,EACT,QAAA,EAAU,QAAA,GAAQ,OAAA;;;;;;AA2FpB;;;;;;;;;;iBAAgB,YAAA,kBAA8B,aAAA,CAAA,CAC5C,OAAA,EAAS,QAAA,EACT,QAAA,EAAU,QAAA,EACV,OAAA,GAAU,gBAAA"}
@@ -0,0 +1,38 @@
1
+ import { Children, PrintTreeOptions } from "@alloy-js/core";
2
+ import { PluginContext } from "powerlines";
3
+
4
+ //#region src/render.d.ts
5
+ /**
6
+ * A function to render children components within the [Alloy](https://alloy-framework.github.io) context, and write any saved content to the file system.
7
+ *
8
+ * @example
9
+ * ```tsx
10
+ * import { render } from "@powerlines/plugin-alloy/render";
11
+ *
12
+ * await render(context, <> ... </>);
13
+ * ```
14
+ *
15
+ * @param context - The Powerlines plugin context.
16
+ * @param children - The children components to render.
17
+ * @returns A promise that resolves when rendering is complete.
18
+ */
19
+ declare function render<TContext extends PluginContext>(context: TContext, children: Children): Promise<void>;
20
+ /**
21
+ * A function to render children components within the [Alloy](https://alloy-framework.github.io) context and return the rendered output as a string.
22
+ *
23
+ * @example
24
+ * ```tsx
25
+ * import { renderString } from "@powerlines/plugin-alloy/render";
26
+ *
27
+ * const output = await renderString(context, <> ... </>);
28
+ * ```
29
+ *
30
+ * @param context - The Powerlines plugin context.
31
+ * @param children - The children components to render.
32
+ * @param options - Optional print tree options.
33
+ * @returns The rendered output as a string.
34
+ */
35
+ declare function renderString<TContext extends PluginContext>(context: TContext, children: Children, options?: PrintTreeOptions): string;
36
+ //#endregion
37
+ export { render, renderString };
38
+ //# sourceMappingURL=render.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render.d.mts","names":[],"sources":["../src/render.tsx"],"mappings":";;;;;;AA4CA;;;;;;;;;;;;iBAAsB,MAAA,kBAAwB,aAAA,CAAA,CAC5C,OAAA,EAAS,QAAA,EACT,QAAA,EAAU,QAAA,GAAQ,OAAA;;;;;;AA2FpB;;;;;;;;;;iBAAgB,YAAA,kBAA8B,aAAA,CAAA,CAC5C,OAAA,EAAS,QAAA,EACT,QAAA,EAAU,QAAA,EACV,OAAA,GAAU,gBAAA"}
@@ -0,0 +1,89 @@
1
+ import { Output as Output$1 } from "./core/components/output.mjs";
2
+ import "./core/index.mjs";
3
+ import { findFileExtension } from "@stryke/path/file-path-fns";
4
+ import { createComponent } from "@alloy-js/core/jsx-runtime";
5
+ import { printTree, renderAsync, renderTree, traverseOutput } from "@alloy-js/core";
6
+
7
+ //#region src/render.tsx
8
+ /**
9
+ * A function to render children components within the [Alloy](https://alloy-framework.github.io) context, and write any saved content to the file system.
10
+ *
11
+ * @example
12
+ * ```tsx
13
+ * import { render } from "@powerlines/plugin-alloy/render";
14
+ *
15
+ * await render(context, <> ... </>);
16
+ * ```
17
+ *
18
+ * @param context - The Powerlines plugin context.
19
+ * @param children - The children components to render.
20
+ * @returns A promise that resolves when rendering is complete.
21
+ */
22
+ async function render(context, children) {
23
+ const meta = {};
24
+ const output = await renderAsync(createComponent(Output$1, {
25
+ context,
26
+ meta,
27
+ children
28
+ }));
29
+ if (!Object.keys(output).length) context.debug("No output files were rendered by Alloy-js component templates.");
30
+ else {
31
+ context.debug(`Processing ${Object.keys(output).length} rendered output files from Alloy-js component templates.`);
32
+ await traverseOutput(output, {
33
+ visitDirectory: (directory) => {
34
+ if (context.fs.existsSync(directory.path)) return;
35
+ context.fs.mkdirSync(directory.path);
36
+ },
37
+ visitFile: (file) => {
38
+ if ("contents" in file) {
39
+ const metadata = meta[file.path] ?? {};
40
+ if (metadata.kind === "builtin") {
41
+ if (!metadata.id) throw new Error(`Built-in file "${file.path}" is missing its ID in the render metadata.`);
42
+ context.emitBuiltinSync(file.contents, metadata.id, {
43
+ skipFormat: metadata.skipFormat,
44
+ storage: metadata.storage,
45
+ extension: findFileExtension(file.path)
46
+ });
47
+ } else if (metadata.kind === "entry") context.emitEntrySync(file.contents, file.path, {
48
+ skipFormat: metadata.skipFormat,
49
+ storage: metadata.storage,
50
+ ...metadata.typeDefinition ?? {}
51
+ });
52
+ else if (metadata.kind === "infrastructure") {
53
+ if (!metadata.id) throw new Error(`Infrastructure file "${file.path}" is missing its ID in the render metadata.`);
54
+ context.emitInfrastructureSync(file.contents, metadata.id, {
55
+ skipFormat: metadata.skipFormat,
56
+ storage: metadata.storage,
57
+ extension: findFileExtension(file.path)
58
+ });
59
+ } else context.emitSync(file.contents, file.path, metadata);
60
+ } else context.fs.copySync(file.sourcePath, file.path);
61
+ }
62
+ });
63
+ }
64
+ }
65
+ /**
66
+ * A function to render children components within the [Alloy](https://alloy-framework.github.io) context and return the rendered output as a string.
67
+ *
68
+ * @example
69
+ * ```tsx
70
+ * import { renderString } from "@powerlines/plugin-alloy/render";
71
+ *
72
+ * const output = await renderString(context, <> ... </>);
73
+ * ```
74
+ *
75
+ * @param context - The Powerlines plugin context.
76
+ * @param children - The children components to render.
77
+ * @param options - Optional print tree options.
78
+ * @returns The rendered output as a string.
79
+ */
80
+ function renderString(context, children, options) {
81
+ return printTree(renderTree(createComponent(Output$1, {
82
+ context,
83
+ children
84
+ })), options);
85
+ }
86
+
87
+ //#endregion
88
+ export { render, renderString };
89
+ //# sourceMappingURL=render.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render.mjs","names":[],"sources":["../src/render.tsx"],"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 {\n Children,\n printTree,\n PrintTreeOptions,\n renderAsync,\n renderTree,\n traverseOutput\n} from \"@alloy-js/core\";\nimport { findFileExtension } from \"@stryke/path/file-path-fns\";\nimport { PluginContext } from \"powerlines\";\nimport { MetaItem, Output } from \"./core\";\n\n/**\n * A function to render children components within the [Alloy](https://alloy-framework.github.io) context, and write any saved content to the file system.\n *\n * @example\n * ```tsx\n * import { render } from \"@powerlines/plugin-alloy/render\";\n *\n * await render(context, <> ... </>);\n * ```\n *\n * @param context - The Powerlines plugin context.\n * @param children - The children components to render.\n * @returns A promise that resolves when rendering is complete.\n */\nexport async function render<TContext extends PluginContext>(\n context: TContext,\n children: Children\n) {\n const meta = {} as Record<string, MetaItem>;\n const output = await renderAsync(\n <Output<TContext> context={context} meta={meta}>\n {children}\n </Output>\n );\n\n if (!Object.keys(output).length) {\n context.debug(\n \"No output files were rendered by Alloy-js component templates.\"\n );\n } else {\n context.debug(\n `Processing ${\n Object.keys(output).length\n } rendered output files from Alloy-js component templates.`\n );\n\n await traverseOutput(output, {\n visitDirectory: directory => {\n if (context.fs.existsSync(directory.path)) {\n return;\n }\n\n context.fs.mkdirSync(directory.path);\n },\n visitFile: file => {\n if (\"contents\" in file) {\n const metadata = meta[file.path] ?? {};\n if (metadata.kind === \"builtin\") {\n if (!metadata.id) {\n throw new Error(\n `Built-in file \"${\n file.path\n }\" is missing its ID in the render metadata.`\n );\n }\n\n context.emitBuiltinSync(file.contents, metadata.id, {\n skipFormat: metadata.skipFormat,\n storage: metadata.storage,\n extension: findFileExtension(file.path)\n });\n } else if (metadata.kind === \"entry\") {\n context.emitEntrySync(file.contents, file.path, {\n skipFormat: metadata.skipFormat,\n storage: metadata.storage,\n ...(metadata.typeDefinition ?? {})\n });\n } else if (metadata.kind === \"infrastructure\") {\n if (!metadata.id) {\n throw new Error(\n `Infrastructure file \"${\n file.path\n }\" is missing its ID in the render metadata.`\n );\n }\n\n context.emitInfrastructureSync(file.contents, metadata.id, {\n skipFormat: metadata.skipFormat,\n storage: metadata.storage,\n extension: findFileExtension(file.path)\n });\n } else {\n context.emitSync(file.contents, file.path, metadata);\n }\n } else {\n context.fs.copySync(file.sourcePath, file.path);\n }\n }\n });\n }\n}\n\n/**\n * A function to render children components within the [Alloy](https://alloy-framework.github.io) context and return the rendered output as a string.\n *\n * @example\n * ```tsx\n * import { renderString } from \"@powerlines/plugin-alloy/render\";\n *\n * const output = await renderString(context, <> ... </>);\n * ```\n *\n * @param context - The Powerlines plugin context.\n * @param children - The children components to render.\n * @param options - Optional print tree options.\n * @returns The rendered output as a string.\n */\nexport function renderString<TContext extends PluginContext>(\n context: TContext,\n children: Children,\n options?: PrintTreeOptions\n) {\n const tree = renderTree(\n <Output<TContext> context={context}>{children}</Output>\n );\n\n return printTree(tree, options);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAsCA,eAAK,OAAA,SAAA,UAAA;CACJ,MAAA,OAAA,EAAA;CACC,MAAE,SAAa,MAAM,YAAY,gBAAc,UAAA;EACvC;EACN;EACF;EACF,CAAA,CAAA;AACE,KAAA,CAAA,OAAS,KAAQ,OAAA,CAAA,OACjB,SAAU,MAAA,iEAAA;MACV;AACA,UAAU,MAAM,cAAU,OAAQ,KAAQ,OAAC,CAAA,OAAA,2DAAA;AAC3C,QAAM,eAAe,QAAA;GAClB,iBAAiB,cAAS;AACxB,QAAA,QAAQ,GAAA,WAAA,UAAA,KAAA,CACT;;;GAIF,YAAa,SAAA;AACV,QAAG,cAAa,MAAK;KACvB,MAAA,WAAA,KAAA,KAAA,SAAA,EAAA;AACI,SAAA,SAAA,SAAA,WAAA;AACG,UAAA,CAAK,SAAA,GACV,OAAY,IAAA,MAAA,kBAAA,KAAA,KAAA,6CAAA;AAEX,cAAS,gBAAkB,KAAM,UAAG,SAAU,IAAU;OAC3D,YAAA,SAAA;;OAEK,WAAe,kBAAQ,KAAA,KAAA;OAC3B,CAAA;gBACc,SAAG,SAAW,QACxB,SAAM,cAAA,KAAA,UAAA,KAAA,MAAA;MACR,YAAA,SAAA;;MAEA,GAAU,SAAC,kBAAyB,EAAA;MACrC,CAAA;cACc,SAAI,SAAA,kBAAA;AACb,UAAC,CAAA,SAAa,GAChB,OAAM,IAAQ,MAAG,wBAAqB,KAAA,KAAA,6CAAA;AAEpC,cAAK,uBAAa,KAAA,UAAA,SAAA,IAAA;OAChB,YAAU,SAAK;OACf,SAAS,SAAS;OAClB,WAAS,kBAAA,KAAA,KAAA;OACV,CAAC;WAEF,SAAA,SAAA,KAAA,UAAA,KAAA,MAAA,SAAA;UAGF,SAAI,GAAA,SAAY,KAAS,YAAU,KAAA,KAAA;;GAGxC,CAAC;;;;;;;;;;;;;;;;;;AAmBN,SAAc,aAAsC,SAAA,UAAA,SAAA;AAKlD,QAAO,UAJK,WAAA,gBAAA,UAAA;EACF;EACA;EACT,CAAC,CAAC,EACU,QAAA"}
File without changes
@@ -0,0 +1,142 @@
1
+ import { Children, Context } from "@alloy-js/core";
2
+ import { ResolvedEntryTypeDefinition, StoragePreset } from "powerlines";
3
+ import { SourceFileContext } from "@alloy-js/typescript";
4
+
5
+ //#region src/types/components.d.ts
6
+ interface CopyOutputFile {
7
+ kind: "file";
8
+ path: string;
9
+ sourcePath: string;
10
+ /**
11
+ * The format of the output files
12
+ *
13
+ * @remarks
14
+ * If not specified, the output mode will be determined by the provided \`output.mode\` value.
15
+ */
16
+ preset?: StoragePreset;
17
+ }
18
+ interface WriteOutputFile {
19
+ kind: "file" | "entry" | "builtin";
20
+ path: string;
21
+ contents: string;
22
+ filetype: string;
23
+ /**
24
+ * The format of the output files
25
+ *
26
+ * @remarks
27
+ * If not specified, the output mode will be determined by the provided \`output.mode\` value.
28
+ */
29
+ preset?: StoragePreset;
30
+ }
31
+ type OutputFile = (WriteOutputFile & {
32
+ kind: "file";
33
+ }) | (WriteOutputFile & {
34
+ kind: "entry";
35
+ typeDefinition?: ResolvedEntryTypeDefinition;
36
+ }) | (WriteOutputFile & {
37
+ kind: "builtin";
38
+ id: string;
39
+ }) | CopyOutputFile;
40
+ interface OutputDirectory {
41
+ kind: "directory";
42
+ path: string;
43
+ contents: (OutputDirectory | OutputFile)[];
44
+ }
45
+ interface RenderEntryContext {
46
+ typeDefinition: ResolvedEntryTypeDefinition;
47
+ }
48
+ interface RenderBuiltinContext {
49
+ id: string;
50
+ }
51
+ interface RenderOutputContext {
52
+ mode?: StoragePreset;
53
+ }
54
+ interface CopyFileOutputContext {
55
+ path?: string;
56
+ sourcePath?: string;
57
+ }
58
+ interface RenderContext extends Context {
59
+ meta?: {
60
+ copyFile?: CopyFileOutputContext;
61
+ /**
62
+ * The current context for the built-in module.
63
+ */
64
+ builtin?: RenderBuiltinContext;
65
+ /**
66
+ * The current context for the application entrypoint file being rendered.
67
+ */
68
+ entry?: RenderEntryContext;
69
+ /**
70
+ * The current context for output rendering.
71
+ */
72
+ output?: RenderOutputContext;
73
+ } & Record<string, any>;
74
+ }
75
+ /**
76
+ * A type that represents the props of a component that can have children.
77
+ */
78
+ interface ComponentProps {
79
+ children?: Children;
80
+ }
81
+ /**
82
+ * A type that requires the `children` prop in a component.
83
+ */
84
+ type ComponentPropsWithChildren = Omit<ComponentProps, "children"> & Required<Pick<ComponentProps, "children">>;
85
+ interface BuiltinSourceFileContext extends SourceFileContext {
86
+ /**
87
+ * The runtime module identifier.
88
+ */
89
+ id: string;
90
+ }
91
+ interface ReflectionOverrideInterface<T> {
92
+ name?: string | Children;
93
+ type?: string | Children;
94
+ extends?: string | false;
95
+ defaultValue?: Partial<T>;
96
+ }
97
+ interface TypescriptFileImportItem {
98
+ name: string;
99
+ default?: boolean;
100
+ alias?: string;
101
+ type?: boolean;
102
+ }
103
+ type TypescriptFileImports = Record<string, null | string | Array<TypescriptFileImportItem | string>>;
104
+ interface SourceFileHeaderProps extends ComponentProps {
105
+ /**
106
+ * If true, disables the ESLint directive at the top of the file.
107
+ *
108
+ * @defaultValue true
109
+ */
110
+ disableEslint?: boolean;
111
+ /**
112
+ * If true, disables the Biome directive at the top of the file.
113
+ *
114
+ * @defaultValue true
115
+ */
116
+ disableBiome?: boolean;
117
+ /**
118
+ * If true, disables the Prettier directive at the top of the file.
119
+ *
120
+ * @defaultValue false
121
+ */
122
+ disablePrettier?: boolean;
123
+ }
124
+ declare type __ΩCopyOutputFile = any[];
125
+ declare type __ΩWriteOutputFile = any[];
126
+ declare type __ΩOutputFile = any[];
127
+ declare type __ΩOutputDirectory = any[];
128
+ declare type __ΩRenderEntryContext = any[];
129
+ declare type __ΩRenderBuiltinContext = any[];
130
+ declare type __ΩRenderOutputContext = any[];
131
+ declare type __ΩCopyFileOutputContext = any[];
132
+ declare type __ΩRenderContext = any[];
133
+ declare type __ΩComponentProps = any[];
134
+ declare type __ΩComponentPropsWithChildren = any[];
135
+ declare type __ΩBuiltinSourceFileContext = any[];
136
+ declare type __ΩReflectionOverrideInterface = any[];
137
+ declare type __ΩTypescriptFileImportItem = any[];
138
+ declare type __ΩTypescriptFileImports = any[];
139
+ declare type __ΩSourceFileHeaderProps = any[];
140
+ //#endregion
141
+ export { BuiltinSourceFileContext, ComponentProps, ComponentPropsWithChildren, CopyFileOutputContext, CopyOutputFile, OutputDirectory, OutputFile, ReflectionOverrideInterface, RenderBuiltinContext, RenderContext, RenderEntryContext, RenderOutputContext, SourceFileHeaderProps, TypescriptFileImportItem, TypescriptFileImports, WriteOutputFile, __ΩBuiltinSourceFileContext, __ΩComponentProps, __ΩComponentPropsWithChildren, __ΩCopyFileOutputContext, __ΩCopyOutputFile, __ΩOutputDirectory, __ΩOutputFile, __ΩReflectionOverrideInterface, __ΩRenderBuiltinContext, __ΩRenderContext, __ΩRenderEntryContext, __ΩRenderOutputContext, __ΩSourceFileHeaderProps, __ΩTypescriptFileImportItem, __ΩTypescriptFileImports, __ΩWriteOutputFile };
142
+ //# sourceMappingURL=components.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"components.d.cts","names":[],"sources":["../../src/types/components.ts"],"mappings":";;;;;UAsBiB,cAAA;EACf,IAAA;EACA,IAAA;EACA,UAAA;;;;;;;EAQA,MAAA,GAAS,aAAA;AAAA;AAAA,UAGM,eAAA;EACf,IAAA;EACA,IAAA;EACA,QAAA;EACA,QAAA;EAHA;;;;;;EAWA,MAAA,GAAS,aAAA;AAAA;AAAA,KAGC,UAAA,IACP,eAAA;EAAoB,IAAA;AAAA,MACpB,eAAA;EACC,IAAA;EACA,cAAA,GAAiB,2BAAA;AAAA,MAElB,eAAA;EAAoB,IAAA;EAAiB,EAAA;AAAA,KACtC,cAAA;AAAA,UAEa,eAAA;EACf,IAAA;EACA,IAAA;EACA,QAAA,GAAW,eAAA,GAAkB,UAAA;AAAA;AAAA,UAGd,kBAAA;EACf,cAAA,EAAgB,2BAAA;AAAA;AAAA,UAGD,oBAAA;EACf,EAAA;AAAA;AAAA,UAGe,mBAAA;EACf,IAAA,GAAO,aAAA;AAAA;AAAA,UAGQ,qBAAA;EACf,IAAA;EACA,UAAA;AAAA;AAAA,UAGe,aAAA,SAAsB,OAAA;EACrC,IAAA;IACE,QAAA,GAAW,qBAAA;IAtBgB;;;IA2B3B,OAAA,GAAU,oBAAA;IAxBqB;;;IA6B/B,KAAA,GAAQ,kBAAA;IAzBK;;;IA8Bb,MAAA,GAAS,mBAAA;EAAA,IACP,MAAA;AAAA;;;;UAMW,cAAA;EACf,QAAA,GAAW,QAAA;AAAA;;;;KAMD,0BAAA,GAA6B,IAAA,CAAK,cAAA,gBAC5C,QAAA,CAAS,IAAA,CAAK,cAAA;AAAA,UAEC,wBAAA,SAAiC,iBAAA;;;;EAIhD,EAAA;AAAA;AAAA,UAGe,2BAAA;EACf,IAAA,YAAgB,QAAA;EAChB,IAAA,YAAgB,QAAA;EAChB,OAAA;EACA,YAAA,GAAe,OAAA,CAAQ,CAAA;AAAA;AAAA,UAGR,wBAAA;EACf,IAAA;EACA,OAAA;EACA,KAAA;EACA,IAAA;AAAA;AAAA,KAGU,qBAAA,GAAwB,MAAA,yBAElB,KAAA,CAAM,wBAAA;AAAA,UAGP,qBAAA,SAA8B,cAAA;EA1CzC;;;AAMN;;EA0CE,aAAA;EAzCA;;AAMF;;;EA0CE,YAAA;EA1CuC;;;;;EAiDvC,eAAA;AAAA;AAAA"}