@powerlines/plugin-alloy 0.26.190 → 0.26.192

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 (390) hide show
  1. package/dist/_virtual/_rolldown/runtime.cjs +0 -14
  2. package/dist/core/components/infrastructure-file.cjs +1 -8
  3. package/dist/core/components/infrastructure-file.mjs +1 -3
  4. package/dist/core/components/infrastructure-file.mjs.map +1 -1
  5. package/dist/core/components/output.cjs +1 -9
  6. package/dist/core/components/output.mjs +1 -3
  7. package/dist/core/components/output.mjs.map +1 -1
  8. package/dist/core/components/single-line-comment.cjs +1 -9
  9. package/dist/core/components/single-line-comment.mjs +1 -3
  10. package/dist/core/components/single-line-comment.mjs.map +1 -1
  11. package/dist/core/components/source-file.cjs +1 -8
  12. package/dist/core/components/source-file.mjs +1 -3
  13. package/dist/core/components/source-file.mjs.map +1 -1
  14. package/dist/core/components/spacing.cjs +1 -9
  15. package/dist/core/components/spacing.mjs +1 -3
  16. package/dist/core/components/spacing.mjs.map +1 -1
  17. package/dist/core/contexts/context.cjs +0 -13
  18. package/dist/core/contexts/context.mjs +1 -8
  19. package/dist/core/contexts/context.mjs.map +1 -1
  20. package/dist/core/contexts/meta.cjs +0 -13
  21. package/dist/core/contexts/meta.mjs +1 -8
  22. package/dist/core/contexts/meta.mjs.map +1 -1
  23. package/dist/core/contexts/schema.cjs +0 -13
  24. package/dist/core/contexts/schema.mjs +1 -8
  25. package/dist/core/contexts/schema.mjs.map +1 -1
  26. package/dist/core/helpers/code.cjs +1 -9
  27. package/dist/core/helpers/code.mjs +1 -3
  28. package/dist/core/helpers/code.mjs.map +1 -1
  29. package/dist/hcl/components/block-declaration.cjs +1 -9
  30. package/dist/hcl/components/block-declaration.mjs +1 -3
  31. package/dist/hcl/components/block-declaration.mjs.map +1 -1
  32. package/dist/hcl/components/hcl-file.cjs +1 -12
  33. package/dist/hcl/components/hcl-file.mjs +1 -6
  34. package/dist/hcl/components/hcl-file.mjs.map +1 -1
  35. package/dist/hcl/components/packer-file.cjs +1 -9
  36. package/dist/hcl/components/packer-file.mjs +1 -3
  37. package/dist/hcl/components/packer-file.mjs.map +1 -1
  38. package/dist/hcl/components/terraform-file.cjs +1 -9
  39. package/dist/hcl/components/terraform-file.mjs +1 -3
  40. package/dist/hcl/components/terraform-file.mjs.map +1 -1
  41. package/dist/helpers/capnp.cjs +0 -24
  42. package/dist/helpers/capnp.mjs +1 -20
  43. package/dist/helpers/capnp.mjs.map +1 -1
  44. package/dist/helpers/create-builtin.cjs +1 -9
  45. package/dist/helpers/create-builtin.mjs +1 -3
  46. package/dist/helpers/create-builtin.mjs.map +1 -1
  47. package/dist/helpers/typescript.cjs +1 -9
  48. package/dist/helpers/typescript.mjs +1 -3
  49. package/dist/helpers/typescript.mjs.map +1 -1
  50. package/dist/markdown/components/front-matter.cjs +1 -9
  51. package/dist/markdown/components/front-matter.mjs +1 -3
  52. package/dist/markdown/components/front-matter.mjs.map +1 -1
  53. package/dist/markdown/components/heading.cjs +1 -9
  54. package/dist/markdown/components/heading.mjs +1 -3
  55. package/dist/markdown/components/heading.mjs.map +1 -1
  56. package/dist/markdown/components/markdown-file.cjs +1 -12
  57. package/dist/markdown/components/markdown-file.mjs +1 -6
  58. package/dist/markdown/components/markdown-file.mjs.map +1 -1
  59. package/dist/markdown/components/markdown-table.cjs +1 -13
  60. package/dist/markdown/components/markdown-table.mjs +1 -7
  61. package/dist/markdown/components/markdown-table.mjs.map +1 -1
  62. package/dist/markdown/contexts/markdown-table.cjs +0 -13
  63. package/dist/markdown/contexts/markdown-table.mjs +1 -8
  64. package/dist/markdown/contexts/markdown-table.mjs.map +1 -1
  65. package/dist/typescript/components/builtin-file.cjs +1 -9
  66. package/dist/typescript/components/builtin-file.mjs +1 -3
  67. package/dist/typescript/components/builtin-file.mjs.map +1 -1
  68. package/dist/typescript/components/class-declaration.cjs +1 -16
  69. package/dist/typescript/components/class-declaration.mjs +1 -10
  70. package/dist/typescript/components/class-declaration.mjs.map +1 -1
  71. package/dist/typescript/components/dynamic-import-statement.cjs +1 -9
  72. package/dist/typescript/components/dynamic-import-statement.mjs +1 -3
  73. package/dist/typescript/components/dynamic-import-statement.mjs.map +1 -1
  74. package/dist/typescript/components/entry-file.cjs +1 -8
  75. package/dist/typescript/components/entry-file.mjs +1 -3
  76. package/dist/typescript/components/entry-file.mjs.map +1 -1
  77. package/dist/typescript/components/interface-declaration.cjs +1 -14
  78. package/dist/typescript/components/interface-declaration.mjs +1 -8
  79. package/dist/typescript/components/interface-declaration.mjs.map +1 -1
  80. package/dist/typescript/components/object-declaration.cjs +1 -12
  81. package/dist/typescript/components/object-declaration.mjs +1 -6
  82. package/dist/typescript/components/object-declaration.mjs.map +1 -1
  83. package/dist/typescript/components/property-name.cjs +1 -9
  84. package/dist/typescript/components/property-name.mjs +1 -3
  85. package/dist/typescript/components/property-name.mjs.map +1 -1
  86. package/dist/typescript/components/record-expression.cjs +1 -9
  87. package/dist/typescript/components/record-expression.mjs +1 -3
  88. package/dist/typescript/components/record-expression.mjs.map +1 -1
  89. package/dist/typescript/components/tsdoc-schema.cjs +1 -12
  90. package/dist/typescript/components/tsdoc-schema.mjs +1 -6
  91. package/dist/typescript/components/tsdoc-schema.mjs.map +1 -1
  92. package/dist/typescript/components/tsdoc.cjs +1 -32
  93. package/dist/typescript/components/tsdoc.mjs +1 -26
  94. package/dist/typescript/components/tsdoc.mjs.map +1 -1
  95. package/dist/typescript/components/type-declaration.cjs +1 -9
  96. package/dist/typescript/components/type-declaration.mjs +1 -3
  97. package/dist/typescript/components/type-declaration.mjs.map +1 -1
  98. package/dist/typescript/components/type-parameters.cjs +1 -9
  99. package/dist/typescript/components/type-parameters.mjs +1 -3
  100. package/dist/typescript/components/type-parameters.mjs.map +1 -1
  101. package/dist/typescript/components/typescript-file.cjs +1 -13
  102. package/dist/typescript/components/typescript-file.mjs +1 -7
  103. package/dist/typescript/components/typescript-file.mjs.map +1 -1
  104. package/dist/typescript/contexts/lexical-scope.cjs +1 -9
  105. package/dist/typescript/contexts/lexical-scope.mjs +1 -3
  106. package/dist/typescript/contexts/lexical-scope.mjs.map +1 -1
  107. package/dist/typescript/contexts/member-scope.cjs +1 -9
  108. package/dist/typescript/contexts/member-scope.mjs +1 -3
  109. package/dist/typescript/contexts/member-scope.mjs.map +1 -1
  110. package/dist/typescript/helpers/get-call-signature-props.cjs +1 -9
  111. package/dist/typescript/helpers/get-call-signature-props.mjs +1 -3
  112. package/dist/typescript/helpers/get-call-signature-props.mjs.map +1 -1
  113. package/dist/typescript/helpers/utilities.cjs +1 -9
  114. package/dist/typescript/helpers/utilities.mjs +1 -4
  115. package/dist/typescript/helpers/utilities.mjs.map +1 -1
  116. package/dist/yaml/components/yaml-file.cjs +1 -12
  117. package/dist/yaml/components/yaml-file.mjs +1 -6
  118. package/dist/yaml/components/yaml-file.mjs.map +1 -1
  119. package/package.json +9 -582
  120. package/dist/_virtual/_rolldown/runtime.mjs +0 -18
  121. package/dist/core/components/infrastructure-file.test.cjs +0 -16
  122. package/dist/core/components/infrastructure-file.test.d.cts +0 -1
  123. package/dist/core/components/infrastructure-file.test.d.mts +0 -1
  124. package/dist/core/components/infrastructure-file.test.mjs +0 -18
  125. package/dist/core/components/infrastructure-file.test.mjs.map +0 -1
  126. package/dist/core/components/output.test.cjs +0 -16
  127. package/dist/core/components/output.test.d.cts +0 -1
  128. package/dist/core/components/output.test.d.mts +0 -1
  129. package/dist/core/components/output.test.mjs +0 -18
  130. package/dist/core/components/output.test.mjs.map +0 -1
  131. package/dist/core/components/single-line-comment.test.cjs +0 -16
  132. package/dist/core/components/single-line-comment.test.d.cts +0 -1
  133. package/dist/core/components/single-line-comment.test.d.mts +0 -1
  134. package/dist/core/components/single-line-comment.test.mjs +0 -18
  135. package/dist/core/components/single-line-comment.test.mjs.map +0 -1
  136. package/dist/core/components/source-file.test.cjs +0 -16
  137. package/dist/core/components/source-file.test.d.cts +0 -1
  138. package/dist/core/components/source-file.test.d.mts +0 -1
  139. package/dist/core/components/source-file.test.mjs +0 -18
  140. package/dist/core/components/source-file.test.mjs.map +0 -1
  141. package/dist/core/components/spacing.test.cjs +0 -16
  142. package/dist/core/components/spacing.test.d.cts +0 -1
  143. package/dist/core/components/spacing.test.d.mts +0 -1
  144. package/dist/core/components/spacing.test.mjs +0 -18
  145. package/dist/core/components/spacing.test.mjs.map +0 -1
  146. package/dist/core/contexts/context.test.cjs +0 -16
  147. package/dist/core/contexts/context.test.d.cts +0 -1
  148. package/dist/core/contexts/context.test.d.mts +0 -1
  149. package/dist/core/contexts/context.test.mjs +0 -18
  150. package/dist/core/contexts/context.test.mjs.map +0 -1
  151. package/dist/core/contexts/meta.test.cjs +0 -16
  152. package/dist/core/contexts/meta.test.d.cts +0 -1
  153. package/dist/core/contexts/meta.test.d.mts +0 -1
  154. package/dist/core/contexts/meta.test.mjs +0 -18
  155. package/dist/core/contexts/meta.test.mjs.map +0 -1
  156. package/dist/core/contexts/schema.test.cjs +0 -16
  157. package/dist/core/contexts/schema.test.d.cts +0 -1
  158. package/dist/core/contexts/schema.test.d.mts +0 -1
  159. package/dist/core/contexts/schema.test.mjs +0 -18
  160. package/dist/core/contexts/schema.test.mjs.map +0 -1
  161. package/dist/core/helpers/code.test.cjs +0 -16
  162. package/dist/core/helpers/code.test.d.cts +0 -1
  163. package/dist/core/helpers/code.test.d.mts +0 -1
  164. package/dist/core/helpers/code.test.mjs +0 -18
  165. package/dist/core/helpers/code.test.mjs.map +0 -1
  166. package/dist/hcl/components/block-declaration.test.cjs +0 -16
  167. package/dist/hcl/components/block-declaration.test.d.cts +0 -1
  168. package/dist/hcl/components/block-declaration.test.d.mts +0 -1
  169. package/dist/hcl/components/block-declaration.test.mjs +0 -18
  170. package/dist/hcl/components/block-declaration.test.mjs.map +0 -1
  171. package/dist/hcl/components/hcl-file.test.cjs +0 -16
  172. package/dist/hcl/components/hcl-file.test.d.cts +0 -1
  173. package/dist/hcl/components/hcl-file.test.d.mts +0 -1
  174. package/dist/hcl/components/hcl-file.test.mjs +0 -18
  175. package/dist/hcl/components/hcl-file.test.mjs.map +0 -1
  176. package/dist/hcl/components/packer-file.test.cjs +0 -16
  177. package/dist/hcl/components/packer-file.test.d.cts +0 -1
  178. package/dist/hcl/components/packer-file.test.d.mts +0 -1
  179. package/dist/hcl/components/packer-file.test.mjs +0 -18
  180. package/dist/hcl/components/packer-file.test.mjs.map +0 -1
  181. package/dist/hcl/components/terraform-file.test.cjs +0 -16
  182. package/dist/hcl/components/terraform-file.test.d.cts +0 -1
  183. package/dist/hcl/components/terraform-file.test.d.mts +0 -1
  184. package/dist/hcl/components/terraform-file.test.mjs +0 -18
  185. package/dist/hcl/components/terraform-file.test.mjs.map +0 -1
  186. package/dist/helpers/capnp.test.cjs +0 -16
  187. package/dist/helpers/capnp.test.d.cts +0 -1
  188. package/dist/helpers/capnp.test.d.mts +0 -1
  189. package/dist/helpers/capnp.test.mjs +0 -18
  190. package/dist/helpers/capnp.test.mjs.map +0 -1
  191. package/dist/helpers/create-builtin.test.cjs +0 -16
  192. package/dist/helpers/create-builtin.test.d.cts +0 -1
  193. package/dist/helpers/create-builtin.test.d.mts +0 -1
  194. package/dist/helpers/create-builtin.test.mjs +0 -18
  195. package/dist/helpers/create-builtin.test.mjs.map +0 -1
  196. package/dist/helpers/refkey.test.cjs +0 -30
  197. package/dist/helpers/refkey.test.d.cts +0 -1
  198. package/dist/helpers/refkey.test.d.mts +0 -1
  199. package/dist/helpers/refkey.test.mjs +0 -32
  200. package/dist/helpers/refkey.test.mjs.map +0 -1
  201. package/dist/helpers/typescript.test.cjs +0 -16
  202. package/dist/helpers/typescript.test.d.cts +0 -1
  203. package/dist/helpers/typescript.test.d.mts +0 -1
  204. package/dist/helpers/typescript.test.mjs +0 -18
  205. package/dist/helpers/typescript.test.mjs.map +0 -1
  206. package/dist/markdown/components/front-matter.test.cjs +0 -16
  207. package/dist/markdown/components/front-matter.test.d.cts +0 -1
  208. package/dist/markdown/components/front-matter.test.d.mts +0 -1
  209. package/dist/markdown/components/front-matter.test.mjs +0 -18
  210. package/dist/markdown/components/front-matter.test.mjs.map +0 -1
  211. package/dist/markdown/components/heading.test.cjs +0 -16
  212. package/dist/markdown/components/heading.test.d.cts +0 -1
  213. package/dist/markdown/components/heading.test.d.mts +0 -1
  214. package/dist/markdown/components/heading.test.mjs +0 -18
  215. package/dist/markdown/components/heading.test.mjs.map +0 -1
  216. package/dist/markdown/components/markdown-file.test.cjs +0 -16
  217. package/dist/markdown/components/markdown-file.test.d.cts +0 -1
  218. package/dist/markdown/components/markdown-file.test.d.mts +0 -1
  219. package/dist/markdown/components/markdown-file.test.mjs +0 -18
  220. package/dist/markdown/components/markdown-file.test.mjs.map +0 -1
  221. package/dist/markdown/components/markdown-table.test.cjs +0 -16
  222. package/dist/markdown/components/markdown-table.test.d.cts +0 -1
  223. package/dist/markdown/components/markdown-table.test.d.mts +0 -1
  224. package/dist/markdown/components/markdown-table.test.mjs +0 -18
  225. package/dist/markdown/components/markdown-table.test.mjs.map +0 -1
  226. package/dist/markdown/contexts/markdown-table.test.cjs +0 -16
  227. package/dist/markdown/contexts/markdown-table.test.d.cts +0 -1
  228. package/dist/markdown/contexts/markdown-table.test.d.mts +0 -1
  229. package/dist/markdown/contexts/markdown-table.test.mjs +0 -18
  230. package/dist/markdown/contexts/markdown-table.test.mjs.map +0 -1
  231. package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.cjs +0 -78
  232. package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs +0 -78
  233. package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs.map +0 -1
  234. package/dist/node_modules/.pnpm/@vitest_expect@4.1.7/node_modules/@vitest/expect/dist/index.cjs +0 -1487
  235. package/dist/node_modules/.pnpm/@vitest_expect@4.1.7/node_modules/@vitest/expect/dist/index.mjs +0 -1473
  236. package/dist/node_modules/.pnpm/@vitest_expect@4.1.7/node_modules/@vitest/expect/dist/index.mjs.map +0 -1
  237. package/dist/node_modules/.pnpm/@vitest_pretty-format@4.1.7/node_modules/@vitest/pretty-format/dist/index.cjs +0 -889
  238. package/dist/node_modules/.pnpm/@vitest_pretty-format@4.1.7/node_modules/@vitest/pretty-format/dist/index.mjs +0 -888
  239. package/dist/node_modules/.pnpm/@vitest_pretty-format@4.1.7/node_modules/@vitest/pretty-format/dist/index.mjs.map +0 -1
  240. package/dist/node_modules/.pnpm/@vitest_runner@4.1.7/node_modules/@vitest/runner/dist/chunk-artifact.cjs +0 -1614
  241. package/dist/node_modules/.pnpm/@vitest_runner@4.1.7/node_modules/@vitest/runner/dist/chunk-artifact.mjs +0 -1594
  242. package/dist/node_modules/.pnpm/@vitest_runner@4.1.7/node_modules/@vitest/runner/dist/chunk-artifact.mjs.map +0 -1
  243. package/dist/node_modules/.pnpm/@vitest_runner@4.1.7/node_modules/@vitest/runner/dist/index.cjs +0 -1
  244. package/dist/node_modules/.pnpm/@vitest_runner@4.1.7/node_modules/@vitest/runner/dist/index.mjs +0 -3
  245. package/dist/node_modules/.pnpm/@vitest_runner@4.1.7/node_modules/@vitest/runner/dist/utils.cjs +0 -1
  246. package/dist/node_modules/.pnpm/@vitest_runner@4.1.7/node_modules/@vitest/runner/dist/utils.mjs +0 -3
  247. package/dist/node_modules/.pnpm/@vitest_snapshot@4.1.7/node_modules/@vitest/snapshot/dist/index.cjs +0 -923
  248. package/dist/node_modules/.pnpm/@vitest_snapshot@4.1.7/node_modules/@vitest/snapshot/dist/index.mjs +0 -922
  249. package/dist/node_modules/.pnpm/@vitest_snapshot@4.1.7/node_modules/@vitest/snapshot/dist/index.mjs.map +0 -1
  250. package/dist/node_modules/.pnpm/@vitest_spy@4.1.7/node_modules/@vitest/spy/dist/index.cjs +0 -391
  251. package/dist/node_modules/.pnpm/@vitest_spy@4.1.7/node_modules/@vitest/spy/dist/index.mjs +0 -386
  252. package/dist/node_modules/.pnpm/@vitest_spy@4.1.7/node_modules/@vitest/spy/dist/index.mjs.map +0 -1
  253. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/chunk-pathe.M-eThtNZ.cjs +0 -82
  254. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/chunk-pathe.M-eThtNZ.mjs +0 -82
  255. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/chunk-pathe.M-eThtNZ.mjs.map +0 -1
  256. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/diff.cjs +0 -1358
  257. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/diff.mjs +0 -1357
  258. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/diff.mjs.map +0 -1
  259. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/display.cjs +0 -561
  260. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/display.mjs +0 -559
  261. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/display.mjs.map +0 -1
  262. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/error.cjs +0 -37
  263. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/error.mjs +0 -38
  264. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/error.mjs.map +0 -1
  265. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/helpers.cjs +0 -197
  266. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/helpers.mjs +0 -181
  267. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/helpers.mjs.map +0 -1
  268. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/offset.cjs +0 -29
  269. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/offset.mjs +0 -27
  270. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/offset.mjs.map +0 -1
  271. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/serialize.cjs +0 -77
  272. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/serialize.mjs +0 -77
  273. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/serialize.mjs.map +0 -1
  274. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/source-map.cjs +0 -374
  275. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/source-map.mjs +0 -374
  276. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/source-map.mjs.map +0 -1
  277. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/timers.cjs +0 -38
  278. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/timers.mjs +0 -37
  279. package/dist/node_modules/.pnpm/@vitest_utils@4.1.7/node_modules/@vitest/utils/dist/timers.mjs.map +0 -1
  280. package/dist/node_modules/.pnpm/chai@6.2.2/node_modules/chai/index.cjs +0 -2978
  281. package/dist/node_modules/.pnpm/chai@6.2.2/node_modules/chai/index.mjs +0 -2973
  282. package/dist/node_modules/.pnpm/chai@6.2.2/node_modules/chai/index.mjs.map +0 -1
  283. package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.cjs +0 -939
  284. package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.mjs +0 -940
  285. package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.mjs.map +0 -1
  286. package/dist/node_modules/.pnpm/tinyrainbow@3.1.0/node_modules/tinyrainbow/dist/index.cjs +0 -87
  287. package/dist/node_modules/.pnpm/tinyrainbow@3.1.0/node_modules/tinyrainbow/dist/index.mjs +0 -87
  288. package/dist/node_modules/.pnpm/tinyrainbow@3.1.0/node_modules/tinyrainbow/dist/index.mjs.map +0 -1
  289. package/dist/node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/_commonjsHelpers.D26ty3Ew.cjs +0 -6
  290. package/dist/node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/_commonjsHelpers.D26ty3Ew.mjs +0 -6
  291. package/dist/node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/_commonjsHelpers.D26ty3Ew.mjs.map +0 -1
  292. package/dist/node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/rpc.MzXet3jl.cjs +0 -54
  293. package/dist/node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/rpc.MzXet3jl.mjs +0 -52
  294. package/dist/node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/rpc.MzXet3jl.mjs.map +0 -1
  295. package/dist/node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/test.DNmyFkvJ.cjs +0 -2696
  296. package/dist/node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/test.DNmyFkvJ.mjs +0 -2697
  297. package/dist/node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/test.DNmyFkvJ.mjs.map +0 -1
  298. package/dist/node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/utils.BX5Fg8C4.cjs +0 -47
  299. package/dist/node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/utils.BX5Fg8C4.mjs +0 -45
  300. package/dist/node_modules/.pnpm/vitest@4.1.7_@opentelemetry_api@1.9.1_@types_node@25.9.1_@vitest_coverage-v8@4.1.7_vite_34dd47607c0af5e5ae7f1b2f95fc48c3/node_modules/vitest/dist/chunks/utils.BX5Fg8C4.mjs.map +0 -1
  301. package/dist/typescript/components/builtin-file.test.cjs +0 -16
  302. package/dist/typescript/components/builtin-file.test.d.cts +0 -1
  303. package/dist/typescript/components/builtin-file.test.d.mts +0 -1
  304. package/dist/typescript/components/builtin-file.test.mjs +0 -18
  305. package/dist/typescript/components/builtin-file.test.mjs.map +0 -1
  306. package/dist/typescript/components/class-declaration.test.cjs +0 -16
  307. package/dist/typescript/components/class-declaration.test.d.cts +0 -1
  308. package/dist/typescript/components/class-declaration.test.d.mts +0 -1
  309. package/dist/typescript/components/class-declaration.test.mjs +0 -18
  310. package/dist/typescript/components/class-declaration.test.mjs.map +0 -1
  311. package/dist/typescript/components/dynamic-import-statement.test.cjs +0 -16
  312. package/dist/typescript/components/dynamic-import-statement.test.d.cts +0 -1
  313. package/dist/typescript/components/dynamic-import-statement.test.d.mts +0 -1
  314. package/dist/typescript/components/dynamic-import-statement.test.mjs +0 -18
  315. package/dist/typescript/components/dynamic-import-statement.test.mjs.map +0 -1
  316. package/dist/typescript/components/entry-file.test.cjs +0 -16
  317. package/dist/typescript/components/entry-file.test.d.cts +0 -1
  318. package/dist/typescript/components/entry-file.test.d.mts +0 -1
  319. package/dist/typescript/components/entry-file.test.mjs +0 -18
  320. package/dist/typescript/components/entry-file.test.mjs.map +0 -1
  321. package/dist/typescript/components/interface-declaration.test.cjs +0 -16
  322. package/dist/typescript/components/interface-declaration.test.d.cts +0 -1
  323. package/dist/typescript/components/interface-declaration.test.d.mts +0 -1
  324. package/dist/typescript/components/interface-declaration.test.mjs +0 -18
  325. package/dist/typescript/components/interface-declaration.test.mjs.map +0 -1
  326. package/dist/typescript/components/object-declaration.test.cjs +0 -16
  327. package/dist/typescript/components/object-declaration.test.d.cts +0 -1
  328. package/dist/typescript/components/object-declaration.test.d.mts +0 -1
  329. package/dist/typescript/components/object-declaration.test.mjs +0 -18
  330. package/dist/typescript/components/object-declaration.test.mjs.map +0 -1
  331. package/dist/typescript/components/property-name.test.cjs +0 -16
  332. package/dist/typescript/components/property-name.test.d.cts +0 -1
  333. package/dist/typescript/components/property-name.test.d.mts +0 -1
  334. package/dist/typescript/components/property-name.test.mjs +0 -18
  335. package/dist/typescript/components/property-name.test.mjs.map +0 -1
  336. package/dist/typescript/components/record-expression.test.cjs +0 -16
  337. package/dist/typescript/components/record-expression.test.d.cts +0 -1
  338. package/dist/typescript/components/record-expression.test.d.mts +0 -1
  339. package/dist/typescript/components/record-expression.test.mjs +0 -18
  340. package/dist/typescript/components/record-expression.test.mjs.map +0 -1
  341. package/dist/typescript/components/tsdoc-schema.test.cjs +0 -16
  342. package/dist/typescript/components/tsdoc-schema.test.d.cts +0 -1
  343. package/dist/typescript/components/tsdoc-schema.test.d.mts +0 -1
  344. package/dist/typescript/components/tsdoc-schema.test.mjs +0 -18
  345. package/dist/typescript/components/tsdoc-schema.test.mjs.map +0 -1
  346. package/dist/typescript/components/tsdoc.test.cjs +0 -16
  347. package/dist/typescript/components/tsdoc.test.d.cts +0 -1
  348. package/dist/typescript/components/tsdoc.test.d.mts +0 -1
  349. package/dist/typescript/components/tsdoc.test.mjs +0 -18
  350. package/dist/typescript/components/tsdoc.test.mjs.map +0 -1
  351. package/dist/typescript/components/type-declaration.test.cjs +0 -16
  352. package/dist/typescript/components/type-declaration.test.d.cts +0 -1
  353. package/dist/typescript/components/type-declaration.test.d.mts +0 -1
  354. package/dist/typescript/components/type-declaration.test.mjs +0 -18
  355. package/dist/typescript/components/type-declaration.test.mjs.map +0 -1
  356. package/dist/typescript/components/type-parameters.test.cjs +0 -16
  357. package/dist/typescript/components/type-parameters.test.d.cts +0 -1
  358. package/dist/typescript/components/type-parameters.test.d.mts +0 -1
  359. package/dist/typescript/components/type-parameters.test.mjs +0 -18
  360. package/dist/typescript/components/type-parameters.test.mjs.map +0 -1
  361. package/dist/typescript/components/typescript-file.test.cjs +0 -16
  362. package/dist/typescript/components/typescript-file.test.d.cts +0 -1
  363. package/dist/typescript/components/typescript-file.test.d.mts +0 -1
  364. package/dist/typescript/components/typescript-file.test.mjs +0 -18
  365. package/dist/typescript/components/typescript-file.test.mjs.map +0 -1
  366. package/dist/typescript/contexts/lexical-scope.test.cjs +0 -16
  367. package/dist/typescript/contexts/lexical-scope.test.d.cts +0 -1
  368. package/dist/typescript/contexts/lexical-scope.test.d.mts +0 -1
  369. package/dist/typescript/contexts/lexical-scope.test.mjs +0 -18
  370. package/dist/typescript/contexts/lexical-scope.test.mjs.map +0 -1
  371. package/dist/typescript/contexts/member-scope.test.cjs +0 -16
  372. package/dist/typescript/contexts/member-scope.test.d.cts +0 -1
  373. package/dist/typescript/contexts/member-scope.test.d.mts +0 -1
  374. package/dist/typescript/contexts/member-scope.test.mjs +0 -18
  375. package/dist/typescript/contexts/member-scope.test.mjs.map +0 -1
  376. package/dist/typescript/helpers/get-call-signature-props.test.cjs +0 -16
  377. package/dist/typescript/helpers/get-call-signature-props.test.d.cts +0 -1
  378. package/dist/typescript/helpers/get-call-signature-props.test.d.mts +0 -1
  379. package/dist/typescript/helpers/get-call-signature-props.test.mjs +0 -18
  380. package/dist/typescript/helpers/get-call-signature-props.test.mjs.map +0 -1
  381. package/dist/typescript/helpers/utilities.test.cjs +0 -16
  382. package/dist/typescript/helpers/utilities.test.d.cts +0 -1
  383. package/dist/typescript/helpers/utilities.test.d.mts +0 -1
  384. package/dist/typescript/helpers/utilities.test.mjs +0 -18
  385. package/dist/typescript/helpers/utilities.test.mjs.map +0 -1
  386. package/dist/yaml/components/yaml-file.test.cjs +0 -16
  387. package/dist/yaml/components/yaml-file.test.d.cts +0 -1
  388. package/dist/yaml/components/yaml-file.test.d.mts +0 -1
  389. package/dist/yaml/components/yaml-file.test.mjs +0 -18
  390. package/dist/yaml/components/yaml-file.test.mjs.map +0 -1
@@ -1,10 +1,8 @@
1
- import { __exportAll } from "../../_virtual/_rolldown/runtime.mjs";
2
1
  import { code as code$1 } from "../../core/helpers/code.mjs";
3
2
  import { createComponent, memo } from "@alloy-js/core/jsx-runtime";
4
3
  import { Prose, Show } from "@alloy-js/core";
5
4
 
6
5
  //#region src/hcl/components/block-declaration.tsx
7
- var block_declaration_exports = /* @__PURE__ */ __exportAll({ BlockDeclaration: () => BlockDeclaration });
8
6
  /**
9
7
  * A base component representing a block declaration in HCL. The children are rendered as a prose element, which means that they are broken into multiple lines. This component can be used to create more specific block declaration components, such as resource blocks, provider blocks, etc.
10
8
  *
@@ -31,5 +29,5 @@ function BlockDeclaration(props) {
31
29
  }
32
30
 
33
31
  //#endregion
34
- export { BlockDeclaration, block_declaration_exports };
32
+ export { BlockDeclaration };
35
33
  //# sourceMappingURL=block-declaration.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"block-declaration.mjs","names":[],"sources":["../../../src/hcl/components/block-declaration.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, Show } from \"@alloy-js/core\";\nimport { code } from \"../../core/helpers/code\";\nimport { ComponentProps } from \"../../types/components\";\n\nexport interface BlockDeclarationProps extends ComponentProps {\n type: string;\n label: string | string[];\n}\n\n/**\n * A base component representing a block declaration in HCL. The children are rendered as a prose element, which means that they are broken into multiple lines. This component can be used to create more specific block declaration components, such as resource blocks, provider blocks, etc.\n *\n * @see https://developer.hashicorp.com/terraform/language#about-the-terraform-language\n * @see https://opentofu.org/docs/language/attr-as-blocks/#summary\n *\n * @param props - The properties for the source file.\n * @returns The rendered source file component.\n */\nexport function BlockDeclaration(props: BlockDeclarationProps) {\n const { children, type, label } = props;\n\n return (\n <>\n {code`${type} ${Array.isArray(label) ? label.join(\" \") : label} {`}\n <Prose>\n <Show when={Boolean(children)}>{children}</Show>\n </Prose>\n {code`} `}\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA+BA,SAAgB,iBAAiB,OAAC;CACjC,MAAA,EACG,UACA,MACF,UACI;CACJ,OAAO;EAAC,WAAU,MAAM,GAAA,KAAS,GAAC,MAAK,QAAA,KAAA,IAAA,MAAA,KAAA,GAAA,IAAA,MAAA,GAAA;EAAA,gBAAA,OAAA;GAEvC,OAAO,gBAAA,MAAA;IACJ,IAAA,OAAA;KACE,OAAO,QAAQ,QAAM;IACrB;IACW;GACZ,CAAC;EACH,EACF,CAAC;EAAG,MAAA;CAAA;AACN"}
1
+ {"version":3,"file":"block-declaration.mjs","names":[],"sources":["../../../src/hcl/components/block-declaration.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, Show } from \"@alloy-js/core\";\nimport { code } from \"../../core/helpers/code\";\nimport { ComponentProps } from \"../../types/components\";\n\nexport interface BlockDeclarationProps extends ComponentProps {\n type: string;\n label: string | string[];\n}\n\n/**\n * A base component representing a block declaration in HCL. The children are rendered as a prose element, which means that they are broken into multiple lines. This component can be used to create more specific block declaration components, such as resource blocks, provider blocks, etc.\n *\n * @see https://developer.hashicorp.com/terraform/language#about-the-terraform-language\n * @see https://opentofu.org/docs/language/attr-as-blocks/#summary\n *\n * @param props - The properties for the source file.\n * @returns The rendered source file component.\n */\nexport function BlockDeclaration(props: BlockDeclarationProps) {\n const { children, type, label } = props;\n\n return (\n <>\n {code`${type} ${Array.isArray(label) ? label.join(\" \") : label} {`}\n <Prose>\n <Show when={Boolean(children)}>{children}</Show>\n </Prose>\n {code`} `}\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AA+BA,SAAgB,iBAAiB,OAAC;CACjC,MAAA,EACG,UACA,MACF,UACI;CACJ,OAAO;EAAC,WAAU,MAAM,GAAA,KAAS,GAAC,MAAK,QAAA,KAAA,IAAA,MAAA,KAAA,GAAA,IAAA,MAAA,GAAA;EAAA,gBAAA,OAAA;GAEvC,OAAO,gBAAA,MAAA;IACJ,IAAA,OAAA;KACE,OAAO,QAAQ,QAAM;IACrB;IACW;GACZ,CAAC;EACH,EACF,CAAC;EAAG,MAAA;CAAA;AACN"}
@@ -1,5 +1,4 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
3
2
  const require_core_contexts_context = require('../../core/contexts/context.cjs');
4
3
  const require_core_components_infrastructure_file = require('../../core/components/infrastructure-file.cjs');
5
4
  const require_core_components_single_line_comment = require('../../core/components/single-line-comment.cjs');
@@ -10,10 +9,6 @@ let _stryke_string_format_title_case = require("@stryke/string-format/title-case
10
9
  let powerlines_utils = require("powerlines/utils");
11
10
 
12
11
  //#region src/hcl/components/hcl-file.tsx
13
- var hcl_file_exports = /* @__PURE__ */ require_runtime.__exportAll({
14
- HCLFile: () => HCLFile,
15
- HCLFileHeader: () => HCLFileHeader
16
- });
17
12
  /**
18
13
  * A base component representing a Powerlines generated HCL source file.
19
14
  *
@@ -84,10 +79,4 @@ function HCLFileHeader(props) {
84
79
 
85
80
  //#endregion
86
81
  exports.HCLFile = HCLFile;
87
- exports.HCLFileHeader = HCLFileHeader;
88
- Object.defineProperty(exports, 'hcl_file_exports', {
89
- enumerable: true,
90
- get: function () {
91
- return hcl_file_exports;
92
- }
93
- });
82
+ exports.HCLFileHeader = HCLFileHeader;
@@ -1,4 +1,3 @@
1
- import { __exportAll } from "../../_virtual/_rolldown/runtime.mjs";
2
1
  import { usePowerlines } from "../../core/contexts/context.mjs";
3
2
  import { InfrastructureFile } from "../../core/components/infrastructure-file.mjs";
4
3
  import { SingleLineComment } from "../../core/components/single-line-comment.mjs";
@@ -9,10 +8,6 @@ import { titleCase } from "@stryke/string-format/title-case";
9
8
  import { getFileHeaderWarning } from "powerlines/utils";
10
9
 
11
10
  //#region src/hcl/components/hcl-file.tsx
12
- var hcl_file_exports = /* @__PURE__ */ __exportAll({
13
- HCLFile: () => HCLFile,
14
- HCLFileHeader: () => HCLFileHeader
15
- });
16
11
  /**
17
12
  * A base component representing a Powerlines generated HCL source file.
18
13
  *
@@ -82,5 +77,5 @@ function HCLFileHeader(props) {
82
77
  }
83
78
 
84
79
  //#endregion
85
- export { HCLFile, HCLFileHeader, hcl_file_exports };
80
+ export { HCLFile, HCLFileHeader };
86
81
  //# sourceMappingURL=hcl-file.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"hcl-file.mjs","names":[],"sources":["../../../src/hcl/components/hcl-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 { Children, computed, Show, splitProps } from \"@alloy-js/core\";\nimport { findFileExtension } from \"@stryke/path/file-path-fns\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { getFileHeaderWarning } from \"powerlines/utils\";\nimport {\n InfrastructureFile,\n InfrastructureFileProps\n} from \"../../core/components/infrastructure-file\";\nimport { SingleLineComment } from \"../../core/components/single-line-comment\";\nimport { usePowerlines } from \"../../core/contexts/context\";\nimport { ComponentProps } from \"../../types/components\";\n\nexport type HCLFileProps = Omit<\n InfrastructureFileProps,\n \"header\" | \"filetype\"\n> &\n ComponentProps & {\n header?: Children;\n filetype?: \"hcl\" | \"tf\" | `${string}.hcl` | `${string}.tf`;\n };\n\n/**\n * A base component representing a Powerlines generated HCL source file.\n *\n * @param props - The properties for the source file.\n * @returns The rendered source file component.\n */\nexport function HCLFile(props: HCLFileProps) {\n const [{ children, storage, header, filetype: _filetype, id }, rest] =\n splitProps(props, [\"children\", \"storage\", \"header\", \"filetype\", \"id\"]);\n\n const filetype = computed(() => _filetype || findFileExtension(id) || \"hcl\");\n\n return (\n <InfrastructureFile\n header={<HCLFileHeader>{header}</HCLFileHeader>}\n {...rest}\n id={id}\n filetype={filetype.value}\n storage={storage || \"fs\"}>\n <Show when={Boolean(children)}>{children}</Show>\n </InfrastructureFile>\n );\n}\n\n/**\n * Renders the header for a Powerlines HCL source file.\n *\n * @param props - The properties for the source file header.\n * @returns The rendered source file header.\n */\nexport function HCLFileHeader(props: ComponentProps) {\n const [{ children }] = splitProps(props, [\"children\"]);\n\n const context = usePowerlines();\n\n return (\n <>\n <Show when={Boolean(children)}>\n <>\n {children}\n <hbr />\n </>\n </Show>\n <SingleLineComment variant=\"hcl\">{`Generated by ${\n titleCase(context?.config?.framework?.name) || \"Powerlines\"\n }`}</SingleLineComment>\n <hbr />\n <SingleLineComment variant=\"hcl\">\n {getFileHeaderWarning(context)}\n </SingleLineComment>\n <hbr />\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAiCA,SAAE,QAAA,OAAA;CACA,MAAA,CAAA,EACE,UACA,SACD,6BAED,MACG,QAAK,WAAU,OAAA;EAAY;EAAG;EAAoB;EAAK;EAAW;CAAA,CAAA;CACtE,MAAA,WAAA,eAAA,aAAA,kBAAA,EAAA,KAAA,KAAA;CACC,OAAO,gBAAa,oBAAyB,WAAK,EAChD,IAAA,SAAY;EACd,OAAA,gBAAA,eAAA,EACK,UAAS,OACd,CAAK;CACH;EAEI;;GAEN,OAAO,SAAA;EACL;EACA,SAAS,WAAE;EACX,IAAI,WAAM;GACR,OAAM,gBAAA,MAAA;IACN,IAAA,OAAU;KACV,OAAS,QAAU,QAAM;IACxB;IACD;GACH,CAAA;EACH;;AAEA;;;;;;;;CASE,MAAM,CAAA,gBAEN,WAAO,OAAA,CAAA,UAAA,CAAA;CACP,MAAG,UAAA,cAAA;CACH,OAAK;EAAA,gBAAmB,MAAQ;GAC9B,IAAI,OAAC;IACH,OAAK,QAAQ,QAAA;GACf;GACA,IAAI,WAAE;IACJ,OAAM,CAAA,UAAA,gBAAA,OAAA,CAAA,CAAA,CAAA;GACR;EACF,CAAC;EAAG,gBAAY,mBAAiB;GAC/B,SAAO;GACP,IAAG,WAAK;IACN,OAAC,gBAAkB,UAAa,SAAA,QAAA,WAAA,IAAA,KAAA;GAClC;EACF,CAAC;EAAG,gBAAE,OAAiB,CAAA,CAAA;EAAA,gBAAA,mBAAA;GACrB,SAAQ;GACR,IAAE,WAAA;IACH,OAAA,qBAAA,OAAA;GACH"}
1
+ {"version":3,"file":"hcl-file.mjs","names":[],"sources":["../../../src/hcl/components/hcl-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 { Children, computed, Show, splitProps } from \"@alloy-js/core\";\nimport { findFileExtension } from \"@stryke/path/file-path-fns\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { getFileHeaderWarning } from \"powerlines/utils\";\nimport {\n InfrastructureFile,\n InfrastructureFileProps\n} from \"../../core/components/infrastructure-file\";\nimport { SingleLineComment } from \"../../core/components/single-line-comment\";\nimport { usePowerlines } from \"../../core/contexts/context\";\nimport { ComponentProps } from \"../../types/components\";\n\nexport type HCLFileProps = Omit<\n InfrastructureFileProps,\n \"header\" | \"filetype\"\n> &\n ComponentProps & {\n header?: Children;\n filetype?: \"hcl\" | \"tf\" | `${string}.hcl` | `${string}.tf`;\n };\n\n/**\n * A base component representing a Powerlines generated HCL source file.\n *\n * @param props - The properties for the source file.\n * @returns The rendered source file component.\n */\nexport function HCLFile(props: HCLFileProps) {\n const [{ children, storage, header, filetype: _filetype, id }, rest] =\n splitProps(props, [\"children\", \"storage\", \"header\", \"filetype\", \"id\"]);\n\n const filetype = computed(() => _filetype || findFileExtension(id) || \"hcl\");\n\n return (\n <InfrastructureFile\n header={<HCLFileHeader>{header}</HCLFileHeader>}\n {...rest}\n id={id}\n filetype={filetype.value}\n storage={storage || \"fs\"}>\n <Show when={Boolean(children)}>{children}</Show>\n </InfrastructureFile>\n );\n}\n\n/**\n * Renders the header for a Powerlines HCL source file.\n *\n * @param props - The properties for the source file header.\n * @returns The rendered source file header.\n */\nexport function HCLFileHeader(props: ComponentProps) {\n const [{ children }] = splitProps(props, [\"children\"]);\n\n const context = usePowerlines();\n\n return (\n <>\n <Show when={Boolean(children)}>\n <>\n {children}\n <hbr />\n </>\n </Show>\n <SingleLineComment variant=\"hcl\">{`Generated by ${\n titleCase(context?.config?.framework?.name) || \"Powerlines\"\n }`}</SingleLineComment>\n <hbr />\n <SingleLineComment variant=\"hcl\">\n {getFileHeaderWarning(context)}\n </SingleLineComment>\n <hbr />\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAiCA,SAAE,QAAA,OAAA;CACA,MAAA,CAAA,EACE,UACA,SACD,6BAED,MACG,QAAK,WAAU,OAAA;EAAY;EAAG;EAAoB;EAAK;EAAW;CAAA,CAAA;CACtE,MAAA,WAAA,eAAA,aAAA,kBAAA,EAAA,KAAA,KAAA;CACC,OAAO,gBAAa,oBAAyB,WAAK,EAChD,IAAA,SAAY;EACd,OAAA,gBAAA,eAAA,EACK,UAAS,OACd,CAAK;CACH;EAEI;;GAEN,OAAO,SAAA;EACL;EACA,SAAS,WAAE;EACX,IAAI,WAAM;GACR,OAAM,gBAAA,MAAA;IACN,IAAA,OAAU;KACV,OAAS,QAAU,QAAM;IACxB;IACD;GACH,CAAA;EACH;;AAEA;;;;;;;;CASE,MAAM,CAAA,gBAEN,WAAO,OAAA,CAAA,UAAA,CAAA;CACP,MAAG,UAAA,cAAA;CACH,OAAK;EAAA,gBAAmB,MAAQ;GAC9B,IAAI,OAAC;IACH,OAAK,QAAQ,QAAA;GACf;GACA,IAAI,WAAE;IACJ,OAAM,CAAA,UAAA,gBAAA,OAAA,CAAA,CAAA,CAAA;GACR;EACF,CAAC;EAAG,gBAAY,mBAAiB;GAC/B,SAAO;GACP,IAAG,WAAK;IACN,OAAC,gBAAkB,UAAa,SAAA,QAAA,WAAA,IAAA,KAAA;GAClC;EACF,CAAC;EAAG,gBAAE,OAAiB,CAAA,CAAA;EAAA,gBAAA,mBAAA;GACrB,SAAQ;GACR,IAAE,WAAA;IACH,OAAA,qBAAA,OAAA;GACH"}
@@ -1,11 +1,9 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
3
2
  const require_hcl_components_hcl_file = require('./hcl-file.cjs');
4
3
  let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
5
4
  let _alloy_js_core = require("@alloy-js/core");
6
5
 
7
6
  //#region src/hcl/components/packer-file.tsx
8
- var packer_file_exports = /* @__PURE__ */ require_runtime.__exportAll({ PackerFile: () => PackerFile });
9
7
  /**
10
8
  * A base component representing a Powerlines generated [Packer](https://developer.hashicorp.com/packer/docs/templates/hcl_templates) source file.
11
9
  *
@@ -27,10 +25,4 @@ function PackerFile(props) {
27
25
  }
28
26
 
29
27
  //#endregion
30
- exports.PackerFile = PackerFile;
31
- Object.defineProperty(exports, 'packer_file_exports', {
32
- enumerable: true,
33
- get: function () {
34
- return packer_file_exports;
35
- }
36
- });
28
+ exports.PackerFile = PackerFile;
@@ -1,10 +1,8 @@
1
- import { __exportAll } from "../../_virtual/_rolldown/runtime.mjs";
2
1
  import { HCLFile } from "./hcl-file.mjs";
3
2
  import { createComponent, mergeProps } from "@alloy-js/core/jsx-runtime";
4
3
  import { Show, splitProps } from "@alloy-js/core";
5
4
 
6
5
  //#region src/hcl/components/packer-file.tsx
7
- var packer_file_exports = /* @__PURE__ */ __exportAll({ PackerFile: () => PackerFile });
8
6
  /**
9
7
  * A base component representing a Powerlines generated [Packer](https://developer.hashicorp.com/packer/docs/templates/hcl_templates) source file.
10
8
  *
@@ -26,5 +24,5 @@ function PackerFile(props) {
26
24
  }
27
25
 
28
26
  //#endregion
29
- export { PackerFile, packer_file_exports };
27
+ export { PackerFile };
30
28
  //# sourceMappingURL=packer-file.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"packer-file.mjs","names":[],"sources":["../../../src/hcl/components/packer-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 { Show, splitProps } from \"@alloy-js/core\";\nimport { PartialKeys } from \"@stryke/types/base\";\nimport { HCLFile, HCLFileProps } from \"./hcl-file\";\n\nexport type PackerFileProps = PartialKeys<HCLFileProps, \"filetype\">;\n\n/**\n * A base component representing a Powerlines generated [Packer](https://developer.hashicorp.com/packer/docs/templates/hcl_templates) source file.\n *\n * @see https://developer.hashicorp.com/packer\n *\n * @param props - The properties for the source file.\n * @returns The rendered source file component.\n */\nexport function PackerFile(props: PackerFileProps) {\n const [{ children }, rest] = splitProps(props, [\"children\"]);\n\n return (\n <HCLFile filetype=\"pkr.hcl\" {...rest}>\n <Show when={Boolean(children)}>{children}</Show>\n </HCLFile>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AA8BA,SAAgB,WAAS,OAAO;CAC9B,MAAA,CAAA,EACF,YACE,QAAS,WAAY,OAAQ,CAAA,UAAW,CAAA;8CAExC,UAAO,UACP,GAAG,MAAA,EACD,IAAG,WAAW;EACZ,OAAO,gBAAA,MAAA;GACV,IAAA,OAAA;IACH,OAAA,QAAA,QAAA"}
1
+ {"version":3,"file":"packer-file.mjs","names":[],"sources":["../../../src/hcl/components/packer-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 { Show, splitProps } from \"@alloy-js/core\";\nimport { PartialKeys } from \"@stryke/types/base\";\nimport { HCLFile, HCLFileProps } from \"./hcl-file\";\n\nexport type PackerFileProps = PartialKeys<HCLFileProps, \"filetype\">;\n\n/**\n * A base component representing a Powerlines generated [Packer](https://developer.hashicorp.com/packer/docs/templates/hcl_templates) source file.\n *\n * @see https://developer.hashicorp.com/packer\n *\n * @param props - The properties for the source file.\n * @returns The rendered source file component.\n */\nexport function PackerFile(props: PackerFileProps) {\n const [{ children }, rest] = splitProps(props, [\"children\"]);\n\n return (\n <HCLFile filetype=\"pkr.hcl\" {...rest}>\n <Show when={Boolean(children)}>{children}</Show>\n </HCLFile>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AA8BA,SAAgB,WAAS,OAAO;CAC9B,MAAA,CAAA,EACF,YACE,QAAS,WAAY,OAAQ,CAAA,UAAW,CAAA;8CAExC,UAAO,UACP,GAAG,MAAA,EACD,IAAG,WAAW;EACZ,OAAO,gBAAA,MAAA;GACV,IAAA,OAAA;IACH,OAAA,QAAA,QAAA"}
@@ -1,11 +1,9 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
3
2
  const require_hcl_components_hcl_file = require('./hcl-file.cjs');
4
3
  let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
5
4
  let _alloy_js_core = require("@alloy-js/core");
6
5
 
7
6
  //#region src/hcl/components/terraform-file.tsx
8
- var terraform_file_exports = /* @__PURE__ */ require_runtime.__exportAll({ TerraformFile: () => TerraformFile });
9
7
  /**
10
8
  * A base component representing a Powerlines generated [Terraform](https://developer.hashicorp.com/terraform/language) or [OpenTofu](https://opentofu.org/docs/language/) source file.
11
9
  *
@@ -28,10 +26,4 @@ function TerraformFile(props) {
28
26
  }
29
27
 
30
28
  //#endregion
31
- exports.TerraformFile = TerraformFile;
32
- Object.defineProperty(exports, 'terraform_file_exports', {
33
- enumerable: true,
34
- get: function () {
35
- return terraform_file_exports;
36
- }
37
- });
29
+ exports.TerraformFile = TerraformFile;
@@ -1,10 +1,8 @@
1
- import { __exportAll } from "../../_virtual/_rolldown/runtime.mjs";
2
1
  import { HCLFile } from "./hcl-file.mjs";
3
2
  import { createComponent, mergeProps } from "@alloy-js/core/jsx-runtime";
4
3
  import { Show, splitProps } from "@alloy-js/core";
5
4
 
6
5
  //#region src/hcl/components/terraform-file.tsx
7
- var terraform_file_exports = /* @__PURE__ */ __exportAll({ TerraformFile: () => TerraformFile });
8
6
  /**
9
7
  * A base component representing a Powerlines generated [Terraform](https://developer.hashicorp.com/terraform/language) or [OpenTofu](https://opentofu.org/docs/language/) source file.
10
8
  *
@@ -27,5 +25,5 @@ function TerraformFile(props) {
27
25
  }
28
26
 
29
27
  //#endregion
30
- export { TerraformFile, terraform_file_exports };
28
+ export { TerraformFile };
31
29
  //# sourceMappingURL=terraform-file.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"terraform-file.mjs","names":[],"sources":["../../../src/hcl/components/terraform-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 { Show, splitProps } from \"@alloy-js/core\";\nimport { PartialKeys } from \"@stryke/types/base\";\nimport { HCLFile, HCLFileProps } from \"./hcl-file\";\n\nexport type TerraformFileProps = PartialKeys<HCLFileProps, \"filetype\">;\n\n/**\n * A base component representing a Powerlines generated [Terraform](https://developer.hashicorp.com/terraform/language) or [OpenTofu](https://opentofu.org/docs/language/) source file.\n *\n * @see https://developer.hashicorp.com/terraform\n * @see https://opentofu.org\n *\n * @param props - The properties for the source file.\n * @returns The rendered source file component.\n */\nexport function TerraformFile(props: TerraformFileProps) {\n const [{ children }, rest] = splitProps(props, [\"children\"]);\n\n return (\n <HCLFile filetype=\"tf\" {...rest}>\n <Show when={Boolean(children)}>{children}</Show>\n </HCLFile>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA+BA,SAAgB,cAAS,OAAY;CACnC,MAAA,CAAA,EACF,YACE,QAAS,WAAY,OAAQ,CAAA,UAAW,CAAA;8CAExC,UAAO,KACP,GAAG,MAAA,EACD,IAAG,WAAW;EACZ,OAAO,gBAAA,MAAA;GACV,IAAA,OAAA;IACH,OAAA,QAAA,QAAA"}
1
+ {"version":3,"file":"terraform-file.mjs","names":[],"sources":["../../../src/hcl/components/terraform-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 { Show, splitProps } from \"@alloy-js/core\";\nimport { PartialKeys } from \"@stryke/types/base\";\nimport { HCLFile, HCLFileProps } from \"./hcl-file\";\n\nexport type TerraformFileProps = PartialKeys<HCLFileProps, \"filetype\">;\n\n/**\n * A base component representing a Powerlines generated [Terraform](https://developer.hashicorp.com/terraform/language) or [OpenTofu](https://opentofu.org/docs/language/) source file.\n *\n * @see https://developer.hashicorp.com/terraform\n * @see https://opentofu.org\n *\n * @param props - The properties for the source file.\n * @returns The rendered source file component.\n */\nexport function TerraformFile(props: TerraformFileProps) {\n const [{ children }, rest] = splitProps(props, [\"children\"]);\n\n return (\n <HCLFile filetype=\"tf\" {...rest}>\n <Show when={Boolean(children)}>{children}</Show>\n </HCLFile>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AA+BA,SAAgB,cAAS,OAAY;CACnC,MAAA,CAAA,EACF,YACE,QAAS,WAAY,OAAQ,CAAA,UAAW,CAAA;8CAExC,UAAO,KACP,GAAG,MAAA,EACD,IAAG,WAAW;EACZ,OAAO,gBAAA,MAAA;GACV,IAAA,OAAA;IACH,OAAA,QAAA,QAAA"}
@@ -26,24 +26,6 @@ let node_child_process = require("node:child_process");
26
26
  let node_util = require("node:util");
27
27
 
28
28
  //#region src/helpers/capnp.ts
29
- var capnp_exports = /* @__PURE__ */ require_runtime.__exportAll({
30
- LARGE_BUFFER: () => LARGE_BUFFER,
31
- compile: () => compile,
32
- generateCapnp: () => generateCapnp,
33
- generateCapnpEnumSchema: () => generateCapnpEnumSchema,
34
- generateCapnpId: () => generateCapnpId,
35
- generateCapnpInterface: () => generateCapnpInterface,
36
- generateCapnpMethodSchema: () => generateCapnpMethodSchema,
37
- generateCapnpPrimitive: () => generateCapnpPrimitive,
38
- generateCapnpSchema: () => generateCapnpSchema,
39
- generateCapnpStruct: () => generateCapnpStruct,
40
- getCapnpEnumTypes: () => getCapnpEnumTypes,
41
- getCapnpUnionTypes: () => getCapnpUnionTypes,
42
- isCapnpStringUnion: () => isCapnpStringUnion,
43
- isVoidType: () => isVoidType,
44
- stringifyCapnpDefaultValue: () => stringifyCapnpDefaultValue,
45
- stringifyCapnpValue: () => stringifyCapnpValue
46
- });
47
29
  /**
48
30
  * Compiles a Cap'n Proto schema into TypeScript definitions.
49
31
  *
@@ -278,12 +260,6 @@ function generateCapnpPrimitive(type) {
278
260
 
279
261
  //#endregion
280
262
  exports.LARGE_BUFFER = LARGE_BUFFER;
281
- Object.defineProperty(exports, 'capnp_exports', {
282
- enumerable: true,
283
- get: function () {
284
- return capnp_exports;
285
- }
286
- });
287
263
  exports.compile = compile;
288
264
  exports.generateCapnp = generateCapnp;
289
265
  exports.generateCapnpEnumSchema = generateCapnpEnumSchema;
@@ -1,4 +1,3 @@
1
- import { __exportAll } from "../_virtual/_rolldown/runtime.mjs";
2
1
  import defu from "defu";
3
2
  import { titleCase } from "@stryke/string-format/title-case";
4
3
  import { getFileHeader } from "powerlines/utils";
@@ -24,24 +23,6 @@ import { exec } from "node:child_process";
24
23
  import { promisify } from "node:util";
25
24
 
26
25
  //#region src/helpers/capnp.ts
27
- var capnp_exports = /* @__PURE__ */ __exportAll({
28
- LARGE_BUFFER: () => LARGE_BUFFER,
29
- compile: () => compile,
30
- generateCapnp: () => generateCapnp,
31
- generateCapnpEnumSchema: () => generateCapnpEnumSchema,
32
- generateCapnpId: () => generateCapnpId,
33
- generateCapnpInterface: () => generateCapnpInterface,
34
- generateCapnpMethodSchema: () => generateCapnpMethodSchema,
35
- generateCapnpPrimitive: () => generateCapnpPrimitive,
36
- generateCapnpSchema: () => generateCapnpSchema,
37
- generateCapnpStruct: () => generateCapnpStruct,
38
- getCapnpEnumTypes: () => getCapnpEnumTypes,
39
- getCapnpUnionTypes: () => getCapnpUnionTypes,
40
- isCapnpStringUnion: () => isCapnpStringUnion,
41
- isVoidType: () => isVoidType,
42
- stringifyCapnpDefaultValue: () => stringifyCapnpDefaultValue,
43
- stringifyCapnpValue: () => stringifyCapnpValue
44
- });
45
26
  /**
46
27
  * Compiles a Cap'n Proto schema into TypeScript definitions.
47
28
  *
@@ -275,5 +256,5 @@ function generateCapnpPrimitive(type) {
275
256
  }
276
257
 
277
258
  //#endregion
278
- export { LARGE_BUFFER, capnp_exports, compile, generateCapnp, generateCapnpEnumSchema, generateCapnpId, generateCapnpInterface, generateCapnpMethodSchema, generateCapnpPrimitive, generateCapnpSchema, generateCapnpStruct, getCapnpEnumTypes, getCapnpUnionTypes, isCapnpStringUnion, isVoidType, stringifyCapnpDefaultValue, stringifyCapnpValue };
259
+ export { LARGE_BUFFER, compile, generateCapnp, generateCapnpEnumSchema, generateCapnpId, generateCapnpInterface, generateCapnpMethodSchema, generateCapnpPrimitive, generateCapnpSchema, generateCapnpStruct, getCapnpEnumTypes, getCapnpUnionTypes, isCapnpStringUnion, isVoidType, stringifyCapnpDefaultValue, stringifyCapnpValue };
279
260
  //# sourceMappingURL=capnp.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"capnp.mjs","names":[],"sources":["../../src/helpers/capnp.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 { getUnionTypes, kindToName } from \"@powerlines/deepkit/utilities\";\nimport { getClassName } from \"@powerlines/deepkit/vendor/core\";\nimport {\n memberNameToString,\n ReflectionClass,\n ReflectionKind,\n ReflectionMethod,\n ReflectionParameter,\n ReflectionProperty,\n Type,\n TypeEnum,\n TypeLiteral,\n TypeUnion\n} from \"@powerlines/deepkit/vendor/type\";\nimport { capnpc } from \"@stryke/capnp/compile\";\nimport { resolveOptions } from \"@stryke/capnp/helpers\";\nimport type { CapnpcOptions, CapnpcResult } from \"@stryke/capnp/types\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { getUniqueBy } from \"@stryke/helpers/get-unique\";\nimport { StormJSON } from \"@stryke/json\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { camelCase } from \"@stryke/string-format/camel-case\";\nimport { getWords } from \"@stryke/string-format/get-words\";\nimport { pascalCase } from \"@stryke/string-format/pascal-case\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { isBigInt } from \"@stryke/type-checks/is-bigint\";\nimport { isNull } from \"@stryke/type-checks/is-null\";\nimport { isNumber } from \"@stryke/type-checks/is-number\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport { isUndefined } from \"@stryke/type-checks/is-undefined\";\nimport defu from \"defu\";\nimport { Buffer } from \"node:buffer\";\nimport { exec } from \"node:child_process\";\nimport { promisify } from \"node:util\";\nimport { Context, PluginContext } from \"powerlines\";\nimport { getFileHeader } from \"powerlines/utils\";\n\n/**\n * Compiles a Cap'n Proto schema into TypeScript definitions.\n *\n * @param context - The context containing the project and workspace information.\n * @param options - The options for compiling the schema.\n * @returns A promise that resolves to the compiled schema.\n */\nexport async function compile(\n context: Context,\n options: Partial<CapnpcOptions> = {}\n): Promise<CapnpcResult> {\n const opts = defu(options, {\n ts: true,\n js: false,\n dts: false,\n schemas: joinPaths(context.artifactsPath, \"schemas\"),\n tsconfig: context.tsconfig,\n projectRoot: context.config.root,\n workspaceRoot: context.config.cwd,\n tty: true\n }) as Parameters<typeof resolveOptions>[0];\n\n const resolvedOptions = await resolveOptions(opts);\n if (!resolvedOptions) {\n throw new Error(\n `✖ No Cap'n Proto schema files found in the specified source paths: ${toArray(\n opts.schemas\n ).join(\", \")}.`\n );\n }\n\n return capnpc(resolvedOptions);\n}\n\n/**\n * Converts any {@link ReflectionProperty} or {@link ReflectionParameter}'s value to string representation.\n *\n * @param property - The {@link ReflectionProperty} or {@link ReflectionParameter} containing the value to stringify.\n * @param value - The value to stringify.\n * @returns A string representation of the value.\n */\nexport function stringifyCapnpDefaultValue(\n property: ReflectionProperty | ReflectionParameter,\n value?: any\n): string {\n return stringifyCapnpValue(\n property.type,\n value ?? property.getDefaultValue()\n );\n}\n\n/**\n * Converts any {@link Type}'s actual value to string representation.\n *\n * @param type - The {@link Type} of the value to stringify.\n * @param value - The value to stringify.\n * @returns A string representation of the value.\n */\nexport function stringifyCapnpValue(type: Type, value: any): string {\n return type.kind === ReflectionKind.string ||\n (type.kind === ReflectionKind.literal && isString(type.literal))\n ? `\"${String(value)}\"`\n : type.kind === ReflectionKind.enum\n ? `${camelCase(String(value))}`\n : type.kind === ReflectionKind.array\n ? StormJSON.stringify(value)\n : type.kind === ReflectionKind.object ||\n type.kind === ReflectionKind.objectLiteral\n ? StormJSON.stringify(value).replaceAll(\"{\", \"(\").replaceAll(\"}\", \")\")\n : String(value);\n}\n\n/**\n * Converts a ReflectionProperty's default value to a Cap'n Proto schema string representation.\n *\n * @param type - The TypeEnum to evaluate.\n * @returns A string representation of the property.\n */\nexport function getCapnpEnumTypes(type: Type): \"Text\" | \"Float32\" | null {\n if (type.kind !== ReflectionKind.enum) {\n return null;\n }\n\n const unique = getUniqueBy(\n type.values.filter(value => !isUndefined(value) && !isNull(value)),\n enumMember => (isString(enumMember) ? \"Text\" : \"Float32\")\n );\n if (unique.length === 0) {\n return null;\n }\n\n return unique[0] && isString(unique[0]) ? \"Text\" : \"Float32\";\n}\n\n/**\n * Determines if a Type is a `Void` type in a Cap'n Proto schema.\n *\n * @param type - The Type to check.\n * @returns True if the Type is a `Void` type, false otherwise.\n */\nexport function isVoidType(type: Type): boolean {\n return (\n type.kind === ReflectionKind.void ||\n type.kind === ReflectionKind.never ||\n type.kind === ReflectionKind.null ||\n type.kind === ReflectionKind.undefined ||\n type.kind === ReflectionKind.symbol\n );\n}\n\n/**\n * Converts a {@link TypeUnion} to an array of its underlying Cap'n Proto primitive type representation.\n *\n * @param type - The {@link TypeUnion} to convert.\n * @returns A string representation of the Cap'n Proto primitive type.\n */\nexport function getCapnpUnionTypes(type: Type): Type[] {\n return getUnionTypes(type);\n}\n\n/**\n * Converts a {@link TypeUnion} to an array of its underlying Cap'n Proto primitive type representation.\n *\n * @param type - The {@link TypeUnion} to convert.\n * @returns An array of Cap'n Proto primitive types.\n */\nexport function isCapnpStringUnion(type: Type): boolean {\n return getCapnpUnionTypes(type).some(\n member => member.kind === ReflectionKind.string\n );\n}\n\nexport const LARGE_BUFFER = 1024 * 1000000;\nexport type IOType = \"overlapped\" | \"pipe\" | \"ignore\" | \"inherit\";\nexport type StdioOptions =\n | IOType\n | Array<IOType | \"ipc\" | number | null | undefined>;\n\nconst execAsync = promisify(exec);\n\nexport async function generateCapnpId() {\n const { stdout } = await execAsync(\"capnp id\", {\n windowsHide: true,\n maxBuffer: LARGE_BUFFER,\n killSignal: \"SIGTERM\"\n });\n\n return stdout;\n}\n\nexport interface GenerateCapnpOptions {\n name?: string;\n}\n\nexport async function generateCapnp(\n context: PluginContext,\n reflection: ReflectionClass<any>,\n options: GenerateCapnpOptions\n) {\n const capnpId = await generateCapnpId();\n\n return `${capnpId.trim()};\n${getFileHeader(context)\n .replace(/^\\r*\\n*/g, \"\")\n .replaceAll(\"//\", \"#\")}\n${\n reflection.getMethods().length === 0\n ? generateCapnpStruct(reflection, options)\n : generateCapnpInterface(reflection, options)\n}\n`.trim();\n}\n\nexport interface GenerateCapnpStructOptions extends GenerateCapnpOptions {\n indexCounter?: () => number;\n}\n\nexport function generateCapnpStruct(\n reflection: ReflectionClass<any>,\n options: GenerateCapnpStructOptions = {}\n): string {\n const structName =\n options?.name ||\n reflection.getTitle() ||\n reflection.getClassName() ||\n reflection.getName();\n\n return `${generateCapnpEnums(reflection)}struct ${pascalCase(structName)} {\n # Struct definition for ${titleCase(structName)}.\n\n ${generateCapnpSchema(reflection, options)}\n}\n`;\n}\n\nexport function generateCapnpInterface(\n reflection: ReflectionClass<any>,\n options: GenerateCapnpStructOptions = {}\n): string {\n const interfaceName =\n options?.name ||\n reflection.getTitle() ||\n reflection.getClassName() ||\n reflection.getName();\n\n return `${generateCapnpEnums(reflection)}interface ${pascalCase(interfaceName)} {\n # Interface definition for ${titleCase(interfaceName)}.\n\n ${generateCapnpSchema(reflection, options)}\n}\n`;\n}\n\nfunction formatEnumName(name: string) {\n return pascalCase(`${name}_Type`);\n}\n\nfunction generateCapnpEnums(reflection: ReflectionClass<any>): string {\n const enums = reflection\n .getProperties()\n .filter(\n prop =>\n !prop.isIgnored() &&\n (prop.type.kind === ReflectionKind.enum ||\n (prop.type.kind === ReflectionKind.union &&\n getCapnpUnionTypes(prop.type).filter(\n type =>\n type.kind === ReflectionKind.literal &&\n (isString(type.literal) || isNumber(type.literal))\n ).length === 1))\n )\n .sort((a, b) =>\n (a.isReadonly() && b.isReadonly()) || (!a.isReadonly() && !b.isReadonly())\n ? b.getNameAsString().localeCompare(a.getNameAsString())\n : a.isReadonly()\n ? 1\n : -1\n );\n if (enums.length === 0) {\n return \"\";\n }\n\n return `${enums\n .map(enumeration =>\n generateCapnpEnumSchema(\n enumeration.type as TypeEnum | TypeUnion,\n formatEnumName(enumeration.getNameAsString())\n )\n )\n .join(\"\\n\\n\")}\n\n`;\n}\n\nexport function generateCapnpSchema(\n reflection: ReflectionClass<any>,\n options: GenerateCapnpStructOptions = {}\n): string {\n let index = 0;\n const indexCounter: () => number = options?.indexCounter ?? (() => index++);\n\n return `${reflection\n .getProperties()\n .filter(prop => !prop.isIgnored())\n .sort((a, b) =>\n (a.isReadonly() && b.isReadonly()) || (!a.isReadonly() && !b.isReadonly())\n ? b.getNameAsString().localeCompare(a.getNameAsString())\n : a.isReadonly()\n ? 1\n : -1\n )\n .map(prop => generateCapnpPropertySchema(prop, indexCounter))\n .join(\" \\n\\n\\t\")}${reflection\n .getMethods()\n .filter(methods => !methods.isIgnored())\n .sort((a, b) =>\n (a.isReadonly() && b.isReadonly()) || (!a.isReadonly() && !b.isReadonly())\n ? String(b.getName()).localeCompare(String(a.getName()))\n : a.isReadonly()\n ? 1\n : -1\n )\n .map(methods => generateCapnpMethodSchema(methods, indexCounter))\n .join(\" \\n\\n\\t\")}${\n reflection\n .getProperties()\n .some(\n prop =>\n prop.type.kind === ReflectionKind.class && prop.type.classType === Map\n )\n ? `\n struct Map(Key, Value) {\n entries @0 :List(Entry);\n\n struct Entry {\n key @0 :Key;\n value @1 :Value;\n }\n }`\n : \"\"\n }${\n reflection\n .getProperties()\n .some(\n prop =>\n prop.type.kind === ReflectionKind.class &&\n prop.type.classType === Date\n )\n ? `\n struct Date {\n # A standard Gregorian calendar date.\n\n year @0 :Int16;\n # The year - Must include the century.\n # Negative value indicates BC.\n\n month @1 :UInt8; # The month, 1-12\n\n day @2 :UInt8; # The day of the month, 1-30\n\n hour @3 :UInt8; # The hour of the day, 0-23\n\n minute @4 :UInt8; # The minute of the hour, 0-59\n\n second @5 :UInt8; # The second of the minute, 0-59\n\n millisecond @6 :UInt16; # Milliseconds of the second, 0-999\n }`\n : \"\"\n }`;\n}\n\nexport function generateCapnpMethodSchema(\n reflection: ReflectionMethod,\n indexCounter: () => number\n): string {\n const methodName =\n reflection.getTitle() || typeof reflection.getName() === \"string\"\n ? String(reflection.getName())\n : \"\";\n if (!methodName) {\n throw new Error(\n `Cannot generate Cap'n Proto schema for method without a name - Parent interface: ${reflection.reflectionClass.getName()}`\n );\n }\n\n return `${camelCase(methodName)} @${indexCounter()} (${reflection\n .getParameters()\n .map(param => {\n return `${camelCase(\n param.getName()\n )} :${generateCapnpPrimitive(param.getType())}${\n param.hasDefault() ? ` = ${stringifyCapnpDefaultValue(param)}` : \"\"\n }`;\n })\n .join(\", \")})${\n isVoidType(reflection.getReturnType())\n ? \"\"\n : ` -> (${kindToName(\n reflection.getReturnType().kind\n )}: ${generateCapnpPrimitive(reflection.getReturnType())})`\n }; # ${(\n reflection.getDescription() ||\n `The ${titleCase(\n reflection.reflectionClass.getTitle() ||\n reflection.reflectionClass.getName()\n )} interface ${titleCase(methodName)} method.`\n ).replaceAll(\"\\n\", \". \")}`;\n}\n\nfunction generateCapnpPropertyComment(reflection: ReflectionProperty) {\n const result = getWords(\n reflection.getDescription() ||\n `A schema property for ${titleCase(\n reflection.getTitle() || reflection.getNameAsString()\n )} field.`,\n {\n relaxed: true\n }\n )\n .reduce((ret, word) => {\n let length = ret.length;\n if (ret.includes(\"\\n\")) {\n length = ret.substring(ret.lastIndexOf(\"\\n\") + 1).length;\n }\n\n const current = word.trim();\n if (length + current.length > 60) {\n ret += `\\n\\t# ${current}`;\n } else {\n ret += ` ${current}`;\n }\n return ret;\n }, \"\")\n .trim();\n if (result.length > 0) {\n return `\\t# ${result}`;\n }\n\n return \"\";\n}\n\nfunction generateCapnpPropertySchema(\n reflection: ReflectionProperty,\n indexCounter: () => number\n): string {\n if (reflection.type.kind === ReflectionKind.union) {\n if (getCapnpUnionTypes(reflection.type).length === 0) {\n return `${camelCase(reflection.getNameAsString())} @${indexCounter()} :Void;\n${generateCapnpPropertyComment(reflection)}`;\n } else if (\n getCapnpUnionTypes(reflection.type).filter(\n type =>\n type.kind === ReflectionKind.literal &&\n (isString(type.literal) || isNumber(type.literal))\n ).length === 1\n ) {\n return `${camelCase(reflection.getNameAsString())} @${indexCounter()} :${formatEnumName(\n reflection.getNameAsString()\n )}${\n reflection.hasDefault()\n ? ` = ${stringifyCapnpDefaultValue(reflection)}`\n : \"\"\n };\n${generateCapnpPropertyComment(reflection)}`;\n } else {\n return `${camelCase(reflection.getNameAsString())} :union {\n${getCapnpUnionTypes(reflection.type)\n .map(\n type =>\n ` ${kindToName(type.kind)} @${indexCounter()} :${generateCapnpPrimitive(\n type\n )};`\n )\n .join(\"\\n\")}\n }\n${generateCapnpPropertyComment(reflection)}`;\n }\n } else if (reflection.type.kind === ReflectionKind.array) {\n return `${camelCase(reflection.getNameAsString())} @${indexCounter()} :List(${generateCapnpPrimitive(reflection.getSubType())})${\n reflection.hasDefault()\n ? ` = ${stringifyCapnpDefaultValue(reflection)}`\n : \"\"\n };\n${generateCapnpPropertyComment(reflection)}`;\n } else if (reflection.type.kind === ReflectionKind.class) {\n if (reflection.type.classType === Map) {\n return `${camelCase(reflection.getNameAsString())} @${indexCounter()} :Map(${\n !reflection.type.typeArguments ||\n reflection.type.typeArguments.length === 0 ||\n !reflection.type.typeArguments[0]\n ? \"Data\"\n : generateCapnpPrimitive(reflection.type.typeArguments[0])\n }, ${\n !reflection.type.typeArguments ||\n reflection.type.typeArguments.length < 2 ||\n !reflection.type.typeArguments[1]\n ? \"Data\"\n : generateCapnpPrimitive(reflection.type.typeArguments[1])\n })${\n reflection.hasDefault()\n ? ` = ${stringifyCapnpDefaultValue(reflection)}`\n : \"\"\n };\n${generateCapnpPropertyComment(reflection)}`;\n } else if (reflection.type.classType === Date) {\n return `${camelCase(reflection.getNameAsString())} @${indexCounter()} :Data${\n reflection.hasDefault()\n ? ` = ${stringifyCapnpDefaultValue(reflection)}`\n : \"\"\n };\n${generateCapnpPropertyComment(reflection)}`;\n } else if (reflection.type.classType === Buffer) {\n return `${camelCase(reflection.getNameAsString())} @${indexCounter()} :Data${\n reflection.hasDefault()\n ? ` = ${stringifyCapnpDefaultValue(reflection)}`\n : \"\"\n };\n${generateCapnpPropertyComment(reflection)}`;\n } else if (reflection.type.classType === ArrayBuffer) {\n return `${camelCase(reflection.getNameAsString())} @${indexCounter()} :Data${\n reflection.hasDefault()\n ? ` = ${stringifyCapnpDefaultValue(reflection)}`\n : \"\"\n };\n${generateCapnpPropertyComment(reflection)}`;\n } else {\n return `${camelCase(reflection.getNameAsString())} @${indexCounter()} :${pascalCase(\n reflection.type.typeName || getClassName(reflection.type.classType)\n )}${generateCapnpStruct(reflection.reflectionClass, {\n name: pascalCase(\n reflection.type.typeName || getClassName(reflection.type.classType)\n )\n })}${\n reflection.hasDefault()\n ? ` = ${stringifyCapnpDefaultValue(reflection)}`\n : \"\"\n };\n${generateCapnpPropertyComment(reflection)}`;\n }\n } else if (reflection.type.kind === ReflectionKind.objectLiteral) {\n return `${camelCase(reflection.getNameAsString())} @${indexCounter()} :${pascalCase(\n reflection.type.typeName ||\n memberNameToString(reflection.getNameAsString())\n )}${generateCapnpStruct(reflection.reflectionClass, {\n name: pascalCase(\n reflection.type.typeName ||\n memberNameToString(reflection.getNameAsString())\n )\n })}${\n reflection.hasDefault()\n ? ` = ${stringifyCapnpDefaultValue(reflection)}`\n : \"\"\n };\n${generateCapnpPropertyComment(reflection)}`;\n } else if (reflection.type.kind === ReflectionKind.enum) {\n return `${camelCase(reflection.getNameAsString())} @${indexCounter()} :${pascalCase(\n reflection.getNameAsString()\n )}${\n reflection.hasDefault()\n ? ` = ${stringifyCapnpDefaultValue(reflection)}`\n : \"\"\n };\n${generateCapnpPropertyComment(reflection)}`;\n }\n\n return `${camelCase(reflection.getNameAsString())} @${indexCounter()} :${generateCapnpPrimitive(\n reflection.getType()\n )}${\n reflection.hasDefault()\n ? ` = ${stringifyCapnpDefaultValue(reflection)}`\n : \"\"\n };\n${generateCapnpPropertyComment(reflection)}`;\n}\n\nexport function generateCapnpEnumSchema(\n type: TypeEnum | TypeUnion,\n name: string\n): string {\n if (type.kind === ReflectionKind.union) {\n return generateCapnpEnumSchema(\n {\n kind: ReflectionKind.enum,\n indexType: type,\n enum: (type.types as TypeLiteral[]).reduce<\n Record<string, string | number>\n >((ret, type) => {\n if (isString(type.literal) || isNumber(type.literal)) {\n ret[camelCase(String(type.literal))] = type.literal;\n }\n\n return ret;\n }, {}),\n values: (\n getCapnpUnionTypes(type).filter(\n type =>\n type.kind === ReflectionKind.literal &&\n (isString(type.literal) || isNumber(type.literal))\n ) as TypeLiteral[]\n ).map(type => type.literal as string | number)\n },\n name\n );\n }\n\n let index = 0;\n const indexCounter: () => number = () => index++;\n\n const enumType = getCapnpEnumTypes(type);\n if (!enumType) {\n return \"\";\n }\n\n return `enum ${pascalCase(name)} {\n${\n type.enum && Object.entries(type.enum).length > 0\n ? Object.entries(type.enum)\n .filter(([, value]) => value !== null && value !== undefined)\n .map(([key]) => ` ${camelCase(key)} @${indexCounter()};`)\n .join(\"\\n\")\n : type.values\n .filter(value => value !== null && value !== undefined)\n .map(\n value =>\n `${\n enumType === \"Text\" && value\n ? camelCase(String(value))\n : `${\n type.typeName ? `${camelCase(type.typeName)}_` : \"\"\n }${value || \"\"}`\n } @${indexCounter()};`\n )\n .join(\"\\n\")\n}\n }`;\n}\n\n/**\n * Generates a string representation of Cap'n Proto primitive types from a Deepkit Type.\n *\n * @param type - The Deepkit Type to convert.\n * @returns A string representation of the Cap'n Proto primitive type.\n */\nexport function generateCapnpPrimitive(type: Type): string {\n return type.kind === ReflectionKind.never ||\n type.kind === ReflectionKind.void ||\n type.kind === ReflectionKind.null ||\n type.kind === ReflectionKind.undefined ||\n type.kind === ReflectionKind.symbol\n ? \"Void\"\n : type.kind === ReflectionKind.class && type.classType === Date\n ? \"Date\"\n : type.kind === ReflectionKind.class && type.classType === Set\n ? `List(${\n type.typeArguments && type.typeArguments[0]\n ? generateCapnpPrimitive(type.typeArguments[0])\n : \"Data\"\n })`\n : type.kind === ReflectionKind.bigint\n ? \"UInt64\"\n : type.kind === ReflectionKind.number\n ? \"Float64\"\n : type.kind === ReflectionKind.string ||\n type.kind === ReflectionKind.regexp\n ? \"Text\"\n : type.kind === ReflectionKind.boolean\n ? \"Bool\"\n : type.kind === ReflectionKind.literal\n ? isNumber(type.literal)\n ? \"Float64\"\n : isBigInt(type.literal)\n ? \"UInt64\"\n : isString(type.literal)\n ? \"Text\"\n : typeof type.literal === \"boolean\"\n ? \"Bool\"\n : \"Data\"\n : \"Data\";\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDA,eAAsB,QAAK,SAAA,UAAc,CAAA,GAAA;CACzC,MAAQ,OAAC,KAAW,SAAO;EAC3B,IAAQ;EACR,IAAQ;;EAEN,SAAA,UAAA,QAAA,eAAA,SAAA;EACC,UAAW,QAAM;EACnB,aAAA,QAAA,OAAA;EACG,eAAe,QAAK,OAAQ;EAC5B,KAAK;CACP,CAAC;CACD,MAAA,kBAAA,MAAA,eAAA,IAAA;CACF,IAAM,CAAC,iBACL,MAAQ,IAAC,MAAO,sEAAA,QAAA,KAAA,OAAA,EAAA,KAAA,IAAA,EAAA,EAAA;CAEhB,OAAC,OAAQ,eAAc;AACzB;;;;;;;;AASA,SAAQ,2BAAmC,UAAC,OAAA;;AAE5C;;;;;;;;AASA,SAAgB,oBAAgB,MAAA,OAAA;CAChC,OAAA,KAAA,SAAA,eAAA,UAAA,KAAA,SAAA,eAAA,WAAA,SAAA,KAAA,OAAA,IAAA,IAAA,OAAA,KAAA,EAAA,KAAA,KAAA,SAAA,eAAA,OAAA,GAAA,UAAA,OAAA,KAAA,CAAA,MAAA,KAAA,SAAA,eAAA,QAAA,UAAA,UAAA,KAAA,IAAA,KAAA,SAAA,eAAA,UAAA,KAAA,SAAA,eAAA,gBAAA,UAAA,UAAA,KAAA,EAAA,WAAA,KAAA,GAAA,EAAA,WAAA,KAAA,GAAA,IAAA,OAAA,KAAA;;;;;;;;AASA,SAAgB,kBAAA,MAAA;CACd,IAAA,KAAS,SAAC,eAAqB,MAC/B,OAAQ;CAER,MAAM,SAAC,YAAmB,KAAA,OAAA,QAAA,UAAA,CAAA,YAAA,KAAA,KAAA,CAAA,OAA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,KAAA,CAAA,SAAA,OAAA,UAAA,GAAA,EAAA,IAAA,aAAA,EAAA,EAAA,EAAA,KAAA,IAAA,IAAA,KAAA,OAAA,QAAA,UAAA,UAAA,QAAA,UAAA,MAAA,EAAA,KAAA,UAAA,GAAA,aAAA,UAAA,QAAA,UAAA,OAAA,KAAA,CAAA,IAAA,GAAA,KAAA,WAAA,GAAA,UAAA,KAAA,QAAA,EAAA,KAAA,KAAA,SAAA,KAAA,IAAA,aAAA,EAAA,EAAA,EAAA,KAAA,IAAA,EAAA;;AAEZ;;;;;;;AAQA,SAAgB,uBAAC,MAA4B;CAC3C,OAAO,KAAK,SAAS,eAAA,SAAA,KAAA,SAAA,eAAA,QAAA,KAAA,SAAA,eAAA,QAAA,KAAA,SAAA,eAAA,aAAA,KAAA,SAAA,eAAA,SAAA,SAAA,KAAA,SAAA,eAAA,SAAA,KAAA,cAAA,OAAA,SAAA,KAAA,SAAA,eAAA,SAAA,KAAA,cAAA,MAAA,QAAA,KAAA,iBAAA,KAAA,cAAA,KAAA,uBAAA,KAAA,cAAA,EAAA,IAAA,OAAA,KAAA,KAAA,SAAA,eAAA,SAAA,WAAA,KAAA,SAAA,eAAA,SAAA,YAAA,KAAA,SAAA,eAAA,UAAA,KAAA,SAAA,eAAA,SAAA,SAAA,KAAA,SAAA,eAAA,UAAA,SAAA,KAAA,SAAA,eAAA,UAAA,SAAA,KAAA,OAAA,IAAA,YAAA,SAAA,KAAA,OAAA,IAAA,WAAA,SAAA,KAAA,OAAA,IAAA,SAAA,OAAA,KAAA,YAAA,YAAA,SAAA,SAAA;AACvB"}
1
+ {"version":3,"file":"capnp.mjs","names":[],"sources":["../../src/helpers/capnp.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 { getUnionTypes, kindToName } from \"@powerlines/deepkit/utilities\";\nimport { getClassName } from \"@powerlines/deepkit/vendor/core\";\nimport {\n memberNameToString,\n ReflectionClass,\n ReflectionKind,\n ReflectionMethod,\n ReflectionParameter,\n ReflectionProperty,\n Type,\n TypeEnum,\n TypeLiteral,\n TypeUnion\n} from \"@powerlines/deepkit/vendor/type\";\nimport { capnpc } from \"@stryke/capnp/compile\";\nimport { resolveOptions } from \"@stryke/capnp/helpers\";\nimport type { CapnpcOptions, CapnpcResult } from \"@stryke/capnp/types\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { getUniqueBy } from \"@stryke/helpers/get-unique\";\nimport { StormJSON } from \"@stryke/json\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport { camelCase } from \"@stryke/string-format/camel-case\";\nimport { getWords } from \"@stryke/string-format/get-words\";\nimport { pascalCase } from \"@stryke/string-format/pascal-case\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { isBigInt } from \"@stryke/type-checks/is-bigint\";\nimport { isNull } from \"@stryke/type-checks/is-null\";\nimport { isNumber } from \"@stryke/type-checks/is-number\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport { isUndefined } from \"@stryke/type-checks/is-undefined\";\nimport defu from \"defu\";\nimport { Buffer } from \"node:buffer\";\nimport { exec } from \"node:child_process\";\nimport { promisify } from \"node:util\";\nimport { Context, PluginContext } from \"powerlines\";\nimport { getFileHeader } from \"powerlines/utils\";\n\n/**\n * Compiles a Cap'n Proto schema into TypeScript definitions.\n *\n * @param context - The context containing the project and workspace information.\n * @param options - The options for compiling the schema.\n * @returns A promise that resolves to the compiled schema.\n */\nexport async function compile(\n context: Context,\n options: Partial<CapnpcOptions> = {}\n): Promise<CapnpcResult> {\n const opts = defu(options, {\n ts: true,\n js: false,\n dts: false,\n schemas: joinPaths(context.artifactsPath, \"schemas\"),\n tsconfig: context.tsconfig,\n projectRoot: context.config.root,\n workspaceRoot: context.config.cwd,\n tty: true\n }) as Parameters<typeof resolveOptions>[0];\n\n const resolvedOptions = await resolveOptions(opts);\n if (!resolvedOptions) {\n throw new Error(\n `✖ No Cap'n Proto schema files found in the specified source paths: ${toArray(\n opts.schemas\n ).join(\", \")}.`\n );\n }\n\n return capnpc(resolvedOptions);\n}\n\n/**\n * Converts any {@link ReflectionProperty} or {@link ReflectionParameter}'s value to string representation.\n *\n * @param property - The {@link ReflectionProperty} or {@link ReflectionParameter} containing the value to stringify.\n * @param value - The value to stringify.\n * @returns A string representation of the value.\n */\nexport function stringifyCapnpDefaultValue(\n property: ReflectionProperty | ReflectionParameter,\n value?: any\n): string {\n return stringifyCapnpValue(\n property.type,\n value ?? property.getDefaultValue()\n );\n}\n\n/**\n * Converts any {@link Type}'s actual value to string representation.\n *\n * @param type - The {@link Type} of the value to stringify.\n * @param value - The value to stringify.\n * @returns A string representation of the value.\n */\nexport function stringifyCapnpValue(type: Type, value: any): string {\n return type.kind === ReflectionKind.string ||\n (type.kind === ReflectionKind.literal && isString(type.literal))\n ? `\"${String(value)}\"`\n : type.kind === ReflectionKind.enum\n ? `${camelCase(String(value))}`\n : type.kind === ReflectionKind.array\n ? StormJSON.stringify(value)\n : type.kind === ReflectionKind.object ||\n type.kind === ReflectionKind.objectLiteral\n ? StormJSON.stringify(value).replaceAll(\"{\", \"(\").replaceAll(\"}\", \")\")\n : String(value);\n}\n\n/**\n * Converts a ReflectionProperty's default value to a Cap'n Proto schema string representation.\n *\n * @param type - The TypeEnum to evaluate.\n * @returns A string representation of the property.\n */\nexport function getCapnpEnumTypes(type: Type): \"Text\" | \"Float32\" | null {\n if (type.kind !== ReflectionKind.enum) {\n return null;\n }\n\n const unique = getUniqueBy(\n type.values.filter(value => !isUndefined(value) && !isNull(value)),\n enumMember => (isString(enumMember) ? \"Text\" : \"Float32\")\n );\n if (unique.length === 0) {\n return null;\n }\n\n return unique[0] && isString(unique[0]) ? \"Text\" : \"Float32\";\n}\n\n/**\n * Determines if a Type is a `Void` type in a Cap'n Proto schema.\n *\n * @param type - The Type to check.\n * @returns True if the Type is a `Void` type, false otherwise.\n */\nexport function isVoidType(type: Type): boolean {\n return (\n type.kind === ReflectionKind.void ||\n type.kind === ReflectionKind.never ||\n type.kind === ReflectionKind.null ||\n type.kind === ReflectionKind.undefined ||\n type.kind === ReflectionKind.symbol\n );\n}\n\n/**\n * Converts a {@link TypeUnion} to an array of its underlying Cap'n Proto primitive type representation.\n *\n * @param type - The {@link TypeUnion} to convert.\n * @returns A string representation of the Cap'n Proto primitive type.\n */\nexport function getCapnpUnionTypes(type: Type): Type[] {\n return getUnionTypes(type);\n}\n\n/**\n * Converts a {@link TypeUnion} to an array of its underlying Cap'n Proto primitive type representation.\n *\n * @param type - The {@link TypeUnion} to convert.\n * @returns An array of Cap'n Proto primitive types.\n */\nexport function isCapnpStringUnion(type: Type): boolean {\n return getCapnpUnionTypes(type).some(\n member => member.kind === ReflectionKind.string\n );\n}\n\nexport const LARGE_BUFFER = 1024 * 1000000;\nexport type IOType = \"overlapped\" | \"pipe\" | \"ignore\" | \"inherit\";\nexport type StdioOptions =\n | IOType\n | Array<IOType | \"ipc\" | number | null | undefined>;\n\nconst execAsync = promisify(exec);\n\nexport async function generateCapnpId() {\n const { stdout } = await execAsync(\"capnp id\", {\n windowsHide: true,\n maxBuffer: LARGE_BUFFER,\n killSignal: \"SIGTERM\"\n });\n\n return stdout;\n}\n\nexport interface GenerateCapnpOptions {\n name?: string;\n}\n\nexport async function generateCapnp(\n context: PluginContext,\n reflection: ReflectionClass<any>,\n options: GenerateCapnpOptions\n) {\n const capnpId = await generateCapnpId();\n\n return `${capnpId.trim()};\n${getFileHeader(context)\n .replace(/^\\r*\\n*/g, \"\")\n .replaceAll(\"//\", \"#\")}\n${\n reflection.getMethods().length === 0\n ? generateCapnpStruct(reflection, options)\n : generateCapnpInterface(reflection, options)\n}\n`.trim();\n}\n\nexport interface GenerateCapnpStructOptions extends GenerateCapnpOptions {\n indexCounter?: () => number;\n}\n\nexport function generateCapnpStruct(\n reflection: ReflectionClass<any>,\n options: GenerateCapnpStructOptions = {}\n): string {\n const structName =\n options?.name ||\n reflection.getTitle() ||\n reflection.getClassName() ||\n reflection.getName();\n\n return `${generateCapnpEnums(reflection)}struct ${pascalCase(structName)} {\n # Struct definition for ${titleCase(structName)}.\n\n ${generateCapnpSchema(reflection, options)}\n}\n`;\n}\n\nexport function generateCapnpInterface(\n reflection: ReflectionClass<any>,\n options: GenerateCapnpStructOptions = {}\n): string {\n const interfaceName =\n options?.name ||\n reflection.getTitle() ||\n reflection.getClassName() ||\n reflection.getName();\n\n return `${generateCapnpEnums(reflection)}interface ${pascalCase(interfaceName)} {\n # Interface definition for ${titleCase(interfaceName)}.\n\n ${generateCapnpSchema(reflection, options)}\n}\n`;\n}\n\nfunction formatEnumName(name: string) {\n return pascalCase(`${name}_Type`);\n}\n\nfunction generateCapnpEnums(reflection: ReflectionClass<any>): string {\n const enums = reflection\n .getProperties()\n .filter(\n prop =>\n !prop.isIgnored() &&\n (prop.type.kind === ReflectionKind.enum ||\n (prop.type.kind === ReflectionKind.union &&\n getCapnpUnionTypes(prop.type).filter(\n type =>\n type.kind === ReflectionKind.literal &&\n (isString(type.literal) || isNumber(type.literal))\n ).length === 1))\n )\n .sort((a, b) =>\n (a.isReadonly() && b.isReadonly()) || (!a.isReadonly() && !b.isReadonly())\n ? b.getNameAsString().localeCompare(a.getNameAsString())\n : a.isReadonly()\n ? 1\n : -1\n );\n if (enums.length === 0) {\n return \"\";\n }\n\n return `${enums\n .map(enumeration =>\n generateCapnpEnumSchema(\n enumeration.type as TypeEnum | TypeUnion,\n formatEnumName(enumeration.getNameAsString())\n )\n )\n .join(\"\\n\\n\")}\n\n`;\n}\n\nexport function generateCapnpSchema(\n reflection: ReflectionClass<any>,\n options: GenerateCapnpStructOptions = {}\n): string {\n let index = 0;\n const indexCounter: () => number = options?.indexCounter ?? (() => index++);\n\n return `${reflection\n .getProperties()\n .filter(prop => !prop.isIgnored())\n .sort((a, b) =>\n (a.isReadonly() && b.isReadonly()) || (!a.isReadonly() && !b.isReadonly())\n ? b.getNameAsString().localeCompare(a.getNameAsString())\n : a.isReadonly()\n ? 1\n : -1\n )\n .map(prop => generateCapnpPropertySchema(prop, indexCounter))\n .join(\" \\n\\n\\t\")}${reflection\n .getMethods()\n .filter(methods => !methods.isIgnored())\n .sort((a, b) =>\n (a.isReadonly() && b.isReadonly()) || (!a.isReadonly() && !b.isReadonly())\n ? String(b.getName()).localeCompare(String(a.getName()))\n : a.isReadonly()\n ? 1\n : -1\n )\n .map(methods => generateCapnpMethodSchema(methods, indexCounter))\n .join(\" \\n\\n\\t\")}${\n reflection\n .getProperties()\n .some(\n prop =>\n prop.type.kind === ReflectionKind.class && prop.type.classType === Map\n )\n ? `\n struct Map(Key, Value) {\n entries @0 :List(Entry);\n\n struct Entry {\n key @0 :Key;\n value @1 :Value;\n }\n }`\n : \"\"\n }${\n reflection\n .getProperties()\n .some(\n prop =>\n prop.type.kind === ReflectionKind.class &&\n prop.type.classType === Date\n )\n ? `\n struct Date {\n # A standard Gregorian calendar date.\n\n year @0 :Int16;\n # The year - Must include the century.\n # Negative value indicates BC.\n\n month @1 :UInt8; # The month, 1-12\n\n day @2 :UInt8; # The day of the month, 1-30\n\n hour @3 :UInt8; # The hour of the day, 0-23\n\n minute @4 :UInt8; # The minute of the hour, 0-59\n\n second @5 :UInt8; # The second of the minute, 0-59\n\n millisecond @6 :UInt16; # Milliseconds of the second, 0-999\n }`\n : \"\"\n }`;\n}\n\nexport function generateCapnpMethodSchema(\n reflection: ReflectionMethod,\n indexCounter: () => number\n): string {\n const methodName =\n reflection.getTitle() || typeof reflection.getName() === \"string\"\n ? String(reflection.getName())\n : \"\";\n if (!methodName) {\n throw new Error(\n `Cannot generate Cap'n Proto schema for method without a name - Parent interface: ${reflection.reflectionClass.getName()}`\n );\n }\n\n return `${camelCase(methodName)} @${indexCounter()} (${reflection\n .getParameters()\n .map(param => {\n return `${camelCase(\n param.getName()\n )} :${generateCapnpPrimitive(param.getType())}${\n param.hasDefault() ? ` = ${stringifyCapnpDefaultValue(param)}` : \"\"\n }`;\n })\n .join(\", \")})${\n isVoidType(reflection.getReturnType())\n ? \"\"\n : ` -> (${kindToName(\n reflection.getReturnType().kind\n )}: ${generateCapnpPrimitive(reflection.getReturnType())})`\n }; # ${(\n reflection.getDescription() ||\n `The ${titleCase(\n reflection.reflectionClass.getTitle() ||\n reflection.reflectionClass.getName()\n )} interface ${titleCase(methodName)} method.`\n ).replaceAll(\"\\n\", \". \")}`;\n}\n\nfunction generateCapnpPropertyComment(reflection: ReflectionProperty) {\n const result = getWords(\n reflection.getDescription() ||\n `A schema property for ${titleCase(\n reflection.getTitle() || reflection.getNameAsString()\n )} field.`,\n {\n relaxed: true\n }\n )\n .reduce((ret, word) => {\n let length = ret.length;\n if (ret.includes(\"\\n\")) {\n length = ret.substring(ret.lastIndexOf(\"\\n\") + 1).length;\n }\n\n const current = word.trim();\n if (length + current.length > 60) {\n ret += `\\n\\t# ${current}`;\n } else {\n ret += ` ${current}`;\n }\n return ret;\n }, \"\")\n .trim();\n if (result.length > 0) {\n return `\\t# ${result}`;\n }\n\n return \"\";\n}\n\nfunction generateCapnpPropertySchema(\n reflection: ReflectionProperty,\n indexCounter: () => number\n): string {\n if (reflection.type.kind === ReflectionKind.union) {\n if (getCapnpUnionTypes(reflection.type).length === 0) {\n return `${camelCase(reflection.getNameAsString())} @${indexCounter()} :Void;\n${generateCapnpPropertyComment(reflection)}`;\n } else if (\n getCapnpUnionTypes(reflection.type).filter(\n type =>\n type.kind === ReflectionKind.literal &&\n (isString(type.literal) || isNumber(type.literal))\n ).length === 1\n ) {\n return `${camelCase(reflection.getNameAsString())} @${indexCounter()} :${formatEnumName(\n reflection.getNameAsString()\n )}${\n reflection.hasDefault()\n ? ` = ${stringifyCapnpDefaultValue(reflection)}`\n : \"\"\n };\n${generateCapnpPropertyComment(reflection)}`;\n } else {\n return `${camelCase(reflection.getNameAsString())} :union {\n${getCapnpUnionTypes(reflection.type)\n .map(\n type =>\n ` ${kindToName(type.kind)} @${indexCounter()} :${generateCapnpPrimitive(\n type\n )};`\n )\n .join(\"\\n\")}\n }\n${generateCapnpPropertyComment(reflection)}`;\n }\n } else if (reflection.type.kind === ReflectionKind.array) {\n return `${camelCase(reflection.getNameAsString())} @${indexCounter()} :List(${generateCapnpPrimitive(reflection.getSubType())})${\n reflection.hasDefault()\n ? ` = ${stringifyCapnpDefaultValue(reflection)}`\n : \"\"\n };\n${generateCapnpPropertyComment(reflection)}`;\n } else if (reflection.type.kind === ReflectionKind.class) {\n if (reflection.type.classType === Map) {\n return `${camelCase(reflection.getNameAsString())} @${indexCounter()} :Map(${\n !reflection.type.typeArguments ||\n reflection.type.typeArguments.length === 0 ||\n !reflection.type.typeArguments[0]\n ? \"Data\"\n : generateCapnpPrimitive(reflection.type.typeArguments[0])\n }, ${\n !reflection.type.typeArguments ||\n reflection.type.typeArguments.length < 2 ||\n !reflection.type.typeArguments[1]\n ? \"Data\"\n : generateCapnpPrimitive(reflection.type.typeArguments[1])\n })${\n reflection.hasDefault()\n ? ` = ${stringifyCapnpDefaultValue(reflection)}`\n : \"\"\n };\n${generateCapnpPropertyComment(reflection)}`;\n } else if (reflection.type.classType === Date) {\n return `${camelCase(reflection.getNameAsString())} @${indexCounter()} :Data${\n reflection.hasDefault()\n ? ` = ${stringifyCapnpDefaultValue(reflection)}`\n : \"\"\n };\n${generateCapnpPropertyComment(reflection)}`;\n } else if (reflection.type.classType === Buffer) {\n return `${camelCase(reflection.getNameAsString())} @${indexCounter()} :Data${\n reflection.hasDefault()\n ? ` = ${stringifyCapnpDefaultValue(reflection)}`\n : \"\"\n };\n${generateCapnpPropertyComment(reflection)}`;\n } else if (reflection.type.classType === ArrayBuffer) {\n return `${camelCase(reflection.getNameAsString())} @${indexCounter()} :Data${\n reflection.hasDefault()\n ? ` = ${stringifyCapnpDefaultValue(reflection)}`\n : \"\"\n };\n${generateCapnpPropertyComment(reflection)}`;\n } else {\n return `${camelCase(reflection.getNameAsString())} @${indexCounter()} :${pascalCase(\n reflection.type.typeName || getClassName(reflection.type.classType)\n )}${generateCapnpStruct(reflection.reflectionClass, {\n name: pascalCase(\n reflection.type.typeName || getClassName(reflection.type.classType)\n )\n })}${\n reflection.hasDefault()\n ? ` = ${stringifyCapnpDefaultValue(reflection)}`\n : \"\"\n };\n${generateCapnpPropertyComment(reflection)}`;\n }\n } else if (reflection.type.kind === ReflectionKind.objectLiteral) {\n return `${camelCase(reflection.getNameAsString())} @${indexCounter()} :${pascalCase(\n reflection.type.typeName ||\n memberNameToString(reflection.getNameAsString())\n )}${generateCapnpStruct(reflection.reflectionClass, {\n name: pascalCase(\n reflection.type.typeName ||\n memberNameToString(reflection.getNameAsString())\n )\n })}${\n reflection.hasDefault()\n ? ` = ${stringifyCapnpDefaultValue(reflection)}`\n : \"\"\n };\n${generateCapnpPropertyComment(reflection)}`;\n } else if (reflection.type.kind === ReflectionKind.enum) {\n return `${camelCase(reflection.getNameAsString())} @${indexCounter()} :${pascalCase(\n reflection.getNameAsString()\n )}${\n reflection.hasDefault()\n ? ` = ${stringifyCapnpDefaultValue(reflection)}`\n : \"\"\n };\n${generateCapnpPropertyComment(reflection)}`;\n }\n\n return `${camelCase(reflection.getNameAsString())} @${indexCounter()} :${generateCapnpPrimitive(\n reflection.getType()\n )}${\n reflection.hasDefault()\n ? ` = ${stringifyCapnpDefaultValue(reflection)}`\n : \"\"\n };\n${generateCapnpPropertyComment(reflection)}`;\n}\n\nexport function generateCapnpEnumSchema(\n type: TypeEnum | TypeUnion,\n name: string\n): string {\n if (type.kind === ReflectionKind.union) {\n return generateCapnpEnumSchema(\n {\n kind: ReflectionKind.enum,\n indexType: type,\n enum: (type.types as TypeLiteral[]).reduce<\n Record<string, string | number>\n >((ret, type) => {\n if (isString(type.literal) || isNumber(type.literal)) {\n ret[camelCase(String(type.literal))] = type.literal;\n }\n\n return ret;\n }, {}),\n values: (\n getCapnpUnionTypes(type).filter(\n type =>\n type.kind === ReflectionKind.literal &&\n (isString(type.literal) || isNumber(type.literal))\n ) as TypeLiteral[]\n ).map(type => type.literal as string | number)\n },\n name\n );\n }\n\n let index = 0;\n const indexCounter: () => number = () => index++;\n\n const enumType = getCapnpEnumTypes(type);\n if (!enumType) {\n return \"\";\n }\n\n return `enum ${pascalCase(name)} {\n${\n type.enum && Object.entries(type.enum).length > 0\n ? Object.entries(type.enum)\n .filter(([, value]) => value !== null && value !== undefined)\n .map(([key]) => ` ${camelCase(key)} @${indexCounter()};`)\n .join(\"\\n\")\n : type.values\n .filter(value => value !== null && value !== undefined)\n .map(\n value =>\n `${\n enumType === \"Text\" && value\n ? camelCase(String(value))\n : `${\n type.typeName ? `${camelCase(type.typeName)}_` : \"\"\n }${value || \"\"}`\n } @${indexCounter()};`\n )\n .join(\"\\n\")\n}\n }`;\n}\n\n/**\n * Generates a string representation of Cap'n Proto primitive types from a Deepkit Type.\n *\n * @param type - The Deepkit Type to convert.\n * @returns A string representation of the Cap'n Proto primitive type.\n */\nexport function generateCapnpPrimitive(type: Type): string {\n return type.kind === ReflectionKind.never ||\n type.kind === ReflectionKind.void ||\n type.kind === ReflectionKind.null ||\n type.kind === ReflectionKind.undefined ||\n type.kind === ReflectionKind.symbol\n ? \"Void\"\n : type.kind === ReflectionKind.class && type.classType === Date\n ? \"Date\"\n : type.kind === ReflectionKind.class && type.classType === Set\n ? `List(${\n type.typeArguments && type.typeArguments[0]\n ? generateCapnpPrimitive(type.typeArguments[0])\n : \"Data\"\n })`\n : type.kind === ReflectionKind.bigint\n ? \"UInt64\"\n : type.kind === ReflectionKind.number\n ? \"Float64\"\n : type.kind === ReflectionKind.string ||\n type.kind === ReflectionKind.regexp\n ? \"Text\"\n : type.kind === ReflectionKind.boolean\n ? \"Bool\"\n : type.kind === ReflectionKind.literal\n ? isNumber(type.literal)\n ? \"Float64\"\n : isBigInt(type.literal)\n ? \"UInt64\"\n : isString(type.literal)\n ? \"Text\"\n : typeof type.literal === \"boolean\"\n ? \"Bool\"\n : \"Data\"\n : \"Data\";\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDA,eAAsB,QAAK,SAAA,UAAc,CAAA,GAAA;CACzC,MAAQ,OAAC,KAAW,SAAO;EAC3B,IAAQ;EACR,IAAQ;;EAEN,SAAA,UAAA,QAAA,eAAA,SAAA;EACC,UAAW,QAAM;EACnB,aAAA,QAAA,OAAA;EACG,eAAe,QAAK,OAAQ;EAC5B,KAAK;CACP,CAAC;CACD,MAAA,kBAAA,MAAA,eAAA,IAAA;CACF,IAAM,CAAC,iBACL,MAAQ,IAAC,MAAO,sEAAA,QAAA,KAAA,OAAA,EAAA,KAAA,IAAA,EAAA,EAAA;CAEhB,OAAC,OAAQ,eAAc;AACzB;;;;;;;;AASA,SAAQ,2BAAmC,UAAC,OAAA;;AAE5C;;;;;;;;AASA,SAAgB,oBAAgB,MAAA,OAAA;CAChC,OAAA,KAAA,SAAA,eAAA,UAAA,KAAA,SAAA,eAAA,WAAA,SAAA,KAAA,OAAA,IAAA,IAAA,OAAA,KAAA,EAAA,KAAA,KAAA,SAAA,eAAA,OAAA,GAAA,UAAA,OAAA,KAAA,CAAA,MAAA,KAAA,SAAA,eAAA,QAAA,UAAA,UAAA,KAAA,IAAA,KAAA,SAAA,eAAA,UAAA,KAAA,SAAA,eAAA,gBAAA,UAAA,UAAA,KAAA,EAAA,WAAA,KAAA,GAAA,EAAA,WAAA,KAAA,GAAA,IAAA,OAAA,KAAA;;;;;;;;AASA,SAAgB,kBAAA,MAAA;CACd,IAAA,KAAS,SAAC,eAAqB,MAC/B,OAAQ;CAER,MAAM,SAAC,YAAmB,KAAA,OAAA,QAAA,UAAA,CAAA,YAAA,KAAA,KAAA,CAAA,OAAA,KAAA,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AAA,SAAA,OAAA,UAAA,GAAA,EAAA,IAAA,aAAA,EAAA,EAAA,EAAA,KAAA,IAAA,IAAA,KAAA,OAAA,QAAA,UAAA,UAAA,QAAA,UAAA,MAAA,EAAA,KAAA,UAAA,GAAA,aAAA,UAAA,QAAA,UAAA,OAAA,KAAA,CAAA,IAAA,GAAA,KAAA,WAAA,GAAA,UAAA,KAAA,QAAA,EAAA,KAAA,KAAA,SAAA,KAAA,IAAA,aAAA,EAAA,EAAA,EAAA,KAAA,IAAA,EAAA;;AAEZ;;;;;;;AAQA,SAAgB,uBAAC,MAA4B;CAC3C,OAAO,KAAK,SAAS,eAAA,SAAA,KAAA,SAAA,eAAA,QAAA,KAAA,SAAA,eAAA,QAAA,KAAA,SAAA,eAAA,aAAA,KAAA,SAAA,eAAA,SAAA,SAAA,KAAA,SAAA,eAAA,SAAA,KAAA,cAAA,OAAA,SAAA,KAAA,SAAA,eAAA,SAAA,KAAA,cAAA,MAAA,QAAA,KAAA,iBAAA,KAAA,cAAA,KAAA,uBAAA,KAAA,cAAA,EAAA,IAAA,OAAA,KAAA,KAAA,SAAA,eAAA,SAAA,WAAA,KAAA,SAAA,eAAA,SAAA,YAAA,KAAA,SAAA,eAAA,UAAA,KAAA,SAAA,eAAA,SAAA,SAAA,KAAA,SAAA,eAAA,UAAA,SAAA,KAAA,SAAA,eAAA,UAAA,SAAA,KAAA,OAAA,IAAA,YAAA,SAAA,KAAA,OAAA,IAAA,WAAA,SAAA,KAAA,OAAA,IAAA,SAAA,OAAA,KAAA,YAAA,YAAA,SAAA,SAAA;AACvB"}
@@ -1,9 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
2
  let _alloy_js_typescript = require("@alloy-js/typescript");
4
3
 
5
4
  //#region src/helpers/create-builtin.ts
6
- var create_builtin_exports = /* @__PURE__ */ require_runtime.__exportAll({ createBuiltin: () => createBuiltin });
7
5
  /**
8
6
  * Creates a built-in representation of a package based on the provided descriptor.
9
7
  *
@@ -18,10 +16,4 @@ function createBuiltin(options) {
18
16
  }
19
17
 
20
18
  //#endregion
21
- exports.createBuiltin = createBuiltin;
22
- Object.defineProperty(exports, 'create_builtin_exports', {
23
- enumerable: true,
24
- get: function () {
25
- return create_builtin_exports;
26
- }
27
- });
19
+ exports.createBuiltin = createBuiltin;
@@ -1,8 +1,6 @@
1
- import { __exportAll } from "../_virtual/_rolldown/runtime.mjs";
2
1
  import { createPackage } from "@alloy-js/typescript";
3
2
 
4
3
  //#region src/helpers/create-builtin.ts
5
- var create_builtin_exports = /* @__PURE__ */ __exportAll({ createBuiltin: () => createBuiltin });
6
4
  /**
7
5
  * Creates a built-in representation of a package based on the provided descriptor.
8
6
  *
@@ -17,5 +15,5 @@ function createBuiltin(options) {
17
15
  }
18
16
 
19
17
  //#endregion
20
- export { createBuiltin, create_builtin_exports };
18
+ export { createBuiltin };
21
19
  //# sourceMappingURL=create-builtin.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-builtin.mjs","names":[],"sources":["../../src/helpers/create-builtin.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 { SymbolCreator } from \"@alloy-js/core\";\nimport {\n createPackage,\n CreatePackageProps,\n PackageDescriptor,\n PackageRefkeys\n} from \"@alloy-js/typescript\";\n\nexport type CreateBuiltinOptions<T extends PackageDescriptor> = Omit<\n CreatePackageProps<T>,\n \"builtin\"\n>;\n\n/**\n * Creates a built-in representation of a package based on the provided descriptor.\n *\n * @param options - Properties to define the package, excluding the 'builtin' flag which is set to true.\n * @returns An object containing reference keys for the package and a symbol creator function.\n */\nexport function createBuiltin<const T extends PackageDescriptor>(\n options: CreateBuiltinOptions<T>\n): PackageRefkeys<T> & SymbolCreator {\n // const refkeys: any = {\n // [getSymbolCreatorSymbol()](binder: Binder) {\n // createSymbols(binder, props, refkeys);\n // }\n // };\n\n // for (const [path, symbols] of Object.entries(props.descriptor)) {\n // const keys = path === \".\" ? refkeys : (refkeys[path] = {});\n\n // if (symbols.default) {\n // keys.default = refkey(props.descriptor, path, \"default\");\n // }\n\n // for (const named of symbols.named ?? []) {\n // const namedObj = typeof named === \"string\" ? { name: named } : named;\n // keys[namedObj.name] = refkey();\n\n // if (namedObj.staticMembers?.length) {\n // createRefkeysForMembers(\n // namedObj.staticMembers,\n // keys[namedObj.name],\n // \"static\"\n // );\n // }\n\n // if (namedObj.instanceMembers?.length) {\n // createRefkeysForMembers(\n // namedObj.instanceMembers,\n // keys[namedObj.name],\n // \"instance\"\n // );\n // }\n\n // keys[namedObj.name][getSymbolCreatorSymbol()] = (\n // binder: Binder,\n // parentSym: TSOutputSymbol\n // ) => {\n // if (namedObj.staticMembers?.length) {\n // assignMembers(\n // binder,\n // parentSym,\n // namedObj.staticMembers,\n // keys[namedObj.name],\n // true\n // );\n // }\n // if (namedObj.instanceMembers?.length) {\n // assignMembers(\n // binder,\n // parentSym,\n // namedObj.instanceMembers,\n // keys[namedObj.name],\n // false\n // );\n // }\n // };\n // }\n // }\n\n // return refkeys;\n\n return createPackage({ ...options, builtin: true });\n}\n"],"mappings":";;;;;;;;;;;AA0BA,SAAY,cAAA,SAAuB;CA8DjC,OAAO,cAAY;EACjB,GAAG;EACH,SAAS;CACX,CAAC;AACH"}
1
+ {"version":3,"file":"create-builtin.mjs","names":[],"sources":["../../src/helpers/create-builtin.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 { SymbolCreator } from \"@alloy-js/core\";\nimport {\n createPackage,\n CreatePackageProps,\n PackageDescriptor,\n PackageRefkeys\n} from \"@alloy-js/typescript\";\n\nexport type CreateBuiltinOptions<T extends PackageDescriptor> = Omit<\n CreatePackageProps<T>,\n \"builtin\"\n>;\n\n/**\n * Creates a built-in representation of a package based on the provided descriptor.\n *\n * @param options - Properties to define the package, excluding the 'builtin' flag which is set to true.\n * @returns An object containing reference keys for the package and a symbol creator function.\n */\nexport function createBuiltin<const T extends PackageDescriptor>(\n options: CreateBuiltinOptions<T>\n): PackageRefkeys<T> & SymbolCreator {\n // const refkeys: any = {\n // [getSymbolCreatorSymbol()](binder: Binder) {\n // createSymbols(binder, props, refkeys);\n // }\n // };\n\n // for (const [path, symbols] of Object.entries(props.descriptor)) {\n // const keys = path === \".\" ? refkeys : (refkeys[path] = {});\n\n // if (symbols.default) {\n // keys.default = refkey(props.descriptor, path, \"default\");\n // }\n\n // for (const named of symbols.named ?? []) {\n // const namedObj = typeof named === \"string\" ? { name: named } : named;\n // keys[namedObj.name] = refkey();\n\n // if (namedObj.staticMembers?.length) {\n // createRefkeysForMembers(\n // namedObj.staticMembers,\n // keys[namedObj.name],\n // \"static\"\n // );\n // }\n\n // if (namedObj.instanceMembers?.length) {\n // createRefkeysForMembers(\n // namedObj.instanceMembers,\n // keys[namedObj.name],\n // \"instance\"\n // );\n // }\n\n // keys[namedObj.name][getSymbolCreatorSymbol()] = (\n // binder: Binder,\n // parentSym: TSOutputSymbol\n // ) => {\n // if (namedObj.staticMembers?.length) {\n // assignMembers(\n // binder,\n // parentSym,\n // namedObj.staticMembers,\n // keys[namedObj.name],\n // true\n // );\n // }\n // if (namedObj.instanceMembers?.length) {\n // assignMembers(\n // binder,\n // parentSym,\n // namedObj.instanceMembers,\n // keys[namedObj.name],\n // false\n // );\n // }\n // };\n // }\n // }\n\n // return refkeys;\n\n return createPackage({ ...options, builtin: true });\n}\n"],"mappings":";;;;;;;;;AA0BA,SAAY,cAAA,SAAuB;CA8DjC,OAAO,cAAY;EACjB,GAAG;EACH,SAAS;CACX,CAAC;AACH"}
@@ -1,12 +1,10 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
2
  let _stryke_string_format_title_case = require("@stryke/string-format/title-case");
4
3
  let _powerlines_deepkit_utilities = require("@powerlines/deepkit/utilities");
5
4
  let _stryke_string_format_camel_case = require("@stryke/string-format/camel-case");
6
5
  let _stryke_type_checks_is_undefined = require("@stryke/type-checks/is-undefined");
7
6
 
8
7
  //#region src/helpers/typescript.ts
9
- var typescript_exports = /* @__PURE__ */ require_runtime.__exportAll({ generateObjectDeclaration: () => generateObjectDeclaration });
10
8
  /**
11
9
  * Generates a TypeScript object for the given reflection class.
12
10
  *
@@ -46,10 +44,4 @@ export const ${(0, _stryke_string_format_camel_case.camelCase)(options.overrideN
46
44
  }
47
45
 
48
46
  //#endregion
49
- exports.generateObjectDeclaration = generateObjectDeclaration;
50
- Object.defineProperty(exports, 'typescript_exports', {
51
- enumerable: true,
52
- get: function () {
53
- return typescript_exports;
54
- }
55
- });
47
+ exports.generateObjectDeclaration = generateObjectDeclaration;
@@ -1,11 +1,9 @@
1
- import { __exportAll } from "../_virtual/_rolldown/runtime.mjs";
2
1
  import { titleCase } from "@stryke/string-format/title-case";
3
2
  import { stringifyValue } from "@powerlines/deepkit/utilities";
4
3
  import { camelCase } from "@stryke/string-format/camel-case";
5
4
  import { isUndefined } from "@stryke/type-checks/is-undefined";
6
5
 
7
6
  //#region src/helpers/typescript.ts
8
- var typescript_exports = /* @__PURE__ */ __exportAll({ generateObjectDeclaration: () => generateObjectDeclaration });
9
7
  /**
10
8
  * Generates a TypeScript object for the given reflection class.
11
9
  *
@@ -45,5 +43,5 @@ export const ${camelCase(options.overrideName || reflection.getName())}${options
45
43
  }
46
44
 
47
45
  //#endregion
48
- export { generateObjectDeclaration, typescript_exports };
46
+ export { generateObjectDeclaration };
49
47
  //# sourceMappingURL=typescript.mjs.map