@powerlines/plugin-alloy 0.25.69 → 0.26.0

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 (168) hide show
  1. package/README.md +1 -1
  2. package/dist/core/components/index.cjs +3 -1
  3. package/dist/core/components/index.d.cts +3 -2
  4. package/dist/core/components/index.d.mts +3 -2
  5. package/dist/core/components/index.mjs +3 -2
  6. package/dist/core/components/infrastructure-file.cjs +48 -0
  7. package/dist/core/components/infrastructure-file.d.cts +28 -0
  8. package/dist/core/components/infrastructure-file.d.cts.map +1 -0
  9. package/dist/core/components/infrastructure-file.d.mts +28 -0
  10. package/dist/core/components/infrastructure-file.d.mts.map +1 -0
  11. package/dist/core/components/infrastructure-file.mjs +46 -0
  12. package/dist/core/components/infrastructure-file.mjs.map +1 -0
  13. package/dist/core/components/output.d.cts +2 -2
  14. package/dist/core/components/output.d.cts.map +1 -1
  15. package/dist/core/components/output.d.mts +2 -2
  16. package/dist/core/components/output.d.mts.map +1 -1
  17. package/dist/core/components/single-line-comment.cjs +1 -1
  18. package/dist/core/components/single-line-comment.d.cts +3 -3
  19. package/dist/core/components/single-line-comment.d.cts.map +1 -1
  20. package/dist/core/components/single-line-comment.d.mts +3 -3
  21. package/dist/core/components/single-line-comment.d.mts.map +1 -1
  22. package/dist/core/components/single-line-comment.mjs +1 -1
  23. package/dist/core/components/single-line-comment.mjs.map +1 -1
  24. package/dist/core/components/source-file.d.cts +2 -2
  25. package/dist/core/components/source-file.d.cts.map +1 -1
  26. package/dist/core/components/source-file.d.mts +2 -2
  27. package/dist/core/components/source-file.d.mts.map +1 -1
  28. package/dist/core/components/spacing.d.cts +2 -2
  29. package/dist/core/components/spacing.d.cts.map +1 -1
  30. package/dist/core/components/spacing.d.mts +2 -2
  31. package/dist/core/components/spacing.d.mts.map +1 -1
  32. package/dist/core/contexts/index.cjs +2 -1
  33. package/dist/core/contexts/index.d.cts +2 -2
  34. package/dist/core/contexts/index.d.mts +2 -2
  35. package/dist/core/contexts/index.mjs +2 -2
  36. package/dist/core/contexts/reflection.cjs +13 -2
  37. package/dist/core/contexts/reflection.d.cts +14 -3
  38. package/dist/core/contexts/reflection.d.cts.map +1 -1
  39. package/dist/core/contexts/reflection.d.mts +14 -3
  40. package/dist/core/contexts/reflection.d.mts.map +1 -1
  41. package/dist/core/contexts/reflection.mjs +12 -2
  42. package/dist/core/contexts/reflection.mjs.map +1 -1
  43. package/dist/core/index.cjs +5 -2
  44. package/dist/core/index.d.cts +4 -3
  45. package/dist/core/index.d.mts +4 -3
  46. package/dist/core/index.mjs +4 -3
  47. package/dist/hcl/components/block-declaration.cjs +34 -0
  48. package/dist/hcl/components/block-declaration.d.cts +22 -0
  49. package/dist/hcl/components/block-declaration.d.cts.map +1 -0
  50. package/dist/hcl/components/block-declaration.d.mts +22 -0
  51. package/dist/hcl/components/block-declaration.d.mts.map +1 -0
  52. package/dist/hcl/components/block-declaration.mjs +33 -0
  53. package/dist/hcl/components/block-declaration.mjs.map +1 -0
  54. package/dist/hcl/components/hcl-file.cjs +83 -0
  55. package/dist/hcl/components/hcl-file.d.cts +27 -0
  56. package/dist/hcl/components/hcl-file.d.cts.map +1 -0
  57. package/dist/hcl/components/hcl-file.d.mts +27 -0
  58. package/dist/hcl/components/hcl-file.d.mts.map +1 -0
  59. package/dist/hcl/components/hcl-file.mjs +81 -0
  60. package/dist/hcl/components/hcl-file.mjs.map +1 -0
  61. package/dist/hcl/components/index.cjs +11 -0
  62. package/dist/hcl/components/index.d.cts +5 -0
  63. package/dist/hcl/components/index.d.mts +5 -0
  64. package/dist/hcl/components/index.mjs +6 -0
  65. package/dist/hcl/components/packer-file.cjs +29 -0
  66. package/dist/hcl/components/packer-file.d.cts +19 -0
  67. package/dist/hcl/components/packer-file.d.cts.map +1 -0
  68. package/dist/hcl/components/packer-file.d.mts +19 -0
  69. package/dist/hcl/components/packer-file.d.mts.map +1 -0
  70. package/dist/hcl/components/packer-file.mjs +28 -0
  71. package/dist/hcl/components/packer-file.mjs.map +1 -0
  72. package/dist/hcl/components/terraform-file.cjs +30 -0
  73. package/dist/hcl/components/terraform-file.d.cts +20 -0
  74. package/dist/hcl/components/terraform-file.d.cts.map +1 -0
  75. package/dist/hcl/components/terraform-file.d.mts +20 -0
  76. package/dist/hcl/components/terraform-file.d.mts.map +1 -0
  77. package/dist/hcl/components/terraform-file.mjs +29 -0
  78. package/dist/hcl/components/terraform-file.mjs.map +1 -0
  79. package/dist/hcl/index.cjs +12 -0
  80. package/dist/hcl/index.d.cts +5 -0
  81. package/dist/hcl/index.d.mts +5 -0
  82. package/dist/hcl/index.mjs +7 -0
  83. package/dist/helpers/capnp.cjs +2 -2
  84. package/dist/helpers/capnp.mjs +2 -2
  85. package/dist/helpers/typescript.cjs +1 -1
  86. package/dist/helpers/typescript.mjs +1 -1
  87. package/dist/markdown/components/front-matter.d.cts +2 -2
  88. package/dist/markdown/components/front-matter.d.cts.map +1 -1
  89. package/dist/markdown/components/front-matter.d.mts +2 -2
  90. package/dist/markdown/components/front-matter.d.mts.map +1 -1
  91. package/dist/markdown/components/markdown-file.cjs +1 -1
  92. package/dist/markdown/components/markdown-file.d.cts +3 -3
  93. package/dist/markdown/components/markdown-file.d.cts.map +1 -1
  94. package/dist/markdown/components/markdown-file.d.mts +3 -3
  95. package/dist/markdown/components/markdown-file.d.mts.map +1 -1
  96. package/dist/markdown/components/markdown-file.mjs +1 -1
  97. package/dist/markdown/components/markdown-table.d.cts +4 -4
  98. package/dist/markdown/components/markdown-table.d.cts.map +1 -1
  99. package/dist/markdown/components/markdown-table.d.mts +4 -4
  100. package/dist/markdown/components/markdown-table.d.mts.map +1 -1
  101. package/dist/typescript/components/builtin-file.d.cts +2 -2
  102. package/dist/typescript/components/builtin-file.d.cts.map +1 -1
  103. package/dist/typescript/components/builtin-file.d.mts +2 -2
  104. package/dist/typescript/components/builtin-file.d.mts.map +1 -1
  105. package/dist/typescript/components/dynamic-import-statement.d.cts +2 -2
  106. package/dist/typescript/components/dynamic-import-statement.d.cts.map +1 -1
  107. package/dist/typescript/components/dynamic-import-statement.d.mts +2 -2
  108. package/dist/typescript/components/dynamic-import-statement.d.mts.map +1 -1
  109. package/dist/typescript/components/entry-file.cjs +1 -1
  110. package/dist/typescript/components/entry-file.d.cts +2 -2
  111. package/dist/typescript/components/entry-file.d.cts.map +1 -1
  112. package/dist/typescript/components/entry-file.d.mts +2 -2
  113. package/dist/typescript/components/entry-file.d.mts.map +1 -1
  114. package/dist/typescript/components/entry-file.mjs +1 -1
  115. package/dist/typescript/components/index.cjs +0 -2
  116. package/dist/typescript/components/index.d.cts +1 -2
  117. package/dist/typescript/components/index.d.mts +1 -2
  118. package/dist/typescript/components/index.mjs +1 -2
  119. package/dist/typescript/components/interface-declaration.cjs +16 -6
  120. package/dist/typescript/components/interface-declaration.d.cts +6 -5
  121. package/dist/typescript/components/interface-declaration.d.cts.map +1 -1
  122. package/dist/typescript/components/interface-declaration.d.mts +5 -4
  123. package/dist/typescript/components/interface-declaration.d.mts.map +1 -1
  124. package/dist/typescript/components/interface-declaration.mjs +16 -6
  125. package/dist/typescript/components/interface-declaration.mjs.map +1 -1
  126. package/dist/typescript/components/object-declaration.cjs +8 -2
  127. package/dist/typescript/components/object-declaration.d.cts +7 -7
  128. package/dist/typescript/components/object-declaration.d.cts.map +1 -1
  129. package/dist/typescript/components/object-declaration.d.mts +6 -6
  130. package/dist/typescript/components/object-declaration.d.mts.map +1 -1
  131. package/dist/typescript/components/object-declaration.mjs +8 -2
  132. package/dist/typescript/components/object-declaration.mjs.map +1 -1
  133. package/dist/typescript/components/property-name.d.cts +2 -2
  134. package/dist/typescript/components/property-name.d.cts.map +1 -1
  135. package/dist/typescript/components/property-name.d.mts +2 -2
  136. package/dist/typescript/components/property-name.d.mts.map +1 -1
  137. package/dist/typescript/components/tsdoc-reflection.cjs +15 -4
  138. package/dist/typescript/components/tsdoc-reflection.d.cts +8 -7
  139. package/dist/typescript/components/tsdoc-reflection.d.cts.map +1 -1
  140. package/dist/typescript/components/tsdoc-reflection.d.mts +8 -7
  141. package/dist/typescript/components/tsdoc-reflection.d.mts.map +1 -1
  142. package/dist/typescript/components/tsdoc-reflection.mjs +16 -5
  143. package/dist/typescript/components/tsdoc-reflection.mjs.map +1 -1
  144. package/dist/typescript/components/tsdoc.d.cts +1 -1
  145. package/dist/typescript/components/type-declaration.d.cts +2 -2
  146. package/dist/typescript/components/type-declaration.d.cts.map +1 -1
  147. package/dist/typescript/components/type-declaration.d.mts +2 -2
  148. package/dist/typescript/components/type-declaration.d.mts.map +1 -1
  149. package/dist/typescript/components/typescript-file.cjs +2 -2
  150. package/dist/typescript/components/typescript-file.mjs +2 -2
  151. package/dist/typescript/contexts/lexical-scope.d.cts +2 -2
  152. package/dist/typescript/contexts/lexical-scope.d.cts.map +1 -1
  153. package/dist/typescript/contexts/lexical-scope.d.mts +2 -2
  154. package/dist/typescript/contexts/lexical-scope.d.mts.map +1 -1
  155. package/dist/typescript/index.cjs +0 -2
  156. package/dist/typescript/index.d.cts +1 -2
  157. package/dist/typescript/index.d.mts +1 -2
  158. package/dist/typescript/index.mjs +1 -2
  159. package/dist/yaml/components/yaml-file.cjs +1 -1
  160. package/dist/yaml/components/yaml-file.mjs +1 -1
  161. package/package.json +104 -20
  162. package/dist/typescript/components/infrastructure-file.cjs +0 -40
  163. package/dist/typescript/components/infrastructure-file.d.cts +0 -21
  164. package/dist/typescript/components/infrastructure-file.d.cts.map +0 -1
  165. package/dist/typescript/components/infrastructure-file.d.mts +0 -21
  166. package/dist/typescript/components/infrastructure-file.d.mts.map +0 -1
  167. package/dist/typescript/components/infrastructure-file.mjs +0 -38
  168. package/dist/typescript/components/infrastructure-file.mjs.map +0 -1
@@ -17,16 +17,26 @@ declare const ReflectionClassContext: ComponentContext<ReflectionClassContextInt
17
17
  * @returns A reactive version of the current reflection.
18
18
  */
19
19
  declare function useReflectionClass<T extends Record<string, any> = Record<string, any>>(): ReflectionClassContextInterface<T>;
20
+ interface ReflectionPropertyContextInterface {
21
+ property: ReflectionProperty;
22
+ defaultValue?: any;
23
+ }
20
24
  /**
21
25
  * The reflection property context used in template rendering.
22
26
  */
23
- declare const ReflectionPropertyContext: ComponentContext<ReflectionProperty>;
27
+ declare const ReflectionPropertyContext: ComponentContext<ReflectionPropertyContextInterface>;
28
+ /**
29
+ * Hook to access the Reflection Property context.
30
+ *
31
+ * @returns A reactive version of the current reflection.
32
+ */
33
+ declare function useReflectionPropertyContext(): ReflectionPropertyContextInterface;
24
34
  /**
25
35
  * Hook to access the Reflection Property context.
26
36
  *
27
37
  * @returns A reactive version of the current reflection.
28
38
  */
29
- declare function useReflectionProperty(): ReflectionProperty;
39
+ declare function useReflectionProperty(): ReflectionPropertyContextInterface;
30
40
  /**
31
41
  * The reflection method context used in template rendering.
32
42
  */
@@ -48,6 +58,7 @@ declare const ReflectionParameterContext: ComponentContext<ReflectionParameter>;
48
58
  */
49
59
  declare function useReflectionParameter(): ReflectionParameter;
50
60
  declare type __ΩReflectionClassContextInterface = any[];
61
+ declare type __ΩReflectionPropertyContextInterface = any[];
51
62
  //#endregion
52
- export { ReflectionClassContext, ReflectionClassContextInterface, ReflectionMethodContext, ReflectionParameterContext, ReflectionPropertyContext, __ΩReflectionClassContextInterface, useReflectionClass, useReflectionMethod, useReflectionParameter, useReflectionProperty };
63
+ export { ReflectionClassContext, ReflectionClassContextInterface, ReflectionMethodContext, ReflectionParameterContext, ReflectionPropertyContext, ReflectionPropertyContextInterface, __ΩReflectionClassContextInterface, __ΩReflectionPropertyContextInterface, useReflectionClass, useReflectionMethod, useReflectionParameter, useReflectionProperty, useReflectionPropertyContext };
53
64
  //# sourceMappingURL=reflection.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"reflection.d.mts","names":[],"sources":["../../../src/core/contexts/reflection.ts"],"mappings":";;;;;UA4BiB,+BAAA,WACL,MAAA,gBAAsB,MAAA;EAEhC,UAAA,EAAY,eAAA,CAAgB,CAAA;EAC5B,QAAA,GAAW,2BAAA,CAA4B,CAAA;AAAA;;;;cAM5B,sBAAA,EAAwB,gBAAA,CACnC,+BAAA;;;;;;iBAQc,kBAAA,WACJ,MAAA,gBAAsB,MAAA,cAAA,CAAA,GAAmB,+BAAA,CAAA,CAAA;;;;cAkBxC,yBAAA,EAA2B,gBAAA,CAAiB,kBAAA;;;;;;iBAQzC,qBAAA,CAAA,GAAqB,kBAAA;AApCrC;;;AAAA,cAmDa,uBAAA,EAAyB,gBAAA,CAAiB,gBAAA;;AA1CvD;;;;iBAkDgB,mBAAA,CAAA,GAAmB,gBAAA;;;;cAetB,0BAAA,EAA4B,gBAAA,CAAiB,mBAAA;;;;;;iBAQ1C,sBAAA,CAAA,GAAsB,mBAAA;AAAA"}
1
+ {"version":3,"file":"reflection.d.mts","names":[],"sources":["../../../src/core/contexts/reflection.ts"],"mappings":";;;;;UA4BiB,+BAAA,WACL,MAAA,gBAAsB,MAAA;EAEhC,UAAA,EAAY,eAAA,CAAgB,CAAA;EAC5B,QAAA,GAAW,2BAAA,CAA4B,CAAA;AAAA;;;;cAM5B,sBAAA,EAAwB,gBAAA,CACnC,+BAAA;;;;;;iBAQc,kBAAA,WACJ,MAAA,gBAAsB,MAAA,cAAA,CAAA,GAAmB,+BAAA,CAAA,CAAA;AAAA,UAepC,kCAAA;EACf,QAAA,EAAU,kBAAA;EACV,YAAA;AAAA;;;;cAMW,yBAAA,EAA2B,gBAAA,CAAiB,kCAAA;;;AAjCzD;;;iBAyCgB,4BAAA,CAAA,GAA4B,kCAAA;;AAhC5C;;;;iBAmDgB,qBAAA,CAAA,GAAqB,kCAAA;;;;cAexB,uBAAA,EAAyB,gBAAA,CAAiB,gBAAA;;;;;;iBAQvC,mBAAA,CAAA,GAAmB,gBAAA;;AA1DnC;;cAyEa,0BAAA,EAA4B,gBAAA,CAAiB,mBAAA;;;;;;iBAQ1C,sBAAA,CAAA,GAAsB,mBAAA;AAAA"}
@@ -24,12 +24,22 @@ const ReflectionPropertyContext = createNamedContext("ReflectionProperty");
24
24
  *
25
25
  * @returns A reactive version of the current reflection.
26
26
  */
27
- function useReflectionProperty() {
27
+ function useReflectionPropertyContext() {
28
28
  const context = useContext(ReflectionPropertyContext);
29
29
  if (!context) throw new Error("Powerlines - Reflection Property Context is not set. Please make sure the Alloy components are being provided to an invocation of the `render` function added to plugins by `@powerlines/plugin-alloy`.");
30
30
  return context;
31
31
  }
32
32
  /**
33
+ * Hook to access the Reflection Property context.
34
+ *
35
+ * @returns A reactive version of the current reflection.
36
+ */
37
+ function useReflectionProperty() {
38
+ const context = useReflectionPropertyContext();
39
+ if (!context) throw new Error("Powerlines - Reflection Property Context is not set. Please make sure the Alloy components are being provided to an invocation of the `render` function added to plugins by `@powerlines/plugin-alloy`.");
40
+ return context;
41
+ }
42
+ /**
33
43
  * The reflection method context used in template rendering.
34
44
  */
35
45
  const ReflectionMethodContext = createNamedContext("ReflectionMethod");
@@ -57,5 +67,5 @@ function useReflectionParameter() {
57
67
  }
58
68
 
59
69
  //#endregion
60
- export { ReflectionClassContext, ReflectionMethodContext, ReflectionParameterContext, ReflectionPropertyContext, useReflectionClass, useReflectionMethod, useReflectionParameter, useReflectionProperty };
70
+ export { ReflectionClassContext, ReflectionMethodContext, ReflectionParameterContext, ReflectionPropertyContext, useReflectionClass, useReflectionMethod, useReflectionParameter, useReflectionProperty, useReflectionPropertyContext };
61
71
  //# sourceMappingURL=reflection.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"reflection.mjs","names":[],"sources":["../../../src/core/contexts/reflection.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { ComponentContext } from \"@alloy-js/core\";\nimport { createContext, createNamedContext, useContext } from \"@alloy-js/core\";\nimport type {\n ReflectionClass,\n ReflectionMethod,\n ReflectionParameter,\n ReflectionProperty\n} from \"@powerlines/deepkit/vendor/type\";\nimport { ReflectionOverrideInterface } from \"../../types/components\";\n\nexport interface ReflectionClassContextInterface<\n T extends Record<string, any> = Record<string, any>\n> {\n reflection: ReflectionClass<T>;\n override?: ReflectionOverrideInterface<T>;\n}\n\n/**\n * The reflection class context used in template rendering.\n */\nexport const ReflectionClassContext: ComponentContext<\n ReflectionClassContextInterface<any>\n> = createContext<ReflectionClassContextInterface<any>>();\n\n/**\n * Hook to access the Reflection context.\n *\n * @returns A reactive version of the current reflection.\n */\nexport function useReflectionClass<\n T extends Record<string, any> = Record<string, any>\n>() {\n const context = useContext<ReflectionClassContextInterface<T>>(\n ReflectionClassContext\n )!;\n\n if (!context) {\n throw new Error(\n \"Powerlines - ReflectionClass Context is not set. Please make sure the Alloy components are being provided to an invocation of the `render` function added to plugins by `@powerlines/plugin-alloy`.\"\n );\n }\n\n return context;\n}\n\n/**\n * The reflection property context used in template rendering.\n */\nexport const ReflectionPropertyContext: ComponentContext<ReflectionProperty> =\n createNamedContext<ReflectionProperty>(\"ReflectionProperty\");\n\n/**\n * Hook to access the Reflection Property context.\n *\n * @returns A reactive version of the current reflection.\n */\nexport function useReflectionProperty() {\n const context = useContext<ReflectionProperty>(ReflectionPropertyContext)!;\n\n if (!context) {\n throw new Error(\n \"Powerlines - Reflection Property Context is not set. Please make sure the Alloy components are being provided to an invocation of the `render` function added to plugins by `@powerlines/plugin-alloy`.\"\n );\n }\n\n return context;\n}\n\n/**\n * The reflection method context used in template rendering.\n */\nexport const ReflectionMethodContext: ComponentContext<ReflectionMethod> =\n createNamedContext<ReflectionMethod>(\"ReflectionMethod\");\n\n/**\n * Hook to access the Reflection Method context.\n *\n * @returns A reactive version of the current reflection.\n */\nexport function useReflectionMethod() {\n const context = useContext<ReflectionMethod>(ReflectionMethodContext)!;\n\n if (!context) {\n throw new Error(\n \"Powerlines - Reflection Method Context is not set. Please make sure the Alloy components are being provided to an invocation of the `render` function added to plugins by `@powerlines/plugin-alloy`.\"\n );\n }\n\n return context;\n}\n\n/**\n * The reflection parameter context used in template rendering.\n */\nexport const ReflectionParameterContext: ComponentContext<ReflectionParameter> =\n createNamedContext<ReflectionParameter>(\"ReflectionParameter\");\n\n/**\n * Hook to access the Reflection Parameter context.\n *\n * @returns A reactive version of the current reflection.\n */\nexport function useReflectionParameter() {\n return useContext<ReflectionParameter>(ReflectionParameterContext)!;\n}\n"],"mappings":";;;;;;AAsCA,MAAa,yBAET,eAAqD;;;;;;AAOzD,SAAgB,qBAEZ;CACF,MAAM,UAAU,WACd,uBACD;AAED,KAAI,CAAC,QACH,OAAM,IAAI,MACR,sMACD;AAGH,QAAO;;;;;AAMT,MAAa,4BACX,mBAAuC,qBAAqB;;;;;;AAO9D,SAAgB,wBAAwB;CACtC,MAAM,UAAU,WAA+B,0BAA0B;AAEzE,KAAI,CAAC,QACH,OAAM,IAAI,MACR,0MACD;AAGH,QAAO;;;;;AAMT,MAAa,0BACX,mBAAqC,mBAAmB;;;;;;AAO1D,SAAgB,sBAAsB;CACpC,MAAM,UAAU,WAA6B,wBAAwB;AAErE,KAAI,CAAC,QACH,OAAM,IAAI,MACR,wMACD;AAGH,QAAO;;;;;AAMT,MAAa,6BACX,mBAAwC,sBAAsB;;;;;;AAOhE,SAAgB,yBAAyB;AACvC,QAAO,WAAgC,2BAA2B"}
1
+ {"version":3,"file":"reflection.mjs","names":[],"sources":["../../../src/core/contexts/reflection.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { ComponentContext } from \"@alloy-js/core\";\nimport { createContext, createNamedContext, useContext } from \"@alloy-js/core\";\nimport type {\n ReflectionClass,\n ReflectionMethod,\n ReflectionParameter,\n ReflectionProperty\n} from \"@powerlines/deepkit/vendor/type\";\nimport { ReflectionOverrideInterface } from \"../../types/components\";\n\nexport interface ReflectionClassContextInterface<\n T extends Record<string, any> = Record<string, any>\n> {\n reflection: ReflectionClass<T>;\n override?: ReflectionOverrideInterface<T>;\n}\n\n/**\n * The reflection class context used in template rendering.\n */\nexport const ReflectionClassContext: ComponentContext<\n ReflectionClassContextInterface<any>\n> = createContext<ReflectionClassContextInterface<any>>();\n\n/**\n * Hook to access the Reflection context.\n *\n * @returns A reactive version of the current reflection.\n */\nexport function useReflectionClass<\n T extends Record<string, any> = Record<string, any>\n>() {\n const context = useContext<ReflectionClassContextInterface<T>>(\n ReflectionClassContext\n )!;\n\n if (!context) {\n throw new Error(\n \"Powerlines - ReflectionClass Context is not set. Please make sure the Alloy components are being provided to an invocation of the `render` function added to plugins by `@powerlines/plugin-alloy`.\"\n );\n }\n\n return context;\n}\n\nexport interface ReflectionPropertyContextInterface {\n property: ReflectionProperty;\n defaultValue?: any;\n}\n\n/**\n * The reflection property context used in template rendering.\n */\nexport const ReflectionPropertyContext: ComponentContext<ReflectionPropertyContextInterface> =\n createNamedContext<ReflectionPropertyContextInterface>(\"ReflectionProperty\");\n\n/**\n * Hook to access the Reflection Property context.\n *\n * @returns A reactive version of the current reflection.\n */\nexport function useReflectionPropertyContext() {\n const context = useContext<ReflectionPropertyContextInterface>(\n ReflectionPropertyContext\n )!;\n\n if (!context) {\n throw new Error(\n \"Powerlines - Reflection Property Context is not set. Please make sure the Alloy components are being provided to an invocation of the `render` function added to plugins by `@powerlines/plugin-alloy`.\"\n );\n }\n\n return context;\n}\n\n/**\n * Hook to access the Reflection Property context.\n *\n * @returns A reactive version of the current reflection.\n */\nexport function useReflectionProperty() {\n const context = useReflectionPropertyContext();\n\n if (!context) {\n throw new Error(\n \"Powerlines - Reflection Property Context is not set. Please make sure the Alloy components are being provided to an invocation of the `render` function added to plugins by `@powerlines/plugin-alloy`.\"\n );\n }\n\n return context;\n}\n\n/**\n * The reflection method context used in template rendering.\n */\nexport const ReflectionMethodContext: ComponentContext<ReflectionMethod> =\n createNamedContext<ReflectionMethod>(\"ReflectionMethod\");\n\n/**\n * Hook to access the Reflection Method context.\n *\n * @returns A reactive version of the current reflection.\n */\nexport function useReflectionMethod() {\n const context = useContext<ReflectionMethod>(ReflectionMethodContext)!;\n\n if (!context) {\n throw new Error(\n \"Powerlines - Reflection Method Context is not set. Please make sure the Alloy components are being provided to an invocation of the `render` function added to plugins by `@powerlines/plugin-alloy`.\"\n );\n }\n\n return context;\n}\n\n/**\n * The reflection parameter context used in template rendering.\n */\nexport const ReflectionParameterContext: ComponentContext<ReflectionParameter> =\n createNamedContext<ReflectionParameter>(\"ReflectionParameter\");\n\n/**\n * Hook to access the Reflection Parameter context.\n *\n * @returns A reactive version of the current reflection.\n */\nexport function useReflectionParameter() {\n return useContext<ReflectionParameter>(ReflectionParameterContext)!;\n}\n"],"mappings":";;;;;;AAsCA,MAAa,yBAET,eAAqD;;;;;;AAOzD,SAAgB,qBAEZ;CACF,MAAM,UAAU,WACd,uBACD;AAED,KAAI,CAAC,QACH,OAAM,IAAI,MACR,sMACD;AAGH,QAAO;;;;;AAWT,MAAa,4BACX,mBAAuD,qBAAqB;;;;;;AAO9E,SAAgB,+BAA+B;CAC7C,MAAM,UAAU,WACd,0BACD;AAED,KAAI,CAAC,QACH,OAAM,IAAI,MACR,0MACD;AAGH,QAAO;;;;;;;AAQT,SAAgB,wBAAwB;CACtC,MAAM,UAAU,8BAA8B;AAE9C,KAAI,CAAC,QACH,OAAM,IAAI,MACR,0MACD;AAGH,QAAO;;;;;AAMT,MAAa,0BACX,mBAAqC,mBAAmB;;;;;;AAO1D,SAAgB,sBAAsB;CACpC,MAAM,UAAU,WAA6B,wBAAwB;AAErE,KAAI,CAAC,QACH,OAAM,IAAI,MACR,wMACD;AAGH,QAAO;;;;;AAMT,MAAa,6BACX,mBAAwC,sBAAsB;;;;;;AAOhE,SAAgB,yBAAyB;AACvC,QAAO,WAAgC,2BAA2B"}
@@ -1,16 +1,18 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_core_contexts_context = require('./contexts/context.cjs');
3
3
  const require_core_contexts_meta = require('./contexts/meta.cjs');
4
+ const require_core_components_source_file = require('./components/source-file.cjs');
5
+ const require_core_components_infrastructure_file = require('./components/infrastructure-file.cjs');
4
6
  const require_core_contexts_reflection = require('./contexts/reflection.cjs');
5
7
  require('./contexts/index.cjs');
6
8
  const require_core_components_output = require('./components/output.cjs');
7
9
  const require_core_components_single_line_comment = require('./components/single-line-comment.cjs');
8
- const require_core_components_source_file = require('./components/source-file.cjs');
9
10
  const require_core_components_spacing = require('./components/spacing.cjs');
10
11
  require('./components/index.cjs');
11
12
  const require_core_helpers_code = require('./helpers/code.cjs');
12
13
  require('./helpers/index.cjs');
13
14
 
15
+ exports.InfrastructureFile = require_core_components_infrastructure_file.InfrastructureFile;
14
16
  exports.MetaContext = require_core_contexts_meta.MetaContext;
15
17
  exports.Output = require_core_components_output.Output;
16
18
  exports.PowerlinesContext = require_core_contexts_context.PowerlinesContext;
@@ -31,4 +33,5 @@ exports.usePowerlinesSafe = require_core_contexts_context.usePowerlinesSafe;
31
33
  exports.useReflectionClass = require_core_contexts_reflection.useReflectionClass;
32
34
  exports.useReflectionMethod = require_core_contexts_reflection.useReflectionMethod;
33
35
  exports.useReflectionParameter = require_core_contexts_reflection.useReflectionParameter;
34
- exports.useReflectionProperty = require_core_contexts_reflection.useReflectionProperty;
36
+ exports.useReflectionProperty = require_core_contexts_reflection.useReflectionProperty;
37
+ exports.useReflectionPropertyContext = require_core_contexts_reflection.useReflectionPropertyContext;
@@ -1,9 +1,10 @@
1
+ import { SourceFile, SourceFileProps, __ΩSourceFileProps } from "./components/source-file.cjs";
2
+ import { InfrastructureFile, InfrastructureFileProps, __ΩInfrastructureFileProps } from "./components/infrastructure-file.cjs";
1
3
  import { PowerlinesContext, usePowerlines, usePowerlinesContext, usePowerlinesSafe } from "./contexts/context.cjs";
2
4
  import { MetaContext, MetaItem, __ΩMetaItem, useMeta, useMetaContext, useMetaSafe } from "./contexts/meta.cjs";
3
- import { ReflectionClassContext, ReflectionClassContextInterface, ReflectionMethodContext, ReflectionParameterContext, ReflectionPropertyContext, __ΩReflectionClassContextInterface, useReflectionClass, useReflectionMethod, useReflectionParameter, useReflectionProperty } from "./contexts/reflection.cjs";
5
+ import { ReflectionClassContext, ReflectionClassContextInterface, ReflectionMethodContext, ReflectionParameterContext, ReflectionPropertyContext, ReflectionPropertyContextInterface, __ΩReflectionClassContextInterface, __ΩReflectionPropertyContextInterface, useReflectionClass, useReflectionMethod, useReflectionParameter, useReflectionProperty, useReflectionPropertyContext } from "./contexts/reflection.cjs";
4
6
  import { Output, OutputProps, __ΩOutputProps } from "./components/output.cjs";
5
7
  import { SingleLineComment, SingleLineCommentProps, SingleLineCommentVariant, __ΩSingleLineCommentProps, __ΩSingleLineCommentVariant } from "./components/single-line-comment.cjs";
6
- import { SourceFile, SourceFileProps, __ΩSourceFileProps } from "./components/source-file.cjs";
7
8
  import { Spacing, SpacingProps, __ΩSpacingProps } from "./components/spacing.cjs";
8
9
  import { code } from "./helpers/code.cjs";
9
- export { MetaContext, MetaItem, Output, OutputProps, PowerlinesContext, ReflectionClassContext, ReflectionClassContextInterface, ReflectionMethodContext, ReflectionParameterContext, ReflectionPropertyContext, SingleLineComment, SingleLineCommentProps, SingleLineCommentVariant, SourceFile, SourceFileProps, Spacing, SpacingProps, __ΩMetaItem, __ΩOutputProps, __ΩReflectionClassContextInterface, __ΩSingleLineCommentProps, __ΩSingleLineCommentVariant, __ΩSourceFileProps, __ΩSpacingProps, code, useMeta, useMetaContext, useMetaSafe, usePowerlines, usePowerlinesContext, usePowerlinesSafe, useReflectionClass, useReflectionMethod, useReflectionParameter, useReflectionProperty };
10
+ export { InfrastructureFile, InfrastructureFileProps, MetaContext, MetaItem, Output, OutputProps, PowerlinesContext, ReflectionClassContext, ReflectionClassContextInterface, ReflectionMethodContext, ReflectionParameterContext, ReflectionPropertyContext, ReflectionPropertyContextInterface, SingleLineComment, SingleLineCommentProps, SingleLineCommentVariant, SourceFile, SourceFileProps, Spacing, SpacingProps, __ΩInfrastructureFileProps, __ΩMetaItem, __ΩOutputProps, __ΩReflectionClassContextInterface, __ΩReflectionPropertyContextInterface, __ΩSingleLineCommentProps, __ΩSingleLineCommentVariant, __ΩSourceFileProps, __ΩSpacingProps, code, useMeta, useMetaContext, useMetaSafe, usePowerlines, usePowerlinesContext, usePowerlinesSafe, useReflectionClass, useReflectionMethod, useReflectionParameter, useReflectionProperty, useReflectionPropertyContext };
@@ -1,9 +1,10 @@
1
+ import { SourceFile, SourceFileProps, __ΩSourceFileProps } from "./components/source-file.mjs";
2
+ import { InfrastructureFile, InfrastructureFileProps, __ΩInfrastructureFileProps } from "./components/infrastructure-file.mjs";
1
3
  import { PowerlinesContext, usePowerlines, usePowerlinesContext, usePowerlinesSafe } from "./contexts/context.mjs";
2
4
  import { MetaContext, MetaItem, __ΩMetaItem, useMeta, useMetaContext, useMetaSafe } from "./contexts/meta.mjs";
3
- import { ReflectionClassContext, ReflectionClassContextInterface, ReflectionMethodContext, ReflectionParameterContext, ReflectionPropertyContext, __ΩReflectionClassContextInterface, useReflectionClass, useReflectionMethod, useReflectionParameter, useReflectionProperty } from "./contexts/reflection.mjs";
5
+ import { ReflectionClassContext, ReflectionClassContextInterface, ReflectionMethodContext, ReflectionParameterContext, ReflectionPropertyContext, ReflectionPropertyContextInterface, __ΩReflectionClassContextInterface, __ΩReflectionPropertyContextInterface, useReflectionClass, useReflectionMethod, useReflectionParameter, useReflectionProperty, useReflectionPropertyContext } from "./contexts/reflection.mjs";
4
6
  import { Output, OutputProps, __ΩOutputProps } from "./components/output.mjs";
5
7
  import { SingleLineComment, SingleLineCommentProps, SingleLineCommentVariant, __ΩSingleLineCommentProps, __ΩSingleLineCommentVariant } from "./components/single-line-comment.mjs";
6
- import { SourceFile, SourceFileProps, __ΩSourceFileProps } from "./components/source-file.mjs";
7
8
  import { Spacing, SpacingProps, __ΩSpacingProps } from "./components/spacing.mjs";
8
9
  import { code } from "./helpers/code.mjs";
9
- export { MetaContext, MetaItem, Output, OutputProps, PowerlinesContext, ReflectionClassContext, ReflectionClassContextInterface, ReflectionMethodContext, ReflectionParameterContext, ReflectionPropertyContext, SingleLineComment, SingleLineCommentProps, SingleLineCommentVariant, SourceFile, SourceFileProps, Spacing, SpacingProps, __ΩMetaItem, __ΩOutputProps, __ΩReflectionClassContextInterface, __ΩSingleLineCommentProps, __ΩSingleLineCommentVariant, __ΩSourceFileProps, __ΩSpacingProps, code, useMeta, useMetaContext, useMetaSafe, usePowerlines, usePowerlinesContext, usePowerlinesSafe, useReflectionClass, useReflectionMethod, useReflectionParameter, useReflectionProperty };
10
+ export { InfrastructureFile, InfrastructureFileProps, MetaContext, MetaItem, Output, OutputProps, PowerlinesContext, ReflectionClassContext, ReflectionClassContextInterface, ReflectionMethodContext, ReflectionParameterContext, ReflectionPropertyContext, ReflectionPropertyContextInterface, SingleLineComment, SingleLineCommentProps, SingleLineCommentVariant, SourceFile, SourceFileProps, Spacing, SpacingProps, __ΩInfrastructureFileProps, __ΩMetaItem, __ΩOutputProps, __ΩReflectionClassContextInterface, __ΩReflectionPropertyContextInterface, __ΩSingleLineCommentProps, __ΩSingleLineCommentVariant, __ΩSourceFileProps, __ΩSpacingProps, code, useMeta, useMetaContext, useMetaSafe, usePowerlines, usePowerlinesContext, usePowerlinesSafe, useReflectionClass, useReflectionMethod, useReflectionParameter, useReflectionProperty, useReflectionPropertyContext };
@@ -1,13 +1,14 @@
1
1
  import { PowerlinesContext, usePowerlines, usePowerlinesContext, usePowerlinesSafe } from "./contexts/context.mjs";
2
2
  import { MetaContext, useMeta, useMetaContext, useMetaSafe } from "./contexts/meta.mjs";
3
- import { ReflectionClassContext, ReflectionMethodContext, ReflectionParameterContext, ReflectionPropertyContext, useReflectionClass, useReflectionMethod, useReflectionParameter, useReflectionProperty } from "./contexts/reflection.mjs";
3
+ import { SourceFile } from "./components/source-file.mjs";
4
+ import { InfrastructureFile } from "./components/infrastructure-file.mjs";
5
+ import { ReflectionClassContext, ReflectionMethodContext, ReflectionParameterContext, ReflectionPropertyContext, useReflectionClass, useReflectionMethod, useReflectionParameter, useReflectionProperty, useReflectionPropertyContext } from "./contexts/reflection.mjs";
4
6
  import "./contexts/index.mjs";
5
7
  import { Output } from "./components/output.mjs";
6
8
  import { SingleLineComment } from "./components/single-line-comment.mjs";
7
- import { SourceFile } from "./components/source-file.mjs";
8
9
  import { Spacing } from "./components/spacing.mjs";
9
10
  import "./components/index.mjs";
10
11
  import { code } from "./helpers/code.mjs";
11
12
  import "./helpers/index.mjs";
12
13
 
13
- export { MetaContext, Output, PowerlinesContext, ReflectionClassContext, ReflectionMethodContext, ReflectionParameterContext, ReflectionPropertyContext, SingleLineComment, SourceFile, Spacing, code, useMeta, useMetaContext, useMetaSafe, usePowerlines, usePowerlinesContext, usePowerlinesSafe, useReflectionClass, useReflectionMethod, useReflectionParameter, useReflectionProperty };
14
+ export { InfrastructureFile, MetaContext, Output, PowerlinesContext, ReflectionClassContext, ReflectionMethodContext, ReflectionParameterContext, ReflectionPropertyContext, SingleLineComment, SourceFile, Spacing, code, useMeta, useMetaContext, useMetaSafe, usePowerlines, usePowerlinesContext, usePowerlinesSafe, useReflectionClass, useReflectionMethod, useReflectionParameter, useReflectionProperty, useReflectionPropertyContext };
@@ -0,0 +1,34 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
3
+ const require_core_helpers_code = require('../../core/helpers/code.cjs');
4
+ let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
5
+ let _alloy_js_core = require("@alloy-js/core");
6
+
7
+ //#region src/hcl/components/block-declaration.tsx
8
+ /**
9
+ * 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
+ *
11
+ * @see https://developer.hashicorp.com/terraform/language#about-the-terraform-language
12
+ * @see https://opentofu.org/docs/language/attr-as-blocks/#summary
13
+ *
14
+ * @param props - The properties for the source file.
15
+ * @returns The rendered source file component.
16
+ */
17
+ function BlockDeclaration(props) {
18
+ const { children, type, label } = props;
19
+ return [
20
+ (0, _alloy_js_core_jsx_runtime.memo)(() => require_core_helpers_code.code`${type} ${Array.isArray(label) ? label.join(" ") : label} {`),
21
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Prose, { get children() {
22
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
23
+ get when() {
24
+ return Boolean(children);
25
+ },
26
+ children
27
+ });
28
+ } }),
29
+ require_core_helpers_code.code`} `
30
+ ];
31
+ }
32
+
33
+ //#endregion
34
+ exports.BlockDeclaration = BlockDeclaration;
@@ -0,0 +1,22 @@
1
+ import { ComponentProps } from "../../types/components.cjs";
2
+ import * as _$_alloy_js_core0 from "@alloy-js/core";
3
+
4
+ //#region src/hcl/components/block-declaration.d.ts
5
+ interface BlockDeclarationProps extends ComponentProps {
6
+ type: string;
7
+ label: string | string[];
8
+ }
9
+ /**
10
+ * 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.
11
+ *
12
+ * @see https://developer.hashicorp.com/terraform/language#about-the-terraform-language
13
+ * @see https://opentofu.org/docs/language/attr-as-blocks/#summary
14
+ *
15
+ * @param props - The properties for the source file.
16
+ * @returns The rendered source file component.
17
+ */
18
+ declare function BlockDeclaration(props: BlockDeclarationProps): _$_alloy_js_core0.Children;
19
+ declare type __ΩBlockDeclarationProps = any[];
20
+ //#endregion
21
+ export { BlockDeclaration, BlockDeclarationProps, __ΩBlockDeclarationProps };
22
+ //# sourceMappingURL=block-declaration.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"block-declaration.d.cts","names":[],"sources":["../../../src/hcl/components/block-declaration.tsx"],"mappings":";;;;UAsBiB,qBAAA,SAA8B,cAAA;EAC7C,IAAA;EACA,KAAA;AAAA;;;;;;;;;AAYF;iBAAgB,gBAAA,CAAiB,KAAA,EAAO,qBAAA,GAAqB,iBAAA,CAAA,QAAA;AAAA"}
@@ -0,0 +1,22 @@
1
+ import { ComponentProps } from "../../types/components.mjs";
2
+ import * as _$_alloy_js_core0 from "@alloy-js/core";
3
+
4
+ //#region src/hcl/components/block-declaration.d.ts
5
+ interface BlockDeclarationProps extends ComponentProps {
6
+ type: string;
7
+ label: string | string[];
8
+ }
9
+ /**
10
+ * 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.
11
+ *
12
+ * @see https://developer.hashicorp.com/terraform/language#about-the-terraform-language
13
+ * @see https://opentofu.org/docs/language/attr-as-blocks/#summary
14
+ *
15
+ * @param props - The properties for the source file.
16
+ * @returns The rendered source file component.
17
+ */
18
+ declare function BlockDeclaration(props: BlockDeclarationProps): _$_alloy_js_core0.Children;
19
+ declare type __ΩBlockDeclarationProps = any[];
20
+ //#endregion
21
+ export { BlockDeclaration, BlockDeclarationProps, __ΩBlockDeclarationProps };
22
+ //# sourceMappingURL=block-declaration.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"block-declaration.d.mts","names":[],"sources":["../../../src/hcl/components/block-declaration.tsx"],"mappings":";;;;UAsBiB,qBAAA,SAA8B,cAAA;EAC7C,IAAA;EACA,KAAA;AAAA;;;;;;;;;AAYF;iBAAgB,gBAAA,CAAiB,KAAA,EAAO,qBAAA,GAAqB,iBAAA,CAAA,QAAA;AAAA"}
@@ -0,0 +1,33 @@
1
+ import { code as code$1 } from "../../core/helpers/code.mjs";
2
+ import { createComponent, memo } from "@alloy-js/core/jsx-runtime";
3
+ import { Prose, Show } from "@alloy-js/core";
4
+
5
+ //#region src/hcl/components/block-declaration.tsx
6
+ /**
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.
8
+ *
9
+ * @see https://developer.hashicorp.com/terraform/language#about-the-terraform-language
10
+ * @see https://opentofu.org/docs/language/attr-as-blocks/#summary
11
+ *
12
+ * @param props - The properties for the source file.
13
+ * @returns The rendered source file component.
14
+ */
15
+ function BlockDeclaration(props) {
16
+ const { children, type, label } = props;
17
+ return [
18
+ memo(() => code$1`${type} ${Array.isArray(label) ? label.join(" ") : label} {`),
19
+ createComponent(Prose, { get children() {
20
+ return createComponent(Show, {
21
+ get when() {
22
+ return Boolean(children);
23
+ },
24
+ children
25
+ });
26
+ } }),
27
+ code$1`} `
28
+ ];
29
+ }
30
+
31
+ //#endregion
32
+ export { BlockDeclaration };
33
+ //# sourceMappingURL=block-declaration.mjs.map
@@ -0,0 +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":";;;;;;;;;;;;;;AAoCA,SAAgB,iBAAiB,OAA8B;CAC7D,MAAM,YAEN,MACE,UACE;AACJ,QAAK;EAAA,WAAK,MAAA,GAAA,KAAA,GAAA,MAAA,QAAA,MAAA,GAAA,MAAA,KAAA,IAAA,GAAA,MAAA,IAAA;EAAA,gBAAA,OAAA,EACR,IAAI,WAAW;AACb,UAAO,gBAAA,MAAA;IACN,IAAK,OAAG;AACT,YAAA,QAAA,SAAA;;IAEN"}
@@ -0,0 +1,83 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
3
+ const require_core_contexts_context = require('../../core/contexts/context.cjs');
4
+ const require_core_components_infrastructure_file = require('../../core/components/infrastructure-file.cjs');
5
+ const require_core_components_single_line_comment = require('../../core/components/single-line-comment.cjs');
6
+ let _stryke_path_file_path_fns = require("@stryke/path/file-path-fns");
7
+ let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
8
+ let _alloy_js_core = require("@alloy-js/core");
9
+ let _stryke_string_format_title_case = require("@stryke/string-format/title-case");
10
+ let powerlines_utils = require("powerlines/utils");
11
+
12
+ //#region src/hcl/components/hcl-file.tsx
13
+ /**
14
+ * A base component representing a Powerlines generated HCL source file.
15
+ *
16
+ * @param props - The properties for the source file.
17
+ * @returns The rendered source file component.
18
+ */
19
+ function HCLFile(props) {
20
+ const [{ children, storage, header, filetype: _filetype, id }, rest] = (0, _alloy_js_core.splitProps)(props, [
21
+ "children",
22
+ "storage",
23
+ "header",
24
+ "filetype",
25
+ "id"
26
+ ]);
27
+ const filetype = (0, _alloy_js_core.computed)(() => _filetype || (0, _stryke_path_file_path_fns.findFileExtension)(id) || "hcl");
28
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(require_core_components_infrastructure_file.InfrastructureFile, (0, _alloy_js_core_jsx_runtime.mergeProps)({ get header() {
29
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(HCLFileHeader, { children: header });
30
+ } }, rest, {
31
+ id,
32
+ get filetype() {
33
+ return filetype.value;
34
+ },
35
+ storage: storage || "fs",
36
+ get children() {
37
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
38
+ get when() {
39
+ return Boolean(children);
40
+ },
41
+ children
42
+ });
43
+ }
44
+ }));
45
+ }
46
+ /**
47
+ * Renders the header for a Powerlines HCL source file.
48
+ *
49
+ * @param props - The properties for the source file header.
50
+ * @returns The rendered source file header.
51
+ */
52
+ function HCLFileHeader(props) {
53
+ const [{ children }] = (0, _alloy_js_core.splitProps)(props, ["children"]);
54
+ const context = require_core_contexts_context.usePowerlines();
55
+ return [
56
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
57
+ get when() {
58
+ return Boolean(children);
59
+ },
60
+ get children() {
61
+ return [children, (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})];
62
+ }
63
+ }),
64
+ (0, _alloy_js_core_jsx_runtime.createComponent)(require_core_components_single_line_comment.SingleLineComment, {
65
+ variant: "hcl",
66
+ get children() {
67
+ return `Generated by ${(0, _stryke_string_format_title_case.titleCase)(context?.config?.framework) || "Powerlines"}`;
68
+ }
69
+ }),
70
+ (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
71
+ (0, _alloy_js_core_jsx_runtime.createComponent)(require_core_components_single_line_comment.SingleLineComment, {
72
+ variant: "hcl",
73
+ get children() {
74
+ return (0, powerlines_utils.getFileHeaderWarning)(context);
75
+ }
76
+ }),
77
+ (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
78
+ ];
79
+ }
80
+
81
+ //#endregion
82
+ exports.HCLFile = HCLFile;
83
+ exports.HCLFileHeader = HCLFileHeader;
@@ -0,0 +1,27 @@
1
+ import { ComponentProps } from "../../types/components.cjs";
2
+ import { InfrastructureFileProps } from "../../core/components/infrastructure-file.cjs";
3
+ import { Children } from "@alloy-js/core";
4
+
5
+ //#region src/hcl/components/hcl-file.d.ts
6
+ type HCLFileProps = Omit<InfrastructureFileProps, "header" | "filetype"> & ComponentProps & {
7
+ header?: Children;
8
+ filetype?: "hcl" | "tf" | `${string}.hcl` | `${string}.tf`;
9
+ };
10
+ /**
11
+ * A base component representing a Powerlines generated HCL source file.
12
+ *
13
+ * @param props - The properties for the source file.
14
+ * @returns The rendered source file component.
15
+ */
16
+ declare function HCLFile(props: HCLFileProps): Children;
17
+ /**
18
+ * Renders the header for a Powerlines HCL source file.
19
+ *
20
+ * @param props - The properties for the source file header.
21
+ * @returns The rendered source file header.
22
+ */
23
+ declare function HCLFileHeader(props: ComponentProps): Children;
24
+ declare type __ΩHCLFileProps = any[];
25
+ //#endregion
26
+ export { HCLFile, HCLFileHeader, HCLFileProps, __ΩHCLFileProps };
27
+ //# sourceMappingURL=hcl-file.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hcl-file.d.cts","names":[],"sources":["../../../src/hcl/components/hcl-file.tsx"],"mappings":";;;;;KA8BY,YAAA,GAAe,IAAA,CACzB,uBAAA,2BAGA,cAAA;EACE,MAAA,GAAS,QAAA;EACT,QAAA;AAAA;;;;;;;iBASY,OAAA,CAAQ,KAAA,EAAO,YAAA,GAAY,QAAA;;;;;;;iBAwB3B,aAAA,CAAc,KAAA,EAAO,cAAA,GAAc,QAAA;AAAA"}
@@ -0,0 +1,27 @@
1
+ import { ComponentProps } from "../../types/components.mjs";
2
+ import { InfrastructureFileProps } from "../../core/components/infrastructure-file.mjs";
3
+ import { Children } from "@alloy-js/core";
4
+
5
+ //#region src/hcl/components/hcl-file.d.ts
6
+ type HCLFileProps = Omit<InfrastructureFileProps, "header" | "filetype"> & ComponentProps & {
7
+ header?: Children;
8
+ filetype?: "hcl" | "tf" | `${string}.hcl` | `${string}.tf`;
9
+ };
10
+ /**
11
+ * A base component representing a Powerlines generated HCL source file.
12
+ *
13
+ * @param props - The properties for the source file.
14
+ * @returns The rendered source file component.
15
+ */
16
+ declare function HCLFile(props: HCLFileProps): Children;
17
+ /**
18
+ * Renders the header for a Powerlines HCL source file.
19
+ *
20
+ * @param props - The properties for the source file header.
21
+ * @returns The rendered source file header.
22
+ */
23
+ declare function HCLFileHeader(props: ComponentProps): Children;
24
+ declare type __ΩHCLFileProps = any[];
25
+ //#endregion
26
+ export { HCLFile, HCLFileHeader, HCLFileProps, __ΩHCLFileProps };
27
+ //# sourceMappingURL=hcl-file.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hcl-file.d.mts","names":[],"sources":["../../../src/hcl/components/hcl-file.tsx"],"mappings":";;;;;KA8BY,YAAA,GAAe,IAAA,CACzB,uBAAA,2BAGA,cAAA;EACE,MAAA,GAAS,QAAA;EACT,QAAA;AAAA;;;;;;;iBASY,OAAA,CAAQ,KAAA,EAAO,YAAA,GAAY,QAAA;;;;;;;iBAwB3B,aAAA,CAAc,KAAA,EAAO,cAAA,GAAc,QAAA;AAAA"}
@@ -0,0 +1,81 @@
1
+ import { usePowerlines } from "../../core/contexts/context.mjs";
2
+ import { InfrastructureFile } from "../../core/components/infrastructure-file.mjs";
3
+ import { SingleLineComment } from "../../core/components/single-line-comment.mjs";
4
+ import { findFileExtension } from "@stryke/path/file-path-fns";
5
+ import { createComponent, createIntrinsic, mergeProps } from "@alloy-js/core/jsx-runtime";
6
+ import { Show, computed, splitProps } from "@alloy-js/core";
7
+ import { titleCase } from "@stryke/string-format/title-case";
8
+ import { getFileHeaderWarning } from "powerlines/utils";
9
+
10
+ //#region src/hcl/components/hcl-file.tsx
11
+ /**
12
+ * A base component representing a Powerlines generated HCL source file.
13
+ *
14
+ * @param props - The properties for the source file.
15
+ * @returns The rendered source file component.
16
+ */
17
+ function HCLFile(props) {
18
+ const [{ children, storage, header, filetype: _filetype, id }, rest] = splitProps(props, [
19
+ "children",
20
+ "storage",
21
+ "header",
22
+ "filetype",
23
+ "id"
24
+ ]);
25
+ const filetype = computed(() => _filetype || findFileExtension(id) || "hcl");
26
+ return createComponent(InfrastructureFile, mergeProps({ get header() {
27
+ return createComponent(HCLFileHeader, { children: header });
28
+ } }, rest, {
29
+ id,
30
+ get filetype() {
31
+ return filetype.value;
32
+ },
33
+ storage: storage || "fs",
34
+ get children() {
35
+ return createComponent(Show, {
36
+ get when() {
37
+ return Boolean(children);
38
+ },
39
+ children
40
+ });
41
+ }
42
+ }));
43
+ }
44
+ /**
45
+ * Renders the header for a Powerlines HCL source file.
46
+ *
47
+ * @param props - The properties for the source file header.
48
+ * @returns The rendered source file header.
49
+ */
50
+ function HCLFileHeader(props) {
51
+ const [{ children }] = splitProps(props, ["children"]);
52
+ const context = usePowerlines();
53
+ return [
54
+ createComponent(Show, {
55
+ get when() {
56
+ return Boolean(children);
57
+ },
58
+ get children() {
59
+ return [children, createIntrinsic("hbr", {})];
60
+ }
61
+ }),
62
+ createComponent(SingleLineComment, {
63
+ variant: "hcl",
64
+ get children() {
65
+ return `Generated by ${titleCase(context?.config?.framework) || "Powerlines"}`;
66
+ }
67
+ }),
68
+ createIntrinsic("hbr", {}),
69
+ createComponent(SingleLineComment, {
70
+ variant: "hcl",
71
+ get children() {
72
+ return getFileHeaderWarning(context);
73
+ }
74
+ }),
75
+ createIntrinsic("hbr", {})
76
+ ];
77
+ }
78
+
79
+ //#endregion
80
+ export { HCLFile, HCLFileHeader };
81
+ //# sourceMappingURL=hcl-file.mjs.map
@@ -0,0 +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) || \"Powerlines\"\n }`}</SingleLineComment>\n <hbr />\n <SingleLineComment variant=\"hcl\">\n {getFileHeaderWarning(context)}\n </SingleLineComment>\n <hbr />\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;CAuCE,MAAA,CAAA,EACE,UACH,SACG,QACA,UAAQ,WACV,MACF,QAAO,WAAiB,OAAO;EAAA;EAAa;EAAC;EAAA;EAAA;EAAA,CAAA;CAC3C,MAAM,WAAW,eAAW,aAAiB,kBAAkB,GAAA,IAAM,MAAA;AACrE,QAAE,gBAAoB,oBAAuB,WAAU;AAEvD,SAAM,gBAAuB,eAAe,oBAE5C,CAAM;IAEL,EAAE,MAAC;EACE;EACJ,IAAI,WAAI;AACN,UAAA,SAAU;;EAEZ,SAAQ,WAAM;EACd,IAAE,WAAA;AACH,UAAA,gBAAA,MAAA;IACH,IAAA,OAAA;;;IAGe;IACd,CAAA;;EAEE,CAAC,CAAA;;;;;;;;AASJ,SAAgB,cAAU,OAAU;CAClC,MAAM,CAAC,EACL,cACG,WAAS,OAAA,CAAA,WAAA,CAAA;CACd,MAAM,UAAE,eAAA;AACR,QAAM;EAAA,gBAAI,MAAA;GACR,IAAG,OAAA;AACD,WAAE,QAAU,SAAS;;GAEvB,IAAG,WAAK;AACN,WAAC,CAAA,UAAiB,gBAAc,OAAA,EAAA,CAAA,CAAA;;GAEnC,CAAC;EAAE,gBAAE,mBAAiB;GACrB,SAAQ;GACR,IAAE,WAAA;AACH,WAAA,gBAAA,UAAA,SAAA,QAAA,UAAA,IAAA"}
@@ -0,0 +1,11 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_hcl_components_block_declaration = require('./block-declaration.cjs');
3
+ const require_hcl_components_hcl_file = require('./hcl-file.cjs');
4
+ const require_hcl_components_packer_file = require('./packer-file.cjs');
5
+ const require_hcl_components_terraform_file = require('./terraform-file.cjs');
6
+
7
+ exports.BlockDeclaration = require_hcl_components_block_declaration.BlockDeclaration;
8
+ exports.HCLFile = require_hcl_components_hcl_file.HCLFile;
9
+ exports.HCLFileHeader = require_hcl_components_hcl_file.HCLFileHeader;
10
+ exports.PackerFile = require_hcl_components_packer_file.PackerFile;
11
+ exports.TerraformFile = require_hcl_components_terraform_file.TerraformFile;
@@ -0,0 +1,5 @@
1
+ import { BlockDeclaration, BlockDeclarationProps, __ΩBlockDeclarationProps } from "./block-declaration.cjs";
2
+ import { HCLFile, HCLFileHeader, HCLFileProps, __ΩHCLFileProps } from "./hcl-file.cjs";
3
+ import { PackerFile, PackerFileProps, __ΩPackerFileProps } from "./packer-file.cjs";
4
+ import { TerraformFile, TerraformFileProps, __ΩTerraformFileProps } from "./terraform-file.cjs";
5
+ export { BlockDeclaration, BlockDeclarationProps, HCLFile, HCLFileHeader, HCLFileProps, PackerFile, PackerFileProps, TerraformFile, TerraformFileProps, __ΩBlockDeclarationProps, __ΩHCLFileProps, __ΩPackerFileProps, __ΩTerraformFileProps };
@@ -0,0 +1,5 @@
1
+ import { BlockDeclaration, BlockDeclarationProps, __ΩBlockDeclarationProps } from "./block-declaration.mjs";
2
+ import { HCLFile, HCLFileHeader, HCLFileProps, __ΩHCLFileProps } from "./hcl-file.mjs";
3
+ import { PackerFile, PackerFileProps, __ΩPackerFileProps } from "./packer-file.mjs";
4
+ import { TerraformFile, TerraformFileProps, __ΩTerraformFileProps } from "./terraform-file.mjs";
5
+ export { BlockDeclaration, BlockDeclarationProps, HCLFile, HCLFileHeader, HCLFileProps, PackerFile, PackerFileProps, TerraformFile, TerraformFileProps, __ΩBlockDeclarationProps, __ΩHCLFileProps, __ΩPackerFileProps, __ΩTerraformFileProps };
@@ -0,0 +1,6 @@
1
+ import { BlockDeclaration } from "./block-declaration.mjs";
2
+ import { HCLFile, HCLFileHeader } from "./hcl-file.mjs";
3
+ import { PackerFile } from "./packer-file.mjs";
4
+ import { TerraformFile } from "./terraform-file.mjs";
5
+
6
+ export { BlockDeclaration, HCLFile, HCLFileHeader, PackerFile, TerraformFile };
@@ -0,0 +1,29 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
3
+ const require_hcl_components_hcl_file = require('./hcl-file.cjs');
4
+ let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
5
+ let _alloy_js_core = require("@alloy-js/core");
6
+
7
+ //#region src/hcl/components/packer-file.tsx
8
+ /**
9
+ * A base component representing a Powerlines generated [Packer](https://developer.hashicorp.com/packer/docs/templates/hcl_templates) source file.
10
+ *
11
+ * @see https://developer.hashicorp.com/packer
12
+ *
13
+ * @param props - The properties for the source file.
14
+ * @returns The rendered source file component.
15
+ */
16
+ function PackerFile(props) {
17
+ const [{ children }, rest] = (0, _alloy_js_core.splitProps)(props, ["children"]);
18
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(require_hcl_components_hcl_file.HCLFile, (0, _alloy_js_core_jsx_runtime.mergeProps)({ filetype: "pkr.hcl" }, rest, { get children() {
19
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
20
+ get when() {
21
+ return Boolean(children);
22
+ },
23
+ children
24
+ });
25
+ } }));
26
+ }
27
+
28
+ //#endregion
29
+ exports.PackerFile = PackerFile;