@powerlines/plugin-alloy 0.25.33 → 0.25.35

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 (80) hide show
  1. package/README.md +1 -1
  2. package/dist/core/components/output.cjs +17 -10
  3. package/dist/core/components/output.mjs +17 -10
  4. package/dist/core/components/output.mjs.map +1 -1
  5. package/dist/core/components/single-line-comment.cjs +6 -4
  6. package/dist/core/components/single-line-comment.mjs +6 -4
  7. package/dist/core/components/single-line-comment.mjs.map +1 -1
  8. package/dist/core/components/source-file.cjs +10 -6
  9. package/dist/core/components/source-file.mjs +10 -6
  10. package/dist/core/components/source-file.mjs.map +1 -1
  11. package/dist/core/components/spacing.cjs +6 -4
  12. package/dist/core/components/spacing.mjs +6 -4
  13. package/dist/core/components/spacing.mjs.map +1 -1
  14. package/dist/index.cjs +13 -18
  15. package/dist/index.d.cts.map +1 -1
  16. package/dist/index.d.mts.map +1 -1
  17. package/dist/index.mjs +12 -17
  18. package/dist/index.mjs.map +1 -1
  19. package/dist/markdown/components/front-matter.cjs +9 -7
  20. package/dist/markdown/components/front-matter.mjs +9 -7
  21. package/dist/markdown/components/front-matter.mjs.map +1 -1
  22. package/dist/markdown/components/markdown-file.cjs +76 -44
  23. package/dist/markdown/components/markdown-file.mjs +76 -44
  24. package/dist/markdown/components/markdown-file.mjs.map +1 -1
  25. package/dist/markdown/components/markdown-table.cjs +49 -28
  26. package/dist/markdown/components/markdown-table.mjs +49 -28
  27. package/dist/markdown/components/markdown-table.mjs.map +1 -1
  28. package/dist/render.cjs +3 -3
  29. package/dist/render.mjs +4 -4
  30. package/dist/render.mjs.map +1 -1
  31. package/dist/typescript/components/builtin-file.cjs +29 -19
  32. package/dist/typescript/components/builtin-file.mjs +30 -20
  33. package/dist/typescript/components/builtin-file.mjs.map +1 -1
  34. package/dist/typescript/components/class-declaration.cjs +165 -100
  35. package/dist/typescript/components/class-declaration.mjs +165 -100
  36. package/dist/typescript/components/class-declaration.mjs.map +1 -1
  37. package/dist/typescript/components/dynamic-import-statement.cjs +2 -6
  38. package/dist/typescript/components/dynamic-import-statement.mjs +2 -6
  39. package/dist/typescript/components/dynamic-import-statement.mjs.map +1 -1
  40. package/dist/typescript/components/entry-file.cjs +9 -6
  41. package/dist/typescript/components/entry-file.mjs +10 -7
  42. package/dist/typescript/components/entry-file.mjs.map +1 -1
  43. package/dist/typescript/components/infrastructure-file.cjs +9 -6
  44. package/dist/typescript/components/infrastructure-file.mjs +10 -7
  45. package/dist/typescript/components/infrastructure-file.mjs.map +1 -1
  46. package/dist/typescript/components/interface-declaration.cjs +121 -70
  47. package/dist/typescript/components/interface-declaration.mjs +121 -70
  48. package/dist/typescript/components/interface-declaration.mjs.map +1 -1
  49. package/dist/typescript/components/object-declaration.cjs +76 -44
  50. package/dist/typescript/components/object-declaration.mjs +76 -44
  51. package/dist/typescript/components/object-declaration.mjs.map +1 -1
  52. package/dist/typescript/components/property-name.cjs +3 -3
  53. package/dist/typescript/components/property-name.mjs +3 -3
  54. package/dist/typescript/components/property-name.mjs.map +1 -1
  55. package/dist/typescript/components/record-expression.mjs.map +1 -1
  56. package/dist/typescript/components/tsdoc-reflection.cjs +225 -104
  57. package/dist/typescript/components/tsdoc-reflection.mjs +225 -104
  58. package/dist/typescript/components/tsdoc-reflection.mjs.map +1 -1
  59. package/dist/typescript/components/tsdoc.cjs +255 -160
  60. package/dist/typescript/components/tsdoc.mjs +255 -160
  61. package/dist/typescript/components/tsdoc.mjs.map +1 -1
  62. package/dist/typescript/components/type-declaration.cjs +20 -15
  63. package/dist/typescript/components/type-declaration.mjs +20 -15
  64. package/dist/typescript/components/type-declaration.mjs.map +1 -1
  65. package/dist/typescript/components/type-parameters.cjs +55 -29
  66. package/dist/typescript/components/type-parameters.mjs +55 -29
  67. package/dist/typescript/components/type-parameters.mjs.map +1 -1
  68. package/dist/typescript/components/typescript-file.cjs +145 -80
  69. package/dist/typescript/components/typescript-file.mjs +145 -80
  70. package/dist/typescript/components/typescript-file.mjs.map +1 -1
  71. package/dist/typescript/contexts/lexical-scope.cjs +5 -3
  72. package/dist/typescript/contexts/lexical-scope.mjs +5 -3
  73. package/dist/typescript/contexts/lexical-scope.mjs.map +1 -1
  74. package/dist/typescript/contexts/member-scope.cjs +5 -3
  75. package/dist/typescript/contexts/member-scope.mjs +5 -3
  76. package/dist/typescript/contexts/member-scope.mjs.map +1 -1
  77. package/dist/yaml/components/yaml-file.cjs +92 -47
  78. package/dist/yaml/components/yaml-file.mjs +92 -47
  79. package/dist/yaml/components/yaml-file.mjs.map +1 -1
  80. package/package.json +16 -17
package/dist/render.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  import { Output as Output$1 } from "./core/components/output.mjs";
2
2
  import "./core/index.mjs";
3
- import { printTree, renderAsync, renderTree, traverseOutput } from "@alloy-js/core";
4
3
  import { findFileExtension } from "@stryke/path/file-path-fns";
5
- import { jsx } from "@alloy-js/core/jsx-runtime";
4
+ import { createComponent } from "@alloy-js/core/jsx-runtime";
5
+ import { printTree, renderAsync, renderTree, traverseOutput } from "@alloy-js/core";
6
6
 
7
7
  //#region src/render.tsx
8
8
  /**
@@ -21,7 +21,7 @@ import { jsx } from "@alloy-js/core/jsx-runtime";
21
21
  */
22
22
  async function render(context, children) {
23
23
  const meta = {};
24
- const output = await renderAsync(/* @__PURE__ */ jsx(Output$1, {
24
+ const output = await renderAsync(createComponent(Output$1, {
25
25
  context,
26
26
  meta,
27
27
  children
@@ -78,7 +78,7 @@ async function render(context, children) {
78
78
  * @returns The rendered output as a string.
79
79
  */
80
80
  function renderString(context, children, options) {
81
- return printTree(renderTree(/* @__PURE__ */ jsx(Output$1, {
81
+ return printTree(renderTree(createComponent(Output$1, {
82
82
  context,
83
83
  children
84
84
  })), options);
@@ -1 +1 @@
1
- {"version":3,"file":"render.mjs","names":["Output"],"sources":["../src/render.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 printTree,\n PrintTreeOptions,\n renderAsync,\n renderTree,\n traverseOutput\n} from \"@alloy-js/core\";\nimport { findFileExtension } from \"@stryke/path/file-path-fns\";\nimport { PluginContext } from \"powerlines\";\nimport { MetaItem, Output } from \"./core\";\n\n/**\n * A function to render children components within the [Alloy](https://alloy-framework.github.io) context, and write any saved content to the file system.\n *\n * @example\n * ```tsx\n * import { render } from \"@powerlines/plugin-alloy/render\";\n *\n * await render(context, <> ... </>);\n * ```\n *\n * @param context - The Powerlines plugin context.\n * @param children - The children components to render.\n * @returns A promise that resolves when rendering is complete.\n */\nexport async function render<TContext extends PluginContext>(\n context: TContext,\n children: Children\n) {\n const meta = {} as Record<string, MetaItem>;\n const output = await renderAsync(\n <Output<TContext> context={context} meta={meta}>\n {children}\n </Output>\n );\n\n if (!Object.keys(output).length) {\n context.debug(\n \"No output files were rendered by Alloy-js component templates.\"\n );\n } else {\n context.debug(\n `Processing ${\n Object.keys(output).length\n } rendered output files from Alloy-js component templates.`\n );\n\n await traverseOutput(output, {\n visitDirectory: directory => {\n if (context.fs.existsSync(directory.path)) {\n return;\n }\n\n context.fs.mkdirSync(directory.path);\n },\n visitFile: file => {\n if (\"contents\" in file) {\n const metadata = meta[file.path] ?? {};\n if (metadata.kind === \"builtin\") {\n if (!metadata.id) {\n throw new Error(\n `Built-in file \"${\n file.path\n }\" is missing its ID in the render metadata.`\n );\n }\n\n context.emitBuiltinSync(file.contents, metadata.id, {\n skipFormat: metadata.skipFormat,\n storage: metadata.storage,\n extension: findFileExtension(file.path)\n });\n } else if (metadata.kind === \"entry\") {\n context.emitEntrySync(file.contents, file.path, {\n skipFormat: metadata.skipFormat,\n storage: metadata.storage,\n ...(metadata.typeDefinition ?? {})\n });\n } else if (metadata.kind === \"infrastructure\") {\n if (!metadata.id) {\n throw new Error(\n `Infrastructure file \"${\n file.path\n }\" is missing its ID in the render metadata.`\n );\n }\n\n context.emitInfrastructureSync(file.contents, metadata.id, {\n skipFormat: metadata.skipFormat,\n storage: metadata.storage,\n extension: findFileExtension(file.path)\n });\n } else {\n context.emitSync(file.contents, file.path, metadata);\n }\n } else {\n context.fs.copySync(file.sourcePath, file.path);\n }\n }\n });\n }\n}\n\n/**\n * A function to render children components within the [Alloy](https://alloy-framework.github.io) context and return the rendered output as a string.\n *\n * @example\n * ```tsx\n * import { renderString } from \"@powerlines/plugin-alloy/render\";\n *\n * const output = await renderString(context, <> ... </>);\n * ```\n *\n * @param context - The Powerlines plugin context.\n * @param children - The children components to render.\n * @param options - Optional print tree options.\n * @returns The rendered output as a string.\n */\nexport function renderString<TContext extends PluginContext>(\n context: TContext,\n children: Children,\n options?: PrintTreeOptions\n) {\n const tree = renderTree(\n <Output<TContext> context={context}>{children}</Output>\n );\n\n return printTree(tree, options);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA4CA,eAAsB,OACpB,SACA,UACA;CACA,MAAM,OAAO,EAAE;CACf,MAAM,SAAS,MAAM,YACnB,oBAACA,UAAD;EAA2B;EAAe;EACvC;EACM,EACV;AAED,KAAI,CAAC,OAAO,KAAK,OAAO,CAAC,OACvB,SAAQ,MACN,iEACD;MACI;AACL,UAAQ,MACN,cACE,OAAO,KAAK,OAAO,CAAC,OACrB,2DACF;AAED,QAAM,eAAe,QAAQ;GAC3B,iBAAgB,cAAa;AAC3B,QAAI,QAAQ,GAAG,WAAW,UAAU,KAAK,CACvC;AAGF,YAAQ,GAAG,UAAU,UAAU,KAAK;;GAEtC,YAAW,SAAQ;AACjB,QAAI,cAAc,MAAM;KACtB,MAAM,WAAW,KAAK,KAAK,SAAS,EAAE;AACtC,SAAI,SAAS,SAAS,WAAW;AAC/B,UAAI,CAAC,SAAS,GACZ,OAAM,IAAI,MACR,kBACE,KAAK,KACN,6CACF;AAGH,cAAQ,gBAAgB,KAAK,UAAU,SAAS,IAAI;OAClD,YAAY,SAAS;OACrB,SAAS,SAAS;OAClB,WAAW,kBAAkB,KAAK,KAAK;OACxC,CAAC;gBACO,SAAS,SAAS,QAC3B,SAAQ,cAAc,KAAK,UAAU,KAAK,MAAM;MAC9C,YAAY,SAAS;MACrB,SAAS,SAAS;MAClB,GAAI,SAAS,kBAAkB,EAAE;MAClC,CAAC;cACO,SAAS,SAAS,kBAAkB;AAC7C,UAAI,CAAC,SAAS,GACZ,OAAM,IAAI,MACR,wBACE,KAAK,KACN,6CACF;AAGH,cAAQ,uBAAuB,KAAK,UAAU,SAAS,IAAI;OACzD,YAAY,SAAS;OACrB,SAAS,SAAS;OAClB,WAAW,kBAAkB,KAAK,KAAK;OACxC,CAAC;WAEF,SAAQ,SAAS,KAAK,UAAU,KAAK,MAAM,SAAS;UAGtD,SAAQ,GAAG,SAAS,KAAK,YAAY,KAAK,KAAK;;GAGpD,CAAC;;;;;;;;;;;;;;;;;;AAmBN,SAAgB,aACd,SACA,UACA,SACA;AAKA,QAAO,UAJM,WACX,oBAACA,UAAD;EAA2B;EAAU;EAAkB,EACxD,EAEsB,QAAQ"}
1
+ {"version":3,"file":"render.mjs","names":[],"sources":["../src/render.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 printTree,\n PrintTreeOptions,\n renderAsync,\n renderTree,\n traverseOutput\n} from \"@alloy-js/core\";\nimport { findFileExtension } from \"@stryke/path/file-path-fns\";\nimport { PluginContext } from \"powerlines\";\nimport { MetaItem, Output } from \"./core\";\n\n/**\n * A function to render children components within the [Alloy](https://alloy-framework.github.io) context, and write any saved content to the file system.\n *\n * @example\n * ```tsx\n * import { render } from \"@powerlines/plugin-alloy/render\";\n *\n * await render(context, <> ... </>);\n * ```\n *\n * @param context - The Powerlines plugin context.\n * @param children - The children components to render.\n * @returns A promise that resolves when rendering is complete.\n */\nexport async function render<TContext extends PluginContext>(\n context: TContext,\n children: Children\n) {\n const meta = {} as Record<string, MetaItem>;\n const output = await renderAsync(\n <Output<TContext> context={context} meta={meta}>\n {children}\n </Output>\n );\n\n if (!Object.keys(output).length) {\n context.debug(\n \"No output files were rendered by Alloy-js component templates.\"\n );\n } else {\n context.debug(\n `Processing ${\n Object.keys(output).length\n } rendered output files from Alloy-js component templates.`\n );\n\n await traverseOutput(output, {\n visitDirectory: directory => {\n if (context.fs.existsSync(directory.path)) {\n return;\n }\n\n context.fs.mkdirSync(directory.path);\n },\n visitFile: file => {\n if (\"contents\" in file) {\n const metadata = meta[file.path] ?? {};\n if (metadata.kind === \"builtin\") {\n if (!metadata.id) {\n throw new Error(\n `Built-in file \"${\n file.path\n }\" is missing its ID in the render metadata.`\n );\n }\n\n context.emitBuiltinSync(file.contents, metadata.id, {\n skipFormat: metadata.skipFormat,\n storage: metadata.storage,\n extension: findFileExtension(file.path)\n });\n } else if (metadata.kind === \"entry\") {\n context.emitEntrySync(file.contents, file.path, {\n skipFormat: metadata.skipFormat,\n storage: metadata.storage,\n ...(metadata.typeDefinition ?? {})\n });\n } else if (metadata.kind === \"infrastructure\") {\n if (!metadata.id) {\n throw new Error(\n `Infrastructure file \"${\n file.path\n }\" is missing its ID in the render metadata.`\n );\n }\n\n context.emitInfrastructureSync(file.contents, metadata.id, {\n skipFormat: metadata.skipFormat,\n storage: metadata.storage,\n extension: findFileExtension(file.path)\n });\n } else {\n context.emitSync(file.contents, file.path, metadata);\n }\n } else {\n context.fs.copySync(file.sourcePath, file.path);\n }\n }\n });\n }\n}\n\n/**\n * A function to render children components within the [Alloy](https://alloy-framework.github.io) context and return the rendered output as a string.\n *\n * @example\n * ```tsx\n * import { renderString } from \"@powerlines/plugin-alloy/render\";\n *\n * const output = await renderString(context, <> ... </>);\n * ```\n *\n * @param context - The Powerlines plugin context.\n * @param children - The children components to render.\n * @param options - Optional print tree options.\n * @returns The rendered output as a string.\n */\nexport function renderString<TContext extends PluginContext>(\n context: TContext,\n children: Children,\n options?: PrintTreeOptions\n) {\n const tree = renderTree(\n <Output<TContext> context={context}>{children}</Output>\n );\n\n return printTree(tree, options);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAsCA,eAAK,OAAA,SAAA,UAAA;CACJ,MAAA,OAAA,EAAA;CACC,MAAE,SAAa,MAAM,YAAY,gBAAc,UAAA;EACvC;EACN;EACF;EACF,CAAA,CAAA;AACE,KAAA,CAAA,OAAS,KAAQ,OAAA,CAAA,OACjB,SAAU,MAAA,iEAAA;MACV;AACA,UAAU,MAAM,cAAU,OAAQ,KAAQ,OAAC,CAAA,OAAA,2DAAA;AAC3C,QAAM,eAAe,QAAA;GAClB,iBAAiB,cAAS;AACxB,QAAA,QAAQ,GAAA,WAAA,UAAA,KAAA,CACT;;;GAIF,YAAa,SAAA;AACV,QAAG,cAAa,MAAK;KACvB,MAAA,WAAA,KAAA,KAAA,SAAA,EAAA;AACI,SAAA,SAAA,SAAA,WAAA;AACG,UAAA,CAAK,SAAA,GACV,OAAY,IAAA,MAAA,kBAAA,KAAA,KAAA,6CAAA;AAEX,cAAS,gBAAkB,KAAM,UAAG,SAAU,IAAU;OAC3D,YAAA,SAAA;;OAEK,WAAe,kBAAQ,KAAA,KAAA;OAC3B,CAAA;gBACc,SAAG,SAAW,QACxB,SAAM,cAAA,KAAA,UAAA,KAAA,MAAA;MACR,YAAA,SAAA;;MAEA,GAAU,SAAC,kBAAyB,EAAA;MACrC,CAAA;cACc,SAAI,SAAA,kBAAA;AACb,UAAC,CAAA,SAAa,GAChB,OAAM,IAAQ,MAAG,wBAAqB,KAAA,KAAA,6CAAA;AAEpC,cAAK,uBAAa,KAAA,UAAA,SAAA,IAAA;OAChB,YAAU,SAAK;OACf,SAAS,SAAS;OAClB,WAAS,kBAAA,KAAA,KAAA;OACV,CAAC;WAEF,SAAA,SAAA,KAAA,UAAA,KAAA,MAAA,SAAA;UAGF,SAAI,GAAA,SAAY,KAAS,YAAU,KAAA,KAAA;;GAGxC,CAAC;;;;;;;;;;;;;;;;;;AAmBN,SAAc,aAAsC,SAAA,UAAA,SAAA;AAKlD,QAAO,UAJK,WAAA,gBAAA,UAAA;EACF;EACA;EACT,CAAC,CAAC,EACU,QAAA"}
@@ -3,9 +3,9 @@ const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
3
3
  const require_core_contexts_context = require('../../core/contexts/context.cjs');
4
4
  const require_typescript_components_tsdoc = require('./tsdoc.cjs');
5
5
  const require_typescript_components_typescript_file = require('./typescript-file.cjs');
6
- let _alloy_js_core = require("@alloy-js/core");
7
6
  let _stryke_path_file_path_fns = require("@stryke/path/file-path-fns");
8
7
  let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
8
+ let _alloy_js_core = require("@alloy-js/core");
9
9
  let _stryke_path_replace = require("@stryke/path/replace");
10
10
  let _stryke_type_checks_is_set = require("@stryke/type-checks/is-set");
11
11
 
@@ -27,26 +27,36 @@ function BuiltinFile(props) {
27
27
  ]);
28
28
  const context = require_core_contexts_context.usePowerlinesSafe();
29
29
  const path = (0, _alloy_js_core.computed)(() => (0, _stryke_path_replace.replacePath)(`${!(0, _stryke_type_checks_is_set.isSet)(tsx) ? id : (0, _stryke_path_replace.replaceExtension)(id)}${(0, _stryke_path_file_path_fns.hasFileExtension)(id) && !(0, _stryke_type_checks_is_set.isSet)(tsx) ? "" : tsx ? ".tsx" : ".ts"}`, context?.builtinsPath));
30
- return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_typescript_components_typescript_file.TypescriptFile, {
31
- header: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_typescript_components_typescript_file.TypescriptFileHeader, {
32
- header: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_typescript_components_tsdoc.TSDocModule, {
33
- name: id,
34
- children: description
35
- }),
36
- children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_typescript_components_typescript_file.TypescriptFileHeaderImports, {
37
- imports,
38
- builtinImports
39
- })
40
- }),
41
- meta: {
42
- kind: "builtin",
43
- extension: tsx ? "tsx" : "ts",
44
- id: (0, _stryke_path_replace.replaceExtension)(id)
30
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_typescript_file.TypescriptFile, (0, _alloy_js_core_jsx_runtime.mergeProps)({
31
+ get header() {
32
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_typescript_file.TypescriptFileHeader, {
33
+ get header() {
34
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_tsdoc.TSDocModule, {
35
+ name: id,
36
+ children: description
37
+ });
38
+ },
39
+ get children() {
40
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_typescript_file.TypescriptFileHeaderImports, {
41
+ imports,
42
+ builtinImports
43
+ });
44
+ }
45
+ });
46
+ },
47
+ get meta() {
48
+ return {
49
+ kind: "builtin",
50
+ extension: tsx ? "tsx" : "ts",
51
+ id: (0, _stryke_path_replace.replaceExtension)(id)
52
+ };
53
+ }
54
+ }, rest, {
55
+ get path() {
56
+ return path.value;
45
57
  },
46
- ...rest,
47
- path: path.value,
48
58
  children
49
- });
59
+ }));
50
60
  }
51
61
 
52
62
  //#endregion
@@ -1,9 +1,9 @@
1
1
  import { usePowerlinesSafe } from "../../core/contexts/context.mjs";
2
2
  import { TSDocModule } from "./tsdoc.mjs";
3
3
  import { TypescriptFile, TypescriptFileHeader, TypescriptFileHeaderImports } from "./typescript-file.mjs";
4
- import { computed, splitProps } from "@alloy-js/core";
5
4
  import { hasFileExtension } from "@stryke/path/file-path-fns";
6
- import { jsx } from "@alloy-js/core/jsx-runtime";
5
+ import { createComponent, mergeProps } from "@alloy-js/core/jsx-runtime";
6
+ import { computed, splitProps } from "@alloy-js/core";
7
7
  import { replaceExtension, replacePath } from "@stryke/path/replace";
8
8
  import { isSet } from "@stryke/type-checks/is-set";
9
9
 
@@ -25,26 +25,36 @@ function BuiltinFile(props) {
25
25
  ]);
26
26
  const context = usePowerlinesSafe();
27
27
  const path = computed(() => replacePath(`${!isSet(tsx) ? id : replaceExtension(id)}${hasFileExtension(id) && !isSet(tsx) ? "" : tsx ? ".tsx" : ".ts"}`, context?.builtinsPath));
28
- return /* @__PURE__ */ jsx(TypescriptFile, {
29
- header: /* @__PURE__ */ jsx(TypescriptFileHeader, {
30
- header: /* @__PURE__ */ jsx(TSDocModule, {
31
- name: id,
32
- children: description
33
- }),
34
- children: /* @__PURE__ */ jsx(TypescriptFileHeaderImports, {
35
- imports,
36
- builtinImports
37
- })
38
- }),
39
- meta: {
40
- kind: "builtin",
41
- extension: tsx ? "tsx" : "ts",
42
- id: replaceExtension(id)
28
+ return createComponent(TypescriptFile, mergeProps({
29
+ get header() {
30
+ return createComponent(TypescriptFileHeader, {
31
+ get header() {
32
+ return createComponent(TSDocModule, {
33
+ name: id,
34
+ children: description
35
+ });
36
+ },
37
+ get children() {
38
+ return createComponent(TypescriptFileHeaderImports, {
39
+ imports,
40
+ builtinImports
41
+ });
42
+ }
43
+ });
44
+ },
45
+ get meta() {
46
+ return {
47
+ kind: "builtin",
48
+ extension: tsx ? "tsx" : "ts",
49
+ id: replaceExtension(id)
50
+ };
51
+ }
52
+ }, rest, {
53
+ get path() {
54
+ return path.value;
43
55
  },
44
- ...rest,
45
- path: path.value,
46
56
  children
47
- });
57
+ }));
48
58
  }
49
59
 
50
60
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"builtin-file.mjs","names":[],"sources":["../../../src/typescript/components/builtin-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 { computed, splitProps } from \"@alloy-js/core\";\nimport { hasFileExtension } from \"@stryke/path/file-path-fns\";\nimport { replaceExtension, replacePath } from \"@stryke/path/replace\";\nimport { isSet } from \"@stryke/type-checks/is-set\";\nimport { usePowerlinesSafe } from \"../../core/contexts/context\";\nimport type { TSDocModuleProps } from \"./tsdoc\";\nimport { TSDocModule } from \"./tsdoc\";\nimport {\n TypescriptFile,\n TypescriptFileHeader,\n TypescriptFileHeaderImports,\n TypescriptFileProps\n} from \"./typescript-file\";\n\nexport type BuiltinFileProps = Omit<TypescriptFileProps, \"path\"> &\n Omit<TSDocModuleProps, \"name\"> & {\n /**\n * The runtime module identifier.\n *\n * @remarks\n * This value will be included after the \\`storm:\\` prefix in the import statement.\n */\n id: string;\n\n /**\n * The description for the builtin module.\n */\n description?: string;\n\n /**\n * Whether the file is a TSX file.\n *\n * @defaultValue false\n */\n tsx?: boolean;\n };\n\n/**\n * A base component representing a Powerlines generated Typescript source file.\n *\n * @param props - The properties for the source file.\n * @returns The rendered source file component.\n */\nexport function BuiltinFile(props: BuiltinFileProps) {\n const [{ children, imports, builtinImports, id, description, tsx }, rest] =\n splitProps(props, [\n \"children\",\n \"imports\",\n \"builtinImports\",\n \"id\",\n \"description\",\n \"tsx\"\n ]);\n\n const context = usePowerlinesSafe();\n const path = computed(() =>\n replacePath(\n `${!isSet(tsx) ? id : replaceExtension(id)}${\n hasFileExtension(id) && !isSet(tsx) ? \"\" : tsx ? \".tsx\" : \".ts\"\n }`,\n context?.builtinsPath\n )\n );\n\n return (\n <TypescriptFile\n header={\n <TypescriptFileHeader\n header={<TSDocModule name={id}>{description}</TSDocModule>}>\n <TypescriptFileHeaderImports\n imports={imports}\n builtinImports={builtinImports}\n />\n </TypescriptFileHeader>\n }\n meta={{\n kind: \"builtin\",\n extension: tsx ? \"tsx\" : \"ts\",\n id: replaceExtension(id)\n }}\n {...rest}\n path={path.value}>\n {children}\n </TypescriptFile>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA6DA,SAAgB,YAAY,OAAyB;CACnD,MAAM,CAAC,EAAE,UAAU,SAAS,gBAAgB,IAAI,aAAa,OAAO,QAClE,WAAW,OAAO;EAChB;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;CAEJ,MAAM,UAAU,mBAAmB;CACnC,MAAM,OAAO,eACX,YACE,GAAG,CAAC,MAAM,IAAI,GAAG,KAAK,iBAAiB,GAAG,GACxC,iBAAiB,GAAG,IAAI,CAAC,MAAM,IAAI,GAAG,KAAK,MAAM,SAAS,SAE5D,SAAS,aACV,CACF;AAED,QACE,oBAAC,gBAAD;EACE,QACE,oBAAC,sBAAD;GACE,QAAQ,oBAAC,aAAD;IAAa,MAAM;cAAK;IAA0B;aAC1D,oBAAC,6BAAD;IACW;IACO;IAChB;GACmB;EAEzB,MAAM;GACJ,MAAM;GACN,WAAW,MAAM,QAAQ;GACzB,IAAI,iBAAiB,GAAG;GACzB;EACD,GAAI;EACJ,MAAM,KAAK;EACV;EACc"}
1
+ {"version":3,"file":"builtin-file.mjs","names":[],"sources":["../../../src/typescript/components/builtin-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 { computed, splitProps } from \"@alloy-js/core\";\nimport { hasFileExtension } from \"@stryke/path/file-path-fns\";\nimport { replaceExtension, replacePath } from \"@stryke/path/replace\";\nimport { isSet } from \"@stryke/type-checks/is-set\";\nimport { usePowerlinesSafe } from \"../../core/contexts/context\";\nimport type { TSDocModuleProps } from \"./tsdoc\";\nimport { TSDocModule } from \"./tsdoc\";\nimport {\n TypescriptFile,\n TypescriptFileHeader,\n TypescriptFileHeaderImports,\n TypescriptFileProps\n} from \"./typescript-file\";\n\nexport type BuiltinFileProps = Omit<TypescriptFileProps, \"path\"> &\n Omit<TSDocModuleProps, \"name\"> & {\n /**\n * The runtime module identifier.\n *\n * @remarks\n * This value will be included after the \\`storm:\\` prefix in the import statement.\n */\n id: string;\n\n /**\n * The description for the builtin module.\n */\n description?: string;\n\n /**\n * Whether the file is a TSX file.\n *\n * @defaultValue false\n */\n tsx?: boolean;\n };\n\n/**\n * A base component representing a Powerlines generated Typescript source file.\n *\n * @param props - The properties for the source file.\n * @returns The rendered source file component.\n */\nexport function BuiltinFile(props: BuiltinFileProps) {\n const [{ children, imports, builtinImports, id, description, tsx }, rest] =\n splitProps(props, [\n \"children\",\n \"imports\",\n \"builtinImports\",\n \"id\",\n \"description\",\n \"tsx\"\n ]);\n\n const context = usePowerlinesSafe();\n const path = computed(() =>\n replacePath(\n `${!isSet(tsx) ? id : replaceExtension(id)}${\n hasFileExtension(id) && !isSet(tsx) ? \"\" : tsx ? \".tsx\" : \".ts\"\n }`,\n context?.builtinsPath\n )\n );\n\n return (\n <TypescriptFile\n header={\n <TypescriptFileHeader\n header={<TSDocModule name={id}>{description}</TSDocModule>}>\n <TypescriptFileHeaderImports\n imports={imports}\n builtinImports={builtinImports}\n />\n </TypescriptFileHeader>\n }\n meta={{\n kind: \"builtin\",\n extension: tsx ? \"tsx\" : \"ts\",\n id: replaceExtension(id)\n }}\n {...rest}\n path={path.value}>\n {children}\n </TypescriptFile>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAuDA,SAAE,YAAA,OAAA;CACA,MAAG,CAAI,EACR,UACG,SACA,gBACF,IACF,aACE,OACE,QAAA,WAAkB,OAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA,CAAA;CACpB,MAAK,UAAS,mBAAA;CACd,MAAK,OAAQ,eAAA,YAAA,GAAA,CAAA,MAAA,IAAA,GAAA,KAAA,iBAAA,GAAA,GAAA,iBAAA,GAAA,IAAA,CAAA,MAAA,IAAA,GAAA,KAAA,MAAA,SAAA,SAAA,SAAA,aAAA,CAAA;AACb,QAAK,gBAAe,gBAAA,WAAA;EAClB,IAAG,SAAG;AACJ,UAAC,gBAAY,sBAAA;IACZ,IAAG,SAAA;AACJ,YAAA,gBAAA,aAAA;;MAEE,UAAU;MACV,CAAI;;IAEJ,IAAE,WAAa;AACf,YAAA,gBAAyB,6BAA+B;MACxD;MACO;MACX,CAAA;;;;EAIA,IAAC,OAAA;AACC,UAAO;IACL,MAAC;IACD,WAAW,MAAA,QAAY;IACvB,IAAG,iBAAA,GAAA;IACJ;;EAEJ,EAAE,MAAM;EACP,IAAI,OAAE;AACJ,UAAA,KAAA;;EAEQ;EACX,CAAC,CAAC"}
@@ -8,8 +8,8 @@ const require_typescript_helpers_get_call_signature_props = require('../helpers/
8
8
  require('../helpers/index.cjs');
9
9
  const require_typescript_components_property_name = require('./property-name.cjs');
10
10
  const require_typescript_components_type_parameters = require('./type-parameters.cjs');
11
- let _alloy_js_core = require("@alloy-js/core");
12
11
  let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
12
+ let _alloy_js_core = require("@alloy-js/core");
13
13
  let _alloy_js_typescript = require("@alloy-js/typescript");
14
14
 
15
15
  //#region src/typescript/components/class-declaration.tsx
@@ -44,18 +44,20 @@ let _alloy_js_typescript = require("@alloy-js/typescript");
44
44
  * ```
45
45
  */
46
46
  function ClassDeclaration(props) {
47
- const extendsPart = props.extends && /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core_jsx_runtime.Fragment, { children: [" extends ", props.extends] });
48
- const implementsPart = props.implements && props.implements.length > 0 && /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core_jsx_runtime.Fragment, { children: [
47
+ const extendsPart = props.extends && [" extends ", (0, _alloy_js_core_jsx_runtime.memo)(() => props.extends)];
48
+ const implementsPart = props.implements && props.implements.length > 0 && [
49
49
  " ",
50
50
  "implements",
51
51
  " ",
52
- /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.For, {
53
- each: props.implements,
52
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
53
+ get each() {
54
+ return props.implements;
55
+ },
54
56
  comma: true,
55
57
  space: true,
56
58
  children: (implement) => implement
57
59
  })
58
- ] });
60
+ ];
59
61
  const sym = (0, _alloy_js_typescript.createTypeAndValueSymbol)(props.name, {
60
62
  refkeys: props.refkey,
61
63
  export: props.export,
@@ -64,27 +66,45 @@ function ClassDeclaration(props) {
64
66
  hasInstanceMembers: true,
65
67
  namePolicy: (0, _alloy_js_typescript.useTSNamePolicy)().for("class")
66
68
  });
67
- return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Show, {
68
- when: Boolean(props.doc),
69
- children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_typescript_components_tsdoc.TSDoc, { heading: props.doc })
70
- }), /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.Declaration, {
69
+ return [(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
70
+ get when() {
71
+ return Boolean(props.doc);
72
+ },
73
+ get children() {
74
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_tsdoc.TSDoc, { get heading() {
75
+ return props.doc;
76
+ } });
77
+ }
78
+ }), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.Declaration, {
71
79
  symbol: sym,
72
- export: props.export,
73
- default: props.default,
74
- children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(require_typescript_contexts_member_scope.MemberScope, {
75
- ownerSymbol: sym,
76
- children: [
77
- props.abstract && _alloy_js_core.code`abstract `,
78
- " class ",
79
- /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Name, {}),
80
- props.typeParameters && /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_typescript_components_type_parameters.TypeParameters, { parameters: props.typeParameters }),
81
- extendsPart,
82
- implementsPart,
83
- " ",
84
- /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Block, { children: props.children })
85
- ]
86
- })
87
- })] });
80
+ get ["export"]() {
81
+ return props.export;
82
+ },
83
+ get ["default"]() {
84
+ return props.default;
85
+ },
86
+ get children() {
87
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(require_typescript_contexts_member_scope.MemberScope, {
88
+ ownerSymbol: sym,
89
+ get children() {
90
+ return [
91
+ (0, _alloy_js_core_jsx_runtime.memo)(() => props.abstract && _alloy_js_core.code`abstract `),
92
+ " class ",
93
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Name, {}),
94
+ (0, _alloy_js_core_jsx_runtime.memo)(() => (0, _alloy_js_core_jsx_runtime.memo)(() => !!props.typeParameters)() && (0, _alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_type_parameters.TypeParameters, { get parameters() {
95
+ return props.typeParameters;
96
+ } })),
97
+ extendsPart,
98
+ implementsPart,
99
+ " ",
100
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Block, { get children() {
101
+ return props.children;
102
+ } })
103
+ ];
104
+ }
105
+ });
106
+ }
107
+ })];
88
108
  }
89
109
  ClassDeclaration.TypeParameters = require_typescript_components_type_parameters.TypeParameters;
90
110
  /**
@@ -101,21 +121,29 @@ function ClassMember(props) {
101
121
  tsFlags,
102
122
  namePolicy: (0, _alloy_js_typescript.useTSNamePolicy)().for("class-member-data")
103
123
  });
104
- return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Show, {
105
- when: Boolean(props.doc),
106
- children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_typescript_components_tsdoc.TSDoc, { heading: props.doc })
107
- }), /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core.MemberDeclaration, {
124
+ return [(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
125
+ get when() {
126
+ return Boolean(props.doc);
127
+ },
128
+ get children() {
129
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_tsdoc.TSDoc, { get heading() {
130
+ return props.doc;
131
+ } });
132
+ }
133
+ }), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.MemberDeclaration, {
108
134
  symbol: sym,
109
- children: [
110
- props.public && "public ",
111
- props.private && "private ",
112
- props.protected && "protected ",
113
- props.abstract && "abstract ",
114
- props.override && "override ",
115
- props.static && "static ",
116
- props.children
117
- ]
118
- })] });
135
+ get children() {
136
+ return [
137
+ (0, _alloy_js_core_jsx_runtime.memo)(() => props.public && "public "),
138
+ (0, _alloy_js_core_jsx_runtime.memo)(() => props.private && "private "),
139
+ (0, _alloy_js_core_jsx_runtime.memo)(() => props.protected && "protected "),
140
+ (0, _alloy_js_core_jsx_runtime.memo)(() => props.abstract && "abstract "),
141
+ (0, _alloy_js_core_jsx_runtime.memo)(() => props.override && "override "),
142
+ (0, _alloy_js_core_jsx_runtime.memo)(() => props.static && "static "),
143
+ (0, _alloy_js_core_jsx_runtime.memo)(() => props.children)
144
+ ];
145
+ }
146
+ })];
119
147
  }
120
148
  /**
121
149
  * Generates a TypeScript class field declaration for the given reflection class.
@@ -125,25 +153,31 @@ function ClassMember(props) {
125
153
  */
126
154
  function ClassField(props) {
127
155
  const optionality = props.optional ? "?" : "";
128
- const typeSection = props.type && /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core_jsx_runtime.Fragment, { children: [
156
+ const typeSection = props.type && [
129
157
  optionality,
130
158
  ": ",
131
- /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.TypeRefContext, { children: props.type })
132
- ] });
133
- const initializerSection = props.children && /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core_jsx_runtime.Fragment, { children: [" = ", props.children] });
134
- const nullish = props.nullish ?? props.optional;
135
- return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(ClassMember, {
136
- ...props,
137
- nullish,
138
- children: [
139
- /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_typescript_components_property_name.PropertyName, {
140
- private: props.isPrivateMember,
141
- name: props.isPrivateMember ? props.name : void 0
142
- }),
143
- typeSection,
144
- initializerSection
145
- ]
146
- });
159
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.TypeRefContext, { get children() {
160
+ return props.type;
161
+ } })
162
+ ];
163
+ const initializerSection = props.children && [" = ", (0, _alloy_js_core_jsx_runtime.memo)(() => props.children)];
164
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(ClassMember, (0, _alloy_js_core_jsx_runtime.mergeProps)(props, {
165
+ nullish: props.nullish ?? props.optional,
166
+ get children() {
167
+ return [
168
+ (0, _alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_property_name.PropertyName, {
169
+ get ["private"]() {
170
+ return props.isPrivateMember;
171
+ },
172
+ get name() {
173
+ return props.isPrivateMember ? props.name : void 0;
174
+ }
175
+ }),
176
+ typeSection,
177
+ initializerSection
178
+ ];
179
+ }
180
+ }));
147
181
  }
148
182
  /**
149
183
  * Generates a TypeScript class property setter declaration for the given reflection class.
@@ -152,21 +186,30 @@ function ClassField(props) {
152
186
  * @returns A JSX element representing the class property setter declaration, which can be used within a ClassDeclaration component.
153
187
  */
154
188
  function ClassPropertySet(props) {
155
- return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core_jsx_runtime.Fragment, { children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(ClassMember, {
156
- ...props,
157
- children: [
189
+ return [(0, _alloy_js_core_jsx_runtime.createComponent)(ClassMember, (0, _alloy_js_core_jsx_runtime.mergeProps)(props, { get children() {
190
+ return [
158
191
  "set ",
159
- /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_typescript_components_property_name.PropertyName, { name: props.name }),
160
- /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(require_typescript_contexts_lexical_scope.LexicalScope, { children: [
161
- /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.CallSignature, { parameters: [{
162
- name: "value",
163
- type: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.TypeRefContext, { children: props.type })
164
- }] }),
165
- " ",
166
- /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Block, { children: props.children })
167
- ] })
168
- ]
169
- }) });
192
+ (0, _alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_property_name.PropertyName, { get name() {
193
+ return props.name;
194
+ } }),
195
+ (0, _alloy_js_core_jsx_runtime.createComponent)(require_typescript_contexts_lexical_scope.LexicalScope, { get children() {
196
+ return [
197
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.CallSignature, { get parameters() {
198
+ return [{
199
+ name: "value",
200
+ type: (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.TypeRefContext, { get children() {
201
+ return props.type;
202
+ } })
203
+ }];
204
+ } }),
205
+ " ",
206
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Block, { get children() {
207
+ return props.children;
208
+ } })
209
+ ];
210
+ } })
211
+ ];
212
+ } }))];
170
213
  }
171
214
  /**
172
215
  * Generates a TypeScript class property getter declaration for the given reflection class.
@@ -175,18 +218,27 @@ function ClassPropertySet(props) {
175
218
  * @returns A JSX element representing the class property getter declaration, which can be used within a ClassDeclaration component.
176
219
  */
177
220
  function ClassPropertyGet(props) {
178
- return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(ClassMember, {
179
- ...props,
180
- children: [
221
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(ClassMember, (0, _alloy_js_core_jsx_runtime.mergeProps)(props, { get children() {
222
+ return [
181
223
  "get ",
182
- /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_typescript_components_property_name.PropertyName, { name: props.name }),
183
- /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(require_typescript_contexts_lexical_scope.LexicalScope, { children: [
184
- /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.CallSignature, { returnType: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.TypeRefContext, { children: props.type }) }),
185
- " ",
186
- /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Block, { children: props.children })
187
- ] })
188
- ]
189
- });
224
+ (0, _alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_property_name.PropertyName, { get name() {
225
+ return props.name;
226
+ } }),
227
+ (0, _alloy_js_core_jsx_runtime.createComponent)(require_typescript_contexts_lexical_scope.LexicalScope, { get children() {
228
+ return [
229
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.CallSignature, { get returnType() {
230
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.TypeRefContext, { get children() {
231
+ return props.type;
232
+ } });
233
+ } }),
234
+ " ",
235
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Block, { get children() {
236
+ return props.children;
237
+ } })
238
+ ];
239
+ } })
240
+ ];
241
+ } }));
190
242
  }
191
243
  /**
192
244
  * Generates a TypeScript class method declaration for the given reflection class.
@@ -197,24 +249,37 @@ function ClassPropertyGet(props) {
197
249
  function ClassMethod(props) {
198
250
  const callProps = require_typescript_helpers_get_call_signature_props.getCallSignatureProps(props);
199
251
  const [_, rest] = (0, _alloy_js_core.splitProps)(props, ["doc"]);
200
- return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(_alloy_js_core_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Show, {
201
- when: Boolean(props.doc),
202
- children: /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_typescript_components_tsdoc.TSDoc, {
203
- heading: props.doc,
204
- children: Array.isArray(rest.parameters) && /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_typescript_components_tsdoc.TSDocParams, { parameters: rest.parameters })
205
- })
206
- }), /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(ClassMember, {
207
- ...rest,
208
- children: [
209
- props.async && "async ",
210
- /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_typescript_components_property_name.PropertyName, {}),
211
- /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsxs)(require_typescript_contexts_lexical_scope.LexicalScope, { children: [
212
- /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.CallSignature, { ...callProps }),
213
- " ",
214
- /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_core.Block, { children: props.children })
215
- ] })
216
- ]
217
- })] });
252
+ return [(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
253
+ get when() {
254
+ return Boolean(props.doc);
255
+ },
256
+ get children() {
257
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_tsdoc.TSDoc, {
258
+ get heading() {
259
+ return props.doc;
260
+ },
261
+ get children() {
262
+ return (0, _alloy_js_core_jsx_runtime.memo)(() => !!Array.isArray(rest.parameters))() && (0, _alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_tsdoc.TSDocParams, { get parameters() {
263
+ return rest.parameters;
264
+ } });
265
+ }
266
+ });
267
+ }
268
+ }), (0, _alloy_js_core_jsx_runtime.createComponent)(ClassMember, (0, _alloy_js_core_jsx_runtime.mergeProps)(rest, { get children() {
269
+ return [
270
+ (0, _alloy_js_core_jsx_runtime.memo)(() => props.async && "async "),
271
+ (0, _alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_property_name.PropertyName, {}),
272
+ (0, _alloy_js_core_jsx_runtime.createComponent)(require_typescript_contexts_lexical_scope.LexicalScope, { get children() {
273
+ return [
274
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.CallSignature, callProps),
275
+ " ",
276
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Block, { get children() {
277
+ return props.children;
278
+ } })
279
+ ];
280
+ } })
281
+ ];
282
+ } }))];
218
283
  }
219
284
 
220
285
  //#endregion