@powerlines/plugin-alloy 0.26.26 → 0.26.28

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 (120) hide show
  1. package/dist/core/components/infrastructure-file.cjs +13 -8
  2. package/dist/core/components/infrastructure-file.mjs +13 -8
  3. package/dist/core/components/infrastructure-file.mjs.map +1 -1
  4. package/dist/core/components/output.cjs +17 -10
  5. package/dist/core/components/output.mjs +17 -10
  6. package/dist/core/components/output.mjs.map +1 -1
  7. package/dist/core/components/single-line-comment.cjs +6 -4
  8. package/dist/core/components/single-line-comment.mjs +6 -4
  9. package/dist/core/components/single-line-comment.mjs.map +1 -1
  10. package/dist/core/components/source-file.cjs +10 -6
  11. package/dist/core/components/source-file.mjs +10 -6
  12. package/dist/core/components/source-file.mjs.map +1 -1
  13. package/dist/core/components/spacing.cjs +6 -4
  14. package/dist/core/components/spacing.mjs +6 -4
  15. package/dist/core/components/spacing.mjs.map +1 -1
  16. package/dist/core/contexts/context.mjs.map +1 -1
  17. package/dist/core/contexts/meta.mjs.map +1 -1
  18. package/dist/core/contexts/reflection.mjs.map +1 -1
  19. package/dist/core/helpers/code.mjs.map +1 -1
  20. package/dist/hcl/components/block-declaration.cjs +12 -8
  21. package/dist/hcl/components/block-declaration.mjs +12 -8
  22. package/dist/hcl/components/block-declaration.mjs.map +1 -1
  23. package/dist/hcl/components/hcl-file.cjs +35 -21
  24. package/dist/hcl/components/hcl-file.mjs +36 -22
  25. package/dist/hcl/components/hcl-file.mjs.map +1 -1
  26. package/dist/hcl/components/packer-file.cjs +8 -8
  27. package/dist/hcl/components/packer-file.mjs +8 -8
  28. package/dist/hcl/components/packer-file.mjs.map +1 -1
  29. package/dist/hcl/components/terraform-file.cjs +8 -8
  30. package/dist/hcl/components/terraform-file.mjs +8 -8
  31. package/dist/hcl/components/terraform-file.mjs.map +1 -1
  32. package/dist/helpers/capnp.mjs.map +1 -1
  33. package/dist/helpers/create-builtin.mjs.map +1 -1
  34. package/dist/helpers/refkey.mjs.map +1 -1
  35. package/dist/helpers/typescript.mjs.map +1 -1
  36. package/dist/index.cjs +15 -8
  37. package/dist/index.d.cts.map +1 -1
  38. package/dist/index.d.mts.map +1 -1
  39. package/dist/index.mjs +14 -8
  40. package/dist/index.mjs.map +1 -1
  41. package/dist/markdown/components/front-matter.cjs +9 -7
  42. package/dist/markdown/components/front-matter.mjs +9 -7
  43. package/dist/markdown/components/front-matter.mjs.map +1 -1
  44. package/dist/markdown/components/heading.cjs +24 -0
  45. package/dist/markdown/components/heading.d.cts +19 -0
  46. package/dist/markdown/components/heading.d.cts.map +1 -0
  47. package/dist/markdown/components/heading.d.mts +19 -0
  48. package/dist/markdown/components/heading.d.mts.map +1 -0
  49. package/dist/markdown/components/heading.mjs +23 -0
  50. package/dist/markdown/components/heading.mjs.map +1 -0
  51. package/dist/markdown/components/index.cjs +2 -0
  52. package/dist/markdown/components/index.d.cts +2 -1
  53. package/dist/markdown/components/index.d.mts +2 -1
  54. package/dist/markdown/components/index.mjs +2 -1
  55. package/dist/markdown/components/markdown-file.cjs +76 -44
  56. package/dist/markdown/components/markdown-file.mjs +76 -44
  57. package/dist/markdown/components/markdown-file.mjs.map +1 -1
  58. package/dist/markdown/components/markdown-table.cjs +49 -28
  59. package/dist/markdown/components/markdown-table.mjs +49 -28
  60. package/dist/markdown/components/markdown-table.mjs.map +1 -1
  61. package/dist/markdown/contexts/markdown-table.mjs.map +1 -1
  62. package/dist/markdown/index.cjs +2 -0
  63. package/dist/markdown/index.d.cts +2 -1
  64. package/dist/markdown/index.d.mts +2 -1
  65. package/dist/markdown/index.mjs +2 -1
  66. package/dist/render.cjs +3 -3
  67. package/dist/render.mjs +4 -4
  68. package/dist/render.mjs.map +1 -1
  69. package/dist/types/components.cjs +9 -0
  70. package/dist/types/components.mjs +10 -1
  71. package/dist/types/components.mjs.map +1 -0
  72. package/dist/typescript/components/builtin-file.cjs +30 -20
  73. package/dist/typescript/components/builtin-file.mjs +30 -20
  74. package/dist/typescript/components/builtin-file.mjs.map +1 -1
  75. package/dist/typescript/components/class-declaration.cjs +180 -100
  76. package/dist/typescript/components/class-declaration.mjs +180 -100
  77. package/dist/typescript/components/class-declaration.mjs.map +1 -1
  78. package/dist/typescript/components/dynamic-import-statement.cjs +2 -6
  79. package/dist/typescript/components/dynamic-import-statement.mjs +2 -6
  80. package/dist/typescript/components/dynamic-import-statement.mjs.map +1 -1
  81. package/dist/typescript/components/entry-file.cjs +10 -7
  82. package/dist/typescript/components/entry-file.mjs +10 -7
  83. package/dist/typescript/components/entry-file.mjs.map +1 -1
  84. package/dist/typescript/components/interface-declaration.cjs +127 -74
  85. package/dist/typescript/components/interface-declaration.mjs +127 -74
  86. package/dist/typescript/components/interface-declaration.mjs.map +1 -1
  87. package/dist/typescript/components/object-declaration.cjs +84 -50
  88. package/dist/typescript/components/object-declaration.mjs +84 -50
  89. package/dist/typescript/components/object-declaration.mjs.map +1 -1
  90. package/dist/typescript/components/property-name.cjs +3 -3
  91. package/dist/typescript/components/property-name.mjs +3 -3
  92. package/dist/typescript/components/property-name.mjs.map +1 -1
  93. package/dist/typescript/components/record-expression.mjs.map +1 -1
  94. package/dist/typescript/components/tsdoc-reflection.cjs +241 -108
  95. package/dist/typescript/components/tsdoc-reflection.mjs +241 -108
  96. package/dist/typescript/components/tsdoc-reflection.mjs.map +1 -1
  97. package/dist/typescript/components/tsdoc.cjs +265 -168
  98. package/dist/typescript/components/tsdoc.mjs +265 -168
  99. package/dist/typescript/components/tsdoc.mjs.map +1 -1
  100. package/dist/typescript/components/type-declaration.cjs +20 -15
  101. package/dist/typescript/components/type-declaration.mjs +20 -15
  102. package/dist/typescript/components/type-declaration.mjs.map +1 -1
  103. package/dist/typescript/components/type-parameters.cjs +56 -29
  104. package/dist/typescript/components/type-parameters.mjs +56 -29
  105. package/dist/typescript/components/type-parameters.mjs.map +1 -1
  106. package/dist/typescript/components/typescript-file.cjs +135 -74
  107. package/dist/typescript/components/typescript-file.mjs +135 -74
  108. package/dist/typescript/components/typescript-file.mjs.map +1 -1
  109. package/dist/typescript/contexts/lexical-scope.cjs +5 -3
  110. package/dist/typescript/contexts/lexical-scope.mjs +5 -3
  111. package/dist/typescript/contexts/lexical-scope.mjs.map +1 -1
  112. package/dist/typescript/contexts/member-scope.cjs +5 -3
  113. package/dist/typescript/contexts/member-scope.mjs +5 -3
  114. package/dist/typescript/contexts/member-scope.mjs.map +1 -1
  115. package/dist/typescript/helpers/get-call-signature-props.mjs.map +1 -1
  116. package/dist/typescript/helpers/utilities.mjs.map +1 -1
  117. package/dist/yaml/components/yaml-file.cjs +92 -47
  118. package/dist/yaml/components/yaml-file.mjs +92 -47
  119. package/dist/yaml/components/yaml-file.mjs.map +1 -1
  120. package/package.json +21 -6
@@ -1,5 +1,5 @@
1
+ import { createComponent } from "@alloy-js/core/jsx-runtime";
1
2
  import { Scope } from "@alloy-js/core";
2
- import { jsx } from "@alloy-js/core/jsx-runtime";
3
3
  import { TSLexicalScope, createLexicalScope } from "@alloy-js/typescript";
4
4
 
5
5
  //#region src/typescript/contexts/lexical-scope.tsx
@@ -12,9 +12,11 @@ function LexicalScope(props) {
12
12
  if (!(props.value instanceof TSLexicalScope)) throw new TypeError("LexicalScope value must be a TSLexicalScope instance");
13
13
  scope = props.value;
14
14
  } else scope = createLexicalScope(props.name ?? "Lexical scope", props);
15
- return /* @__PURE__ */ jsx(Scope, {
15
+ return createComponent(Scope, {
16
16
  value: scope,
17
- children: props.children
17
+ get children() {
18
+ return props.children;
19
+ }
18
20
  });
19
21
  }
20
22
 
@@ -1 +1 @@
1
- {"version":3,"file":"lexical-scope.mjs","names":[],"sources":["../../../src/typescript/contexts/lexical-scope.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 { Scope, ScopePropsWithInfo, ScopePropsWithValue } from \"@alloy-js/core\";\nimport { createLexicalScope, TSLexicalScope } from \"@alloy-js/typescript\";\n\nexport interface LexicalScopePropsWithScopeValue extends ScopePropsWithValue {}\nexport interface LexicalScopePropsWithScopeInfo extends ScopePropsWithInfo {}\n\nexport type LexicalScopeProps =\n | LexicalScopePropsWithScopeValue\n | LexicalScopePropsWithScopeInfo;\n\n/**\n * A lexical scope for TypeScript, which contains declaration spaces for types and values. Declaration components will create symbols in this scope.\n */\nexport function LexicalScope(props: LexicalScopeProps) {\n let scope;\n if (\"value\" in props) {\n if (!(props.value instanceof TSLexicalScope)) {\n throw new TypeError(\n \"LexicalScope value must be a TSLexicalScope instance\"\n );\n }\n scope = props.value;\n } else {\n scope = createLexicalScope(props.name ?? \"Lexical scope\", props);\n }\n\n return <Scope value={scope}>{props.children}</Scope>;\n}\n"],"mappings":";;;;;;;;AA+BA,SAAgB,aAAa,OAA0B;CACrD,IAAI;AACJ,KAAI,WAAW,OAAO;AACpB,MAAI,EAAE,MAAM,iBAAiB,gBAC3B,OAAM,IAAI,UACR,uDACD;AAEH,UAAQ,MAAM;OAEd,SAAQ,mBAAmB,MAAM,QAAQ,iBAAiB,MAAM;AAGlE,QAAO,oBAAC,OAAD;EAAO,OAAO;YAAQ,MAAM;EAAiB"}
1
+ {"version":3,"file":"lexical-scope.mjs","names":[],"sources":["../../../src/typescript/contexts/lexical-scope.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 { Scope, ScopePropsWithInfo, ScopePropsWithValue } from \"@alloy-js/core\";\nimport { createLexicalScope, TSLexicalScope } from \"@alloy-js/typescript\";\n\nexport interface LexicalScopePropsWithScopeValue extends ScopePropsWithValue {}\nexport interface LexicalScopePropsWithScopeInfo extends ScopePropsWithInfo {}\n\nexport type LexicalScopeProps =\n | LexicalScopePropsWithScopeValue\n | LexicalScopePropsWithScopeInfo;\n\n/**\n * A lexical scope for TypeScript, which contains declaration spaces for types and values. Declaration components will create symbols in this scope.\n */\nexport function LexicalScope(props: LexicalScopeProps) {\n let scope;\n if (\"value\" in props) {\n if (!(props.value instanceof TSLexicalScope)) {\n throw new TypeError(\n \"LexicalScope value must be a TSLexicalScope instance\"\n );\n }\n scope = props.value;\n } else {\n scope = createLexicalScope(props.name ?? \"Lexical scope\", props);\n }\n\n return <Scope value={scope}>{props.children}</Scope>;\n}\n"],"mappings":";;;;;;;;AAwBA,SAAY,aAAiB,OAAC;CAC5B,IAAE;AACF,KAAE,WAAA,OAAA;+CAEF,OAAA,IAAA,UAAA,uDAAA;AAEA,UAAA,MAAA;OAEA,SAAS,mBAAA,MAAA,QAAA,iBAAA,MAAA;AAET,QAAO,gBAAa,OAAW;EAC7B,OAAO;EACP,IAAI,WAAC;AACH,UAAC,MAAA;;EAEJ,CAAC"}
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
3
- let _alloy_js_core = require("@alloy-js/core");
4
3
  let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
4
+ let _alloy_js_core = require("@alloy-js/core");
5
5
  let _alloy_js_typescript = require("@alloy-js/typescript");
6
6
 
7
7
  //#region src/typescript/contexts/member-scope.tsx
@@ -12,9 +12,11 @@ let _alloy_js_typescript = require("@alloy-js/typescript");
12
12
  function MemberScope(props) {
13
13
  const parentScope = (0, _alloy_js_typescript.useTSLexicalScopeIfPresent)();
14
14
  const binder = props.ownerSymbol.binder ?? parentScope?.binder;
15
- return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.MemberScope, {
15
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.MemberScope, {
16
16
  value: (0, _alloy_js_core.createScope)(_alloy_js_typescript.TSMemberScope, "member-scope", parentScope, props.ownerSymbol, { binder }),
17
- children: props.children
17
+ get children() {
18
+ return props.children;
19
+ }
18
20
  });
19
21
  }
20
22
 
@@ -1,5 +1,5 @@
1
+ import { createComponent } from "@alloy-js/core/jsx-runtime";
1
2
  import { MemberScope as MemberScope$1, createScope } from "@alloy-js/core";
2
- import { jsx } from "@alloy-js/core/jsx-runtime";
3
3
  import { TSMemberScope, useTSLexicalScopeIfPresent } from "@alloy-js/typescript";
4
4
 
5
5
  //#region src/typescript/contexts/member-scope.tsx
@@ -10,9 +10,11 @@ import { TSMemberScope, useTSLexicalScopeIfPresent } from "@alloy-js/typescript"
10
10
  function MemberScope(props) {
11
11
  const parentScope = useTSLexicalScopeIfPresent();
12
12
  const binder = props.ownerSymbol.binder ?? parentScope?.binder;
13
- return /* @__PURE__ */ jsx(MemberScope$1, {
13
+ return createComponent(MemberScope$1, {
14
14
  value: createScope(TSMemberScope, "member-scope", parentScope, props.ownerSymbol, { binder }),
15
- children: props.children
15
+ get children() {
16
+ return props.children;
17
+ }
16
18
  });
17
19
  }
18
20
 
@@ -1 +1 @@
1
- {"version":3,"file":"member-scope.mjs","names":["CoreMemberScope"],"sources":["../../../src/typescript/contexts/member-scope.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport {\n Children,\n MemberScope as CoreMemberScope,\n createScope\n} from \"@alloy-js/core\";\nimport {\n TSMemberScope,\n TSOutputSymbol,\n useTSLexicalScopeIfPresent\n} from \"@alloy-js/typescript\";\n\nexport interface MemberScopeProps {\n children: Children;\n\n /**\n * The symbol that this member scope will create member symbols on.\n */\n ownerSymbol: TSOutputSymbol;\n}\n\n/**\n * A member scope for TypeScript. Member declarations will create symbols\n * in this scope, which will be added to the owner symbol's members.\n */\nexport function MemberScope(props: MemberScopeProps) {\n const parentScope = useTSLexicalScopeIfPresent();\n const binder = props.ownerSymbol.binder ?? parentScope?.binder;\n const memberScope = createScope(\n TSMemberScope,\n \"member-scope\",\n parentScope,\n props.ownerSymbol,\n {\n binder\n }\n );\n\n return (\n <CoreMemberScope value={memberScope}>{props.children}</CoreMemberScope>\n );\n}\n"],"mappings":";;;;;;;;;AA0CA,SAAgB,YAAY,OAAyB;CACnD,MAAM,cAAc,4BAA4B;CAChD,MAAM,SAAS,MAAM,YAAY,UAAU,aAAa;AAWxD,QACE,oBAACA,eAAD;EAAiB,OAXC,YAClB,eACA,gBACA,aACA,MAAM,aACN,EACE,QACD,CACF;YAGuC,MAAM;EAA2B"}
1
+ {"version":3,"file":"member-scope.mjs","names":[],"sources":["../../../src/typescript/contexts/member-scope.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport {\n Children,\n MemberScope as CoreMemberScope,\n createScope\n} from \"@alloy-js/core\";\nimport {\n TSMemberScope,\n TSOutputSymbol,\n useTSLexicalScopeIfPresent\n} from \"@alloy-js/typescript\";\n\nexport interface MemberScopeProps {\n children: Children;\n\n /**\n * The symbol that this member scope will create member symbols on.\n */\n ownerSymbol: TSOutputSymbol;\n}\n\n/**\n * A member scope for TypeScript. Member declarations will create symbols\n * in this scope, which will be added to the owner symbol's members.\n */\nexport function MemberScope(props: MemberScopeProps) {\n const parentScope = useTSLexicalScopeIfPresent();\n const binder = props.ownerSymbol.binder ?? parentScope?.binder;\n const memberScope = createScope(\n TSMemberScope,\n \"member-scope\",\n parentScope,\n props.ownerSymbol,\n {\n binder\n }\n );\n\n return (\n <CoreMemberScope value={memberScope}>{props.children}</CoreMemberScope>\n );\n}\n"],"mappings":";;;;;;;;;AAyBA,SAAgB,YAAA,OAAA;CACd,MAAA,cAAA,4BAAA;CACA,MAAM,SAAS,MAAC,YAAW,UAAA,aAAA;;EAKzB,oFAHJ,QACE,CAEE;EACA,IAAI,WAAQ;AACZ,UAAA,MAAA;;EAEJ,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"get-call-signature-props.mjs","names":[],"sources":["../../../src/typescript/helpers/get-call-signature-props.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 { defaultProps, splitProps } from \"@alloy-js/core\";\nimport { CallSignatureProps } from \"@alloy-js/typescript\";\n\n/**\n * Get the properties for a call signature, applying any defaults as necessary.\n *\n * @param props - The properties for the call signature.\n * @param defaults - Optional default properties to apply to the call signature.\n * @returns The properties for the call signature, with defaults applied as necessary.\n */\nexport function getCallSignatureProps(\n props: CallSignatureProps,\n defaults?: Partial<CallSignatureProps>\n) {\n const [callSignatureProps] = splitProps(props, [\n \"parameters\",\n \"parametersChildren\",\n \"typeParameters\",\n \"typeParametersChildren\",\n \"returnType\"\n ]);\n\n if (!defaults) {\n return callSignatureProps;\n }\n\n return defaultProps(callSignatureProps, defaults);\n}\n"],"mappings":";;;;;;;;;;AA4BA,SAAgB,sBACd,OACA,UACA;CACA,MAAM,CAAC,sBAAsB,WAAW,OAAO;EAC7C;EACA;EACA;EACA;EACA;EACD,CAAC;AAEF,KAAI,CAAC,SACH,QAAO;AAGT,QAAO,aAAa,oBAAoB,SAAS"}
1
+ {"version":3,"file":"get-call-signature-props.mjs","names":[],"sources":["../../../src/typescript/helpers/get-call-signature-props.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 { defaultProps, splitProps } from \"@alloy-js/core\";\nimport { CallSignatureProps } from \"@alloy-js/typescript\";\n\n/**\n * Get the properties for a call signature, applying any defaults as necessary.\n *\n * @param props - The properties for the call signature.\n * @param defaults - Optional default properties to apply to the call signature.\n * @returns The properties for the call signature, with defaults applied as necessary.\n */\nexport function getCallSignatureProps(\n props: CallSignatureProps,\n defaults?: Partial<CallSignatureProps>\n) {\n const [callSignatureProps] = splitProps(props, [\n \"parameters\",\n \"parametersChildren\",\n \"typeParameters\",\n \"typeParametersChildren\",\n \"returnType\"\n ]);\n\n if (!defaults) {\n return callSignatureProps;\n }\n\n return defaultProps(callSignatureProps, defaults);\n}\n"],"mappings":";;;;;;;;;;AA4BA,SAAgB,sBAAqB,OAAA,UAAA;CACnC,MAAM,CAAC,sBAAkB,WAAA,OAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA,CAAA;AACzB,KAAA,CAAA,SACA,QAAA;AAEA,QAAG,aAAW,oBAAA,SAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"utilities.mjs","names":[],"sources":["../../../src/typescript/helpers/utilities.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\n/**\n * Check if a string is a valid JavaScript identifier.\n *\n * @param identifier - The string to check.\n * @returns `true` if the string is a valid JavaScript identifier, `false` otherwise.\n */\nexport function isValidJSIdentifier(identifier: string) {\n return /^[\\p{ID_Start}$_][\\p{ID_Continue}$\\u200C\\u200D]*$/u.test(identifier);\n}\n"],"mappings":";;;;;;;AAwBA,SAAgB,oBAAoB,YAAoB;AACtD,QAAO,qDAAqD,KAAK,WAAW"}
1
+ {"version":3,"file":"utilities.mjs","names":[],"sources":["../../../src/typescript/helpers/utilities.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\n/**\n * Check if a string is a valid JavaScript identifier.\n *\n * @param identifier - The string to check.\n * @returns `true` if the string is a valid JavaScript identifier, `false` otherwise.\n */\nexport function isValidJSIdentifier(identifier: string) {\n return /^[\\p{ID_Start}$_][\\p{ID_Continue}$\\u200C\\u200D]*$/u.test(identifier);\n}\n"],"mappings":";;;;;;;AAwBA,SAAgB,oBAAoB,YAAY;AAC9C,QAAO,qDAAqD,KAAK,WAAW"}
@@ -3,47 +3,73 @@ const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
3
3
  const require_core_contexts_context = require('../../core/contexts/context.cjs');
4
4
  const require_core_components_source_file = require('../../core/components/source-file.cjs');
5
5
  const require_core_components_single_line_comment = require('../../core/components/single-line-comment.cjs');
6
- let _alloy_js_core = require("@alloy-js/core");
7
6
  let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
7
+ let _alloy_js_core = require("@alloy-js/core");
8
8
  let _stryke_string_format_title_case = require("@stryke/string-format/title-case");
9
9
  let powerlines_utils = require("powerlines/utils");
10
10
  let _stryke_type_checks = require("@stryke/type-checks");
11
11
 
12
12
  //#region src/yaml/components/yaml-file.tsx
13
13
  function YamlFileDataItem({ key, value }) {
14
- return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core_jsx_runtime.Fragment, { children: [
15
- /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Show, {
16
- when: Boolean(key),
14
+ return [
15
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
16
+ get when() {
17
+ return Boolean(key);
18
+ },
17
19
  children: _alloy_js_core.code`${key}:`
18
20
  }),
19
- /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Show, {
21
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
20
22
  when: typeof value === "string" || typeof value === "number" || typeof value === "boolean",
21
- children: _alloy_js_core.code` ${String(value)}`
23
+ get children() {
24
+ return _alloy_js_core.code` ${String(value)}`;
25
+ }
22
26
  }),
23
- /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Show, {
24
- when: (0, _stryke_type_checks.isSetObject)(value) && !Array.isArray(value),
25
- children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.For, {
26
- each: Object.entries(value),
27
- children: ([nestedKey, nestedValue]) => /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(YamlFileDataItem, { value: nestedValue }, nestedKey)
28
- })
27
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
28
+ get when() {
29
+ return (0, _alloy_js_core_jsx_runtime.memo)(() => !!(0, _stryke_type_checks.isSetObject)(value))() && !Array.isArray(value);
30
+ },
31
+ get children() {
32
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
33
+ get each() {
34
+ return Object.entries(value);
35
+ },
36
+ children: ([nestedKey, nestedValue]) => (0, _alloy_js_core_jsx_runtime.createComponent)(YamlFileDataItem, {
37
+ key: nestedKey,
38
+ value: nestedValue
39
+ })
40
+ });
41
+ }
29
42
  }),
30
- /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Show, {
31
- when: Array.isArray(value),
32
- children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.For, {
33
- each: value,
34
- children: (item) => /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(YamlFileDataItem, { value: item })
35
- })
43
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
44
+ get when() {
45
+ return Array.isArray(value);
46
+ },
47
+ get children() {
48
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
49
+ each: value,
50
+ children: (item) => (0, _alloy_js_core_jsx_runtime.createComponent)(YamlFileDataItem, { value: item })
51
+ });
52
+ }
36
53
  })
37
- ] });
54
+ ];
38
55
  }
39
56
  function YamlFileData({ data }) {
40
- return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core_jsx_runtime.Fragment, { children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Show, {
41
- when: Boolean(data),
42
- children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.For, {
43
- each: Object.entries(data ?? {}),
44
- children: ([key, value]) => /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(YamlFileDataItem, { value }, key)
45
- })
46
- }) });
57
+ return [(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
58
+ get when() {
59
+ return Boolean(data);
60
+ },
61
+ get children() {
62
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
63
+ get each() {
64
+ return Object.entries(data ?? {});
65
+ },
66
+ children: ([key, value]) => (0, _alloy_js_core_jsx_runtime.createComponent)(YamlFileDataItem, {
67
+ key,
68
+ value
69
+ })
70
+ });
71
+ }
72
+ })];
47
73
  }
48
74
  /**
49
75
  * A base component representing a Powerlines generated YAML source file.
@@ -61,19 +87,30 @@ function YamlFile(props) {
61
87
  "data",
62
88
  "header"
63
89
  ]);
64
- return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(require_core_components_source_file.SourceFile, {
65
- ...rest,
90
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(require_core_components_source_file.SourceFile, (0, _alloy_js_core_jsx_runtime.mergeProps)(rest, {
66
91
  path,
67
- header: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(YamlFileHeader, { children: header }),
92
+ get header() {
93
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(YamlFileHeader, { children: header });
94
+ },
68
95
  filetype: "yaml",
69
- children: [/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Show, {
70
- when: Boolean(data),
71
- children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(YamlFileData, { data })
72
- }), /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Show, {
73
- when: Boolean(children),
74
- children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core_jsx_runtime.Fragment, { children: [children, /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {})] })
75
- })]
76
- });
96
+ get children() {
97
+ return [(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
98
+ get when() {
99
+ return Boolean(data);
100
+ },
101
+ get children() {
102
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(YamlFileData, { data });
103
+ }
104
+ }), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
105
+ get when() {
106
+ return Boolean(children);
107
+ },
108
+ get children() {
109
+ return [children, (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})];
110
+ }
111
+ })];
112
+ }
113
+ }));
77
114
  }
78
115
  /**
79
116
  * Renders the header for a Powerlines YAML source file.
@@ -84,19 +121,27 @@ function YamlFile(props) {
84
121
  function YamlFileHeader(props) {
85
122
  const { children } = props;
86
123
  const context = require_core_contexts_context.usePowerlinesSafe();
87
- return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core_jsx_runtime.Fragment, { children: [
88
- /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Show, {
89
- when: Boolean(children),
90
- children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core_jsx_runtime.Fragment, { children: [children, /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {})] })
124
+ return [
125
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
126
+ get when() {
127
+ return Boolean(children);
128
+ },
129
+ get children() {
130
+ return [children, (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})];
131
+ }
91
132
  }),
92
- /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_core_components_single_line_comment.SingleLineComment, { children: `Generated by ${(0, _stryke_string_format_title_case.titleCase)(context?.config?.framework) || "Powerlines"}` }),
93
- /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {}),
94
- /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_core_components_single_line_comment.SingleLineComment, {
133
+ (0, _alloy_js_core_jsx_runtime.createComponent)(require_core_components_single_line_comment.SingleLineComment, { get children() {
134
+ return `Generated by ${(0, _stryke_string_format_title_case.titleCase)(context?.config?.framework) || "Powerlines"}`;
135
+ } }),
136
+ (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
137
+ (0, _alloy_js_core_jsx_runtime.createComponent)(require_core_components_single_line_comment.SingleLineComment, {
95
138
  variant: "yaml",
96
- children: (0, powerlines_utils.getFileHeaderWarning)(context)
139
+ get children() {
140
+ return (0, powerlines_utils.getFileHeaderWarning)(context);
141
+ }
97
142
  }),
98
- /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)("hbr", {})
99
- ] });
143
+ (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
144
+ ];
100
145
  }
101
146
 
102
147
  //#endregion
@@ -1,47 +1,73 @@
1
1
  import { usePowerlinesSafe } from "../../core/contexts/context.mjs";
2
2
  import { SourceFile } from "../../core/components/source-file.mjs";
3
3
  import { SingleLineComment } from "../../core/components/single-line-comment.mjs";
4
+ import { createComponent, createIntrinsic, memo, mergeProps } from "@alloy-js/core/jsx-runtime";
4
5
  import { For, Show, code, splitProps } from "@alloy-js/core";
5
- import { Fragment, jsx, jsxs } from "@alloy-js/core/jsx-runtime";
6
6
  import { titleCase } from "@stryke/string-format/title-case";
7
7
  import { getFileHeaderWarning } from "powerlines/utils";
8
8
  import { isSetObject } from "@stryke/type-checks";
9
9
 
10
10
  //#region src/yaml/components/yaml-file.tsx
11
11
  function YamlFileDataItem({ key, value }) {
12
- return /* @__PURE__ */ jsxs(Fragment, { children: [
13
- /* @__PURE__ */ jsx(Show, {
14
- when: Boolean(key),
12
+ return [
13
+ createComponent(Show, {
14
+ get when() {
15
+ return Boolean(key);
16
+ },
15
17
  children: code`${key}:`
16
18
  }),
17
- /* @__PURE__ */ jsx(Show, {
19
+ createComponent(Show, {
18
20
  when: typeof value === "string" || typeof value === "number" || typeof value === "boolean",
19
- children: code` ${String(value)}`
21
+ get children() {
22
+ return code` ${String(value)}`;
23
+ }
20
24
  }),
21
- /* @__PURE__ */ jsx(Show, {
22
- when: isSetObject(value) && !Array.isArray(value),
23
- children: /* @__PURE__ */ jsx(For, {
24
- each: Object.entries(value),
25
- children: ([nestedKey, nestedValue]) => /* @__PURE__ */ jsx(YamlFileDataItem, { value: nestedValue }, nestedKey)
26
- })
25
+ createComponent(Show, {
26
+ get when() {
27
+ return memo(() => !!isSetObject(value))() && !Array.isArray(value);
28
+ },
29
+ get children() {
30
+ return createComponent(For, {
31
+ get each() {
32
+ return Object.entries(value);
33
+ },
34
+ children: ([nestedKey, nestedValue]) => createComponent(YamlFileDataItem, {
35
+ key: nestedKey,
36
+ value: nestedValue
37
+ })
38
+ });
39
+ }
27
40
  }),
28
- /* @__PURE__ */ jsx(Show, {
29
- when: Array.isArray(value),
30
- children: /* @__PURE__ */ jsx(For, {
31
- each: value,
32
- children: (item) => /* @__PURE__ */ jsx(YamlFileDataItem, { value: item })
33
- })
41
+ createComponent(Show, {
42
+ get when() {
43
+ return Array.isArray(value);
44
+ },
45
+ get children() {
46
+ return createComponent(For, {
47
+ each: value,
48
+ children: (item) => createComponent(YamlFileDataItem, { value: item })
49
+ });
50
+ }
34
51
  })
35
- ] });
52
+ ];
36
53
  }
37
54
  function YamlFileData({ data }) {
38
- return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(Show, {
39
- when: Boolean(data),
40
- children: /* @__PURE__ */ jsx(For, {
41
- each: Object.entries(data ?? {}),
42
- children: ([key, value]) => /* @__PURE__ */ jsx(YamlFileDataItem, { value }, key)
43
- })
44
- }) });
55
+ return [createComponent(Show, {
56
+ get when() {
57
+ return Boolean(data);
58
+ },
59
+ get children() {
60
+ return createComponent(For, {
61
+ get each() {
62
+ return Object.entries(data ?? {});
63
+ },
64
+ children: ([key, value]) => createComponent(YamlFileDataItem, {
65
+ key,
66
+ value
67
+ })
68
+ });
69
+ }
70
+ })];
45
71
  }
46
72
  /**
47
73
  * A base component representing a Powerlines generated YAML source file.
@@ -59,19 +85,30 @@ function YamlFile(props) {
59
85
  "data",
60
86
  "header"
61
87
  ]);
62
- return /* @__PURE__ */ jsxs(SourceFile, {
63
- ...rest,
88
+ return createComponent(SourceFile, mergeProps(rest, {
64
89
  path,
65
- header: /* @__PURE__ */ jsx(YamlFileHeader, { children: header }),
90
+ get header() {
91
+ return createComponent(YamlFileHeader, { children: header });
92
+ },
66
93
  filetype: "yaml",
67
- children: [/* @__PURE__ */ jsx(Show, {
68
- when: Boolean(data),
69
- children: /* @__PURE__ */ jsx(YamlFileData, { data })
70
- }), /* @__PURE__ */ jsx(Show, {
71
- when: Boolean(children),
72
- children: /* @__PURE__ */ jsxs(Fragment, { children: [children, /* @__PURE__ */ jsx("hbr", {})] })
73
- })]
74
- });
94
+ get children() {
95
+ return [createComponent(Show, {
96
+ get when() {
97
+ return Boolean(data);
98
+ },
99
+ get children() {
100
+ return createComponent(YamlFileData, { data });
101
+ }
102
+ }), createComponent(Show, {
103
+ get when() {
104
+ return Boolean(children);
105
+ },
106
+ get children() {
107
+ return [children, createIntrinsic("hbr", {})];
108
+ }
109
+ })];
110
+ }
111
+ }));
75
112
  }
76
113
  /**
77
114
  * Renders the header for a Powerlines YAML source file.
@@ -82,19 +119,27 @@ function YamlFile(props) {
82
119
  function YamlFileHeader(props) {
83
120
  const { children } = props;
84
121
  const context = usePowerlinesSafe();
85
- return /* @__PURE__ */ jsxs(Fragment, { children: [
86
- /* @__PURE__ */ jsx(Show, {
87
- when: Boolean(children),
88
- children: /* @__PURE__ */ jsxs(Fragment, { children: [children, /* @__PURE__ */ jsx("hbr", {})] })
122
+ return [
123
+ createComponent(Show, {
124
+ get when() {
125
+ return Boolean(children);
126
+ },
127
+ get children() {
128
+ return [children, createIntrinsic("hbr", {})];
129
+ }
89
130
  }),
90
- /* @__PURE__ */ jsx(SingleLineComment, { children: `Generated by ${titleCase(context?.config?.framework) || "Powerlines"}` }),
91
- /* @__PURE__ */ jsx("hbr", {}),
92
- /* @__PURE__ */ jsx(SingleLineComment, {
131
+ createComponent(SingleLineComment, { get children() {
132
+ return `Generated by ${titleCase(context?.config?.framework) || "Powerlines"}`;
133
+ } }),
134
+ createIntrinsic("hbr", {}),
135
+ createComponent(SingleLineComment, {
93
136
  variant: "yaml",
94
- children: getFileHeaderWarning(context)
137
+ get children() {
138
+ return getFileHeaderWarning(context);
139
+ }
95
140
  }),
96
- /* @__PURE__ */ jsx("hbr", {})
97
- ] });
141
+ createIntrinsic("hbr", {})
142
+ ];
98
143
  }
99
144
 
100
145
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"yaml-file.mjs","names":[],"sources":["../../../src/yaml/components/yaml-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 type { Children } from \"@alloy-js/core\";\nimport { code, For, Show, splitProps } from \"@alloy-js/core\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { isSetObject } from \"@stryke/type-checks\";\nimport { getFileHeaderWarning } from \"powerlines/utils\";\nimport { SingleLineComment } from \"../../core/components/single-line-comment\";\nimport { SourceFile, SourceFileProps } from \"../../core/components/source-file\";\nimport { usePowerlinesSafe } from \"../../core/contexts/context\";\nimport { ComponentProps, SourceFileHeaderProps } from \"../../types/components\";\n\nexport interface YamlData {\n [key: string]: string | number | boolean | YamlData | YamlData[];\n}\n\ninterface YamlFileDataItemProps {\n value: string | number | boolean | YamlData | YamlData[];\n key?: string;\n}\n\nfunction YamlFileDataItem({ key, value }: YamlFileDataItemProps) {\n return (\n <>\n <Show when={Boolean(key)}>{code`${key}:`}</Show>\n <Show\n when={\n typeof value === \"string\" ||\n typeof value === \"number\" ||\n typeof value === \"boolean\"\n }>\n {code` ${String(value)}`}\n </Show>\n <Show when={isSetObject(value) && !Array.isArray(value)}>\n <For each={Object.entries(value as YamlData)}>\n {([nestedKey, nestedValue]) => (\n <YamlFileDataItem key={nestedKey} value={nestedValue} />\n )}\n </For>\n </Show>\n <Show when={Array.isArray(value)}>\n <For each={value as YamlData[]}>\n {item => <YamlFileDataItem value={item} />}\n </For>\n </Show>\n </>\n );\n}\n\ninterface YamlFileDataProps {\n data?: YamlData;\n}\n\nfunction YamlFileData({ data }: YamlFileDataProps) {\n return (\n <>\n <Show when={Boolean(data)}>\n <For each={Object.entries(data ?? {})}>\n {([key, value]) => <YamlFileDataItem key={key} value={value} />}\n </For>\n </Show>\n </>\n );\n}\n\nexport type YamlFileProps = Omit<SourceFileProps, \"filetype\"> &\n ComponentProps & {\n header?: Children;\n data?: YamlData;\n };\n\n/**\n * A base component representing a Powerlines generated YAML source file.\n *\n * @remarks\n * The file content can be provided either through the `data` prop, which accepts a nested object representing the YAML structure, or through the `children` prop, which allows for custom YAML content to be rendered. The `header` prop can be used to provide custom header content for the YAML file, which is rendered above the generated file header warning and generation comment.\n *\n * @param props - The properties for the source file.\n * @returns The rendered source file component.\n */\nexport function YamlFile(props: YamlFileProps) {\n const [{ children, path, data, header }, rest] = splitProps(props, [\n \"children\",\n \"path\",\n \"data\",\n \"header\"\n ]);\n\n return (\n <SourceFile\n {...rest}\n path={path}\n header={<YamlFileHeader>{header}</YamlFileHeader>}\n filetype=\"yaml\">\n <Show when={Boolean(data)}>\n <YamlFileData data={data} />\n </Show>\n <Show when={Boolean(children)}>\n <>\n {children}\n <hbr />\n </>\n </Show>\n </SourceFile>\n );\n}\n\n/**\n * Renders the header for a Powerlines YAML source file.\n *\n * @param props - The properties for the source file header.\n * @returns The rendered source file header.\n */\nexport function YamlFileHeader(props: SourceFileHeaderProps) {\n const { children } = props;\n\n const context = usePowerlinesSafe();\n\n return (\n <>\n <Show when={Boolean(children)}>\n <>\n {children}\n <hbr />\n </>\n </Show>\n <SingleLineComment>{`Generated by ${\n titleCase(context?.config?.framework) || \"Powerlines\"\n }`}</SingleLineComment>\n <hbr />\n <SingleLineComment variant=\"yaml\">\n {getFileHeaderWarning(context!)}\n </SingleLineComment>\n <hbr />\n </>\n );\n}\n"],"mappings":";;;;;;;;;;AAqCA,SAAS,iBAAiB,EAAE,KAAK,SAAgC;AAC/D,QACE;EACE,oBAAC,MAAD;GAAM,MAAM,QAAQ,IAAI;aAAG,IAAI,GAAG,IAAI;GAAU;EAChD,oBAAC,MAAD;GACE,MACE,OAAO,UAAU,YACjB,OAAO,UAAU,YACjB,OAAO,UAAU;aAElB,IAAI,KAAK,OAAO,MAAM;GAClB;EACP,oBAAC,MAAD;GAAM,MAAM,YAAY,MAAM,IAAI,CAAC,MAAM,QAAQ,MAAM;aACrD,oBAAC,KAAD;IAAK,MAAM,OAAO,QAAQ,MAAkB;eACxC,CAAC,WAAW,iBACZ,oBAAC,kBAAD,EAAkC,OAAO,aAAe,EAAjC,UAAiC;IAEtD;GACD;EACP,oBAAC,MAAD;GAAM,MAAM,MAAM,QAAQ,MAAM;aAC9B,oBAAC,KAAD;IAAK,MAAM;eACR,SAAQ,oBAAC,kBAAD,EAAkB,OAAO,MAAQ;IACtC;GACD;EACN;;AAQP,SAAS,aAAa,EAAE,QAA2B;AACjD,QACE,0CACE,oBAAC,MAAD;EAAM,MAAM,QAAQ,KAAK;YACvB,oBAAC,KAAD;GAAK,MAAM,OAAO,QAAQ,QAAQ,EAAE,CAAC;cACjC,CAAC,KAAK,WAAW,oBAAC,kBAAD,EAAmC,OAAS,EAArB,IAAqB;GAC3D;EACD,GACN;;;;;;;;;;;AAmBP,SAAgB,SAAS,OAAsB;CAC7C,MAAM,CAAC,EAAE,UAAU,MAAM,MAAM,UAAU,QAAQ,WAAW,OAAO;EACjE;EACA;EACA;EACA;EACD,CAAC;AAEF,QACE,qBAAC,YAAD;EACE,GAAI;EACE;EACN,QAAQ,oBAAC,gBAAD,YAAiB,QAAwB;EACjD,UAAS;YAJX,CAKE,oBAAC,MAAD;GAAM,MAAM,QAAQ,KAAK;aACvB,oBAAC,cAAD,EAAoB,MAAQ;GACvB,GACP,oBAAC,MAAD;GAAM,MAAM,QAAQ,SAAS;aAC3B,4CACG,UACD,oBAAC,OAAD,EAAO,EACN;GACE,EACI;;;;;;;;;AAUjB,SAAgB,eAAe,OAA8B;CAC3D,MAAM,EAAE,aAAa;CAErB,MAAM,UAAU,mBAAmB;AAEnC,QACE;EACE,oBAAC,MAAD;GAAM,MAAM,QAAQ,SAAS;aAC3B,4CACG,UACD,oBAAC,OAAD,EAAO,EACN;GACE;EACP,oBAAC,mBAAD,YAAoB,gBAClB,UAAU,SAAS,QAAQ,UAAU,IAAI,gBACpB;EACvB,oBAAC,OAAD,EAAO;EACP,oBAAC,mBAAD;GAAmB,SAAQ;aACxB,qBAAqB,QAAS;GACb;EACpB,oBAAC,OAAD,EAAO;EACN"}
1
+ {"version":3,"file":"yaml-file.mjs","names":[],"sources":["../../../src/yaml/components/yaml-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 type { Children } from \"@alloy-js/core\";\nimport { code, For, Show, splitProps } from \"@alloy-js/core\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { isSetObject } from \"@stryke/type-checks\";\nimport { getFileHeaderWarning } from \"powerlines/utils\";\nimport { SingleLineComment } from \"../../core/components/single-line-comment\";\nimport { SourceFile, SourceFileProps } from \"../../core/components/source-file\";\nimport { usePowerlinesSafe } from \"../../core/contexts/context\";\nimport { ComponentProps, SourceFileHeaderProps } from \"../../types/components\";\n\nexport interface YamlData {\n [key: string]: string | number | boolean | YamlData | YamlData[];\n}\n\ninterface YamlFileDataItemProps {\n value: string | number | boolean | YamlData | YamlData[];\n key?: string;\n}\n\nfunction YamlFileDataItem({ key, value }: YamlFileDataItemProps) {\n return (\n <>\n <Show when={Boolean(key)}>{code`${key}:`}</Show>\n <Show\n when={\n typeof value === \"string\" ||\n typeof value === \"number\" ||\n typeof value === \"boolean\"\n }>\n {code` ${String(value)}`}\n </Show>\n <Show when={isSetObject(value) && !Array.isArray(value)}>\n <For each={Object.entries(value as YamlData)}>\n {([nestedKey, nestedValue]) => (\n <YamlFileDataItem key={nestedKey} value={nestedValue} />\n )}\n </For>\n </Show>\n <Show when={Array.isArray(value)}>\n <For each={value as YamlData[]}>\n {item => <YamlFileDataItem value={item} />}\n </For>\n </Show>\n </>\n );\n}\n\ninterface YamlFileDataProps {\n data?: YamlData;\n}\n\nfunction YamlFileData({ data }: YamlFileDataProps) {\n return (\n <>\n <Show when={Boolean(data)}>\n <For each={Object.entries(data ?? {})}>\n {([key, value]) => <YamlFileDataItem key={key} value={value} />}\n </For>\n </Show>\n </>\n );\n}\n\nexport type YamlFileProps = Omit<SourceFileProps, \"filetype\"> &\n ComponentProps & {\n header?: Children;\n data?: YamlData;\n };\n\n/**\n * A base component representing a Powerlines generated YAML source file.\n *\n * @remarks\n * The file content can be provided either through the `data` prop, which accepts a nested object representing the YAML structure, or through the `children` prop, which allows for custom YAML content to be rendered. The `header` prop can be used to provide custom header content for the YAML file, which is rendered above the generated file header warning and generation comment.\n *\n * @param props - The properties for the source file.\n * @returns The rendered source file component.\n */\nexport function YamlFile(props: YamlFileProps) {\n const [{ children, path, data, header }, rest] = splitProps(props, [\n \"children\",\n \"path\",\n \"data\",\n \"header\"\n ]);\n\n return (\n <SourceFile\n {...rest}\n path={path}\n header={<YamlFileHeader>{header}</YamlFileHeader>}\n filetype=\"yaml\">\n <Show when={Boolean(data)}>\n <YamlFileData data={data} />\n </Show>\n <Show when={Boolean(children)}>\n <>\n {children}\n <hbr />\n </>\n </Show>\n </SourceFile>\n );\n}\n\n/**\n * Renders the header for a Powerlines YAML source file.\n *\n * @param props - The properties for the source file header.\n * @returns The rendered source file header.\n */\nexport function YamlFileHeader(props: SourceFileHeaderProps) {\n const { children } = props;\n\n const context = usePowerlinesSafe();\n\n return (\n <>\n <Show when={Boolean(children)}>\n <>\n {children}\n <hbr />\n </>\n </Show>\n <SingleLineComment>{`Generated by ${\n titleCase(context?.config?.framework) || \"Powerlines\"\n }`}</SingleLineComment>\n <hbr />\n <SingleLineComment variant=\"yaml\">\n {getFileHeaderWarning(context!)}\n </SingleLineComment>\n <hbr />\n </>\n );\n}\n"],"mappings":";;;;;;;;;;4BA4BA,KACE,SACF;;;GAEA,IAAA,OAAU;AACR,WAAO,QAAS,IAAO;;GAEzB,UAAA,IAAA,GAAA,IAAA;;;GAEA,MAAS,OAAA,UAAkB,YAAY,OAAG,UAAA,YAAuB,OAAA,UAAA;GAC/D,IAAM,WAAC;AACJ,WAAA,IAAA,KAAA,OAAA,MAAA;;GAEF,CAAC;EAAE,gBAAC,MAAA;GACH,IAAI,OAAK;AACP,WAAI,WAAgB,CAAC,CAAC,YAAS,MAAA,CAAA,EAAA,IAAA,CAAA,MAAA,QAAA,MAAA;;GAEjC,IAAI,WAAS;AACX,WAAG,gBAAA,KAAA;KACD,IAAC,OAAS;AACV,aAAI,OAAA,QAAA,MAAA;;KAEJ,WAAW,CAAA,WAAO,iBAAiB,gBAAU,kBAAA;MAC3C,KAAG;MACH,OAAG;MACJ,CAAC;KACH,CAAC;;GAEL,CAAC;EAAE,gBAAkB,MAAA;GACpB,IAAI,OAAK;AACP,WAAK,MAAQ,QAAC,MAAA;;GAEhB,IAAI,WAAI;AACN,WAAA,gBAAA,KAAA;KACH,MAAA;KACH,WAAA,SAAA,gBAAA,kBAAA,eAES,CAAC;KACH,CAAC;;;;;AAIR,SAAS,aAAA,EACP,QACC;AACD,QAAO,CAAA,gBAAiB,MAAQ;EAC9B,IAAI,OAAK;AACP,UAAO,QAAA,KAAA;;EAET,IAAE,WAAA;AACH,UAAA,gBAAA,KAAA;IACH,IAAA,OAAA;;;IAGE,WAAiB,CAAA,KAAA,WAAA,gBAAA,kBAAA;KACN;KACF;KACR,CAAA;;;EAGA,CAAC,CAAC;;;;;;;;;;;AAWL,SAAU,SAAA,OAAA;CACR,MAAG,CAAI,EACL,UACA,YAEF,UACG,QAAA,WAAA,OAAA;EAAA;EAAA;EAAA;EAAA;EAAA,CAAA;AACH,QAAO,gBAAK,YAAA,WAAA,MAAA;EACJ;EACN,IAAE,SAAS;AACT,UAAA,gBAAe,gBAAA,EACd,UAAW,QACX,CAAC;;EAEJ,UAAQ;EACR,IAAI,WAAC;AACH,UAAK,CAAA,gBAAQ,MAAA;IACX,IAAG,OAAK;AACN,YAAA,QAAA,KAAA;;IAEJ,IAAA,WAAU;AACb,YAAA,gBAAA,cAAA,EACH;;IAGG,CAAA,EAAO,gBAAkB,MAAA;IAC3B,IAAA,OAAA;AACS,YAAO,QAAK,SAAW;;IAE/B,IAAA,WAAA;AACK,YAAS,CAAA,UAAA,gBAAsB,OAAA,EAAA,CAAA,CAAA;;;;;;;;;;;;AAatC,SAAO,eAAoB,OAAU;CACnC,MAAM,EACJ,aACE;CACJ,MAAK,UAAA,mBAA2B;AAChC,QAAO;EAAA,gBAAA,MAAqB;GAC1B,IAAI,OAAA;AACF,WAAM,QAAA,SAAA;;GAET,IAAA,WAAA;AACH,WAAA,CAAA,UAAA,gBAAA,OAAA,EAAA,CAAA,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-alloy",
3
- "version": "0.26.26",
3
+ "version": "0.26.28",
4
4
  "type": "module",
5
5
  "description": "A package containing various Alloy framework components and helper utilities.",
6
6
  "repository": {
@@ -433,6 +433,20 @@
433
433
  "default": "./dist/markdown/components/front-matter.mjs"
434
434
  }
435
435
  },
436
+ "./markdown/components/heading": {
437
+ "require": {
438
+ "types": "./dist/markdown/components/heading.d.cts",
439
+ "default": "./dist/markdown/components/heading.cjs"
440
+ },
441
+ "import": {
442
+ "types": "./dist/markdown/components/heading.d.mts",
443
+ "default": "./dist/markdown/components/heading.mjs"
444
+ },
445
+ "default": {
446
+ "types": "./dist/markdown/components/heading.d.mts",
447
+ "default": "./dist/markdown/components/heading.mjs"
448
+ }
449
+ },
436
450
  "./markdown/components/markdown-file": {
437
451
  "require": {
438
452
  "types": "./dist/markdown/components/markdown-file.d.cts",
@@ -888,13 +902,14 @@
888
902
  "files": ["dist/**/*"],
889
903
  "keywords": ["alloy-js", "powerlines", "storm-software", "powerlines-plugin"],
890
904
  "dependencies": {
905
+ "@babel/preset-typescript": "8.0.0-rc.3",
891
906
  "@alloy-js/babel-preset": "^0.2.1",
892
907
  "@alloy-js/core": "0.23.0-dev.8",
893
908
  "@alloy-js/json": "0.23.0-dev.2",
894
909
  "@alloy-js/markdown": "0.23.0-dev.1",
895
910
  "@alloy-js/typescript": "0.23.0-dev.4",
896
- "@powerlines/deepkit": "^0.8.10",
897
- "@powerlines/plugin-babel": "^0.12.402",
911
+ "@powerlines/deepkit": "^0.8.12",
912
+ "@powerlines/plugin-babel": "^0.12.404",
898
913
  "@storm-software/config-tools": "^1.189.77",
899
914
  "@stryke/capnp": "^0.12.92",
900
915
  "@stryke/convert": "^0.6.58",
@@ -907,14 +922,14 @@
907
922
  "@stryke/types": "^0.11.3",
908
923
  "@stryke/unique-id": "^0.3.77",
909
924
  "defu": "^6.1.7",
910
- "powerlines": "^0.43.7",
925
+ "powerlines": "^0.43.9",
911
926
  "prettier": "^3.8.3",
912
927
  "unctx": "^2.5.0"
913
928
  },
914
929
  "devDependencies": {
915
- "@powerlines/plugin-plugin": "^0.12.359",
930
+ "@powerlines/plugin-plugin": "^0.12.361",
916
931
  "@types/node": "^25.6.0"
917
932
  },
918
933
  "publishConfig": { "access": "public" },
919
- "gitHead": "b7dcad6bc06c093b3a839ab89438129c56f72813"
934
+ "gitHead": "507b498ea7a291431e92f4ebfb82978f07e45a47"
920
935
  }