@powerlines/plugin-alloy 0.26.75 → 0.26.77

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 (164) hide show
  1. package/dist/_virtual/_rolldown/runtime.cjs +29 -1
  2. package/dist/core/components/index.cjs +12 -1
  3. package/dist/core/components/index.mjs +7 -1
  4. package/dist/core/components/infrastructure-file.cjs +48 -1
  5. package/dist/core/components/infrastructure-file.mjs +45 -1
  6. package/dist/core/components/infrastructure-file.mjs.map +1 -1
  7. package/dist/core/components/output.cjs +41 -1
  8. package/dist/core/components/output.mjs +39 -1
  9. package/dist/core/components/output.mjs.map +1 -1
  10. package/dist/core/components/single-line-comment.cjs +23 -1
  11. package/dist/core/components/single-line-comment.mjs +21 -1
  12. package/dist/core/components/single-line-comment.mjs.map +1 -1
  13. package/dist/core/components/source-file.cjs +64 -1
  14. package/dist/core/components/source-file.mjs +61 -1
  15. package/dist/core/components/source-file.mjs.map +1 -1
  16. package/dist/core/components/spacing.cjs +20 -1
  17. package/dist/core/components/spacing.mjs +18 -1
  18. package/dist/core/components/spacing.mjs.map +1 -1
  19. package/dist/core/contexts/context.cjs +41 -1
  20. package/dist/core/contexts/context.mjs +36 -1
  21. package/dist/core/contexts/context.mjs.map +1 -1
  22. package/dist/core/contexts/index.cjs +22 -1
  23. package/dist/core/contexts/index.mjs +5 -1
  24. package/dist/core/contexts/meta.cjs +41 -1
  25. package/dist/core/contexts/meta.mjs +36 -1
  26. package/dist/core/contexts/meta.mjs.map +1 -1
  27. package/dist/core/contexts/reflection.cjs +80 -1
  28. package/dist/core/contexts/reflection.mjs +70 -1
  29. package/dist/core/contexts/reflection.mjs.map +1 -1
  30. package/dist/core/helpers/code.cjs +34 -1
  31. package/dist/core/helpers/code.mjs +32 -1
  32. package/dist/core/helpers/code.mjs.map +1 -1
  33. package/dist/core/helpers/index.cjs +4 -1
  34. package/dist/core/helpers/index.mjs +3 -1
  35. package/dist/core/index.cjs +37 -1
  36. package/dist/core/index.mjs +14 -1
  37. package/dist/hcl/components/block-declaration.cjs +34 -1
  38. package/dist/hcl/components/block-declaration.mjs +32 -1
  39. package/dist/hcl/components/block-declaration.mjs.map +1 -1
  40. package/dist/hcl/components/hcl-file.cjs +83 -1
  41. package/dist/hcl/components/hcl-file.mjs +80 -1
  42. package/dist/hcl/components/hcl-file.mjs.map +1 -1
  43. package/dist/hcl/components/index.cjs +11 -1
  44. package/dist/hcl/components/index.mjs +6 -1
  45. package/dist/hcl/components/packer-file.cjs +29 -1
  46. package/dist/hcl/components/packer-file.mjs +27 -1
  47. package/dist/hcl/components/packer-file.mjs.map +1 -1
  48. package/dist/hcl/components/terraform-file.cjs +30 -1
  49. package/dist/hcl/components/terraform-file.mjs +28 -1
  50. package/dist/hcl/components/terraform-file.mjs.map +1 -1
  51. package/dist/hcl/index.cjs +12 -1
  52. package/dist/hcl/index.mjs +7 -1
  53. package/dist/helpers/capnp.cjs +245 -37
  54. package/dist/helpers/capnp.mjs +227 -37
  55. package/dist/helpers/capnp.mjs.map +1 -1
  56. package/dist/helpers/create-builtin.cjs +20 -1
  57. package/dist/helpers/create-builtin.mjs +18 -1
  58. package/dist/helpers/create-builtin.mjs.map +1 -1
  59. package/dist/helpers/index.cjs +25 -1
  60. package/dist/helpers/index.mjs +6 -1
  61. package/dist/helpers/refkey.cjs +17 -1
  62. package/dist/helpers/refkey.mjs +15 -1
  63. package/dist/helpers/refkey.mjs.map +1 -1
  64. package/dist/helpers/typescript.cjs +43 -19
  65. package/dist/helpers/typescript.mjs +41 -19
  66. package/dist/helpers/typescript.mjs.map +1 -1
  67. package/dist/index.cjs +55 -1
  68. package/dist/index.mjs +51 -1
  69. package/dist/index.mjs.map +1 -1
  70. package/dist/markdown/components/front-matter.cjs +29 -1
  71. package/dist/markdown/components/front-matter.mjs +27 -1
  72. package/dist/markdown/components/front-matter.mjs.map +1 -1
  73. package/dist/markdown/components/heading.cjs +24 -1
  74. package/dist/markdown/components/heading.mjs +22 -1
  75. package/dist/markdown/components/heading.mjs.map +1 -1
  76. package/dist/markdown/components/index.cjs +13 -1
  77. package/dist/markdown/components/index.mjs +6 -1
  78. package/dist/markdown/components/markdown-file.cjs +135 -1
  79. package/dist/markdown/components/markdown-file.mjs +132 -1
  80. package/dist/markdown/components/markdown-file.mjs.map +1 -1
  81. package/dist/markdown/components/markdown-table.cjs +102 -1
  82. package/dist/markdown/components/markdown-table.mjs +98 -1
  83. package/dist/markdown/components/markdown-table.mjs.map +1 -1
  84. package/dist/markdown/contexts/index.cjs +7 -1
  85. package/dist/markdown/contexts/index.mjs +3 -1
  86. package/dist/markdown/contexts/markdown-table.cjs +38 -1
  87. package/dist/markdown/contexts/markdown-table.mjs +33 -1
  88. package/dist/markdown/contexts/markdown-table.mjs.map +1 -1
  89. package/dist/markdown/index.cjs +20 -1
  90. package/dist/markdown/index.mjs +9 -1
  91. package/dist/render.cjs +91 -1
  92. package/dist/render.mjs +88 -1
  93. package/dist/render.mjs.map +1 -1
  94. package/dist/types/components.cjs +9 -0
  95. package/dist/types/components.mjs +9 -1
  96. package/dist/types/index.mjs +1 -1
  97. package/dist/types/plugin.mjs +1 -1
  98. package/dist/typescript/components/builtin-file.cjs +63 -1
  99. package/dist/typescript/components/builtin-file.mjs +61 -1
  100. package/dist/typescript/components/builtin-file.mjs.map +1 -1
  101. package/dist/typescript/components/class-declaration.cjs +306 -1
  102. package/dist/typescript/components/class-declaration.mjs +299 -1
  103. package/dist/typescript/components/class-declaration.mjs.map +1 -1
  104. package/dist/typescript/components/dynamic-import-statement.cjs +26 -1
  105. package/dist/typescript/components/dynamic-import-statement.mjs +24 -1
  106. package/dist/typescript/components/dynamic-import-statement.mjs.map +1 -1
  107. package/dist/typescript/components/entry-file.cjs +43 -1
  108. package/dist/typescript/components/entry-file.mjs +40 -1
  109. package/dist/typescript/components/entry-file.mjs.map +1 -1
  110. package/dist/typescript/components/index.cjs +64 -1
  111. package/dist/typescript/components/index.mjs +15 -1
  112. package/dist/typescript/components/interface-declaration.cjs +239 -1
  113. package/dist/typescript/components/interface-declaration.mjs +234 -1
  114. package/dist/typescript/components/interface-declaration.mjs.map +1 -1
  115. package/dist/typescript/components/object-declaration.cjs +139 -1
  116. package/dist/typescript/components/object-declaration.mjs +136 -1
  117. package/dist/typescript/components/object-declaration.mjs.map +1 -1
  118. package/dist/typescript/components/property-name.cjs +32 -1
  119. package/dist/typescript/components/property-name.mjs +30 -1
  120. package/dist/typescript/components/property-name.mjs.map +1 -1
  121. package/dist/typescript/components/record-expression.cjs +13 -3
  122. package/dist/typescript/components/record-expression.mjs +11 -3
  123. package/dist/typescript/components/record-expression.mjs.map +1 -1
  124. package/dist/typescript/components/tsdoc-reflection.cjs +331 -1
  125. package/dist/typescript/components/tsdoc-reflection.mjs +324 -1
  126. package/dist/typescript/components/tsdoc-reflection.mjs.map +1 -1
  127. package/dist/typescript/components/tsdoc.cjs +497 -1
  128. package/dist/typescript/components/tsdoc.mjs +475 -1
  129. package/dist/typescript/components/tsdoc.mjs.map +1 -1
  130. package/dist/typescript/components/type-declaration.cjs +39 -1
  131. package/dist/typescript/components/type-declaration.mjs +37 -1
  132. package/dist/typescript/components/type-declaration.mjs.map +1 -1
  133. package/dist/typescript/components/type-parameters.cjs +83 -1
  134. package/dist/typescript/components/type-parameters.mjs +81 -1
  135. package/dist/typescript/components/type-parameters.mjs.map +1 -1
  136. package/dist/typescript/components/typescript-file.cjs +221 -1
  137. package/dist/typescript/components/typescript-file.mjs +217 -1
  138. package/dist/typescript/components/typescript-file.mjs.map +1 -1
  139. package/dist/typescript/contexts/index.cjs +4 -1
  140. package/dist/typescript/contexts/index.mjs +3 -1
  141. package/dist/typescript/contexts/lexical-scope.cjs +26 -1
  142. package/dist/typescript/contexts/lexical-scope.mjs +24 -1
  143. package/dist/typescript/contexts/lexical-scope.mjs.map +1 -1
  144. package/dist/typescript/contexts/member-scope.cjs +24 -1
  145. package/dist/typescript/contexts/member-scope.mjs +22 -1
  146. package/dist/typescript/contexts/member-scope.mjs.map +1 -1
  147. package/dist/typescript/helpers/get-call-signature-props.cjs +26 -1
  148. package/dist/typescript/helpers/get-call-signature-props.mjs +24 -1
  149. package/dist/typescript/helpers/get-call-signature-props.mjs.map +1 -1
  150. package/dist/typescript/helpers/index.cjs +6 -1
  151. package/dist/typescript/helpers/index.mjs +4 -1
  152. package/dist/typescript/helpers/utilities.cjs +15 -1
  153. package/dist/typescript/helpers/utilities.mjs +13 -1
  154. package/dist/typescript/helpers/utilities.mjs.map +1 -1
  155. package/dist/typescript/index.cjs +73 -1
  156. package/dist/typescript/index.mjs +21 -1
  157. package/dist/yaml/components/index.cjs +5 -1
  158. package/dist/yaml/components/index.mjs +3 -1
  159. package/dist/yaml/components/yaml-file.cjs +149 -1
  160. package/dist/yaml/components/yaml-file.mjs +146 -1
  161. package/dist/yaml/components/yaml-file.mjs.map +1 -1
  162. package/dist/yaml/index.cjs +6 -1
  163. package/dist/yaml/index.mjs +4 -1
  164. package/package.json +6 -6
@@ -1 +1 @@
1
- {"version":3,"file":"refkey.mjs","names":[],"sources":["../../src/helpers/refkey.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 { Refkey, refkey as refkeyExternal } from \"@alloy-js/core\";\n\n/**\n * Create a refkey for the provided arguments. Passing no arguments returns a fresh refkey that is guaranteed to be unique. Otherwise, the arguments passed will be used to create a refkey for those values. Providing the same arguments will always return the same refkey.\n *\n * @remarks\n * Values are compared using the SameValueZero algorithm, which considers objects the same if they are reference identical, and primitives the same if they are the same value, with the exception of `NaN`, which is always considered equal to other `NaN` values, and `-0`, which is considered identical to `+0`\n */\nexport function refkey(...args: unknown[]): Refkey {\n return refkeyExternal(\"powerlines\", ...args);\n}\n"],"mappings":"wCA0BA,SAAgB,EAAO,GAAG,EAAM,CAC9B,OAAO,EAAe,aAAc,GAAG,EAAK"}
1
+ {"version":3,"file":"refkey.mjs","names":[],"sources":["../../src/helpers/refkey.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 { Refkey, refkey as refkeyExternal } from \"@alloy-js/core\";\n\n/**\n * Create a refkey for the provided arguments. Passing no arguments returns a fresh refkey that is guaranteed to be unique. Otherwise, the arguments passed will be used to create a refkey for those values. Providing the same arguments will always return the same refkey.\n *\n * @remarks\n * Values are compared using the SameValueZero algorithm, which considers objects the same if they are reference identical, and primitives the same if they are the same value, with the exception of `NaN`, which is always considered equal to other `NaN` values, and `-0`, which is considered identical to `+0`\n */\nexport function refkey(...args: unknown[]): Refkey {\n return refkeyExternal(\"powerlines\", ...args);\n}\n"],"mappings":";;;;;;;;;AA0BA,SAAgB,OAAO,GAAG,MAAM;AAC9B,QAAO,SAAe,cAAc,GAAG,KAAK"}
@@ -1,24 +1,48 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);let e=require(`@stryke/string-format/title-case`),t=require(`@powerlines/deepkit/utilities`),n=require(`@stryke/string-format/camel-case`),r=require(`@stryke/type-checks/is-undefined`);function i(i,a={}){return i?`
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
+ let _stryke_string_format_title_case = require("@stryke/string-format/title-case");
4
+ let _powerlines_deepkit_utilities = require("@powerlines/deepkit/utilities");
5
+ let _stryke_string_format_camel_case = require("@stryke/string-format/camel-case");
6
+ let _stryke_type_checks_is_undefined = require("@stryke/type-checks/is-undefined");
7
+
8
+ //#region src/helpers/typescript.ts
2
9
  /**
3
- * ${i.getDescription()||`${(0,e.titleCase)(a.overrideName||i.getClassName()||i.getName())} object instance`}.
10
+ * Generates a TypeScript object for the given reflection class.
11
+ *
12
+ * @param reflection - The reflection class to generate the object for.
13
+ * @param options - Options for generating the object.
14
+ * @returns A string containing the TypeScript object definition.
15
+ */
16
+ function generateObjectDeclaration(reflection, options = {}) {
17
+ if (!reflection) return "";
18
+ return `
19
+ /**
20
+ * ${reflection.getDescription() || `${(0, _stryke_string_format_title_case.titleCase)(options.overrideName || reflection.getClassName() || reflection.getName())} object instance`}.
4
21
  */
5
- export const ${(0,n.camelCase)(a.overrideName||i.getName())}${a.overrideExtends!==!1&&(a.overrideExtends||i.getSuperReflectionClass()?.getName())?`: ${a.overrideExtends||i.getSuperReflectionClass()?.getName()}`:``} = {
6
- ${i.getProperties().filter(e=>!e.isIgnored()&&!(0,r.isUndefined)(a.defaultValues?.[e.getNameAsString()]??e.getAlias().reduce((e,t)=>(0,r.isUndefined)(e)&&!(0,r.isUndefined)(a.defaultValues?.[t])?a.defaultValues?.[t]:e,void 0)??e.getDefaultValue())).sort((e,t)=>e.isReadonly()&&t.isReadonly()||!e.isReadonly()&&!t.isReadonly()?e.getNameAsString().localeCompare(t.getNameAsString()):e.isReadonly()?1:-1).map(n=>` /**
7
- * ${n.getDescription()||n.getTitle()||(0,e.titleCase)(n.getNameAsString())}
22
+ export const ${(0, _stryke_string_format_camel_case.camelCase)(options.overrideName || reflection.getName())}${options.overrideExtends !== false && (options.overrideExtends || reflection.getSuperReflectionClass()?.getName()) ? `: ${options.overrideExtends || reflection.getSuperReflectionClass()?.getName()}` : ""} = {
23
+ ${reflection.getProperties().filter((item) => !item.isIgnored() && !(0, _stryke_type_checks_is_undefined.isUndefined)(options.defaultValues?.[item.getNameAsString()] ?? item.getAlias().reduce((ret, alias) => {
24
+ if ((0, _stryke_type_checks_is_undefined.isUndefined)(ret) && !(0, _stryke_type_checks_is_undefined.isUndefined)(options.defaultValues?.[alias])) return options.defaultValues?.[alias];
25
+ return ret;
26
+ }, void 0) ?? item.getDefaultValue())).sort((a, b) => a.isReadonly() && b.isReadonly() || !a.isReadonly() && !b.isReadonly() ? a.getNameAsString().localeCompare(b.getNameAsString()) : a.isReadonly() ? 1 : -1).map((item) => ` /**
27
+ * ${item.getDescription() || item.getTitle() || (0, _stryke_string_format_title_case.titleCase)(item.getNameAsString())}
8
28
  *
9
- * @title ${n.getTitle()||(0,e.titleCase)(n.getNameAsString())}${n.getAlias().length?`
10
- ${n.getAlias().map(e=>` * @alias ${e}`).join(`
11
- `)}`:``}${n.getDomain()?`
12
- * @domain ${n.getDomain()}`:``}${n.getPermission().length?`
13
- ${n.getPermission().map(e=>` * @permission ${e}`).join(`
14
- `)}`:``}${n.isInternal()?`
15
- * @internal`:``}${n.isRuntime()?`
16
- * @runtime`:``}${n.isReadonly()?`
17
- * @readonly`:``}${n.isIgnored()?`
18
- * @ignored`:``}${n.isHidden()?`
19
- * @hidden`:``}
29
+ * @title ${item.getTitle() || (0, _stryke_string_format_title_case.titleCase)(item.getNameAsString())}${item.getAlias().length ? `
30
+ ${item.getAlias().map((alias) => ` * @alias ${alias}`).join("\n")}` : ""}${item.getDomain() ? `
31
+ * @domain ${item.getDomain()}` : ""}${item.getPermission().length ? `
32
+ ${item.getPermission().map((permission) => ` * @permission ${permission}`).join("\n")}` : ""}${item.isInternal() ? `
33
+ * @internal` : ""}${item.isRuntime() ? `
34
+ * @runtime` : ""}${item.isReadonly() ? `
35
+ * @readonly` : ""}${item.isIgnored() ? `
36
+ * @ignored` : ""}${item.isHidden() ? `
37
+ * @hidden` : ""}
20
38
  */
21
- ${n.getNameAsString()}: ${(0,t.stringifyValue)(n.getType(),a.defaultValues?.[n.getNameAsString()]??n.getAlias().reduce((e,t)=>(0,r.isUndefined)(e)&&!(0,r.isUndefined)(a.defaultValues?.[t])?a.defaultValues?.[t]:e,void 0)??n.getDefaultValue())}`).join(`,
22
- `)}
39
+ ${item.getNameAsString()}: ${(0, _powerlines_deepkit_utilities.stringifyValue)(item.getType(), options.defaultValues?.[item.getNameAsString()] ?? item.getAlias().reduce((ret, alias) => {
40
+ if ((0, _stryke_type_checks_is_undefined.isUndefined)(ret) && !(0, _stryke_type_checks_is_undefined.isUndefined)(options.defaultValues?.[alias])) return options.defaultValues?.[alias];
41
+ return ret;
42
+ }, void 0) ?? item.getDefaultValue())}`).join(", \n")}
23
43
  };
24
- `:``}exports.generateObjectDeclaration=i;
44
+ `;
45
+ }
46
+
47
+ //#endregion
48
+ exports.generateObjectDeclaration = generateObjectDeclaration;
@@ -1,25 +1,47 @@
1
- import{titleCase as e}from"@stryke/string-format/title-case";import{stringifyValue as t}from"@powerlines/deepkit/utilities";import{camelCase as n}from"@stryke/string-format/camel-case";import{isUndefined as r}from"@stryke/type-checks/is-undefined";function i(i,a={}){return i?`
1
+ import { titleCase } from "@stryke/string-format/title-case";
2
+ import { stringifyValue } from "@powerlines/deepkit/utilities";
3
+ import { camelCase } from "@stryke/string-format/camel-case";
4
+ import { isUndefined } from "@stryke/type-checks/is-undefined";
5
+
6
+ //#region src/helpers/typescript.ts
2
7
  /**
3
- * ${i.getDescription()||`${e(a.overrideName||i.getClassName()||i.getName())} object instance`}.
8
+ * Generates a TypeScript object for the given reflection class.
9
+ *
10
+ * @param reflection - The reflection class to generate the object for.
11
+ * @param options - Options for generating the object.
12
+ * @returns A string containing the TypeScript object definition.
13
+ */
14
+ function generateObjectDeclaration(reflection, options = {}) {
15
+ if (!reflection) return "";
16
+ return `
17
+ /**
18
+ * ${reflection.getDescription() || `${titleCase(options.overrideName || reflection.getClassName() || reflection.getName())} object instance`}.
4
19
  */
5
- export const ${n(a.overrideName||i.getName())}${a.overrideExtends!==!1&&(a.overrideExtends||i.getSuperReflectionClass()?.getName())?`: ${a.overrideExtends||i.getSuperReflectionClass()?.getName()}`:``} = {
6
- ${i.getProperties().filter(e=>!e.isIgnored()&&!r(a.defaultValues?.[e.getNameAsString()]??e.getAlias().reduce((e,t)=>r(e)&&!r(a.defaultValues?.[t])?a.defaultValues?.[t]:e,void 0)??e.getDefaultValue())).sort((e,t)=>e.isReadonly()&&t.isReadonly()||!e.isReadonly()&&!t.isReadonly()?e.getNameAsString().localeCompare(t.getNameAsString()):e.isReadonly()?1:-1).map(n=>` /**
7
- * ${n.getDescription()||n.getTitle()||e(n.getNameAsString())}
20
+ export const ${camelCase(options.overrideName || reflection.getName())}${options.overrideExtends !== false && (options.overrideExtends || reflection.getSuperReflectionClass()?.getName()) ? `: ${options.overrideExtends || reflection.getSuperReflectionClass()?.getName()}` : ""} = {
21
+ ${reflection.getProperties().filter((item) => !item.isIgnored() && !isUndefined(options.defaultValues?.[item.getNameAsString()] ?? item.getAlias().reduce((ret, alias) => {
22
+ if (isUndefined(ret) && !isUndefined(options.defaultValues?.[alias])) return options.defaultValues?.[alias];
23
+ return ret;
24
+ }, void 0) ?? item.getDefaultValue())).sort((a, b) => a.isReadonly() && b.isReadonly() || !a.isReadonly() && !b.isReadonly() ? a.getNameAsString().localeCompare(b.getNameAsString()) : a.isReadonly() ? 1 : -1).map((item) => ` /**
25
+ * ${item.getDescription() || item.getTitle() || titleCase(item.getNameAsString())}
8
26
  *
9
- * @title ${n.getTitle()||e(n.getNameAsString())}${n.getAlias().length?`
10
- ${n.getAlias().map(e=>` * @alias ${e}`).join(`
11
- `)}`:``}${n.getDomain()?`
12
- * @domain ${n.getDomain()}`:``}${n.getPermission().length?`
13
- ${n.getPermission().map(e=>` * @permission ${e}`).join(`
14
- `)}`:``}${n.isInternal()?`
15
- * @internal`:``}${n.isRuntime()?`
16
- * @runtime`:``}${n.isReadonly()?`
17
- * @readonly`:``}${n.isIgnored()?`
18
- * @ignored`:``}${n.isHidden()?`
19
- * @hidden`:``}
27
+ * @title ${item.getTitle() || titleCase(item.getNameAsString())}${item.getAlias().length ? `
28
+ ${item.getAlias().map((alias) => ` * @alias ${alias}`).join("\n")}` : ""}${item.getDomain() ? `
29
+ * @domain ${item.getDomain()}` : ""}${item.getPermission().length ? `
30
+ ${item.getPermission().map((permission) => ` * @permission ${permission}`).join("\n")}` : ""}${item.isInternal() ? `
31
+ * @internal` : ""}${item.isRuntime() ? `
32
+ * @runtime` : ""}${item.isReadonly() ? `
33
+ * @readonly` : ""}${item.isIgnored() ? `
34
+ * @ignored` : ""}${item.isHidden() ? `
35
+ * @hidden` : ""}
20
36
  */
21
- ${n.getNameAsString()}: ${t(n.getType(),a.defaultValues?.[n.getNameAsString()]??n.getAlias().reduce((e,t)=>r(e)&&!r(a.defaultValues?.[t])?a.defaultValues?.[t]:e,void 0)??n.getDefaultValue())}`).join(`,
22
- `)}
37
+ ${item.getNameAsString()}: ${stringifyValue(item.getType(), options.defaultValues?.[item.getNameAsString()] ?? item.getAlias().reduce((ret, alias) => {
38
+ if (isUndefined(ret) && !isUndefined(options.defaultValues?.[alias])) return options.defaultValues?.[alias];
39
+ return ret;
40
+ }, void 0) ?? item.getDefaultValue())}`).join(", \n")}
23
41
  };
24
- `:``}export{i as generateObjectDeclaration};
42
+ `;
43
+ }
44
+
45
+ //#endregion
46
+ export { generateObjectDeclaration };
25
47
  //# sourceMappingURL=typescript.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"typescript.mjs","names":[],"sources":["../../src/helpers/typescript.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 { stringifyValue } from \"@powerlines/deepkit/utilities\";\nimport type { ReflectionClass } from \"@powerlines/deepkit/vendor/type\";\nimport { camelCase } from \"@stryke/string-format/camel-case\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { isUndefined } from \"@stryke/type-checks/is-undefined\";\n\nexport interface GenerateInterfaceDeclarationOptions<T> {\n overrideName?: string;\n overrideExtends?: string | false;\n defaultValues?: Partial<T>;\n}\n\n// /**\n// * Generates a TypeScript interface for the given reflection class.\n// *\n// * @param reflection - The reflection class to generate the interface for.\n// * @returns A string containing the TypeScript interface definition.\n// */\n// export function InterfaceDeclaration<T>(\n// reflection: ReflectionClass<T>,\n// options: GenerateInterfaceDeclarationOptions<T> = {}\n// ): string {\n// if (!reflection) {\n// return \"\";\n// }\n\n// return `\n// /**\n// * Interface for ${reflection.getTitle() || titleCase(options.overrideName || reflection.getName())}.\n// *\n// * @title ${reflection.getTitle() || titleCase(reflection.getName())}${\n// reflection.getAlias().length\n// ? ` ${reflection\n// .getAlias()\n// .map(alias => ` * @alias ${alias}`)\n// .join(\"\\n\")}`\n// : \"\"\n// }${reflection.getDomain() ? ` * @domain ${reflection.getDomain()}` : \"\"}${\n// reflection.getPermission().length\n// ? `\n// ${reflection\n// .getPermission()\n// .map(permission => ` * @permission ${permission}`)\n// .join(\"\\n\")}`\n// : \"\"\n// }${\n// reflection.isInternal()\n// ? `\n// * @internal`\n// : \"\"\n// }${\n// reflection.isReadonly()\n// ? `\n// * @readonly`\n// : \"\"\n// }${\n// reflection.isIgnored()\n// ? `\n// * @ignored`\n// : \"\"\n// }${\n// reflection.isHidden()\n// ? `\n// * @hidden`\n// : \"\"\n// }\n// */\n// export interface ${pascalCase(options.overrideName || reflection.getName())}${\n// options.overrideExtends !== false &&\n// (options.overrideExtends || reflection.getSuperReflectionClass()?.getName())\n// ? ` extends ${options.overrideExtends || reflection.getSuperReflectionClass()?.getName()}`\n// : \"\"\n// } {\n// ${reflection\n// .getProperties()\n// .filter(item => !item.isIgnored())\n// .sort((a, b) =>\n// (a.isReadonly() && b.isReadonly()) || (!a.isReadonly() && !b.isReadonly())\n// ? a.getNameAsString().localeCompare(b.getNameAsString())\n// : a.isReadonly()\n// ? 1\n// : -1\n// )\n// .map(\n// item =>\n// ` /**\n// * ${\n// item.getDescription() ||\n// item.getTitle() ||\n// titleCase(item.getNameAsString())\n// }\n// *\n// * @title ${item.getTitle() || titleCase(item.getNameAsString())}${\n// item.getAlias().length\n// ? `\n// ${item\n// .getAlias()\n// .map(alias => ` * @alias ${alias}`)\n// .join(\"\\n\")}`\n// : \"\"\n// }${\n// item.getDomain()\n// ? `\n// * @domain ${item.getDomain()}`\n// : \"\"\n// }${\n// item.getPermission().length\n// ? `\n// ${item\n// .getPermission()\n// .map(permission => ` * @permission ${permission}`)\n// .join(\"\\n\")}`\n// : \"\"\n// }${\n// !isUndefined(item.getDefaultValue()) && item.getDefaultValue() !== \"\"\n// ? `\n// * @defaultValue ${item.getDefaultValue()}`\n// : \"\"\n// }${\n// item.isInternal()\n// ? `\n// * @internal`\n// : \"\"\n// }${\n// item.isReadonly()\n// ? `\n// * @readonly`\n// : \"\"\n// }${\n// item.isHidden()\n// ? `\n// * @hidden`\n// : \"\"\n// }\n// */\n// ${item.isReadonly() ? \"readonly \" : \"\"}${item.getNameAsString()}${\n// isUndefined(\n// (options.defaultValues as Record<string, any>)?.[item.getNameAsString()]\n// ) &&\n// isUndefined(item.getDefaultValue()) &&\n// !item\n// .getAlias()\n// .some(\n// alias =>\n// !isUndefined(\n// (options.defaultValues as Record<string, any>)?.[alias]\n// )\n// ) &&\n// item.isOptional()\n// ? \"?\"\n// : \"\"\n// }: ${stringifyType(item.getType())}`\n// )\n// .join(\", \\n\")}\n// }\n// `;\n// }\n\nexport interface GenerateObjectDeclarationOptions<T> {\n overrideName?: string;\n overrideExtends?: string | false;\n defaultValues?: Partial<T>;\n}\n\n/**\n * Generates a TypeScript object for the given reflection class.\n *\n * @param reflection - The reflection class to generate the object for.\n * @param options - Options for generating the object.\n * @returns A string containing the TypeScript object definition.\n */\nexport function generateObjectDeclaration<T extends Record<string, any>>(\n reflection: ReflectionClass<T>,\n options: GenerateObjectDeclarationOptions<T> = {}\n) {\n if (!reflection) {\n return \"\";\n }\n\n return `\n/**\n * ${\n reflection.getDescription() ||\n `${titleCase(options.overrideName || reflection.getClassName() || reflection.getName())} object instance`\n }.\n */\nexport const ${camelCase(options.overrideName || reflection.getName())}${\n options.overrideExtends !== false &&\n (options.overrideExtends || reflection.getSuperReflectionClass()?.getName())\n ? `: ${options.overrideExtends || reflection.getSuperReflectionClass()?.getName()}`\n : \"\"\n } = {\n ${reflection\n .getProperties()\n .filter(\n item =>\n !item.isIgnored() &&\n !isUndefined(\n options.defaultValues?.[item.getNameAsString()] ??\n item.getAlias().reduce((ret, alias) => {\n if (\n isUndefined(ret) &&\n !isUndefined(\n (options.defaultValues as Record<string, any>)?.[alias]\n )\n ) {\n return (options.defaultValues as Record<string, any>)?.[alias];\n }\n\n return ret;\n }, undefined) ??\n item.getDefaultValue()\n )\n )\n .sort((a, b) =>\n (a.isReadonly() && b.isReadonly()) || (!a.isReadonly() && !b.isReadonly())\n ? a.getNameAsString().localeCompare(b.getNameAsString())\n : a.isReadonly()\n ? 1\n : -1\n )\n .map(\n item =>\n ` /**\n * ${\n item.getDescription() ||\n item.getTitle() ||\n titleCase(item.getNameAsString())\n }\n *\n * @title ${item.getTitle() || titleCase(item.getNameAsString())}${\n item.getAlias().length\n ? `\n ${item\n .getAlias()\n .map(alias => ` * @alias ${alias}`)\n .join(\"\\n\")}`\n : \"\"\n }${\n item.getDomain()\n ? `\n * @domain ${item.getDomain()}`\n : \"\"\n }${\n item.getPermission().length\n ? `\n ${item\n .getPermission()\n .map(permission => ` * @permission ${permission}`)\n .join(\"\\n\")}`\n : \"\"\n }${\n item.isInternal()\n ? `\n * @internal`\n : \"\"\n }${\n item.isRuntime()\n ? `\n * @runtime`\n : \"\"\n }${\n item.isReadonly()\n ? `\n * @readonly`\n : \"\"\n }${\n item.isIgnored()\n ? `\n * @ignored`\n : \"\"\n }${\n item.isHidden()\n ? `\n * @hidden`\n : \"\"\n }\n */\n ${item.getNameAsString()}: ${stringifyValue(\n item.getType(),\n options.defaultValues?.[item.getNameAsString()] ??\n item.getAlias().reduce((ret, alias) => {\n if (\n isUndefined(ret) &&\n !isUndefined((options.defaultValues as Record<string, any>)?.[alias])\n ) {\n return (options.defaultValues as Record<string, any>)?.[alias];\n }\n\n return ret;\n }, undefined) ??\n item.getDefaultValue()\n )}`\n )\n .join(\", \\n\")}\n};\n`;\n}\n"],"mappings":"wPAgLA,SAAgB,EAAC,EAAoC,EAAA,EAAA,CAAA,CAIrD,OAHE,EAGF;;KAEE,EAAA,gBAAA,EAAA,GAAA,EAAA,EAAA,cAAA,EAAA,cAAA,EAAA,EAAA,SAAA,CAAA,CAAA,kBAAA;;eAED,EAAA,EAAA,cAAA,EAAA,SAAA,CAAA,GAAA,EAAA,kBAAA,KAAA,EAAA,iBAAA,EAAA,yBAAA,EAAA,SAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,yBAAA,EAAA,SAAA,GAAA,GAAA;IACG,EAAM,eAAiB,CAAA,OAAW,GAAQ,CAAC,EAAA,WAAa,EAAO,CAAA,EAAG,EAAA,gBAAA,EAAA,iBAAA,GAAA,EAAA,UAAA,CAAA,QAAA,EAAA,IAClE,EAAgB,EAAA,EAAQ,CAAA,EAAI,EAAe,gBAAM,GAAA,CACxC,EAAQ,gBAAe,GAE7B,EACL,IAAA,GAAY,EAAA,EAAA,iBAAkB,CAAA,CAAA,CAAA,MAAA,EAAA,IAAA,EAAA,YAAA,EAAA,EAAA,YAAA,EAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,YAAA,CAAA,EAAA,iBAAA,CAAA,cAAA,EAAA,iBAAA,CAAA,CAAA,EAAA,YAAA,CAAA,EAAA,GAAA,CAAA,IAAA,GAAA;MAC9B,EAAS,gBAAA,EAAA,EAAA,UAAmC,EAAI,EAAA,EAAA,iBAAA,CAAA,CAAA;;aAE3C,EAAW,UAAC,EAAA,EAAA,EAAA,iBAAA,CAAA,GAAA,EAAA,UAAA,CAAA,OAAA;IACf,EAAA,UAAS,CAAA,IAAA,GAAA,aAAA,IAAA,CAAA,KAAA;EAAA,GAAA,KAAA,EAAA,WAAA,CAAA;cACX,EAAA,WAAA,GAAA,KAAA,EAAA,eAAA,CAAA,OAAA;;;eAEO,KAAA,EAAA,WAAA,CAAA;cACP,KAAA,EAAA,YAAA,CAAA;eACE,KAAA,EAAA,WAAA,CAAA;cACU,KAAA,EAAA,UAAkB,CAAA;aACjB,GAAC;;IAEd,EAAA,iBAAA,CAAA,IAAA,EAAA,EAAA,SAAA,CAAA,EAAA,gBAAA,EAAA,iBAAA,GAAA,EAAA,UAAA,CAAA,QAAA,EAAA,IACK,EAAQ,EAAS,EAAC,CAAA,EAAQ,EAAgB,gBAAW,GAAY,CAC5D,EAAA,gBAAyB,GAE1B,EACN,IAAA,GAAI,EAAA,EAAA,iBAAA,CAAA,GAAA,CAAA,KAAA;EAAA,CAAA;;EA9BP"}
1
+ {"version":3,"file":"typescript.mjs","names":[],"sources":["../../src/helpers/typescript.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 { stringifyValue } from \"@powerlines/deepkit/utilities\";\nimport type { ReflectionClass } from \"@powerlines/deepkit/vendor/type\";\nimport { camelCase } from \"@stryke/string-format/camel-case\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { isUndefined } from \"@stryke/type-checks/is-undefined\";\n\nexport interface GenerateInterfaceDeclarationOptions<T> {\n overrideName?: string;\n overrideExtends?: string | false;\n defaultValues?: Partial<T>;\n}\n\n// /**\n// * Generates a TypeScript interface for the given reflection class.\n// *\n// * @param reflection - The reflection class to generate the interface for.\n// * @returns A string containing the TypeScript interface definition.\n// */\n// export function InterfaceDeclaration<T>(\n// reflection: ReflectionClass<T>,\n// options: GenerateInterfaceDeclarationOptions<T> = {}\n// ): string {\n// if (!reflection) {\n// return \"\";\n// }\n\n// return `\n// /**\n// * Interface for ${reflection.getTitle() || titleCase(options.overrideName || reflection.getName())}.\n// *\n// * @title ${reflection.getTitle() || titleCase(reflection.getName())}${\n// reflection.getAlias().length\n// ? ` ${reflection\n// .getAlias()\n// .map(alias => ` * @alias ${alias}`)\n// .join(\"\\n\")}`\n// : \"\"\n// }${reflection.getDomain() ? ` * @domain ${reflection.getDomain()}` : \"\"}${\n// reflection.getPermission().length\n// ? `\n// ${reflection\n// .getPermission()\n// .map(permission => ` * @permission ${permission}`)\n// .join(\"\\n\")}`\n// : \"\"\n// }${\n// reflection.isInternal()\n// ? `\n// * @internal`\n// : \"\"\n// }${\n// reflection.isReadonly()\n// ? `\n// * @readonly`\n// : \"\"\n// }${\n// reflection.isIgnored()\n// ? `\n// * @ignored`\n// : \"\"\n// }${\n// reflection.isHidden()\n// ? `\n// * @hidden`\n// : \"\"\n// }\n// */\n// export interface ${pascalCase(options.overrideName || reflection.getName())}${\n// options.overrideExtends !== false &&\n// (options.overrideExtends || reflection.getSuperReflectionClass()?.getName())\n// ? ` extends ${options.overrideExtends || reflection.getSuperReflectionClass()?.getName()}`\n// : \"\"\n// } {\n// ${reflection\n// .getProperties()\n// .filter(item => !item.isIgnored())\n// .sort((a, b) =>\n// (a.isReadonly() && b.isReadonly()) || (!a.isReadonly() && !b.isReadonly())\n// ? a.getNameAsString().localeCompare(b.getNameAsString())\n// : a.isReadonly()\n// ? 1\n// : -1\n// )\n// .map(\n// item =>\n// ` /**\n// * ${\n// item.getDescription() ||\n// item.getTitle() ||\n// titleCase(item.getNameAsString())\n// }\n// *\n// * @title ${item.getTitle() || titleCase(item.getNameAsString())}${\n// item.getAlias().length\n// ? `\n// ${item\n// .getAlias()\n// .map(alias => ` * @alias ${alias}`)\n// .join(\"\\n\")}`\n// : \"\"\n// }${\n// item.getDomain()\n// ? `\n// * @domain ${item.getDomain()}`\n// : \"\"\n// }${\n// item.getPermission().length\n// ? `\n// ${item\n// .getPermission()\n// .map(permission => ` * @permission ${permission}`)\n// .join(\"\\n\")}`\n// : \"\"\n// }${\n// !isUndefined(item.getDefaultValue()) && item.getDefaultValue() !== \"\"\n// ? `\n// * @defaultValue ${item.getDefaultValue()}`\n// : \"\"\n// }${\n// item.isInternal()\n// ? `\n// * @internal`\n// : \"\"\n// }${\n// item.isReadonly()\n// ? `\n// * @readonly`\n// : \"\"\n// }${\n// item.isHidden()\n// ? `\n// * @hidden`\n// : \"\"\n// }\n// */\n// ${item.isReadonly() ? \"readonly \" : \"\"}${item.getNameAsString()}${\n// isUndefined(\n// (options.defaultValues as Record<string, any>)?.[item.getNameAsString()]\n// ) &&\n// isUndefined(item.getDefaultValue()) &&\n// !item\n// .getAlias()\n// .some(\n// alias =>\n// !isUndefined(\n// (options.defaultValues as Record<string, any>)?.[alias]\n// )\n// ) &&\n// item.isOptional()\n// ? \"?\"\n// : \"\"\n// }: ${stringifyType(item.getType())}`\n// )\n// .join(\", \\n\")}\n// }\n// `;\n// }\n\nexport interface GenerateObjectDeclarationOptions<T> {\n overrideName?: string;\n overrideExtends?: string | false;\n defaultValues?: Partial<T>;\n}\n\n/**\n * Generates a TypeScript object for the given reflection class.\n *\n * @param reflection - The reflection class to generate the object for.\n * @param options - Options for generating the object.\n * @returns A string containing the TypeScript object definition.\n */\nexport function generateObjectDeclaration<T extends Record<string, any>>(\n reflection: ReflectionClass<T>,\n options: GenerateObjectDeclarationOptions<T> = {}\n) {\n if (!reflection) {\n return \"\";\n }\n\n return `\n/**\n * ${\n reflection.getDescription() ||\n `${titleCase(options.overrideName || reflection.getClassName() || reflection.getName())} object instance`\n }.\n */\nexport const ${camelCase(options.overrideName || reflection.getName())}${\n options.overrideExtends !== false &&\n (options.overrideExtends || reflection.getSuperReflectionClass()?.getName())\n ? `: ${options.overrideExtends || reflection.getSuperReflectionClass()?.getName()}`\n : \"\"\n } = {\n ${reflection\n .getProperties()\n .filter(\n item =>\n !item.isIgnored() &&\n !isUndefined(\n options.defaultValues?.[item.getNameAsString()] ??\n item.getAlias().reduce((ret, alias) => {\n if (\n isUndefined(ret) &&\n !isUndefined(\n (options.defaultValues as Record<string, any>)?.[alias]\n )\n ) {\n return (options.defaultValues as Record<string, any>)?.[alias];\n }\n\n return ret;\n }, undefined) ??\n item.getDefaultValue()\n )\n )\n .sort((a, b) =>\n (a.isReadonly() && b.isReadonly()) || (!a.isReadonly() && !b.isReadonly())\n ? a.getNameAsString().localeCompare(b.getNameAsString())\n : a.isReadonly()\n ? 1\n : -1\n )\n .map(\n item =>\n ` /**\n * ${\n item.getDescription() ||\n item.getTitle() ||\n titleCase(item.getNameAsString())\n }\n *\n * @title ${item.getTitle() || titleCase(item.getNameAsString())}${\n item.getAlias().length\n ? `\n ${item\n .getAlias()\n .map(alias => ` * @alias ${alias}`)\n .join(\"\\n\")}`\n : \"\"\n }${\n item.getDomain()\n ? `\n * @domain ${item.getDomain()}`\n : \"\"\n }${\n item.getPermission().length\n ? `\n ${item\n .getPermission()\n .map(permission => ` * @permission ${permission}`)\n .join(\"\\n\")}`\n : \"\"\n }${\n item.isInternal()\n ? `\n * @internal`\n : \"\"\n }${\n item.isRuntime()\n ? `\n * @runtime`\n : \"\"\n }${\n item.isReadonly()\n ? `\n * @readonly`\n : \"\"\n }${\n item.isIgnored()\n ? `\n * @ignored`\n : \"\"\n }${\n item.isHidden()\n ? `\n * @hidden`\n : \"\"\n }\n */\n ${item.getNameAsString()}: ${stringifyValue(\n item.getType(),\n options.defaultValues?.[item.getNameAsString()] ??\n item.getAlias().reduce((ret, alias) => {\n if (\n isUndefined(ret) &&\n !isUndefined((options.defaultValues as Record<string, any>)?.[alias])\n ) {\n return (options.defaultValues as Record<string, any>)?.[alias];\n }\n\n return ret;\n }, undefined) ??\n item.getDefaultValue()\n )}`\n )\n .join(\", \\n\")}\n};\n`;\n}\n"],"mappings":";;;;;;;;;;;;;AAgLA,SAAgB,0BAAC,YAAoC,UAAA,EAAA,EAAA;AACnD,KAAA,CAAA,WACA,QAAA;AAEF,QAAA;;KAEE,WAAA,gBAAA,IAAA,GAAA,UAAA,QAAA,gBAAA,WAAA,cAAA,IAAA,WAAA,SAAA,CAAA,CAAA,kBAAA;;eAED,UAAA,QAAA,gBAAA,WAAA,SAAA,CAAA,GAAA,QAAA,oBAAA,UAAA,QAAA,mBAAA,WAAA,yBAAA,EAAA,SAAA,IAAA,KAAA,QAAA,mBAAA,WAAA,yBAAA,EAAA,SAAA,KAAA,GAAA;IACG,WAAM,eAAiB,CAAA,QAAW,SAAQ,CAAC,KAAA,WAAa,IAAO,CAAA,YAAG,QAAA,gBAAA,KAAA,iBAAA,KAAA,KAAA,UAAA,CAAA,QAAA,KAAA,UAAA;AAClE,MAAA,YAAgB,IAAA,IAAQ,CAAA,YAAI,QAAe,gBAAM,OAAA,CACjD,QAAS,QAAQ,gBAAe;AAEpC,SAAO;IACL,OAAY,IAAA,KAAA,iBAAkB,CAAA,CAAA,CAAA,MAAA,GAAA,MAAA,EAAA,YAAA,IAAA,EAAA,YAAA,IAAA,CAAA,EAAA,YAAA,IAAA,CAAA,EAAA,YAAA,GAAA,EAAA,iBAAA,CAAA,cAAA,EAAA,iBAAA,CAAA,GAAA,EAAA,YAAA,GAAA,IAAA,GAAA,CAAA,KAAA,SAAA;MAC9B,KAAS,gBAAA,IAAA,KAAA,UAAmC,IAAI,UAAA,KAAA,iBAAA,CAAA,CAAA;;aAE3C,KAAW,UAAC,IAAA,UAAA,KAAA,iBAAA,CAAA,GAAA,KAAA,UAAA,CAAA,SAAA;IACf,KAAA,UAAS,CAAA,KAAA,UAAA,aAAA,QAAA,CAAA,KAAA,KAAA,KAAA,KAAA,KAAA,WAAA,GAAA;cACX,KAAA,WAAA,KAAA,KAAA,KAAA,eAAA,CAAA,SAAA;;iBAEO,KAAA,KAAA,WAAA,GAAA;gBACP,KAAA,KAAA,YAAA,GAAA;iBACE,KAAA,KAAA,WAAA,GAAA;gBACU,KAAA,KAAA,UAAkB,GAAA;eACjB,GAAC;;IAEd,KAAA,iBAAA,CAAA,IAAA,eAAA,KAAA,SAAA,EAAA,QAAA,gBAAA,KAAA,iBAAA,KAAA,KAAA,UAAA,CAAA,QAAA,KAAA,UAAA;AACF,MAAO,YAAQ,IAAS,IAAC,CAAA,YAAQ,QAAgB,gBAAW,OAAY,CACpE,QAAQ,QAAA,gBAAyB;AAEjC,SAAO;IACN,OAAI,IAAA,KAAA,iBAAA,CAAA,GAAA,CAAA,KAAA,OAAA,CAAA"}
package/dist/index.cjs CHANGED
@@ -1 +1,55 @@
1
- Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require(`./_virtual/_rolldown/runtime.cjs`);let t=require(`@powerlines/plugin-babel`);t=e.__toESM(t);let n=require(`@stryke/json/storm-json`),r=require(`@stryke/path/file-path-fns`);const i=(e={})=>[(0,t.default)(),{name:`alloy`,config(){return this.debug(`Updating configuration options to support Alloy-js builds.`),{alloy:{typescript:!0,...e},babel:{skipConfigResolution:!0,presets:[`@babel/preset-typescript`,[`@alloy-js/babel-preset`,{},(e,t)=>(0,r.findFileExtension)(t)===`tsx`||(0,r.findFileExtension)(t)===`jsx`]]},tsdown:{inputOptions:{transform:{jsx:`preserve`}}},resolve:{external:[`@alloy-js/core`,`@alloy-js/typescript`,`@alloy-js/json`,`@alloy-js/markdown`]}}},async configResolved(){this.debug(`Ensuring TypeScript configuration is set up for Alloy-js.`),this.tsconfig.tsconfigJson.compilerOptions?.jsx!==`preserve`&&(this.tsconfig.tsconfigJson.compilerOptions??={},this.tsconfig.tsconfigJson.compilerOptions.jsx=`preserve`,await this.fs.write(this.tsconfig.tsconfigFilePath,n.StormJSON.stringify(this.tsconfig.tsconfigJson)))}}];exports.default=i,exports.plugin=i;
1
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
2
+ const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
3
+ let _powerlines_plugin_babel = require("@powerlines/plugin-babel");
4
+ _powerlines_plugin_babel = require_runtime.__toESM(_powerlines_plugin_babel);
5
+ let _stryke_json_storm_json = require("@stryke/json/storm-json");
6
+ let _stryke_path_file_path_fns = require("@stryke/path/file-path-fns");
7
+
8
+ //#region src/index.tsx
9
+ /**
10
+ * Alloy-js plugin for Powerlines.
11
+ *
12
+ * @param options - The Alloy-js plugin user configuration options.
13
+ * @returns A Powerlines plugin that integrates Alloy-js transformations.
14
+ */
15
+ const plugin = (options = {}) => {
16
+ return [(0, _powerlines_plugin_babel.default)(), {
17
+ name: "alloy",
18
+ config() {
19
+ this.debug("Updating configuration options to support Alloy-js builds.");
20
+ return {
21
+ alloy: {
22
+ typescript: true,
23
+ ...options
24
+ },
25
+ babel: {
26
+ skipConfigResolution: true,
27
+ presets: ["@babel/preset-typescript", [
28
+ "@alloy-js/babel-preset",
29
+ {},
30
+ (_, id) => (0, _stryke_path_file_path_fns.findFileExtension)(id) === "tsx" || (0, _stryke_path_file_path_fns.findFileExtension)(id) === "jsx"
31
+ ]]
32
+ },
33
+ tsdown: { inputOptions: { transform: { jsx: "preserve" } } },
34
+ resolve: { external: [
35
+ "@alloy-js/core",
36
+ "@alloy-js/typescript",
37
+ "@alloy-js/json",
38
+ "@alloy-js/markdown"
39
+ ] }
40
+ };
41
+ },
42
+ async configResolved() {
43
+ this.debug("Ensuring TypeScript configuration is set up for Alloy-js.");
44
+ if (this.tsconfig.tsconfigJson.compilerOptions?.jsx !== "preserve") {
45
+ this.tsconfig.tsconfigJson.compilerOptions ??= {};
46
+ this.tsconfig.tsconfigJson.compilerOptions.jsx = "preserve";
47
+ await this.fs.write(this.tsconfig.tsconfigFilePath, _stryke_json_storm_json.StormJSON.stringify(this.tsconfig.tsconfigJson));
48
+ }
49
+ }
50
+ }];
51
+ };
52
+
53
+ //#endregion
54
+ exports.default = plugin;
55
+ exports.plugin = plugin;
package/dist/index.mjs CHANGED
@@ -1,2 +1,52 @@
1
- import e from"@powerlines/plugin-babel";import{StormJSON as t}from"@stryke/json/storm-json";import{findFileExtension as n}from"@stryke/path/file-path-fns";const r=(r={})=>[e(),{name:`alloy`,config(){return this.debug(`Updating configuration options to support Alloy-js builds.`),{alloy:{typescript:!0,...r},babel:{skipConfigResolution:!0,presets:[`@babel/preset-typescript`,[`@alloy-js/babel-preset`,{},(e,t)=>n(t)===`tsx`||n(t)===`jsx`]]},tsdown:{inputOptions:{transform:{jsx:`preserve`}}},resolve:{external:[`@alloy-js/core`,`@alloy-js/typescript`,`@alloy-js/json`,`@alloy-js/markdown`]}}},async configResolved(){this.debug(`Ensuring TypeScript configuration is set up for Alloy-js.`),this.tsconfig.tsconfigJson.compilerOptions?.jsx!==`preserve`&&(this.tsconfig.tsconfigJson.compilerOptions??={},this.tsconfig.tsconfigJson.compilerOptions.jsx=`preserve`,await this.fs.write(this.tsconfig.tsconfigFilePath,t.stringify(this.tsconfig.tsconfigJson)))}}];export{r as default,r as plugin};
1
+ import babel from "@powerlines/plugin-babel";
2
+ import { StormJSON } from "@stryke/json/storm-json";
3
+ import { findFileExtension } from "@stryke/path/file-path-fns";
4
+
5
+ //#region src/index.tsx
6
+ /**
7
+ * Alloy-js plugin for Powerlines.
8
+ *
9
+ * @param options - The Alloy-js plugin user configuration options.
10
+ * @returns A Powerlines plugin that integrates Alloy-js transformations.
11
+ */
12
+ const plugin = (options = {}) => {
13
+ return [babel(), {
14
+ name: "alloy",
15
+ config() {
16
+ this.debug("Updating configuration options to support Alloy-js builds.");
17
+ return {
18
+ alloy: {
19
+ typescript: true,
20
+ ...options
21
+ },
22
+ babel: {
23
+ skipConfigResolution: true,
24
+ presets: ["@babel/preset-typescript", [
25
+ "@alloy-js/babel-preset",
26
+ {},
27
+ (_, id) => findFileExtension(id) === "tsx" || findFileExtension(id) === "jsx"
28
+ ]]
29
+ },
30
+ tsdown: { inputOptions: { transform: { jsx: "preserve" } } },
31
+ resolve: { external: [
32
+ "@alloy-js/core",
33
+ "@alloy-js/typescript",
34
+ "@alloy-js/json",
35
+ "@alloy-js/markdown"
36
+ ] }
37
+ };
38
+ },
39
+ async configResolved() {
40
+ this.debug("Ensuring TypeScript configuration is set up for Alloy-js.");
41
+ if (this.tsconfig.tsconfigJson.compilerOptions?.jsx !== "preserve") {
42
+ this.tsconfig.tsconfigJson.compilerOptions ??= {};
43
+ this.tsconfig.tsconfigJson.compilerOptions.jsx = "preserve";
44
+ await this.fs.write(this.tsconfig.tsconfigFilePath, StormJSON.stringify(this.tsconfig.tsconfigJson));
45
+ }
46
+ }
47
+ }];
48
+ };
49
+
50
+ //#endregion
51
+ export { plugin as default, plugin };
2
52
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.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 babel from \"@powerlines/plugin-babel\";\nimport { StormJSON } from \"@stryke/json/storm-json\";\nimport { findFileExtension } from \"@stryke/path/file-path-fns\";\nimport type { Plugin } from \"powerlines\";\nimport type { AlloyPluginContext, AlloyPluginOptions } from \"./types/plugin\";\n\ndeclare module \"powerlines\" {\n interface Config {\n alloy?: AlloyPluginOptions;\n }\n}\n\n/**\n * Alloy-js plugin for Powerlines.\n *\n * @param options - The Alloy-js plugin user configuration options.\n * @returns A Powerlines plugin that integrates Alloy-js transformations.\n */\nexport const plugin = <\n TContext extends AlloyPluginContext = AlloyPluginContext\n>(\n options: AlloyPluginOptions = {}\n) => {\n return [\n babel(),\n {\n name: \"alloy\",\n config() {\n this.debug(\n \"Updating configuration options to support Alloy-js builds.\"\n );\n\n return {\n alloy: {\n typescript: true,\n ...options\n },\n babel: {\n skipConfigResolution: true,\n presets: [\n \"@babel/preset-typescript\",\n [\n \"@alloy-js/babel-preset\",\n {},\n (_: string, id: string) =>\n findFileExtension(id) === \"tsx\" ||\n findFileExtension(id) === \"jsx\"\n ]\n ]\n },\n tsdown: {\n inputOptions: {\n transform: {\n jsx: \"preserve\"\n }\n }\n },\n resolve: {\n external: [\n \"@alloy-js/core\",\n \"@alloy-js/typescript\",\n \"@alloy-js/json\",\n \"@alloy-js/markdown\"\n ]\n }\n };\n },\n async configResolved() {\n this.debug(\"Ensuring TypeScript configuration is set up for Alloy-js.\");\n\n if (this.tsconfig.tsconfigJson.compilerOptions?.jsx !== \"preserve\") {\n this.tsconfig.tsconfigJson.compilerOptions ??= {};\n this.tsconfig.tsconfigJson.compilerOptions.jsx = \"preserve\";\n\n await this.fs.write(\n this.tsconfig.tsconfigFilePath,\n StormJSON.stringify(this.tsconfig.tsconfigJson)\n );\n }\n }\n }\n ] as Plugin<TContext>[];\n};\n\nexport default plugin;\n"],"mappings":"2JA2BA,MAAE,GAAA,EAAA,EAAA,GACF,CAAA,GAAA,CAAA,cAEE,QAAA,CAED,OADE,KAAQ,MAAC,6DAAqB,CAChC,CACG,MAAM,CACN,WAAU,GACZ,GAAA,EACK,CACL,MAAS,CACV,qBAAA,GACS,QAAC,CAAA,2BAAsB,CAAA,yBAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,GAAA,OAAA,EAAA,EAAA,GAAA,MAAA,CAAA,CAC5B,CACG,OAAC,CACC,aAAC,CACP,UAAA,CACS,IAAM,WACN,CACL,CACC,CACD,QAAC,CAAA,SAAA,gFAED,CACD,EAEH,MAAM,gBAAK,CACT,KAAK,MAAA,4DAAA,CACD,KAAK,SAAE,aAAA,iBAAA,MAAA,aACT,KAAI,SAAA,aAAsB,kBAAI,EAAA,CAC9B,KAAI,SAAS,aAAA,gBAAA,IAAA,WACb,MAAM,KAAE,GAAM,MAAM,KAAC,SAAW,iBAAA,EAAA,UAAA,KAAA,SAAA,aAAA,CAAA,GAGrC,CAAC"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.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 babel from \"@powerlines/plugin-babel\";\nimport { StormJSON } from \"@stryke/json/storm-json\";\nimport { findFileExtension } from \"@stryke/path/file-path-fns\";\nimport type { Plugin } from \"powerlines\";\nimport type { AlloyPluginContext, AlloyPluginOptions } from \"./types/plugin\";\n\ndeclare module \"powerlines\" {\n interface Config {\n alloy?: AlloyPluginOptions;\n }\n}\n\n/**\n * Alloy-js plugin for Powerlines.\n *\n * @param options - The Alloy-js plugin user configuration options.\n * @returns A Powerlines plugin that integrates Alloy-js transformations.\n */\nexport const plugin = <\n TContext extends AlloyPluginContext = AlloyPluginContext\n>(\n options: AlloyPluginOptions = {}\n) => {\n return [\n babel(),\n {\n name: \"alloy\",\n config() {\n this.debug(\n \"Updating configuration options to support Alloy-js builds.\"\n );\n\n return {\n alloy: {\n typescript: true,\n ...options\n },\n babel: {\n skipConfigResolution: true,\n presets: [\n \"@babel/preset-typescript\",\n [\n \"@alloy-js/babel-preset\",\n {},\n (_: string, id: string) =>\n findFileExtension(id) === \"tsx\" ||\n findFileExtension(id) === \"jsx\"\n ]\n ]\n },\n tsdown: {\n inputOptions: {\n transform: {\n jsx: \"preserve\"\n }\n }\n },\n resolve: {\n external: [\n \"@alloy-js/core\",\n \"@alloy-js/typescript\",\n \"@alloy-js/json\",\n \"@alloy-js/markdown\"\n ]\n }\n };\n },\n async configResolved() {\n this.debug(\"Ensuring TypeScript configuration is set up for Alloy-js.\");\n\n if (this.tsconfig.tsconfigJson.compilerOptions?.jsx !== \"preserve\") {\n this.tsconfig.tsconfigJson.compilerOptions ??= {};\n this.tsconfig.tsconfigJson.compilerOptions.jsx = \"preserve\";\n\n await this.fs.write(\n this.tsconfig.tsconfigFilePath,\n StormJSON.stringify(this.tsconfig.tsconfigJson)\n );\n }\n }\n }\n ] as Plugin<TContext>[];\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;AA2BA,MAAE,UAAA,UAAA,EAAA,KAAA;AACF,QAAA,CAAA,OAAA,EAAA;;EAEE,SAAA;AACC,QAAQ,MAAC,6DAAqB;AAChC,UAAA;IACG,OAAM;KACN,YAAU;KACZ,GAAA;KACK;IACL,OAAS;KACV,sBAAA;KACS,SAAC,CAAA,4BAAsB;MAAA;MAAA,EAAA;OAAA,GAAA,OAAA,kBAAA,GAAA,KAAA,SAAA,kBAAA,GAAA,KAAA;MAAA,CAAA;KAC5B;IACG,QAAC,EACC,cAAC,EACP,WAAA,EACS,KAAM,YACN,EACL,EACC;IACD,SAAC;;;;;OAED;IACD;;EAEH,MAAM,iBAAK;AACT,QAAK,MAAA,4DAAA;AACL,OAAI,KAAK,SAAE,aAAA,iBAAA,QAAA,YAAA;AACT,SAAI,SAAA,aAAsB,oBAAI,EAAA;AAC9B,SAAI,SAAS,aAAA,gBAAA,MAAA;AACb,UAAM,KAAE,GAAM,MAAM,KAAC,SAAW,kBAAA,UAAA,UAAA,KAAA,SAAA,aAAA,CAAA;;;EAGrC,CAAC"}
@@ -1 +1,29 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../_virtual/_rolldown/runtime.cjs`);let e=require(`@alloy-js/core/jsx-runtime`),t=require(`@alloy-js/core`);function n(n){return[`---`,(0,e.createIntrinsic)(`hbr`,{}),(0,e.createComponent)(t.For,{get each(){return Object.entries(n.data)},hardline:!0,children:([e,n])=>t.code`${e}: ${JSON.stringify(n)}`}),`---`,(0,e.createIntrinsic)(`hbr`,{})]}exports.FrontMatter=n;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
3
+ let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
4
+ let _alloy_js_core = require("@alloy-js/core");
5
+
6
+ //#region src/markdown/components/front-matter.tsx
7
+ /**
8
+ * Renders YAML front matter for a markdown file.
9
+ *
10
+ * @see https://jekyllrb.com/docs/front-matter/
11
+ */
12
+ function FrontMatter(props) {
13
+ return [
14
+ "---",
15
+ (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
16
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
17
+ get each() {
18
+ return Object.entries(props.data);
19
+ },
20
+ hardline: true,
21
+ children: ([key, value]) => _alloy_js_core.code`${key}: ${JSON.stringify(value)}`
22
+ }),
23
+ "---",
24
+ (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
25
+ ];
26
+ }
27
+
28
+ //#endregion
29
+ exports.FrontMatter = FrontMatter;
@@ -1,2 +1,28 @@
1
- import{createComponent as e,createIntrinsic as t}from"@alloy-js/core/jsx-runtime";import{For as n,code as r}from"@alloy-js/core";function i(i){return[`---`,t(`hbr`,{}),e(n,{get each(){return Object.entries(i.data)},hardline:!0,children:([e,t])=>r`${e}: ${JSON.stringify(t)}`}),`---`,t(`hbr`,{})]}export{i as FrontMatter};
1
+ import { createComponent, createIntrinsic } from "@alloy-js/core/jsx-runtime";
2
+ import { For, code } from "@alloy-js/core";
3
+
4
+ //#region src/markdown/components/front-matter.tsx
5
+ /**
6
+ * Renders YAML front matter for a markdown file.
7
+ *
8
+ * @see https://jekyllrb.com/docs/front-matter/
9
+ */
10
+ function FrontMatter(props) {
11
+ return [
12
+ "---",
13
+ createIntrinsic("hbr", {}),
14
+ createComponent(For, {
15
+ get each() {
16
+ return Object.entries(props.data);
17
+ },
18
+ hardline: true,
19
+ children: ([key, value]) => code`${key}: ${JSON.stringify(value)}`
20
+ }),
21
+ "---",
22
+ createIntrinsic("hbr", {})
23
+ ];
24
+ }
25
+
26
+ //#endregion
27
+ export { FrontMatter };
2
28
  //# sourceMappingURL=front-matter.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"front-matter.mjs","names":[],"sources":["../../../src/markdown/components/front-matter.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 { code, For } from \"@alloy-js/core\";\n\nexport interface FrontMatterProps {\n data: Record<string, any>;\n}\n\n/**\n * Renders YAML front matter for a markdown file.\n *\n * @see https://jekyllrb.com/docs/front-matter/\n */\nexport function FrontMatter(props: FrontMatterProps) {\n return (\n <>\n {\"---\"}\n <hbr />\n <For each={Object.entries(props.data)} hardline>\n {([key, value]) => code`${key}: ${JSON.stringify(value)}`}\n </For>\n {\"---\"}\n <hbr />\n </>\n );\n}\n"],"mappings":"iIAyBA,SAAgB,EAAY,EAAO,CAClC,MAAA,CAAA,MAAA,EAAA,MAAA,EAAA,CAAA,CAAA,EAAA,EAAA,CACG,IAAI,MAAO,CACb,OAAA,OAAA,QAAA,EAAA,KAAA,EAEA,SAAO,GACL,UAAC,CAAA,EAAA,KAAA,CAAA,GAAA,EAAA,IAAA,KAAA,UAAA,EAAA,GACF,CAAC,CAAE,MAAM,EAAA,MAAA,EAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"front-matter.mjs","names":[],"sources":["../../../src/markdown/components/front-matter.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 { code, For } from \"@alloy-js/core\";\n\nexport interface FrontMatterProps {\n data: Record<string, any>;\n}\n\n/**\n * Renders YAML front matter for a markdown file.\n *\n * @see https://jekyllrb.com/docs/front-matter/\n */\nexport function FrontMatter(props: FrontMatterProps) {\n return (\n <>\n {\"---\"}\n <hbr />\n <For each={Object.entries(props.data)} hardline>\n {([key, value]) => code`${key}: ${JSON.stringify(value)}`}\n </For>\n {\"---\"}\n <hbr />\n </>\n );\n}\n"],"mappings":";;;;;;;;;AAyBA,SAAgB,YAAY,OAAO;AAClC,QAAA;EAAA;EAAA,gBAAA,OAAA,EAAA,CAAA;EAAA,gBAAA,KAAA;GACG,IAAI,OAAO;AACb,WAAA,OAAA,QAAA,MAAA,KAAA;;GAEA,UAAO;GACL,WAAC,CAAA,KAAA,WAAA,IAAA,GAAA,IAAA,IAAA,KAAA,UAAA,MAAA;GACF,CAAC;EAAE;EAAM,gBAAA,OAAA,EAAA,CAAA;EAAA"}
@@ -1 +1,24 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../core/components/spacing.cjs`);let t=require(`@alloy-js/core/jsx-runtime`),n=require(`@alloy-js/markdown`);function r(r){let{children:i,...a}=r;return[(0,t.createComponent)(n.Heading,(0,t.mergeProps)({level:1},a,{children:i})),(0,t.createComponent)(e.Spacing,{})]}exports.Heading=r;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
3
+ const require_core_components_spacing = require('../../core/components/spacing.cjs');
4
+ let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
5
+ let _alloy_js_markdown = require("@alloy-js/markdown");
6
+
7
+ //#region src/markdown/components/heading.tsx
8
+ /**
9
+ * Renders a heading for a markdown file.
10
+ *
11
+ * @see https://www.markdownguide.org/basic-syntax/#headings
12
+ *
13
+ * @example
14
+ * ```tsx
15
+ * <Heading level={1}>This is a heading</Heading>
16
+ * ```
17
+ */
18
+ function Heading(props) {
19
+ const { children, ...rest } = props;
20
+ return [(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_markdown.Heading, (0, _alloy_js_core_jsx_runtime.mergeProps)({ level: 1 }, rest, { children })), (0, _alloy_js_core_jsx_runtime.createComponent)(require_core_components_spacing.Spacing, {})];
21
+ }
22
+
23
+ //#endregion
24
+ exports.Heading = Heading;
@@ -1,2 +1,23 @@
1
- import{Spacing as e}from"../../core/components/spacing.mjs";import{createComponent as t,mergeProps as n}from"@alloy-js/core/jsx-runtime";import{Heading as r}from"@alloy-js/markdown";function i(i){let{children:a,...o}=i;return[t(r,n({level:1},o,{children:a})),t(e,{})]}export{i as Heading};
1
+ import { Spacing } from "../../core/components/spacing.mjs";
2
+ import { createComponent, mergeProps } from "@alloy-js/core/jsx-runtime";
3
+ import { Heading as Heading$1 } from "@alloy-js/markdown";
4
+
5
+ //#region src/markdown/components/heading.tsx
6
+ /**
7
+ * Renders a heading for a markdown file.
8
+ *
9
+ * @see https://www.markdownguide.org/basic-syntax/#headings
10
+ *
11
+ * @example
12
+ * ```tsx
13
+ * <Heading level={1}>This is a heading</Heading>
14
+ * ```
15
+ */
16
+ function Heading(props) {
17
+ const { children, ...rest } = props;
18
+ return [createComponent(Heading$1, mergeProps({ level: 1 }, rest, { children })), createComponent(Spacing, {})];
19
+ }
20
+
21
+ //#endregion
22
+ export { Heading };
2
23
  //# sourceMappingURL=heading.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"heading.mjs","names":[],"sources":["../../../src/markdown/components/heading.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 { HeadingProps as BaseHeadingProps } from \"@alloy-js/markdown\";\nimport { Heading as BaseHeading } from \"@alloy-js/markdown\";\nimport { Spacing } from \"../../core/components/spacing\";\n\nexport interface HeadingProps extends BaseHeadingProps {}\n\n/**\n * Renders a heading for a markdown file.\n *\n * @see https://www.markdownguide.org/basic-syntax/#headings\n *\n * @example\n * ```tsx\n * <Heading level={1}>This is a heading</Heading>\n * ```\n */\nexport function Heading(props: HeadingProps) {\n const { children, ...rest } = props;\n\n return (\n <>\n <BaseHeading level={1} {...rest}>\n {children}\n </BaseHeading>\n <Spacing />\n </>\n );\n}\n"],"mappings":"sLA+BA,SAAY,EAAU,EAAS,CAC7B,GAAG,CACH,WACF,GAAO,GACL,gBAEA,MAAO,EACN,CAAE,EAAA,CACE,WACJ,CAAC,CAAC,CAAE,EAAU,EAAA,EAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"heading.mjs","names":[],"sources":["../../../src/markdown/components/heading.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 { HeadingProps as BaseHeadingProps } from \"@alloy-js/markdown\";\nimport { Heading as BaseHeading } from \"@alloy-js/markdown\";\nimport { Spacing } from \"../../core/components/spacing\";\n\nexport interface HeadingProps extends BaseHeadingProps {}\n\n/**\n * Renders a heading for a markdown file.\n *\n * @see https://www.markdownguide.org/basic-syntax/#headings\n *\n * @example\n * ```tsx\n * <Heading level={1}>This is a heading</Heading>\n * ```\n */\nexport function Heading(props: HeadingProps) {\n const { children, ...rest } = props;\n\n return (\n <>\n <BaseHeading level={1} {...rest}>\n {children}\n </BaseHeading>\n <Spacing />\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AA+BA,SAAY,QAAU,OAAS;CAC7B,MAAG,EACH,UACF,GAAO,SACL;iDAEA,OAAO,GACN,EAAE,MAAA,EACE,UACJ,CAAC,CAAC,EAAE,gBAAU,SAAA,EAAA,CAAA,CAAA"}
@@ -1 +1,13 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./front-matter.cjs`),t=require(`./heading.cjs`),n=require(`./markdown-file.cjs`),r=require(`./markdown-table.cjs`);exports.FrontMatter=e.FrontMatter,exports.Heading=t.Heading,exports.MarkdownFile=n.MarkdownFile,exports.MarkdownFileHeader=n.MarkdownFileHeader,exports.MarkdownTable=r.MarkdownTable,exports.MarkdownTableColumn=r.MarkdownTableColumn,exports.MarkdownTableColumnHeader=r.MarkdownTableColumnHeader;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_markdown_components_front_matter = require('./front-matter.cjs');
3
+ const require_markdown_components_heading = require('./heading.cjs');
4
+ const require_markdown_components_markdown_file = require('./markdown-file.cjs');
5
+ const require_markdown_components_markdown_table = require('./markdown-table.cjs');
6
+
7
+ exports.FrontMatter = require_markdown_components_front_matter.FrontMatter;
8
+ exports.Heading = require_markdown_components_heading.Heading;
9
+ exports.MarkdownFile = require_markdown_components_markdown_file.MarkdownFile;
10
+ exports.MarkdownFileHeader = require_markdown_components_markdown_file.MarkdownFileHeader;
11
+ exports.MarkdownTable = require_markdown_components_markdown_table.MarkdownTable;
12
+ exports.MarkdownTableColumn = require_markdown_components_markdown_table.MarkdownTableColumn;
13
+ exports.MarkdownTableColumnHeader = require_markdown_components_markdown_table.MarkdownTableColumnHeader;
@@ -1 +1,6 @@
1
- import{FrontMatter as e}from"./front-matter.mjs";import{Heading as t}from"./heading.mjs";import{MarkdownFile as n,MarkdownFileHeader as r}from"./markdown-file.mjs";import{MarkdownTable as i,MarkdownTableColumn as a,MarkdownTableColumnHeader as o}from"./markdown-table.mjs";export{e as FrontMatter,t as Heading,n as MarkdownFile,r as MarkdownFileHeader,i as MarkdownTable,a as MarkdownTableColumn,o as MarkdownTableColumnHeader};
1
+ import { FrontMatter } from "./front-matter.mjs";
2
+ import { Heading } from "./heading.mjs";
3
+ import { MarkdownFile, MarkdownFileHeader } from "./markdown-file.mjs";
4
+ import { MarkdownTable, MarkdownTableColumn, MarkdownTableColumnHeader } from "./markdown-table.mjs";
5
+
6
+ export { FrontMatter, Heading, MarkdownFile, MarkdownFileHeader, MarkdownTable, MarkdownTableColumn, MarkdownTableColumnHeader };