@powerlines/plugin-alloy 0.25.33 → 0.25.34

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 (287) hide show
  1. package/README.md +1 -1
  2. package/dist/core/components/output.cjs +17 -10
  3. package/dist/core/components/output.mjs +18 -12
  4. package/dist/core/components/single-line-comment.cjs +6 -4
  5. package/dist/core/components/single-line-comment.mjs +7 -6
  6. package/dist/core/components/source-file.cjs +10 -6
  7. package/dist/core/components/source-file.mjs +11 -8
  8. package/dist/core/components/spacing.cjs +6 -4
  9. package/dist/core/components/spacing.mjs +7 -6
  10. package/dist/core/contexts/context.mjs +1 -2
  11. package/dist/core/contexts/meta.mjs +1 -2
  12. package/dist/core/contexts/reflection.mjs +1 -2
  13. package/dist/core/helpers/code.mjs +1 -2
  14. package/dist/helpers/capnp.mjs +1 -2
  15. package/dist/helpers/create-builtin.mjs +1 -2
  16. package/dist/helpers/refkey.mjs +1 -2
  17. package/dist/helpers/typescript.mjs +1 -2
  18. package/dist/index.cjs +8 -18
  19. package/dist/index.mjs +8 -19
  20. package/dist/markdown/components/front-matter.cjs +9 -7
  21. package/dist/markdown/components/front-matter.mjs +10 -9
  22. package/dist/markdown/components/markdown-file.cjs +76 -44
  23. package/dist/markdown/components/markdown-file.mjs +77 -46
  24. package/dist/markdown/components/markdown-table.cjs +49 -28
  25. package/dist/markdown/components/markdown-table.mjs +50 -30
  26. package/dist/markdown/contexts/markdown-table.mjs +1 -2
  27. package/dist/render.cjs +3 -3
  28. package/dist/render.mjs +4 -5
  29. package/dist/typescript/components/builtin-file.cjs +29 -19
  30. package/dist/typescript/components/builtin-file.mjs +30 -21
  31. package/dist/typescript/components/class-declaration.cjs +165 -100
  32. package/dist/typescript/components/class-declaration.mjs +166 -102
  33. package/dist/typescript/components/dynamic-import-statement.cjs +2 -6
  34. package/dist/typescript/components/dynamic-import-statement.mjs +3 -8
  35. package/dist/typescript/components/entry-file.cjs +9 -6
  36. package/dist/typescript/components/entry-file.mjs +10 -8
  37. package/dist/typescript/components/infrastructure-file.cjs +9 -6
  38. package/dist/typescript/components/infrastructure-file.mjs +10 -8
  39. package/dist/typescript/components/interface-declaration.cjs +121 -70
  40. package/dist/typescript/components/interface-declaration.mjs +122 -72
  41. package/dist/typescript/components/object-declaration.cjs +76 -44
  42. package/dist/typescript/components/object-declaration.mjs +77 -46
  43. package/dist/typescript/components/property-name.cjs +3 -3
  44. package/dist/typescript/components/property-name.mjs +4 -5
  45. package/dist/typescript/components/record-expression.mjs +1 -2
  46. package/dist/typescript/components/tsdoc-reflection.cjs +225 -104
  47. package/dist/typescript/components/tsdoc-reflection.mjs +226 -106
  48. package/dist/typescript/components/tsdoc.cjs +255 -160
  49. package/dist/typescript/components/tsdoc.mjs +256 -162
  50. package/dist/typescript/components/type-declaration.cjs +20 -15
  51. package/dist/typescript/components/type-declaration.mjs +21 -17
  52. package/dist/typescript/components/type-parameters.cjs +55 -29
  53. package/dist/typescript/components/type-parameters.mjs +56 -31
  54. package/dist/typescript/components/typescript-file.cjs +145 -80
  55. package/dist/typescript/components/typescript-file.mjs +146 -82
  56. package/dist/typescript/contexts/lexical-scope.cjs +5 -3
  57. package/dist/typescript/contexts/lexical-scope.mjs +6 -5
  58. package/dist/typescript/contexts/member-scope.cjs +5 -3
  59. package/dist/typescript/contexts/member-scope.mjs +6 -5
  60. package/dist/typescript/helpers/get-call-signature-props.mjs +1 -2
  61. package/dist/typescript/helpers/utilities.mjs +1 -2
  62. package/dist/yaml/components/yaml-file.cjs +92 -47
  63. package/dist/yaml/components/yaml-file.mjs +93 -49
  64. package/package.json +16 -17
  65. package/dist/core/components/index.d.cts +0 -5
  66. package/dist/core/components/index.d.mts +0 -5
  67. package/dist/core/components/output.d.cts +0 -24
  68. package/dist/core/components/output.d.cts.map +0 -1
  69. package/dist/core/components/output.d.mts +0 -24
  70. package/dist/core/components/output.d.mts.map +0 -1
  71. package/dist/core/components/output.mjs.map +0 -1
  72. package/dist/core/components/single-line-comment.d.cts +0 -23
  73. package/dist/core/components/single-line-comment.d.cts.map +0 -1
  74. package/dist/core/components/single-line-comment.d.mts +0 -23
  75. package/dist/core/components/single-line-comment.d.mts.map +0 -1
  76. package/dist/core/components/single-line-comment.mjs.map +0 -1
  77. package/dist/core/components/source-file.d.cts +0 -33
  78. package/dist/core/components/source-file.d.cts.map +0 -1
  79. package/dist/core/components/source-file.d.mts +0 -33
  80. package/dist/core/components/source-file.d.mts.map +0 -1
  81. package/dist/core/components/source-file.mjs.map +0 -1
  82. package/dist/core/components/spacing.d.cts +0 -24
  83. package/dist/core/components/spacing.d.cts.map +0 -1
  84. package/dist/core/components/spacing.d.mts +0 -24
  85. package/dist/core/components/spacing.d.mts.map +0 -1
  86. package/dist/core/components/spacing.mjs.map +0 -1
  87. package/dist/core/contexts/context.d.cts +0 -29
  88. package/dist/core/contexts/context.d.cts.map +0 -1
  89. package/dist/core/contexts/context.d.mts +0 -29
  90. package/dist/core/contexts/context.d.mts.map +0 -1
  91. package/dist/core/contexts/context.mjs.map +0 -1
  92. package/dist/core/contexts/index.d.cts +0 -4
  93. package/dist/core/contexts/index.d.mts +0 -4
  94. package/dist/core/contexts/meta.d.cts +0 -48
  95. package/dist/core/contexts/meta.d.cts.map +0 -1
  96. package/dist/core/contexts/meta.d.mts +0 -48
  97. package/dist/core/contexts/meta.d.mts.map +0 -1
  98. package/dist/core/contexts/meta.mjs.map +0 -1
  99. package/dist/core/contexts/reflection.d.cts +0 -53
  100. package/dist/core/contexts/reflection.d.cts.map +0 -1
  101. package/dist/core/contexts/reflection.d.mts +0 -53
  102. package/dist/core/contexts/reflection.d.mts.map +0 -1
  103. package/dist/core/contexts/reflection.mjs.map +0 -1
  104. package/dist/core/helpers/code.d.cts +0 -29
  105. package/dist/core/helpers/code.d.cts.map +0 -1
  106. package/dist/core/helpers/code.d.mts +0 -29
  107. package/dist/core/helpers/code.d.mts.map +0 -1
  108. package/dist/core/helpers/code.mjs.map +0 -1
  109. package/dist/core/helpers/index.d.cts +0 -2
  110. package/dist/core/helpers/index.d.mts +0 -2
  111. package/dist/core/index.d.cts +0 -9
  112. package/dist/core/index.d.mts +0 -9
  113. package/dist/helpers/capnp.d.cts +0 -87
  114. package/dist/helpers/capnp.d.cts.map +0 -1
  115. package/dist/helpers/capnp.d.mts +0 -87
  116. package/dist/helpers/capnp.d.mts.map +0 -1
  117. package/dist/helpers/capnp.mjs.map +0 -1
  118. package/dist/helpers/create-builtin.d.cts +0 -16
  119. package/dist/helpers/create-builtin.d.cts.map +0 -1
  120. package/dist/helpers/create-builtin.d.mts +0 -16
  121. package/dist/helpers/create-builtin.d.mts.map +0 -1
  122. package/dist/helpers/create-builtin.mjs.map +0 -1
  123. package/dist/helpers/index.d.cts +0 -5
  124. package/dist/helpers/index.d.mts +0 -5
  125. package/dist/helpers/refkey.d.cts +0 -13
  126. package/dist/helpers/refkey.d.cts.map +0 -1
  127. package/dist/helpers/refkey.d.mts +0 -13
  128. package/dist/helpers/refkey.d.mts.map +0 -1
  129. package/dist/helpers/refkey.mjs.map +0 -1
  130. package/dist/helpers/typescript.d.cts +0 -26
  131. package/dist/helpers/typescript.d.cts.map +0 -1
  132. package/dist/helpers/typescript.d.mts +0 -26
  133. package/dist/helpers/typescript.d.mts.map +0 -1
  134. package/dist/helpers/typescript.mjs.map +0 -1
  135. package/dist/index.d.cts +0 -19
  136. package/dist/index.d.cts.map +0 -1
  137. package/dist/index.d.mts +0 -19
  138. package/dist/index.d.mts.map +0 -1
  139. package/dist/index.mjs.map +0 -1
  140. package/dist/markdown/components/front-matter.d.cts +0 -16
  141. package/dist/markdown/components/front-matter.d.cts.map +0 -1
  142. package/dist/markdown/components/front-matter.d.mts +0 -16
  143. package/dist/markdown/components/front-matter.d.mts.map +0 -1
  144. package/dist/markdown/components/front-matter.mjs.map +0 -1
  145. package/dist/markdown/components/index.d.cts +0 -4
  146. package/dist/markdown/components/index.d.mts +0 -4
  147. package/dist/markdown/components/markdown-file.d.cts +0 -29
  148. package/dist/markdown/components/markdown-file.d.cts.map +0 -1
  149. package/dist/markdown/components/markdown-file.d.mts +0 -29
  150. package/dist/markdown/components/markdown-file.d.mts.map +0 -1
  151. package/dist/markdown/components/markdown-file.mjs.map +0 -1
  152. package/dist/markdown/components/markdown-table.d.cts +0 -28
  153. package/dist/markdown/components/markdown-table.d.cts.map +0 -1
  154. package/dist/markdown/components/markdown-table.d.mts +0 -28
  155. package/dist/markdown/components/markdown-table.d.mts.map +0 -1
  156. package/dist/markdown/components/markdown-table.mjs.map +0 -1
  157. package/dist/markdown/contexts/index.d.cts +0 -2
  158. package/dist/markdown/contexts/index.d.mts +0 -2
  159. package/dist/markdown/contexts/markdown-table.d.cts +0 -38
  160. package/dist/markdown/contexts/markdown-table.d.cts.map +0 -1
  161. package/dist/markdown/contexts/markdown-table.d.mts +0 -38
  162. package/dist/markdown/contexts/markdown-table.d.mts.map +0 -1
  163. package/dist/markdown/contexts/markdown-table.mjs.map +0 -1
  164. package/dist/markdown/index.d.cts +0 -5
  165. package/dist/markdown/index.d.mts +0 -5
  166. package/dist/render.d.cts +0 -38
  167. package/dist/render.d.cts.map +0 -1
  168. package/dist/render.d.mts +0 -38
  169. package/dist/render.d.mts.map +0 -1
  170. package/dist/render.mjs.map +0 -1
  171. package/dist/types/components.d.cts +0 -142
  172. package/dist/types/components.d.cts.map +0 -1
  173. package/dist/types/components.d.mts +0 -142
  174. package/dist/types/components.d.mts.map +0 -1
  175. package/dist/types/index.d.cts +0 -3
  176. package/dist/types/index.d.mts +0 -3
  177. package/dist/types/plugin.d.cts +0 -39
  178. package/dist/types/plugin.d.cts.map +0 -1
  179. package/dist/types/plugin.d.mts +0 -39
  180. package/dist/types/plugin.d.mts.map +0 -1
  181. package/dist/typescript/components/builtin-file.d.cts +0 -35
  182. package/dist/typescript/components/builtin-file.d.cts.map +0 -1
  183. package/dist/typescript/components/builtin-file.d.mts +0 -35
  184. package/dist/typescript/components/builtin-file.d.mts.map +0 -1
  185. package/dist/typescript/components/builtin-file.mjs.map +0 -1
  186. package/dist/typescript/components/class-declaration.d.cts +0 -145
  187. package/dist/typescript/components/class-declaration.d.cts.map +0 -1
  188. package/dist/typescript/components/class-declaration.d.mts +0 -145
  189. package/dist/typescript/components/class-declaration.d.mts.map +0 -1
  190. package/dist/typescript/components/class-declaration.mjs.map +0 -1
  191. package/dist/typescript/components/dynamic-import-statement.d.cts +0 -33
  192. package/dist/typescript/components/dynamic-import-statement.d.cts.map +0 -1
  193. package/dist/typescript/components/dynamic-import-statement.d.mts +0 -33
  194. package/dist/typescript/components/dynamic-import-statement.d.mts.map +0 -1
  195. package/dist/typescript/components/dynamic-import-statement.mjs.map +0 -1
  196. package/dist/typescript/components/entry-file.d.cts +0 -28
  197. package/dist/typescript/components/entry-file.d.cts.map +0 -1
  198. package/dist/typescript/components/entry-file.d.mts +0 -28
  199. package/dist/typescript/components/entry-file.d.mts.map +0 -1
  200. package/dist/typescript/components/entry-file.mjs.map +0 -1
  201. package/dist/typescript/components/index.d.cts +0 -15
  202. package/dist/typescript/components/index.d.mts +0 -15
  203. package/dist/typescript/components/infrastructure-file.d.cts +0 -21
  204. package/dist/typescript/components/infrastructure-file.d.cts.map +0 -1
  205. package/dist/typescript/components/infrastructure-file.d.mts +0 -21
  206. package/dist/typescript/components/infrastructure-file.d.mts.map +0 -1
  207. package/dist/typescript/components/infrastructure-file.mjs.map +0 -1
  208. package/dist/typescript/components/interface-declaration.d.cts +0 -86
  209. package/dist/typescript/components/interface-declaration.d.cts.map +0 -1
  210. package/dist/typescript/components/interface-declaration.d.mts +0 -86
  211. package/dist/typescript/components/interface-declaration.d.mts.map +0 -1
  212. package/dist/typescript/components/interface-declaration.mjs.map +0 -1
  213. package/dist/typescript/components/object-declaration.d.cts +0 -30
  214. package/dist/typescript/components/object-declaration.d.cts.map +0 -1
  215. package/dist/typescript/components/object-declaration.d.mts +0 -30
  216. package/dist/typescript/components/object-declaration.d.mts.map +0 -1
  217. package/dist/typescript/components/object-declaration.mjs.map +0 -1
  218. package/dist/typescript/components/property-name.d.cts +0 -24
  219. package/dist/typescript/components/property-name.d.cts.map +0 -1
  220. package/dist/typescript/components/property-name.d.mts +0 -24
  221. package/dist/typescript/components/property-name.d.mts.map +0 -1
  222. package/dist/typescript/components/property-name.mjs.map +0 -1
  223. package/dist/typescript/components/record-expression.d.cts +0 -13
  224. package/dist/typescript/components/record-expression.d.cts.map +0 -1
  225. package/dist/typescript/components/record-expression.d.mts +0 -13
  226. package/dist/typescript/components/record-expression.d.mts.map +0 -1
  227. package/dist/typescript/components/record-expression.mjs.map +0 -1
  228. package/dist/typescript/components/tsdoc-reflection.d.cts +0 -44
  229. package/dist/typescript/components/tsdoc-reflection.d.cts.map +0 -1
  230. package/dist/typescript/components/tsdoc-reflection.d.mts +0 -44
  231. package/dist/typescript/components/tsdoc-reflection.d.mts.map +0 -1
  232. package/dist/typescript/components/tsdoc-reflection.mjs.map +0 -1
  233. package/dist/typescript/components/tsdoc.d.cts +0 -164
  234. package/dist/typescript/components/tsdoc.d.cts.map +0 -1
  235. package/dist/typescript/components/tsdoc.d.mts +0 -164
  236. package/dist/typescript/components/tsdoc.d.mts.map +0 -1
  237. package/dist/typescript/components/tsdoc.mjs.map +0 -1
  238. package/dist/typescript/components/type-declaration.d.cts +0 -18
  239. package/dist/typescript/components/type-declaration.d.cts.map +0 -1
  240. package/dist/typescript/components/type-declaration.d.mts +0 -18
  241. package/dist/typescript/components/type-declaration.d.mts.map +0 -1
  242. package/dist/typescript/components/type-declaration.mjs.map +0 -1
  243. package/dist/typescript/components/type-parameters.d.cts +0 -24
  244. package/dist/typescript/components/type-parameters.d.cts.map +0 -1
  245. package/dist/typescript/components/type-parameters.d.mts +0 -24
  246. package/dist/typescript/components/type-parameters.d.mts.map +0 -1
  247. package/dist/typescript/components/type-parameters.mjs.map +0 -1
  248. package/dist/typescript/components/typescript-file.d.cts +0 -50
  249. package/dist/typescript/components/typescript-file.d.cts.map +0 -1
  250. package/dist/typescript/components/typescript-file.d.mts +0 -50
  251. package/dist/typescript/components/typescript-file.d.mts.map +0 -1
  252. package/dist/typescript/components/typescript-file.mjs.map +0 -1
  253. package/dist/typescript/contexts/index.d.cts +0 -2
  254. package/dist/typescript/contexts/index.d.mts +0 -2
  255. package/dist/typescript/contexts/lexical-scope.d.cts +0 -17
  256. package/dist/typescript/contexts/lexical-scope.d.cts.map +0 -1
  257. package/dist/typescript/contexts/lexical-scope.d.mts +0 -17
  258. package/dist/typescript/contexts/lexical-scope.d.mts.map +0 -1
  259. package/dist/typescript/contexts/lexical-scope.mjs.map +0 -1
  260. package/dist/typescript/contexts/member-scope.d.cts +0 -20
  261. package/dist/typescript/contexts/member-scope.d.cts.map +0 -1
  262. package/dist/typescript/contexts/member-scope.d.mts +0 -20
  263. package/dist/typescript/contexts/member-scope.d.mts.map +0 -1
  264. package/dist/typescript/contexts/member-scope.mjs.map +0 -1
  265. package/dist/typescript/helpers/get-call-signature-props.d.cts +0 -14
  266. package/dist/typescript/helpers/get-call-signature-props.d.cts.map +0 -1
  267. package/dist/typescript/helpers/get-call-signature-props.d.mts +0 -14
  268. package/dist/typescript/helpers/get-call-signature-props.d.mts.map +0 -1
  269. package/dist/typescript/helpers/get-call-signature-props.mjs.map +0 -1
  270. package/dist/typescript/helpers/index.d.cts +0 -3
  271. package/dist/typescript/helpers/index.d.mts +0 -3
  272. package/dist/typescript/helpers/utilities.d.cts +0 -11
  273. package/dist/typescript/helpers/utilities.d.cts.map +0 -1
  274. package/dist/typescript/helpers/utilities.d.mts +0 -11
  275. package/dist/typescript/helpers/utilities.d.mts.map +0 -1
  276. package/dist/typescript/helpers/utilities.mjs.map +0 -1
  277. package/dist/typescript/index.d.cts +0 -18
  278. package/dist/typescript/index.d.mts +0 -18
  279. package/dist/yaml/components/index.d.cts +0 -2
  280. package/dist/yaml/components/index.d.mts +0 -2
  281. package/dist/yaml/components/yaml-file.d.cts +0 -34
  282. package/dist/yaml/components/yaml-file.d.cts.map +0 -1
  283. package/dist/yaml/components/yaml-file.d.mts +0 -34
  284. package/dist/yaml/components/yaml-file.d.mts.map +0 -1
  285. package/dist/yaml/components/yaml-file.mjs.map +0 -1
  286. package/dist/yaml/index.d.cts +0 -2
  287. package/dist/yaml/index.d.mts +0 -2
@@ -1,47 +1,73 @@
1
1
  import { usePowerlinesSafe } from "../../core/contexts/context.mjs";
2
2
  import { SingleLineComment } from "../../core/components/single-line-comment.mjs";
3
3
  import { SourceFile } from "../../core/components/source-file.mjs";
4
+ import { createComponent, createIntrinsic, memo, mergeProps } from "@alloy-js/core/jsx-runtime";
4
5
  import { For, Show, code, splitProps } from "@alloy-js/core";
5
- import { Fragment, jsx, jsxs } from "@alloy-js/core/jsx-runtime";
6
6
  import { titleCase } from "@stryke/string-format/title-case";
7
7
  import { getFileHeaderWarning } from "powerlines/utils";
8
8
  import { isSetObject } from "@stryke/type-checks";
9
9
 
10
10
  //#region src/yaml/components/yaml-file.tsx
11
11
  function YamlFileDataItem({ key, value }) {
12
- return /* @__PURE__ */ jsxs(Fragment, { children: [
13
- /* @__PURE__ */ jsx(Show, {
14
- when: Boolean(key),
12
+ return [
13
+ createComponent(Show, {
14
+ get when() {
15
+ return Boolean(key);
16
+ },
15
17
  children: code`${key}:`
16
18
  }),
17
- /* @__PURE__ */ jsx(Show, {
19
+ createComponent(Show, {
18
20
  when: typeof value === "string" || typeof value === "number" || typeof value === "boolean",
19
- children: code` ${String(value)}`
21
+ get children() {
22
+ return code` ${String(value)}`;
23
+ }
20
24
  }),
21
- /* @__PURE__ */ jsx(Show, {
22
- when: isSetObject(value) && !Array.isArray(value),
23
- children: /* @__PURE__ */ jsx(For, {
24
- each: Object.entries(value),
25
- children: ([nestedKey, nestedValue]) => /* @__PURE__ */ jsx(YamlFileDataItem, { value: nestedValue }, nestedKey)
26
- })
25
+ createComponent(Show, {
26
+ get when() {
27
+ return memo(() => !!isSetObject(value))() && !Array.isArray(value);
28
+ },
29
+ get children() {
30
+ return createComponent(For, {
31
+ get each() {
32
+ return Object.entries(value);
33
+ },
34
+ children: ([nestedKey, nestedValue]) => createComponent(YamlFileDataItem, {
35
+ key: nestedKey,
36
+ value: nestedValue
37
+ })
38
+ });
39
+ }
27
40
  }),
28
- /* @__PURE__ */ jsx(Show, {
29
- when: Array.isArray(value),
30
- children: /* @__PURE__ */ jsx(For, {
31
- each: value,
32
- children: (item) => /* @__PURE__ */ jsx(YamlFileDataItem, { value: item })
33
- })
41
+ createComponent(Show, {
42
+ get when() {
43
+ return Array.isArray(value);
44
+ },
45
+ get children() {
46
+ return createComponent(For, {
47
+ each: value,
48
+ children: (item) => createComponent(YamlFileDataItem, { value: item })
49
+ });
50
+ }
34
51
  })
35
- ] });
52
+ ];
36
53
  }
37
54
  function YamlFileData({ data }) {
38
- return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(Show, {
39
- when: Boolean(data),
40
- children: /* @__PURE__ */ jsx(For, {
41
- each: Object.entries(data ?? {}),
42
- children: ([key, value]) => /* @__PURE__ */ jsx(YamlFileDataItem, { value }, key)
43
- })
44
- }) });
55
+ return [createComponent(Show, {
56
+ get when() {
57
+ return Boolean(data);
58
+ },
59
+ get children() {
60
+ return createComponent(For, {
61
+ get each() {
62
+ return Object.entries(data ?? {});
63
+ },
64
+ children: ([key, value]) => createComponent(YamlFileDataItem, {
65
+ key,
66
+ value
67
+ })
68
+ });
69
+ }
70
+ })];
45
71
  }
46
72
  /**
47
73
  * A base component representing a Powerlines generated YAML source file.
@@ -59,19 +85,30 @@ function YamlFile(props) {
59
85
  "data",
60
86
  "header"
61
87
  ]);
62
- return /* @__PURE__ */ jsxs(SourceFile, {
63
- ...rest,
88
+ return createComponent(SourceFile, mergeProps(rest, {
64
89
  path,
65
- header: /* @__PURE__ */ jsx(YamlFileHeader, { children: header }),
90
+ get header() {
91
+ return createComponent(YamlFileHeader, { children: header });
92
+ },
66
93
  filetype: "yaml",
67
- children: [/* @__PURE__ */ jsx(Show, {
68
- when: Boolean(data),
69
- children: /* @__PURE__ */ jsx(YamlFileData, { data })
70
- }), /* @__PURE__ */ jsx(Show, {
71
- when: Boolean(children),
72
- children: /* @__PURE__ */ jsxs(Fragment, { children: [children, /* @__PURE__ */ jsx("hbr", {})] })
73
- })]
74
- });
94
+ get children() {
95
+ return [createComponent(Show, {
96
+ get when() {
97
+ return Boolean(data);
98
+ },
99
+ get children() {
100
+ return createComponent(YamlFileData, { data });
101
+ }
102
+ }), createComponent(Show, {
103
+ get when() {
104
+ return Boolean(children);
105
+ },
106
+ get children() {
107
+ return [children, createIntrinsic("hbr", {})];
108
+ }
109
+ })];
110
+ }
111
+ }));
75
112
  }
76
113
  /**
77
114
  * Renders the header for a Powerlines YAML source file.
@@ -82,21 +119,28 @@ function YamlFile(props) {
82
119
  function YamlFileHeader(props) {
83
120
  const { children } = props;
84
121
  const context = usePowerlinesSafe();
85
- return /* @__PURE__ */ jsxs(Fragment, { children: [
86
- /* @__PURE__ */ jsx(Show, {
87
- when: Boolean(children),
88
- children: /* @__PURE__ */ jsxs(Fragment, { children: [children, /* @__PURE__ */ jsx("hbr", {})] })
122
+ return [
123
+ createComponent(Show, {
124
+ get when() {
125
+ return Boolean(children);
126
+ },
127
+ get children() {
128
+ return [children, createIntrinsic("hbr", {})];
129
+ }
89
130
  }),
90
- /* @__PURE__ */ jsx(SingleLineComment, { children: `Generated by ${titleCase(context?.config?.framework) || "Powerlines"}` }),
91
- /* @__PURE__ */ jsx("hbr", {}),
92
- /* @__PURE__ */ jsx(SingleLineComment, {
131
+ createComponent(SingleLineComment, { get children() {
132
+ return `Generated by ${titleCase(context?.config?.framework) || "Powerlines"}`;
133
+ } }),
134
+ createIntrinsic("hbr", {}),
135
+ createComponent(SingleLineComment, {
93
136
  variant: "yaml",
94
- children: getFileHeaderWarning(context)
137
+ get children() {
138
+ return getFileHeaderWarning(context);
139
+ }
95
140
  }),
96
- /* @__PURE__ */ jsx("hbr", {})
97
- ] });
141
+ createIntrinsic("hbr", {})
142
+ ];
98
143
  }
99
144
 
100
145
  //#endregion
101
- export { YamlFile, YamlFileHeader };
102
- //# sourceMappingURL=yaml-file.mjs.map
146
+ export { YamlFile, YamlFileHeader };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-alloy",
3
- "version": "0.25.33",
3
+ "version": "0.25.34",
4
4
  "type": "module",
5
5
  "description": "A package containing various Alloy framework components and helper utilities.",
6
6
  "repository": {
@@ -808,30 +808,29 @@
808
808
  "@alloy-js/core": "0.23.0-dev.8",
809
809
  "@alloy-js/json": "0.23.0-dev.2",
810
810
  "@alloy-js/markdown": "0.23.0-dev.1",
811
- "@alloy-js/rollup-plugin": "^0.1.0",
812
811
  "@alloy-js/typescript": "0.23.0-dev.4",
813
- "@powerlines/deepkit": "^0.6.127",
814
- "@powerlines/plugin-babel": "^0.12.351",
812
+ "@powerlines/deepkit": "^0.6.128",
813
+ "@powerlines/plugin-babel": "^0.12.352",
815
814
  "@storm-software/config-tools": "1.189.28",
816
- "@stryke/capnp": "^0.12.83",
817
- "@stryke/convert": "^0.6.53",
818
- "@stryke/fs": "^0.33.57",
819
- "@stryke/helpers": "^0.10.3",
820
- "@stryke/json": "^0.14.7",
821
- "@stryke/path": "^0.26.19",
822
- "@stryke/string-format": "^0.17.3",
823
- "@stryke/type-checks": "^0.5.38",
824
- "@stryke/types": "^0.10.52",
825
- "@stryke/unique-id": "^0.3.68",
815
+ "@stryke/capnp": "^0.12.84",
816
+ "@stryke/convert": "^0.6.54",
817
+ "@stryke/fs": "^0.33.58",
818
+ "@stryke/helpers": "^0.10.4",
819
+ "@stryke/json": "^0.14.8",
820
+ "@stryke/path": "^0.27.0",
821
+ "@stryke/string-format": "^0.17.4",
822
+ "@stryke/type-checks": "^0.5.39",
823
+ "@stryke/types": "^0.10.53",
824
+ "@stryke/unique-id": "^0.3.69",
826
825
  "defu": "^6.1.4",
827
- "powerlines": "^0.41.13",
826
+ "powerlines": "^0.41.14",
828
827
  "prettier": "^3.8.1",
829
828
  "unctx": "^2.5.0"
830
829
  },
831
830
  "devDependencies": {
832
- "@powerlines/plugin-plugin": "^0.12.299",
831
+ "@powerlines/plugin-plugin": "^0.12.300",
833
832
  "@types/node": "^25.5.0"
834
833
  },
835
834
  "publishConfig": { "access": "public" },
836
- "gitHead": "0fcc7a33523c8b70c1b5f65684a8b6a15ab68eba"
835
+ "gitHead": "369e884879e82b75feffe7cfd91c78584accb1d2"
837
836
  }
@@ -1,5 +0,0 @@
1
- import { Output, OutputProps, __ΩOutputProps } from "./output.cjs";
2
- import { SingleLineComment, SingleLineCommentProps, SingleLineCommentVariant, __ΩSingleLineCommentProps, __ΩSingleLineCommentVariant } from "./single-line-comment.cjs";
3
- import { SourceFile, SourceFileProps, __ΩSourceFileProps } from "./source-file.cjs";
4
- import { Spacing, SpacingProps, __ΩSpacingProps } from "./spacing.cjs";
5
- export { Output, OutputProps, SingleLineComment, SingleLineCommentProps, SingleLineCommentVariant, SourceFile, SourceFileProps, Spacing, SpacingProps, __ΩOutputProps, __ΩSingleLineCommentProps, __ΩSingleLineCommentVariant, __ΩSourceFileProps, __ΩSpacingProps };
@@ -1,5 +0,0 @@
1
- import { Output, OutputProps, __ΩOutputProps } from "./output.mjs";
2
- import { SingleLineComment, SingleLineCommentProps, SingleLineCommentVariant, __ΩSingleLineCommentProps, __ΩSingleLineCommentVariant } from "./single-line-comment.mjs";
3
- import { SourceFile, SourceFileProps, __ΩSourceFileProps } from "./source-file.mjs";
4
- import { Spacing, SpacingProps, __ΩSpacingProps } from "./spacing.mjs";
5
- export { Output, OutputProps, SingleLineComment, SingleLineCommentProps, SingleLineCommentVariant, SourceFile, SourceFileProps, Spacing, SpacingProps, __ΩOutputProps, __ΩSingleLineCommentProps, __ΩSingleLineCommentVariant, __ΩSourceFileProps, __ΩSpacingProps };
@@ -1,24 +0,0 @@
1
- import { MetaItem } from "../contexts/meta.cjs";
2
- import * as _alloy_js_core0 from "@alloy-js/core";
3
- import { OutputProps as OutputProps$1 } from "@alloy-js/core";
4
- import { PluginContext } from "@powerlines/core";
5
-
6
- //#region src/core/components/output.d.ts
7
- interface OutputProps<TContext extends PluginContext = PluginContext> extends Omit<OutputProps$1, "basePath"> {
8
- /**
9
- * The current Powerlines process context.
10
- */
11
- context: TContext;
12
- /**
13
- * The file metadata collected during rendering.
14
- */
15
- meta?: Record<string, MetaItem>;
16
- }
17
- /**
18
- * Output component for rendering the Powerlines plugin's output files via templates.
19
- */
20
- declare function Output<TContext extends PluginContext = PluginContext>(props: OutputProps<TContext>): _alloy_js_core0.Children;
21
- declare type __ΩOutputProps = any[];
22
- //#endregion
23
- export { Output, OutputProps, __ΩOutputProps };
24
- //# sourceMappingURL=output.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"output.d.cts","names":[],"sources":["../../../src/core/components/output.tsx"],"mappings":";;;;;;UAwBiB,WAAA,kBACE,aAAA,GAAgB,aAAA,UACzB,IAAA,CAAK,aAAA;;;;EAIb,OAAA,EAAS,QAAA;EANiB;;;EAW1B,IAAA,GAAO,MAAA,SAAe,QAAA;AAAA;;;;iBAMR,MAAA,kBAAwB,aAAA,GAAgB,aAAA,CAAA,CACtD,KAAA,EAAO,WAAA,CAAY,QAAA,IAAD,eAAA,CAAU,QAAA;AAAA"}
@@ -1,24 +0,0 @@
1
- import { MetaItem } from "../contexts/meta.mjs";
2
- import * as _alloy_js_core0 from "@alloy-js/core";
3
- import { OutputProps as OutputProps$1 } from "@alloy-js/core";
4
- import { PluginContext } from "@powerlines/core";
5
-
6
- //#region src/core/components/output.d.ts
7
- interface OutputProps<TContext extends PluginContext = PluginContext> extends Omit<OutputProps$1, "basePath"> {
8
- /**
9
- * The current Powerlines process context.
10
- */
11
- context: TContext;
12
- /**
13
- * The file metadata collected during rendering.
14
- */
15
- meta?: Record<string, MetaItem>;
16
- }
17
- /**
18
- * Output component for rendering the Powerlines plugin's output files via templates.
19
- */
20
- declare function Output<TContext extends PluginContext = PluginContext>(props: OutputProps<TContext>): _alloy_js_core0.Children;
21
- declare type __ΩOutputProps = any[];
22
- //#endregion
23
- export { Output, OutputProps, __ΩOutputProps };
24
- //# sourceMappingURL=output.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"output.d.mts","names":[],"sources":["../../../src/core/components/output.tsx"],"mappings":";;;;;;UAwBiB,WAAA,kBACE,aAAA,GAAgB,aAAA,UACzB,IAAA,CAAK,aAAA;;;;EAIb,OAAA,EAAS,QAAA;EANiB;;;EAW1B,IAAA,GAAO,MAAA,SAAe,QAAA;AAAA;;;;iBAMR,MAAA,kBAAwB,aAAA,GAAgB,aAAA,CAAA,CACtD,KAAA,EAAO,WAAA,CAAY,QAAA,IAAD,eAAA,CAAU,QAAA;AAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"output.mjs","names":["OutputExternal"],"sources":["../../../src/core/components/output.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 type { OutputProps as OutputPropsExternal } from \"@alloy-js/core\";\nimport { computed, Output as OutputExternal, splitProps } from \"@alloy-js/core\";\nimport type { PluginContext } from \"@powerlines/core\";\nimport { MetaContext, MetaItem } from \"../contexts\";\nimport { PowerlinesContext } from \"../contexts/context\";\n\nexport interface OutputProps<\n TContext extends PluginContext = PluginContext\n> extends Omit<OutputPropsExternal, \"basePath\"> {\n /**\n * The current Powerlines process context.\n */\n context: TContext;\n\n /**\n * The file metadata collected during rendering.\n */\n meta?: Record<string, MetaItem>;\n}\n\n/**\n * Output component for rendering the Powerlines plugin's output files via templates.\n */\nexport function Output<TContext extends PluginContext = PluginContext>(\n props: OutputProps<TContext>\n) {\n const [{ children, context, meta = {} }, rest] = splitProps(props, [\n \"children\",\n \"context\",\n \"meta\"\n ]);\n\n const contextRef = computed(() => context);\n\n return (\n <MetaContext.Provider value={meta}>\n <PowerlinesContext.Provider value={contextRef.value}>\n <OutputExternal\n {...rest}\n basePath={contextRef.value.workspaceConfig.workspaceRoot}>\n {children}\n </OutputExternal>\n </PowerlinesContext.Provider>\n </MetaContext.Provider>\n );\n}\n"],"mappings":";;;;;;;;;;AAyCA,SAAgB,OACd,OACA;CACA,MAAM,CAAC,EAAE,UAAU,SAAS,OAAO,EAAE,IAAI,QAAQ,WAAW,OAAO;EACjE;EACA;EACA;EACD,CAAC;CAEF,MAAM,aAAa,eAAe,QAAQ;AAE1C,QACE,oBAAC,YAAY,UAAb;EAAsB,OAAO;YAC3B,oBAAC,kBAAkB,UAAnB;GAA4B,OAAO,WAAW;aAC5C,oBAACA,UAAD;IACE,GAAI;IACJ,UAAU,WAAW,MAAM,gBAAgB;IAC1C;IACc;GACU;EACR"}
@@ -1,23 +0,0 @@
1
- import { ComponentProps } from "../../types/components.cjs";
2
- import * as _alloy_js_core0 from "@alloy-js/core";
3
-
4
- //#region src/core/components/single-line-comment.d.ts
5
- type SingleLineCommentVariant = "double-slash" | "triple-slash" | "slash-star" | "slash-star-star" | "markdown" | "yaml";
6
- interface SingleLineCommentProps extends ComponentProps {
7
- /**
8
- * The variant of the single line comment.
9
- *
10
- * @defaultValue "double-slash"
11
- */
12
- variant?: SingleLineCommentVariant;
13
- }
14
- /**
15
- * A single line comment block. The children are rendered as a prose element, which means that they
16
- * are broken into multiple lines
17
- */
18
- declare function SingleLineComment(props: SingleLineCommentProps): _alloy_js_core0.Children;
19
- declare type __ΩSingleLineCommentVariant = any[];
20
- declare type __ΩSingleLineCommentProps = any[];
21
- //#endregion
22
- export { SingleLineComment, SingleLineCommentProps, SingleLineCommentVariant, __ΩSingleLineCommentProps, __ΩSingleLineCommentVariant };
23
- //# sourceMappingURL=single-line-comment.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"single-line-comment.d.cts","names":[],"sources":["../../../src/core/components/single-line-comment.tsx"],"mappings":";;;;KAqBY,wBAAA;AAAA,UAQK,sBAAA,SAA+B,cAAA;;AARhD;;;;EAcE,OAAA,GAAU,wBAAA;AAAA;;;;;iBAOI,iBAAA,CAAkB,KAAA,EAAO,sBAAA,GAAsB,eAAA,CAAA,QAAA;AAAA"}
@@ -1,23 +0,0 @@
1
- import { ComponentProps } from "../../types/components.mjs";
2
- import * as _alloy_js_core0 from "@alloy-js/core";
3
-
4
- //#region src/core/components/single-line-comment.d.ts
5
- type SingleLineCommentVariant = "double-slash" | "triple-slash" | "slash-star" | "slash-star-star" | "markdown" | "yaml";
6
- interface SingleLineCommentProps extends ComponentProps {
7
- /**
8
- * The variant of the single line comment.
9
- *
10
- * @defaultValue "double-slash"
11
- */
12
- variant?: SingleLineCommentVariant;
13
- }
14
- /**
15
- * A single line comment block. The children are rendered as a prose element, which means that they
16
- * are broken into multiple lines
17
- */
18
- declare function SingleLineComment(props: SingleLineCommentProps): _alloy_js_core0.Children;
19
- declare type __ΩSingleLineCommentVariant = any[];
20
- declare type __ΩSingleLineCommentProps = any[];
21
- //#endregion
22
- export { SingleLineComment, SingleLineCommentProps, SingleLineCommentVariant, __ΩSingleLineCommentProps, __ΩSingleLineCommentVariant };
23
- //# sourceMappingURL=single-line-comment.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"single-line-comment.d.mts","names":[],"sources":["../../../src/core/components/single-line-comment.tsx"],"mappings":";;;;KAqBY,wBAAA;AAAA,UAQK,sBAAA,SAA+B,cAAA;;AARhD;;;;EAcE,OAAA,GAAU,wBAAA;AAAA;;;;;iBAOI,iBAAA,CAAkB,KAAA,EAAO,sBAAA,GAAsB,eAAA,CAAA,QAAA;AAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"single-line-comment.mjs","names":[],"sources":["../../../src/core/components/single-line-comment.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 { Prose } from \"@alloy-js/core\";\nimport { ComponentProps } from \"../../types/components\";\n\nexport type SingleLineCommentVariant =\n | \"double-slash\"\n | \"triple-slash\"\n | \"slash-star\"\n | \"slash-star-star\"\n | \"markdown\"\n | \"yaml\";\n\nexport interface SingleLineCommentProps extends ComponentProps {\n /**\n * The variant of the single line comment.\n *\n * @defaultValue \"double-slash\"\n */\n variant?: SingleLineCommentVariant;\n}\n\n/**\n * A single line comment block. The children are rendered as a prose element, which means that they\n * are broken into multiple lines\n */\nexport function SingleLineComment(props: SingleLineCommentProps) {\n const { variant = \"double-slash\", children } = props;\n\n const commentStart =\n variant === \"slash-star\"\n ? \"/* \"\n : variant === \"slash-star-star\"\n ? \"/** \"\n : variant === \"triple-slash\"\n ? \"/// \"\n : variant === \"markdown\"\n ? \"<!-- \"\n : variant === \"yaml\"\n ? \"# \"\n : \"// \";\n\n return (\n <>\n {commentStart}\n <align string={commentStart}>\n <Prose>{children}</Prose>\n\n {variant === \"slash-star\" || variant === \"slash-star-star\"\n ? \" */ \"\n : variant === \"markdown\"\n ? \" -->\"\n : \"\"}\n </align>\n </>\n );\n}\n"],"mappings":";;;;;;;;AA0CA,SAAgB,kBAAkB,OAA+B;CAC/D,MAAM,EAAE,UAAU,gBAAgB,aAAa;CAE/C,MAAM,eACJ,YAAY,eACR,QACA,YAAY,oBACV,SACA,YAAY,iBACV,SACA,YAAY,aACV,UACA,YAAY,SACV,OACA;AAEd,QACE,4CACG,cACD,qBAAC,SAAD;EAAO,QAAQ;YAAf,CACE,oBAAC,OAAD,EAAQ,UAAiB,GAExB,YAAY,gBAAgB,YAAY,oBACrC,SACA,YAAY,aACV,SACA,GACA;IACP"}
@@ -1,33 +0,0 @@
1
- import { ComponentProps } from "../../types/components.cjs";
2
- import * as _alloy_js_core0 from "@alloy-js/core";
3
- import { SourceFileProps as SourceFileProps$1 } from "@alloy-js/core";
4
- import { StoragePreset } from "powerlines";
5
-
6
- //#region src/core/components/source-file.d.ts
7
- type SourceFileProps = SourceFileProps$1 & ComponentProps & {
8
- /**
9
- * The storage preset for the output files.
10
- *
11
- * @remarks
12
- * If not specified, the output mode will be determined by the provided `output.mode` value.
13
- */
14
- storage?: StoragePreset;
15
- /**
16
- * The metadata associated with the source file.
17
- *
18
- * @remarks
19
- * The values stored in the metadata will be available in the rendering context.
20
- */
21
- meta?: Record<string, any>;
22
- };
23
- /**
24
- * A base component representing a Powerlines generated source file.
25
- *
26
- * @param props - The properties for the source file.
27
- * @returns The rendered source file component.
28
- */
29
- declare function SourceFile(props: SourceFileProps): _alloy_js_core0.Children;
30
- declare type __ΩSourceFileProps = any[];
31
- //#endregion
32
- export { SourceFile, SourceFileProps, __ΩSourceFileProps };
33
- //# sourceMappingURL=source-file.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"source-file.d.cts","names":[],"sources":["../../../src/core/components/source-file.tsx"],"mappings":";;;;;;KAkCY,eAAA,GAAkB,iBAAA,GAC5B,cAAA;;;AADF;;;;EAQI,OAAA,GAAU,aAAA;EAAA;;;;;;EAQV,IAAA,GAAO,MAAA;AAAA;;;;;AASX;;iBAAgB,UAAA,CAAW,KAAA,EAAO,eAAA,GAAe,eAAA,CAAA,QAAA;AAAA"}
@@ -1,33 +0,0 @@
1
- import { ComponentProps } from "../../types/components.mjs";
2
- import * as _alloy_js_core0 from "@alloy-js/core";
3
- import { SourceFileProps as SourceFileProps$1 } from "@alloy-js/core";
4
- import { StoragePreset } from "powerlines";
5
-
6
- //#region src/core/components/source-file.d.ts
7
- type SourceFileProps = SourceFileProps$1 & ComponentProps & {
8
- /**
9
- * The storage preset for the output files.
10
- *
11
- * @remarks
12
- * If not specified, the output mode will be determined by the provided `output.mode` value.
13
- */
14
- storage?: StoragePreset;
15
- /**
16
- * The metadata associated with the source file.
17
- *
18
- * @remarks
19
- * The values stored in the metadata will be available in the rendering context.
20
- */
21
- meta?: Record<string, any>;
22
- };
23
- /**
24
- * A base component representing a Powerlines generated source file.
25
- *
26
- * @param props - The properties for the source file.
27
- * @returns The rendered source file component.
28
- */
29
- declare function SourceFile(props: SourceFileProps): _alloy_js_core0.Children;
30
- declare type __ΩSourceFileProps = any[];
31
- //#endregion
32
- export { SourceFile, SourceFileProps, __ΩSourceFileProps };
33
- //# sourceMappingURL=source-file.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"source-file.d.mts","names":[],"sources":["../../../src/core/components/source-file.tsx"],"mappings":";;;;;;KAkCY,eAAA,GAAkB,iBAAA,GAC5B,cAAA;;;AADF;;;;EAQI,OAAA,GAAU,aAAA;EAAA;;;;;;EAQV,IAAA,GAAO,MAAA;AAAA;;;;;AASX;;iBAAgB,UAAA,CAAW,KAAA,EAAO,eAAA,GAAe,eAAA,CAAA,QAAA;AAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"source-file.mjs","names":[],"sources":["../../../src/core/components/source-file.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 getContext,\n Show,\n SourceDirectoryContext,\n SourceFileContext,\n SourceFileProps as SourceFilePropsExternal,\n splitProps,\n useContext,\n useFormatOptions\n} from \"@alloy-js/core\";\nimport { appendPath } from \"@stryke/path/append\";\nimport defu from \"defu\";\nimport type { StoragePreset } from \"powerlines\";\nimport { ComponentProps } from \"../../types/components\";\nimport { useMeta } from \"../contexts/meta\";\n\nexport type SourceFileProps = SourceFilePropsExternal &\n ComponentProps & {\n /**\n * The storage preset for the output files.\n *\n * @remarks\n * If not specified, the output mode will be determined by the provided `output.mode` value.\n */\n storage?: StoragePreset;\n\n /**\n * The metadata associated with the source file.\n *\n * @remarks\n * The values stored in the metadata will be available in the rendering context.\n */\n meta?: Record<string, any>;\n };\n\n/**\n * A base component representing a Powerlines generated source file.\n *\n * @param props - The properties for the source file.\n * @returns The rendered source file component.\n */\nexport function SourceFile(props: SourceFileProps) {\n const [{ children, meta, path, header, storage, filetype, reference }] =\n splitProps(props, [\n \"children\",\n \"meta\",\n \"path\",\n \"header\",\n \"storage\",\n \"filetype\",\n \"reference\"\n ]);\n\n const metadata = useMeta();\n const parentDirectory = useContext(SourceDirectoryContext)!;\n\n const sourceFile: SourceFileContext = {\n path: appendPath(path, parentDirectory.path),\n filetype,\n reference\n };\n parentDirectory?.addContent(sourceFile);\n\n const printOptions = useFormatOptions({\n printWidth: props.printWidth,\n tabWidth: props.tabWidth,\n useTabs: props.useTabs,\n insertFinalNewLine: props.insertFinalNewLine\n });\n\n const nodeContext = getContext()!;\n nodeContext.meta = defu(\n {\n sourceFile,\n printOptions\n },\n meta ?? {}\n );\n\n if (metadata) {\n metadata[sourceFile.path] = {\n storage,\n ...(meta ?? {})\n };\n }\n\n return (\n <SourceFileContext.Provider value={sourceFile}>\n <Show when={header !== undefined}>\n {header}\n <hbr />\n </Show>\n {children}\n </SourceFileContext.Provider>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AA2DA,SAAgB,WAAW,OAAwB;CACjD,MAAM,CAAC,EAAE,UAAU,MAAM,MAAM,QAAQ,SAAS,UAAU,eACxD,WAAW,OAAO;EAChB;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;CAEJ,MAAM,WAAW,SAAS;CAC1B,MAAM,kBAAkB,WAAW,uBAAuB;CAE1D,MAAM,aAAgC;EACpC,MAAM,WAAW,MAAM,gBAAgB,KAAK;EAC5C;EACA;EACD;AACD,kBAAiB,WAAW,WAAW;CAEvC,MAAM,eAAe,iBAAiB;EACpC,YAAY,MAAM;EAClB,UAAU,MAAM;EAChB,SAAS,MAAM;EACf,oBAAoB,MAAM;EAC3B,CAAC;CAEF,MAAM,cAAc,YAAY;AAChC,aAAY,OAAO,KACjB;EACE;EACA;EACD,EACD,QAAQ,EAAE,CACX;AAED,KAAI,SACF,UAAS,WAAW,QAAQ;EAC1B;EACA,GAAI,QAAQ,EAAE;EACf;AAGH,QACE,qBAAC,kBAAkB,UAAnB;EAA4B,OAAO;YAAnC,CACE,qBAAC,MAAD;GAAM,MAAM,WAAW;aAAvB,CACG,QACD,oBAAC,OAAD,EAAO,EACF;MACN,SAC0B"}
@@ -1,24 +0,0 @@
1
- import * as _alloy_js_core0 from "@alloy-js/core";
2
-
3
- //#region src/core/components/spacing.d.ts
4
- interface SpacingProps {
5
- /**
6
- * A scale factor that determines the amount of vertical space to be added.
7
- *
8
- * @remarks
9
- * The default value is 1, which corresponds to a standard spacing. A value of 2 would double the spacing, while a value of 0.5 would halve it.
10
- *
11
- * @defaultValue 1
12
- */
13
- scale?: number;
14
- }
15
- /**
16
- * A simple component that renders two horizontal breaks to create vertical spacing between elements.
17
- */
18
- declare function Spacing({
19
- scale
20
- }: SpacingProps): _alloy_js_core0.Children;
21
- declare type __ΩSpacingProps = any[];
22
- //#endregion
23
- export { Spacing, SpacingProps, __ΩSpacingProps };
24
- //# sourceMappingURL=spacing.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"spacing.d.cts","names":[],"sources":["../../../src/core/components/spacing.tsx"],"mappings":";;;UAoBiB,YAAA;;;AAAjB;;;;;AAeA;EANE,KAAA;AAAA;;;;iBAMc,OAAA,CAAA;EAAU;AAAA,GAAa,YAAA,GAAY,eAAA,CAAA,QAAA;AAAA"}
@@ -1,24 +0,0 @@
1
- import * as _alloy_js_core0 from "@alloy-js/core";
2
-
3
- //#region src/core/components/spacing.d.ts
4
- interface SpacingProps {
5
- /**
6
- * A scale factor that determines the amount of vertical space to be added.
7
- *
8
- * @remarks
9
- * The default value is 1, which corresponds to a standard spacing. A value of 2 would double the spacing, while a value of 0.5 would halve it.
10
- *
11
- * @defaultValue 1
12
- */
13
- scale?: number;
14
- }
15
- /**
16
- * A simple component that renders two horizontal breaks to create vertical spacing between elements.
17
- */
18
- declare function Spacing({
19
- scale
20
- }: SpacingProps): _alloy_js_core0.Children;
21
- declare type __ΩSpacingProps = any[];
22
- //#endregion
23
- export { Spacing, SpacingProps, __ΩSpacingProps };
24
- //# sourceMappingURL=spacing.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"spacing.d.mts","names":[],"sources":["../../../src/core/components/spacing.tsx"],"mappings":";;;UAoBiB,YAAA;;;AAAjB;;;;;AAeA;EANE,KAAA;AAAA;;;;iBAMc,OAAA,CAAA;EAAU;AAAA,GAAa,YAAA,GAAY,eAAA,CAAA,QAAA;AAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"spacing.mjs","names":[],"sources":["../../../src/core/components/spacing.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 { For } from \"@alloy-js/core\";\n\nexport interface SpacingProps {\n /**\n * A scale factor that determines the amount of vertical space to be added.\n *\n * @remarks\n * The default value is 1, which corresponds to a standard spacing. A value of 2 would double the spacing, while a value of 0.5 would halve it.\n *\n * @defaultValue 1\n */\n scale?: number;\n}\n\n/**\n * A simple component that renders two horizontal breaks to create vertical spacing between elements.\n */\nexport function Spacing({ scale = 1 }: SpacingProps) {\n return (\n <For each={Array.from({ length: scale })}>\n {_ => (\n <>\n <hbr />\n <hbr />\n </>\n )}\n </For>\n );\n}\n"],"mappings":";;;;;;;AAmCA,SAAgB,QAAQ,EAAE,QAAQ,KAAmB;AACnD,QACE,oBAAC,KAAD;EAAK,MAAM,MAAM,KAAK,EAAE,QAAQ,OAAO,CAAC;aACrC,MACC,4CACE,oBAAC,OAAD,EAAO,GACP,oBAAC,OAAD,EAAO,EACN;EAED"}
@@ -1,29 +0,0 @@
1
- import { ComponentContext } from "@alloy-js/core";
2
- import { PluginContext } from "powerlines";
3
-
4
- //#region src/core/contexts/context.d.ts
5
- /**
6
- * The Powerlines context used in template rendering.
7
- */
8
- declare const PowerlinesContext: ComponentContext<PluginContext>;
9
- /**
10
- * Hook to access the Powerlines Context.
11
- *
12
- * @returns The Context.
13
- */
14
- declare function usePowerlinesContext<TContext extends PluginContext = PluginContext>(): TContext | undefined;
15
- /**
16
- * Hook to safely access the {@link PluginContext | Powerlines context}.
17
- *
18
- * @returns The Powerlines context or undefined if not set.
19
- */
20
- declare function usePowerlinesSafe<TContext extends PluginContext = PluginContext>(): TContext | undefined;
21
- /**
22
- * Hook to access the {@link PluginContext | Powerlines context}.
23
- *
24
- * @returns The Powerlines context.
25
- */
26
- declare function usePowerlines<TContext extends PluginContext = PluginContext>(): TContext;
27
- //#endregion
28
- export { PowerlinesContext, usePowerlines, usePowerlinesContext, usePowerlinesSafe };
29
- //# sourceMappingURL=context.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"context.d.cts","names":[],"sources":["../../../src/core/contexts/context.ts"],"mappings":";;;;;;AA4BA;cAAa,iBAAA,EAAmB,gBAAA,CAAiB,aAAA;;;;AAQjD;;iBAAgB,oBAAA,kBACG,aAAA,GAAgB,aAAA,CAAA,CAAA,GAC9B,QAAA;;;;;;iBASW,iBAAA,kBACG,aAAA,GAAgB,aAAA,CAAA,CAAA,GAC9B,QAAA;;;;;;iBAWW,aAAA,kBACG,aAAA,GAAgB,aAAA,CAAA,CAAA,GAC9B,QAAA"}
@@ -1,29 +0,0 @@
1
- import { ComponentContext } from "@alloy-js/core";
2
- import { PluginContext } from "powerlines";
3
-
4
- //#region src/core/contexts/context.d.ts
5
- /**
6
- * The Powerlines context used in template rendering.
7
- */
8
- declare const PowerlinesContext: ComponentContext<PluginContext>;
9
- /**
10
- * Hook to access the Powerlines Context.
11
- *
12
- * @returns The Context.
13
- */
14
- declare function usePowerlinesContext<TContext extends PluginContext = PluginContext>(): TContext | undefined;
15
- /**
16
- * Hook to safely access the {@link PluginContext | Powerlines context}.
17
- *
18
- * @returns The Powerlines context or undefined if not set.
19
- */
20
- declare function usePowerlinesSafe<TContext extends PluginContext = PluginContext>(): TContext | undefined;
21
- /**
22
- * Hook to access the {@link PluginContext | Powerlines context}.
23
- *
24
- * @returns The Powerlines context.
25
- */
26
- declare function usePowerlines<TContext extends PluginContext = PluginContext>(): TContext;
27
- //#endregion
28
- export { PowerlinesContext, usePowerlines, usePowerlinesContext, usePowerlinesSafe };
29
- //# sourceMappingURL=context.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"context.d.mts","names":[],"sources":["../../../src/core/contexts/context.ts"],"mappings":";;;;;;AA4BA;cAAa,iBAAA,EAAmB,gBAAA,CAAiB,aAAA;;;;AAQjD;;iBAAgB,oBAAA,kBACG,aAAA,GAAgB,aAAA,CAAA,CAAA,GAC9B,QAAA;;;;;;iBASW,iBAAA,kBACG,aAAA,GAAgB,aAAA,CAAA,CAAA,GAC9B,QAAA;;;;;;iBAWW,aAAA,kBACG,aAAA,GAAgB,aAAA,CAAA,CAAA,GAC9B,QAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"context.mjs","names":[],"sources":["../../../src/core/contexts/context.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 {\n ComponentContext,\n createNamedContext,\n useContext\n} from \"@alloy-js/core\";\nimport type { PluginContext } from \"powerlines\";\n\n/**\n * The Powerlines context used in template rendering.\n */\nexport const PowerlinesContext: ComponentContext<PluginContext> =\n createNamedContext<PluginContext>(\"Powerlines\");\n\n/**\n * Hook to access the Powerlines Context.\n *\n * @returns The Context.\n */\nexport function usePowerlinesContext<\n TContext extends PluginContext = PluginContext\n>(): TContext | undefined {\n return useContext(PowerlinesContext) as TContext | undefined;\n}\n\n/**\n * Hook to safely access the {@link PluginContext | Powerlines context}.\n *\n * @returns The Powerlines context or undefined if not set.\n */\nexport function usePowerlinesSafe<\n TContext extends PluginContext = PluginContext\n>(): TContext | undefined {\n const powerlines = usePowerlinesContext<TContext>();\n\n return powerlines ?? undefined;\n}\n\n/**\n * Hook to access the {@link PluginContext | Powerlines context}.\n *\n * @returns The Powerlines context.\n */\nexport function usePowerlines<\n TContext extends PluginContext = PluginContext\n>(): TContext {\n const powerlines = usePowerlinesSafe<TContext>();\n if (!powerlines) {\n throw new Error(\n \"Powerlines - Context is not set. Please make sure the Alloy components are being provided to an invocation of the `render` function added to plugins by `@powerlines/plugin-alloy`.\"\n );\n }\n\n return powerlines;\n}\n"],"mappings":";;;;;;AA4BA,MAAa,oBACX,mBAAkC,aAAa;;;;;;AAOjD,SAAgB,uBAEU;AACxB,QAAO,WAAW,kBAAkB;;;;;;;AAQtC,SAAgB,oBAEU;AAGxB,QAFmB,sBAAgC,IAE9B;;;;;;;AAQvB,SAAgB,gBAEF;CACZ,MAAM,aAAa,mBAA6B;AAChD,KAAI,CAAC,WACH,OAAM,IAAI,MACR,sLACD;AAGH,QAAO"}
@@ -1,4 +0,0 @@
1
- import { PowerlinesContext, usePowerlines, usePowerlinesContext, usePowerlinesSafe } from "./context.cjs";
2
- import { MetaContext, MetaItem, __ΩMetaItem, useMeta, useMetaContext, useMetaSafe } from "./meta.cjs";
3
- import { ReflectionClassContext, ReflectionClassContextInterface, ReflectionMethodContext, ReflectionParameterContext, ReflectionPropertyContext, __ΩReflectionClassContextInterface, useReflectionClass, useReflectionMethod, useReflectionParameter, useReflectionProperty } from "./reflection.cjs";
4
- export { MetaContext, MetaItem, PowerlinesContext, ReflectionClassContext, ReflectionClassContextInterface, ReflectionMethodContext, ReflectionParameterContext, ReflectionPropertyContext, __ΩMetaItem, __ΩReflectionClassContextInterface, useMeta, useMetaContext, useMetaSafe, usePowerlines, usePowerlinesContext, usePowerlinesSafe, useReflectionClass, useReflectionMethod, useReflectionParameter, useReflectionProperty };
@@ -1,4 +0,0 @@
1
- import { PowerlinesContext, usePowerlines, usePowerlinesContext, usePowerlinesSafe } from "./context.mjs";
2
- import { MetaContext, MetaItem, __ΩMetaItem, useMeta, useMetaContext, useMetaSafe } from "./meta.mjs";
3
- import { ReflectionClassContext, ReflectionClassContextInterface, ReflectionMethodContext, ReflectionParameterContext, ReflectionPropertyContext, __ΩReflectionClassContextInterface, useReflectionClass, useReflectionMethod, useReflectionParameter, useReflectionProperty } from "./reflection.mjs";
4
- export { MetaContext, MetaItem, PowerlinesContext, ReflectionClassContext, ReflectionClassContextInterface, ReflectionMethodContext, ReflectionParameterContext, ReflectionPropertyContext, __ΩMetaItem, __ΩReflectionClassContextInterface, useMeta, useMetaContext, useMetaSafe, usePowerlines, usePowerlinesContext, usePowerlinesSafe, useReflectionClass, useReflectionMethod, useReflectionParameter, useReflectionProperty };