@powerlines/plugin-alloy 0.26.26 → 0.26.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/dist/core/components/infrastructure-file.cjs +13 -8
  2. package/dist/core/components/infrastructure-file.mjs +13 -8
  3. package/dist/core/components/infrastructure-file.mjs.map +1 -1
  4. package/dist/core/components/output.cjs +17 -10
  5. package/dist/core/components/output.mjs +17 -10
  6. package/dist/core/components/output.mjs.map +1 -1
  7. package/dist/core/components/single-line-comment.cjs +6 -4
  8. package/dist/core/components/single-line-comment.mjs +6 -4
  9. package/dist/core/components/single-line-comment.mjs.map +1 -1
  10. package/dist/core/components/source-file.cjs +10 -6
  11. package/dist/core/components/source-file.mjs +10 -6
  12. package/dist/core/components/source-file.mjs.map +1 -1
  13. package/dist/core/components/spacing.cjs +6 -4
  14. package/dist/core/components/spacing.mjs +6 -4
  15. package/dist/core/components/spacing.mjs.map +1 -1
  16. package/dist/core/contexts/context.mjs.map +1 -1
  17. package/dist/core/contexts/meta.mjs.map +1 -1
  18. package/dist/core/contexts/reflection.mjs.map +1 -1
  19. package/dist/core/helpers/code.mjs.map +1 -1
  20. package/dist/hcl/components/block-declaration.cjs +12 -8
  21. package/dist/hcl/components/block-declaration.mjs +12 -8
  22. package/dist/hcl/components/block-declaration.mjs.map +1 -1
  23. package/dist/hcl/components/hcl-file.cjs +35 -21
  24. package/dist/hcl/components/hcl-file.mjs +36 -22
  25. package/dist/hcl/components/hcl-file.mjs.map +1 -1
  26. package/dist/hcl/components/packer-file.cjs +8 -8
  27. package/dist/hcl/components/packer-file.mjs +8 -8
  28. package/dist/hcl/components/packer-file.mjs.map +1 -1
  29. package/dist/hcl/components/terraform-file.cjs +8 -8
  30. package/dist/hcl/components/terraform-file.mjs +8 -8
  31. package/dist/hcl/components/terraform-file.mjs.map +1 -1
  32. package/dist/helpers/capnp.mjs.map +1 -1
  33. package/dist/helpers/create-builtin.mjs.map +1 -1
  34. package/dist/helpers/refkey.mjs.map +1 -1
  35. package/dist/helpers/typescript.mjs.map +1 -1
  36. package/dist/index.cjs +15 -8
  37. package/dist/index.d.cts.map +1 -1
  38. package/dist/index.d.mts.map +1 -1
  39. package/dist/index.mjs +14 -8
  40. package/dist/index.mjs.map +1 -1
  41. package/dist/markdown/components/front-matter.cjs +9 -7
  42. package/dist/markdown/components/front-matter.mjs +9 -7
  43. package/dist/markdown/components/front-matter.mjs.map +1 -1
  44. package/dist/markdown/components/heading.cjs +24 -0
  45. package/dist/markdown/components/heading.d.cts +19 -0
  46. package/dist/markdown/components/heading.d.cts.map +1 -0
  47. package/dist/markdown/components/heading.d.mts +19 -0
  48. package/dist/markdown/components/heading.d.mts.map +1 -0
  49. package/dist/markdown/components/heading.mjs +23 -0
  50. package/dist/markdown/components/heading.mjs.map +1 -0
  51. package/dist/markdown/components/index.cjs +2 -0
  52. package/dist/markdown/components/index.d.cts +2 -1
  53. package/dist/markdown/components/index.d.mts +2 -1
  54. package/dist/markdown/components/index.mjs +2 -1
  55. package/dist/markdown/components/markdown-file.cjs +76 -44
  56. package/dist/markdown/components/markdown-file.mjs +76 -44
  57. package/dist/markdown/components/markdown-file.mjs.map +1 -1
  58. package/dist/markdown/components/markdown-table.cjs +49 -28
  59. package/dist/markdown/components/markdown-table.mjs +49 -28
  60. package/dist/markdown/components/markdown-table.mjs.map +1 -1
  61. package/dist/markdown/contexts/markdown-table.mjs.map +1 -1
  62. package/dist/markdown/index.cjs +2 -0
  63. package/dist/markdown/index.d.cts +2 -1
  64. package/dist/markdown/index.d.mts +2 -1
  65. package/dist/markdown/index.mjs +2 -1
  66. package/dist/render.cjs +3 -3
  67. package/dist/render.mjs +4 -4
  68. package/dist/render.mjs.map +1 -1
  69. package/dist/types/components.cjs +9 -0
  70. package/dist/types/components.mjs +10 -1
  71. package/dist/types/components.mjs.map +1 -0
  72. package/dist/typescript/components/builtin-file.cjs +30 -20
  73. package/dist/typescript/components/builtin-file.mjs +30 -20
  74. package/dist/typescript/components/builtin-file.mjs.map +1 -1
  75. package/dist/typescript/components/class-declaration.cjs +180 -100
  76. package/dist/typescript/components/class-declaration.mjs +180 -100
  77. package/dist/typescript/components/class-declaration.mjs.map +1 -1
  78. package/dist/typescript/components/dynamic-import-statement.cjs +2 -6
  79. package/dist/typescript/components/dynamic-import-statement.mjs +2 -6
  80. package/dist/typescript/components/dynamic-import-statement.mjs.map +1 -1
  81. package/dist/typescript/components/entry-file.cjs +10 -7
  82. package/dist/typescript/components/entry-file.mjs +10 -7
  83. package/dist/typescript/components/entry-file.mjs.map +1 -1
  84. package/dist/typescript/components/interface-declaration.cjs +127 -74
  85. package/dist/typescript/components/interface-declaration.mjs +127 -74
  86. package/dist/typescript/components/interface-declaration.mjs.map +1 -1
  87. package/dist/typescript/components/object-declaration.cjs +84 -50
  88. package/dist/typescript/components/object-declaration.mjs +84 -50
  89. package/dist/typescript/components/object-declaration.mjs.map +1 -1
  90. package/dist/typescript/components/property-name.cjs +3 -3
  91. package/dist/typescript/components/property-name.mjs +3 -3
  92. package/dist/typescript/components/property-name.mjs.map +1 -1
  93. package/dist/typescript/components/record-expression.mjs.map +1 -1
  94. package/dist/typescript/components/tsdoc-reflection.cjs +241 -108
  95. package/dist/typescript/components/tsdoc-reflection.mjs +241 -108
  96. package/dist/typescript/components/tsdoc-reflection.mjs.map +1 -1
  97. package/dist/typescript/components/tsdoc.cjs +265 -168
  98. package/dist/typescript/components/tsdoc.mjs +265 -168
  99. package/dist/typescript/components/tsdoc.mjs.map +1 -1
  100. package/dist/typescript/components/type-declaration.cjs +20 -15
  101. package/dist/typescript/components/type-declaration.mjs +20 -15
  102. package/dist/typescript/components/type-declaration.mjs.map +1 -1
  103. package/dist/typescript/components/type-parameters.cjs +56 -29
  104. package/dist/typescript/components/type-parameters.mjs +56 -29
  105. package/dist/typescript/components/type-parameters.mjs.map +1 -1
  106. package/dist/typescript/components/typescript-file.cjs +135 -74
  107. package/dist/typescript/components/typescript-file.mjs +135 -74
  108. package/dist/typescript/components/typescript-file.mjs.map +1 -1
  109. package/dist/typescript/contexts/lexical-scope.cjs +5 -3
  110. package/dist/typescript/contexts/lexical-scope.mjs +5 -3
  111. package/dist/typescript/contexts/lexical-scope.mjs.map +1 -1
  112. package/dist/typescript/contexts/member-scope.cjs +5 -3
  113. package/dist/typescript/contexts/member-scope.mjs +5 -3
  114. package/dist/typescript/contexts/member-scope.mjs.map +1 -1
  115. package/dist/typescript/helpers/get-call-signature-props.mjs.map +1 -1
  116. package/dist/typescript/helpers/utilities.mjs.map +1 -1
  117. package/dist/yaml/components/yaml-file.cjs +92 -47
  118. package/dist/yaml/components/yaml-file.mjs +92 -47
  119. package/dist/yaml/components/yaml-file.mjs.map +1 -1
  120. package/package.json +21 -6
@@ -6,12 +6,15 @@ import { getCallSignatureProps } from "../helpers/get-call-signature-props.mjs";
6
6
  import "../helpers/index.mjs";
7
7
  import { PropertyName } from "./property-name.mjs";
8
8
  import { TypeParameters } from "./type-parameters.mjs";
9
+ import { createComponent, memo, mergeProps } from "@alloy-js/core/jsx-runtime";
9
10
  import { Block, For, MemberDeclaration, Name, Show, code, splitProps } from "@alloy-js/core";
10
- import { Fragment, jsx, jsxs } from "@alloy-js/core/jsx-runtime";
11
11
  import { CallSignature, Declaration as Declaration$1, TSSymbolFlags, TypeRefContext, createMemberSymbol, createTypeAndValueSymbol, useTSNamePolicy } from "@alloy-js/typescript";
12
12
 
13
13
  //#region src/typescript/components/class-declaration.tsx
14
14
  /**
15
+ * Props for the ClassDeclaration component, which represents a TypeScript class declaration
16
+ */
17
+ /**
15
18
  * Create a TypeScript class declaration.
16
19
  *
17
20
  * @example
@@ -42,18 +45,20 @@ import { CallSignature, Declaration as Declaration$1, TSSymbolFlags, TypeRefCont
42
45
  * ```
43
46
  */
44
47
  function ClassDeclaration(props) {
45
- const extendsPart = props.extends && /* @__PURE__ */ jsxs(Fragment, { children: [" extends ", props.extends] });
46
- const implementsPart = props.implements && props.implements.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
48
+ const extendsPart = props.extends && [" extends ", memo(() => props.extends)];
49
+ const implementsPart = props.implements && props.implements.length > 0 && [
47
50
  " ",
48
51
  "implements",
49
52
  " ",
50
- /* @__PURE__ */ jsx(For, {
51
- each: props.implements,
53
+ createComponent(For, {
54
+ get each() {
55
+ return props.implements;
56
+ },
52
57
  comma: true,
53
58
  space: true,
54
59
  children: (implement) => implement
55
60
  })
56
- ] });
61
+ ];
57
62
  const sym = createTypeAndValueSymbol(props.name, {
58
63
  refkeys: props.refkey,
59
64
  export: props.export,
@@ -62,31 +67,52 @@ function ClassDeclaration(props) {
62
67
  hasInstanceMembers: true,
63
68
  namePolicy: useTSNamePolicy().for("class")
64
69
  });
65
- return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Show, {
66
- when: Boolean(props.doc),
67
- children: /* @__PURE__ */ jsx(TSDoc, { heading: props.doc })
68
- }), /* @__PURE__ */ jsx(Declaration$1, {
70
+ return [createComponent(Show, {
71
+ get when() {
72
+ return Boolean(props.doc);
73
+ },
74
+ get children() {
75
+ return createComponent(TSDoc, { get heading() {
76
+ return props.doc;
77
+ } });
78
+ }
79
+ }), createComponent(Declaration$1, {
69
80
  symbol: sym,
70
- export: props.export,
71
- default: props.default,
72
- children: /* @__PURE__ */ jsxs(MemberScope$1, {
73
- ownerSymbol: sym,
74
- children: [
75
- props.abstract && code`abstract `,
76
- " class ",
77
- /* @__PURE__ */ jsx(Name, {}),
78
- props.typeParameters && /* @__PURE__ */ jsx(TypeParameters, { parameters: props.typeParameters }),
79
- extendsPart,
80
- implementsPart,
81
- " ",
82
- /* @__PURE__ */ jsx(Block, { children: props.children })
83
- ]
84
- })
85
- })] });
81
+ get ["export"]() {
82
+ return props.export;
83
+ },
84
+ get ["default"]() {
85
+ return props.default;
86
+ },
87
+ get children() {
88
+ return createComponent(MemberScope$1, {
89
+ ownerSymbol: sym,
90
+ get children() {
91
+ return [
92
+ memo(() => props.abstract && code`abstract `),
93
+ " class ",
94
+ createComponent(Name, {}),
95
+ memo(() => memo(() => !!props.typeParameters)() && createComponent(TypeParameters, { get parameters() {
96
+ return props.typeParameters;
97
+ } })),
98
+ extendsPart,
99
+ implementsPart,
100
+ " ",
101
+ createComponent(Block, { get children() {
102
+ return props.children;
103
+ } })
104
+ ];
105
+ }
106
+ });
107
+ }
108
+ })];
86
109
  }
87
110
  ClassDeclaration.TypeParameters = TypeParameters;
88
111
  /**
89
112
  * Generates a TypeScript class member declaration for the given reflection class.
113
+ */
114
+ /**
115
+ * Generates a TypeScript class member declaration for the given reflection class.
90
116
  *
91
117
  * @param props - The properties of the class member, including its name, visibility, and other modifiers.
92
118
  * @returns A JSX element representing the class member declaration, which can be used within a ClassDeclaration component.
@@ -99,23 +125,34 @@ function ClassMember(props) {
99
125
  tsFlags,
100
126
  namePolicy: useTSNamePolicy().for("class-member-data")
101
127
  });
102
- return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Show, {
103
- when: Boolean(props.doc),
104
- children: /* @__PURE__ */ jsx(TSDoc, { heading: props.doc })
105
- }), /* @__PURE__ */ jsxs(MemberDeclaration, {
128
+ return [createComponent(Show, {
129
+ get when() {
130
+ return Boolean(props.doc);
131
+ },
132
+ get children() {
133
+ return createComponent(TSDoc, { get heading() {
134
+ return props.doc;
135
+ } });
136
+ }
137
+ }), createComponent(MemberDeclaration, {
106
138
  symbol: sym,
107
- children: [
108
- props.public && "public ",
109
- props.private && "private ",
110
- props.protected && "protected ",
111
- props.abstract && "abstract ",
112
- props.override && "override ",
113
- props.static && "static ",
114
- props.children
115
- ]
116
- })] });
139
+ get children() {
140
+ return [
141
+ memo(() => props.public && "public "),
142
+ memo(() => props.private && "private "),
143
+ memo(() => props.protected && "protected "),
144
+ memo(() => props.abstract && "abstract "),
145
+ memo(() => props.override && "override "),
146
+ memo(() => props.static && "static "),
147
+ memo(() => props.children)
148
+ ];
149
+ }
150
+ })];
117
151
  }
118
152
  /**
153
+ * Props for a class field, which is a specific type of class member that represents a property of the class.
154
+ */
155
+ /**
119
156
  * Generates a TypeScript class field declaration for the given reflection class.
120
157
  *
121
158
  * @param props - The properties of the class field, including its name, type, optionality, and other modifiers.
@@ -123,48 +160,66 @@ function ClassMember(props) {
123
160
  */
124
161
  function ClassField(props) {
125
162
  const optionality = props.optional ? "?" : "";
126
- const typeSection = props.type && /* @__PURE__ */ jsxs(Fragment, { children: [
163
+ const typeSection = props.type && [
127
164
  optionality,
128
165
  ": ",
129
- /* @__PURE__ */ jsx(TypeRefContext, { children: props.type })
130
- ] });
131
- const initializerSection = props.children && /* @__PURE__ */ jsxs(Fragment, { children: [" = ", props.children] });
132
- const nullish = props.nullish ?? props.optional;
133
- return /* @__PURE__ */ jsxs(ClassMember, {
134
- ...props,
135
- nullish,
136
- children: [
137
- /* @__PURE__ */ jsx(PropertyName, {
138
- private: props.isPrivateMember,
139
- name: props.isPrivateMember ? props.name : void 0
140
- }),
141
- typeSection,
142
- initializerSection
143
- ]
144
- });
166
+ createComponent(TypeRefContext, { get children() {
167
+ return props.type;
168
+ } })
169
+ ];
170
+ const initializerSection = props.children && [" = ", memo(() => props.children)];
171
+ return createComponent(ClassMember, mergeProps(props, {
172
+ nullish: props.nullish ?? props.optional,
173
+ get children() {
174
+ return [
175
+ createComponent(PropertyName, {
176
+ get ["private"]() {
177
+ return props.isPrivateMember;
178
+ },
179
+ get name() {
180
+ return props.isPrivateMember ? props.name : void 0;
181
+ }
182
+ }),
183
+ typeSection,
184
+ initializerSection
185
+ ];
186
+ }
187
+ }));
145
188
  }
146
189
  /**
190
+ * Props for a class field, which is a specific type of class member that represents a property of the class.
191
+ */
192
+ /**
147
193
  * Generates a TypeScript class property setter declaration for the given reflection class.
148
194
  *
149
195
  * @param props - The properties of the class property, including its name, type, and other modifiers.
150
196
  * @returns A JSX element representing the class property setter declaration, which can be used within a ClassDeclaration component.
151
197
  */
152
198
  function ClassPropertySet(props) {
153
- return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(ClassMember, {
154
- ...props,
155
- children: [
199
+ return [createComponent(ClassMember, mergeProps(props, { get children() {
200
+ return [
156
201
  "set ",
157
- /* @__PURE__ */ jsx(PropertyName, { name: props.name }),
158
- /* @__PURE__ */ jsxs(LexicalScope, { children: [
159
- /* @__PURE__ */ jsx(CallSignature, { parameters: [{
160
- name: "value",
161
- type: /* @__PURE__ */ jsx(TypeRefContext, { children: props.type })
162
- }] }),
163
- " ",
164
- /* @__PURE__ */ jsx(Block, { children: props.children })
165
- ] })
166
- ]
167
- }) });
202
+ createComponent(PropertyName, { get name() {
203
+ return props.name;
204
+ } }),
205
+ createComponent(LexicalScope, { get children() {
206
+ return [
207
+ createComponent(CallSignature, { get parameters() {
208
+ return [{
209
+ name: "value",
210
+ type: createComponent(TypeRefContext, { get children() {
211
+ return props.type;
212
+ } })
213
+ }];
214
+ } }),
215
+ " ",
216
+ createComponent(Block, { get children() {
217
+ return props.children;
218
+ } })
219
+ ];
220
+ } })
221
+ ];
222
+ } }))];
168
223
  }
169
224
  /**
170
225
  * Generates a TypeScript class property getter declaration for the given reflection class.
@@ -173,20 +228,32 @@ function ClassPropertySet(props) {
173
228
  * @returns A JSX element representing the class property getter declaration, which can be used within a ClassDeclaration component.
174
229
  */
175
230
  function ClassPropertyGet(props) {
176
- return /* @__PURE__ */ jsxs(ClassMember, {
177
- ...props,
178
- children: [
231
+ return createComponent(ClassMember, mergeProps(props, { get children() {
232
+ return [
179
233
  "get ",
180
- /* @__PURE__ */ jsx(PropertyName, { name: props.name }),
181
- /* @__PURE__ */ jsxs(LexicalScope, { children: [
182
- /* @__PURE__ */ jsx(CallSignature, { returnType: /* @__PURE__ */ jsx(TypeRefContext, { children: props.type }) }),
183
- " ",
184
- /* @__PURE__ */ jsx(Block, { children: props.children })
185
- ] })
186
- ]
187
- });
234
+ createComponent(PropertyName, { get name() {
235
+ return props.name;
236
+ } }),
237
+ createComponent(LexicalScope, { get children() {
238
+ return [
239
+ createComponent(CallSignature, { get returnType() {
240
+ return createComponent(TypeRefContext, { get children() {
241
+ return props.type;
242
+ } });
243
+ } }),
244
+ " ",
245
+ createComponent(Block, { get children() {
246
+ return props.children;
247
+ } })
248
+ ];
249
+ } })
250
+ ];
251
+ } }));
188
252
  }
189
253
  /**
254
+ * Props for a class method, which is a specific type of class member that represents a function defined within the class.
255
+ */
256
+ /**
190
257
  * Generates a TypeScript class method declaration for the given reflection class.
191
258
  *
192
259
  * @param props - The properties of the class method, including its name, visibility, and other modifiers.
@@ -195,24 +262,37 @@ function ClassPropertyGet(props) {
195
262
  function ClassMethod(props) {
196
263
  const callProps = getCallSignatureProps(props);
197
264
  const [_, rest] = splitProps(props, ["doc"]);
198
- return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Show, {
199
- when: Boolean(props.doc),
200
- children: /* @__PURE__ */ jsx(TSDoc, {
201
- heading: props.doc,
202
- children: Array.isArray(rest.parameters) && /* @__PURE__ */ jsx(TSDocParams, { parameters: rest.parameters })
203
- })
204
- }), /* @__PURE__ */ jsxs(ClassMember, {
205
- ...rest,
206
- children: [
207
- props.async && "async ",
208
- /* @__PURE__ */ jsx(PropertyName, {}),
209
- /* @__PURE__ */ jsxs(LexicalScope, { children: [
210
- /* @__PURE__ */ jsx(CallSignature, { ...callProps }),
211
- " ",
212
- /* @__PURE__ */ jsx(Block, { children: props.children })
213
- ] })
214
- ]
215
- })] });
265
+ return [createComponent(Show, {
266
+ get when() {
267
+ return Boolean(props.doc);
268
+ },
269
+ get children() {
270
+ return createComponent(TSDoc, {
271
+ get heading() {
272
+ return props.doc;
273
+ },
274
+ get children() {
275
+ return memo(() => !!Array.isArray(rest.parameters))() && createComponent(TSDocParams, { get parameters() {
276
+ return rest.parameters;
277
+ } });
278
+ }
279
+ });
280
+ }
281
+ }), createComponent(ClassMember, mergeProps(rest, { get children() {
282
+ return [
283
+ memo(() => props.async && "async "),
284
+ createComponent(PropertyName, {}),
285
+ createComponent(LexicalScope, { get children() {
286
+ return [
287
+ createComponent(CallSignature, callProps),
288
+ " ",
289
+ createComponent(Block, { get children() {
290
+ return props.children;
291
+ } })
292
+ ];
293
+ } })
294
+ ];
295
+ } }))];
216
296
  }
217
297
 
218
298
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"class-declaration.mjs","names":["Declaration","MemberScope"],"sources":["../../../src/typescript/components/class-declaration.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport {\n Block,\n Children,\n code,\n For,\n MemberDeclaration,\n Name,\n Namekey,\n Refkey,\n Show,\n splitProps\n} from \"@alloy-js/core\";\nimport {\n CallSignature,\n CallSignatureProps,\n CommonDeclarationProps,\n createMemberSymbol,\n createTypeAndValueSymbol,\n Declaration,\n TSSymbolFlags,\n TypeParameterDescriptor,\n TypeRefContext,\n useTSNamePolicy\n} from \"@alloy-js/typescript\";\nimport { LexicalScope } from \"../contexts\";\nimport { MemberScope } from \"../contexts/member-scope\";\nimport { getCallSignatureProps } from \"../helpers\";\nimport { PropertyName } from \"./property-name\";\nimport { TSDoc, TSDocParams } from \"./tsdoc\";\nimport { TypeParameters } from \"./type-parameters\";\n\n/**\n * Props for the ClassDeclaration component, which represents a TypeScript class declaration\n */\nexport interface ClassDeclarationProps extends CommonDeclarationProps {\n /**\n * An indication of whether this class is abstract\n */\n abstract?: boolean;\n\n /**\n * An optional class that this class extends. This will be rendered as an `extends` clause in the class declaration\n */\n extends?: Children;\n\n /**\n * Optional interfaces that this class implements. This will be rendered as an `implements` clause in the class declaration\n */\n implements?: Children[];\n\n /**\n * The generic type parameters of the class.\n */\n typeParameters?: TypeParameterDescriptor[] | string[];\n}\n\n/**\n * Create a TypeScript class declaration.\n *\n * @example\n * ```tsx\n * const myPetRefkey = refkey();\n * const Animal = refkey();\n * const staticMember = refkey();\n * const instanceMember = refkey();\n *\n * <ClassDeclaration name=\"Animal\" refkey={Animal}>\n * <ClassMember public static name=\"something\" type=\"string\" refkey={staticMember}>\n * \"hello\"\n * </ClassMember>\n * <ClassMember public name=\"kind\" type=\"string\" />\n * <ClassMember public name=\"name\" type=\"string\" refkey={instanceMember} />\n * <ClassConstructor parameters=\"name: string\">\n * this.name = name;\n * </ClassConstructor>\n * </ClassDeclaration>\n *\n * <VarDeclaration const name=\"myPet\" refkey={myPetRefkey}>\n * new {Animal}();\n * </VarDeclaration>\n *\n * {staticMember}; // Animal.something\n * <MemberReference path={[myPetRefkey, instanceMember]} /> // myPet.name\n * {memberRefkey(myPetRefkey, instanceMember)}\n * ```\n */\nexport function ClassDeclaration(props: ClassDeclarationProps) {\n const extendsPart = props.extends && <> extends {props.extends}</>;\n const implementsPart = props.implements && props.implements.length > 0 && (\n <>\n {\" \"}\n implements{\" \"}\n <For each={props.implements} comma space>\n {implement => implement}\n </For>\n </>\n );\n const sym = createTypeAndValueSymbol(props.name, {\n refkeys: props.refkey,\n export: props.export,\n default: props.default,\n metadata: props.metadata,\n hasInstanceMembers: true,\n namePolicy: useTSNamePolicy().for(\"class\")\n });\n\n return (\n <>\n <Show when={Boolean(props.doc)}>\n <TSDoc heading={props.doc} />\n </Show>\n <Declaration symbol={sym} export={props.export} default={props.default}>\n <MemberScope ownerSymbol={sym}>\n {props.abstract && code`abstract `} class <Name />\n {props.typeParameters && (\n <TypeParameters parameters={props.typeParameters} />\n )}\n {extendsPart}\n {implementsPart} <Block>{props.children}</Block>\n </MemberScope>\n </Declaration>\n </>\n );\n}\n\nClassDeclaration.TypeParameters = TypeParameters;\n\n/**\n * Generates a TypeScript class member declaration for the given reflection class.\n */\nexport interface ClassMemberProps {\n name: string | Namekey;\n refkey?: Refkey;\n public?: boolean;\n private?: boolean;\n protected?: boolean;\n jsPrivate?: boolean;\n static?: boolean;\n abstract?: boolean;\n children?: Children;\n doc?: Children;\n nullish?: boolean;\n override?: boolean;\n}\n\n/**\n * Generates a TypeScript class member declaration for the given reflection class.\n *\n * @param props - The properties of the class member, including its name, visibility, and other modifiers.\n * @returns A JSX element representing the class member declaration, which can be used within a ClassDeclaration component.\n */\nexport function ClassMember(props: ClassMemberProps) {\n let tsFlags = TSSymbolFlags.None;\n if (props.nullish) {\n tsFlags |= TSSymbolFlags.Nullish;\n }\n\n const sym = createMemberSymbol(props.name, props, {\n refkeys: props.refkey,\n tsFlags,\n namePolicy: useTSNamePolicy().for(\"class-member-data\")\n });\n\n return (\n <>\n <Show when={Boolean(props.doc)}>\n <TSDoc heading={props.doc} />\n </Show>\n <MemberDeclaration symbol={sym}>\n {props.public && \"public \"}\n {props.private && \"private \"}\n {props.protected && \"protected \"}\n {props.abstract && \"abstract \"}\n {props.override && \"override \"}\n {props.static && \"static \"}\n {props.children}\n </MemberDeclaration>\n </>\n );\n}\n\n/**\n * Props for a class field, which is a specific type of class member that represents a property of the class.\n */\nexport interface ClassFieldProps extends ClassMemberProps {\n name: string;\n type?: Children;\n optional?: boolean;\n children?: Children;\n isPrivateMember?: boolean;\n}\n\n/**\n * Generates a TypeScript class field declaration for the given reflection class.\n *\n * @param props - The properties of the class field, including its name, type, optionality, and other modifiers.\n * @returns A JSX element representing the class field declaration, which can be used within a ClassDeclaration component.\n */\nexport function ClassField(props: ClassFieldProps) {\n const optionality = props.optional ? \"?\" : \"\";\n const typeSection = props.type && (\n <>\n {optionality}: <TypeRefContext>{props.type}</TypeRefContext>\n </>\n );\n const initializerSection = props.children && <> = {props.children}</>;\n const nullish = props.nullish ?? props.optional;\n\n return (\n <ClassMember {...props} nullish={nullish}>\n <PropertyName\n private={props.isPrivateMember}\n name={props.isPrivateMember ? props.name : undefined}\n />\n {typeSection}\n {initializerSection}\n </ClassMember>\n );\n}\n\n/**\n * Props for a class field, which is a specific type of class member that represents a property of the class.\n */\nexport interface ClassPropertyProps extends ClassMemberProps {\n name: string;\n type?: Children;\n children?: Children;\n}\n\n/**\n * Generates a TypeScript class property setter declaration for the given reflection class.\n *\n * @param props - The properties of the class property, including its name, type, and other modifiers.\n * @returns A JSX element representing the class property setter declaration, which can be used within a ClassDeclaration component.\n */\nexport function ClassPropertySet(props: ClassPropertyProps) {\n return (\n <>\n <ClassMember {...props}>\n {\"set \"}\n <PropertyName name={props.name} />\n <LexicalScope>\n <CallSignature\n parameters={[\n {\n name: \"value\",\n type: <TypeRefContext>{props.type}</TypeRefContext>\n }\n ]}\n />{\" \"}\n <Block>{props.children}</Block>\n </LexicalScope>\n </ClassMember>\n </>\n );\n}\n\n/**\n * Generates a TypeScript class property getter declaration for the given reflection class.\n *\n * @param props - The properties of the class property, including its name, type, and other modifiers.\n * @returns A JSX element representing the class property getter declaration, which can be used within a ClassDeclaration component.\n */\nexport function ClassPropertyGet(props: ClassPropertyProps) {\n return (\n <ClassMember {...props}>\n {\"get \"}\n <PropertyName name={props.name} />\n <LexicalScope>\n <CallSignature\n returnType={<TypeRefContext>{props.type}</TypeRefContext>}\n />{\" \"}\n <Block>{props.children}</Block>\n </LexicalScope>\n </ClassMember>\n );\n}\n\n/**\n * Props for a class method, which is a specific type of class member that represents a function defined within the class.\n */\nexport interface ClassMethodProps extends ClassMemberProps, CallSignatureProps {\n async?: boolean;\n children?: Children;\n}\n\n/**\n * Generates a TypeScript class method declaration for the given reflection class.\n *\n * @param props - The properties of the class method, including its name, visibility, and other modifiers.\n * @returns A JSX element representing the class method declaration, which can be used within a ClassDeclaration component.\n */\nexport function ClassMethod(props: ClassMethodProps) {\n const callProps = getCallSignatureProps(props);\n const [_, rest] = splitProps(props, [\"doc\"]);\n\n return (\n <>\n <Show when={Boolean(props.doc)}>\n <TSDoc heading={props.doc}>\n {Array.isArray(rest.parameters) && (\n <TSDocParams parameters={rest.parameters} />\n )}\n </TSDoc>\n </Show>\n <ClassMember {...rest}>\n {props.async && \"async \"}\n <PropertyName />\n <LexicalScope>\n <CallSignature {...callProps} /> <Block>{props.children}</Block>\n </LexicalScope>\n </ClassMember>\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwGA,SAAgB,iBAAiB,OAA8B;CAC7D,MAAM,cAAc,MAAM,WAAW,4CAAE,aAAU,MAAM,QAAW;CAClE,MAAM,iBAAiB,MAAM,cAAc,MAAM,WAAW,SAAS,KACnE;EACG;EAAI;EACM;EACX,oBAAC,KAAD;GAAK,MAAM,MAAM;GAAY;GAAM;cAChC,cAAa;GACV;EACL;CAEL,MAAM,MAAM,yBAAyB,MAAM,MAAM;EAC/C,SAAS,MAAM;EACf,QAAQ,MAAM;EACd,SAAS,MAAM;EACf,UAAU,MAAM;EAChB,oBAAoB;EACpB,YAAY,iBAAiB,CAAC,IAAI,QAAQ;EAC3C,CAAC;AAEF,QACE,4CACE,oBAAC,MAAD;EAAM,MAAM,QAAQ,MAAM,IAAI;YAC5B,oBAAC,OAAD,EAAO,SAAS,MAAM,KAAO;EACxB,GACP,oBAACA,eAAD;EAAa,QAAQ;EAAK,QAAQ,MAAM;EAAQ,SAAS,MAAM;YAC7D,qBAACC,eAAD;GAAa,aAAa;aAA1B;IACG,MAAM,YAAY,IAAI;IAAY;IAAO,oBAAC,MAAD,EAAQ;IACjD,MAAM,kBACL,oBAAC,gBAAD,EAAgB,YAAY,MAAM,gBAAkB;IAErD;IACA;IAAe;IAAC,oBAAC,OAAD,YAAQ,MAAM,UAAiB;IACpC;;EACF,EACb;;AAIP,iBAAiB,iBAAiB;;;;;;;AA0BlC,SAAgB,YAAY,OAAyB;CACnD,IAAI,UAAU,cAAc;AAC5B,KAAI,MAAM,QACR,YAAW,cAAc;CAG3B,MAAM,MAAM,mBAAmB,MAAM,MAAM,OAAO;EAChD,SAAS,MAAM;EACf;EACA,YAAY,iBAAiB,CAAC,IAAI,oBAAoB;EACvD,CAAC;AAEF,QACE,4CACE,oBAAC,MAAD;EAAM,MAAM,QAAQ,MAAM,IAAI;YAC5B,oBAAC,OAAD,EAAO,SAAS,MAAM,KAAO;EACxB,GACP,qBAAC,mBAAD;EAAmB,QAAQ;YAA3B;GACG,MAAM,UAAU;GAChB,MAAM,WAAW;GACjB,MAAM,aAAa;GACnB,MAAM,YAAY;GAClB,MAAM,YAAY;GAClB,MAAM,UAAU;GAChB,MAAM;GACW;IACnB;;;;;;;;AAqBP,SAAgB,WAAW,OAAwB;CACjD,MAAM,cAAc,MAAM,WAAW,MAAM;CAC3C,MAAM,cAAc,MAAM,QACxB;EACG;EAAY;EAAE,oBAAC,gBAAD,YAAiB,MAAM,MAAsB;EAC3D;CAEL,MAAM,qBAAqB,MAAM,YAAY,4CAAE,OAAI,MAAM,SAAY;CACrE,MAAM,UAAU,MAAM,WAAW,MAAM;AAEvC,QACE,qBAAC,aAAD;EAAa,GAAI;EAAgB;YAAjC;GACE,oBAAC,cAAD;IACE,SAAS,MAAM;IACf,MAAM,MAAM,kBAAkB,MAAM,OAAO;IAC3C;GACD;GACA;GACW;;;;;;;;;AAmBlB,SAAgB,iBAAiB,OAA2B;AAC1D,QACE,0CACE,qBAAC,aAAD;EAAa,GAAI;YAAjB;GACG;GACD,oBAAC,cAAD,EAAc,MAAM,MAAM,MAAQ;GAClC,qBAAC,cAAD;IACE,oBAAC,eAAD,EACE,YAAY,CACV;KACE,MAAM;KACN,MAAM,oBAAC,gBAAD,YAAiB,MAAM,MAAsB;KACpD,CACF,EACD;IAAC;IACH,oBAAC,OAAD,YAAQ,MAAM,UAAiB;IAClB;GACH;KACb;;;;;;;;AAUP,SAAgB,iBAAiB,OAA2B;AAC1D,QACE,qBAAC,aAAD;EAAa,GAAI;YAAjB;GACG;GACD,oBAAC,cAAD,EAAc,MAAM,MAAM,MAAQ;GAClC,qBAAC,cAAD;IACE,oBAAC,eAAD,EACE,YAAY,oBAAC,gBAAD,YAAiB,MAAM,MAAsB,GACzD;IAAC;IACH,oBAAC,OAAD,YAAQ,MAAM,UAAiB;IAClB;GACH;;;;;;;;;AAkBlB,SAAgB,YAAY,OAAyB;CACnD,MAAM,YAAY,sBAAsB,MAAM;CAC9C,MAAM,CAAC,GAAG,QAAQ,WAAW,OAAO,CAAC,MAAM,CAAC;AAE5C,QACE,4CACE,oBAAC,MAAD;EAAM,MAAM,QAAQ,MAAM,IAAI;YAC5B,oBAAC,OAAD;GAAO,SAAS,MAAM;aACnB,MAAM,QAAQ,KAAK,WAAW,IAC7B,oBAAC,aAAD,EAAa,YAAY,KAAK,YAAc;GAExC;EACH,GACP,qBAAC,aAAD;EAAa,GAAI;YAAjB;GACG,MAAM,SAAS;GAChB,oBAAC,cAAD,EAAgB;GAChB,qBAAC,cAAD;IACE,oBAAC,eAAD,EAAe,GAAI,WAAa;;IAAC,oBAAC,OAAD,YAAQ,MAAM,UAAiB;IACnD;GACH;IACb"}
1
+ {"version":3,"file":"class-declaration.mjs","names":[],"sources":["../../../src/typescript/components/class-declaration.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport {\n Block,\n Children,\n code,\n For,\n MemberDeclaration,\n Name,\n Namekey,\n Refkey,\n Show,\n splitProps\n} from \"@alloy-js/core\";\nimport {\n CallSignature,\n CallSignatureProps,\n CommonDeclarationProps,\n createMemberSymbol,\n createTypeAndValueSymbol,\n Declaration,\n TSSymbolFlags,\n TypeParameterDescriptor,\n TypeRefContext,\n useTSNamePolicy\n} from \"@alloy-js/typescript\";\nimport { LexicalScope } from \"../contexts\";\nimport { MemberScope } from \"../contexts/member-scope\";\nimport { getCallSignatureProps } from \"../helpers\";\nimport { PropertyName } from \"./property-name\";\nimport { TSDoc, TSDocParams } from \"./tsdoc\";\nimport { TypeParameters } from \"./type-parameters\";\n\n/**\n * Props for the ClassDeclaration component, which represents a TypeScript class declaration\n */\nexport interface ClassDeclarationProps extends CommonDeclarationProps {\n /**\n * An indication of whether this class is abstract\n */\n abstract?: boolean;\n\n /**\n * An optional class that this class extends. This will be rendered as an `extends` clause in the class declaration\n */\n extends?: Children;\n\n /**\n * Optional interfaces that this class implements. This will be rendered as an `implements` clause in the class declaration\n */\n implements?: Children[];\n\n /**\n * The generic type parameters of the class.\n */\n typeParameters?: TypeParameterDescriptor[] | string[];\n}\n\n/**\n * Create a TypeScript class declaration.\n *\n * @example\n * ```tsx\n * const myPetRefkey = refkey();\n * const Animal = refkey();\n * const staticMember = refkey();\n * const instanceMember = refkey();\n *\n * <ClassDeclaration name=\"Animal\" refkey={Animal}>\n * <ClassMember public static name=\"something\" type=\"string\" refkey={staticMember}>\n * \"hello\"\n * </ClassMember>\n * <ClassMember public name=\"kind\" type=\"string\" />\n * <ClassMember public name=\"name\" type=\"string\" refkey={instanceMember} />\n * <ClassConstructor parameters=\"name: string\">\n * this.name = name;\n * </ClassConstructor>\n * </ClassDeclaration>\n *\n * <VarDeclaration const name=\"myPet\" refkey={myPetRefkey}>\n * new {Animal}();\n * </VarDeclaration>\n *\n * {staticMember}; // Animal.something\n * <MemberReference path={[myPetRefkey, instanceMember]} /> // myPet.name\n * {memberRefkey(myPetRefkey, instanceMember)}\n * ```\n */\nexport function ClassDeclaration(props: ClassDeclarationProps) {\n const extendsPart = props.extends && <> extends {props.extends}</>;\n const implementsPart = props.implements && props.implements.length > 0 && (\n <>\n {\" \"}\n implements{\" \"}\n <For each={props.implements} comma space>\n {implement => implement}\n </For>\n </>\n );\n const sym = createTypeAndValueSymbol(props.name, {\n refkeys: props.refkey,\n export: props.export,\n default: props.default,\n metadata: props.metadata,\n hasInstanceMembers: true,\n namePolicy: useTSNamePolicy().for(\"class\")\n });\n\n return (\n <>\n <Show when={Boolean(props.doc)}>\n <TSDoc heading={props.doc} />\n </Show>\n <Declaration symbol={sym} export={props.export} default={props.default}>\n <MemberScope ownerSymbol={sym}>\n {props.abstract && code`abstract `} class <Name />\n {props.typeParameters && (\n <TypeParameters parameters={props.typeParameters} />\n )}\n {extendsPart}\n {implementsPart} <Block>{props.children}</Block>\n </MemberScope>\n </Declaration>\n </>\n );\n}\n\nClassDeclaration.TypeParameters = TypeParameters;\n\n/**\n * Generates a TypeScript class member declaration for the given reflection class.\n */\nexport interface ClassMemberProps {\n name: string | Namekey;\n refkey?: Refkey;\n public?: boolean;\n private?: boolean;\n protected?: boolean;\n jsPrivate?: boolean;\n static?: boolean;\n abstract?: boolean;\n children?: Children;\n doc?: Children;\n nullish?: boolean;\n override?: boolean;\n}\n\n/**\n * Generates a TypeScript class member declaration for the given reflection class.\n *\n * @param props - The properties of the class member, including its name, visibility, and other modifiers.\n * @returns A JSX element representing the class member declaration, which can be used within a ClassDeclaration component.\n */\nexport function ClassMember(props: ClassMemberProps) {\n let tsFlags = TSSymbolFlags.None;\n if (props.nullish) {\n tsFlags |= TSSymbolFlags.Nullish;\n }\n\n const sym = createMemberSymbol(props.name, props, {\n refkeys: props.refkey,\n tsFlags,\n namePolicy: useTSNamePolicy().for(\"class-member-data\")\n });\n\n return (\n <>\n <Show when={Boolean(props.doc)}>\n <TSDoc heading={props.doc} />\n </Show>\n <MemberDeclaration symbol={sym}>\n {props.public && \"public \"}\n {props.private && \"private \"}\n {props.protected && \"protected \"}\n {props.abstract && \"abstract \"}\n {props.override && \"override \"}\n {props.static && \"static \"}\n {props.children}\n </MemberDeclaration>\n </>\n );\n}\n\n/**\n * Props for a class field, which is a specific type of class member that represents a property of the class.\n */\nexport interface ClassFieldProps extends ClassMemberProps {\n name: string;\n type?: Children;\n optional?: boolean;\n children?: Children;\n isPrivateMember?: boolean;\n}\n\n/**\n * Generates a TypeScript class field declaration for the given reflection class.\n *\n * @param props - The properties of the class field, including its name, type, optionality, and other modifiers.\n * @returns A JSX element representing the class field declaration, which can be used within a ClassDeclaration component.\n */\nexport function ClassField(props: ClassFieldProps) {\n const optionality = props.optional ? \"?\" : \"\";\n const typeSection = props.type && (\n <>\n {optionality}: <TypeRefContext>{props.type}</TypeRefContext>\n </>\n );\n const initializerSection = props.children && <> = {props.children}</>;\n const nullish = props.nullish ?? props.optional;\n\n return (\n <ClassMember {...props} nullish={nullish}>\n <PropertyName\n private={props.isPrivateMember}\n name={props.isPrivateMember ? props.name : undefined}\n />\n {typeSection}\n {initializerSection}\n </ClassMember>\n );\n}\n\n/**\n * Props for a class field, which is a specific type of class member that represents a property of the class.\n */\nexport interface ClassPropertyProps extends ClassMemberProps {\n name: string;\n type?: Children;\n children?: Children;\n}\n\n/**\n * Generates a TypeScript class property setter declaration for the given reflection class.\n *\n * @param props - The properties of the class property, including its name, type, and other modifiers.\n * @returns A JSX element representing the class property setter declaration, which can be used within a ClassDeclaration component.\n */\nexport function ClassPropertySet(props: ClassPropertyProps) {\n return (\n <>\n <ClassMember {...props}>\n {\"set \"}\n <PropertyName name={props.name} />\n <LexicalScope>\n <CallSignature\n parameters={[\n {\n name: \"value\",\n type: <TypeRefContext>{props.type}</TypeRefContext>\n }\n ]}\n />{\" \"}\n <Block>{props.children}</Block>\n </LexicalScope>\n </ClassMember>\n </>\n );\n}\n\n/**\n * Generates a TypeScript class property getter declaration for the given reflection class.\n *\n * @param props - The properties of the class property, including its name, type, and other modifiers.\n * @returns A JSX element representing the class property getter declaration, which can be used within a ClassDeclaration component.\n */\nexport function ClassPropertyGet(props: ClassPropertyProps) {\n return (\n <ClassMember {...props}>\n {\"get \"}\n <PropertyName name={props.name} />\n <LexicalScope>\n <CallSignature\n returnType={<TypeRefContext>{props.type}</TypeRefContext>}\n />{\" \"}\n <Block>{props.children}</Block>\n </LexicalScope>\n </ClassMember>\n );\n}\n\n/**\n * Props for a class method, which is a specific type of class member that represents a function defined within the class.\n */\nexport interface ClassMethodProps extends ClassMemberProps, CallSignatureProps {\n async?: boolean;\n children?: Children;\n}\n\n/**\n * Generates a TypeScript class method declaration for the given reflection class.\n *\n * @param props - The properties of the class method, including its name, visibility, and other modifiers.\n * @returns A JSX element representing the class method declaration, which can be used within a ClassDeclaration component.\n */\nexport function ClassMethod(props: ClassMethodProps) {\n const callProps = getCallSignatureProps(props);\n const [_, rest] = splitProps(props, [\"doc\"]);\n\n return (\n <>\n <Show when={Boolean(props.doc)}>\n <TSDoc heading={props.doc}>\n {Array.isArray(rest.parameters) && (\n <TSDocParams parameters={rest.parameters} />\n )}\n </TSDoc>\n </Show>\n <ClassMember {...rest}>\n {props.async && \"async \"}\n <PropertyName />\n <LexicalScope>\n <CallSignature {...callProps} /> <Block>{props.children}</Block>\n </LexicalScope>\n </ClassMember>\n </>\n );\n}\n"],"mappings":"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"}
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
3
- let _alloy_js_core = require("@alloy-js/core");
4
3
  let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
4
+ let _alloy_js_core = require("@alloy-js/core");
5
5
  let _alloy_js_typescript = require("@alloy-js/typescript");
6
6
 
7
7
  //#region src/typescript/components/dynamic-import-statement.tsx
@@ -19,11 +19,7 @@ let _alloy_js_typescript = require("@alloy-js/typescript");
19
19
  */
20
20
  function DynamicImportStatement(props) {
21
21
  const { importPath, exportName = "default", const: isConst = true, ...rest } = props;
22
- return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(_alloy_js_typescript.VarDeclaration, {
23
- const: isConst,
24
- ...rest,
25
- initializer: _alloy_js_core.code`await import("${importPath}").then(m => m.${exportName});`
26
- });
22
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, (0, _alloy_js_core_jsx_runtime.mergeProps)({ "const": isConst }, rest, { initializer: _alloy_js_core.code`await import("${importPath}").then(m => m.${exportName});` }));
27
23
  }
28
24
 
29
25
  //#endregion
@@ -1,5 +1,5 @@
1
+ import { createComponent, mergeProps } from "@alloy-js/core/jsx-runtime";
1
2
  import { code } from "@alloy-js/core";
2
- import { jsx } from "@alloy-js/core/jsx-runtime";
3
3
  import { VarDeclaration } from "@alloy-js/typescript";
4
4
 
5
5
  //#region src/typescript/components/dynamic-import-statement.tsx
@@ -17,11 +17,7 @@ import { VarDeclaration } from "@alloy-js/typescript";
17
17
  */
18
18
  function DynamicImportStatement(props) {
19
19
  const { importPath, exportName = "default", const: isConst = true, ...rest } = props;
20
- return /* @__PURE__ */ jsx(VarDeclaration, {
21
- const: isConst,
22
- ...rest,
23
- initializer: code`await import("${importPath}").then(m => m.${exportName});`
24
- });
20
+ return createComponent(VarDeclaration, mergeProps({ "const": isConst }, rest, { initializer: code`await import("${importPath}").then(m => m.${exportName});` }));
25
21
  }
26
22
 
27
23
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"dynamic-import-statement.mjs","names":[],"sources":["../../../src/typescript/components/dynamic-import-statement.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 } from \"@alloy-js/core\";\nimport { VarDeclaration, VarDeclarationProps } from \"@alloy-js/typescript\";\n\nexport interface DynamicImportStatementProps extends Omit<\n VarDeclarationProps,\n \"initializer\"\n> {\n /**\n * The path of the module to import.\n */\n importPath: string;\n\n /**\n * The name of the export to import from the module.\n *\n * @defaultValue \"default\"\n */\n exportName?: string;\n}\n\n/**\n * Generates a dynamic import statement for a given module path and export name.\n *\n * @example\n * ```tsx\n * <DynamicImportStatement importPath=\"./my-module\" exportName=\"myExport\" const={true} name=\"myVar\" />\n * // const myVar = await import(\"./my-module\").then(m => m.myExport);\n * ```\n *\n * @param props - The properties for the dynamic import statement.\n * @returns A `VarDeclaration` component representing the dynamic import statement.\n */\nexport function DynamicImportStatement(props: DynamicImportStatementProps) {\n const {\n importPath,\n exportName = \"default\",\n const: isConst = true,\n ...rest\n } = props;\n\n return (\n <VarDeclaration\n const={isConst}\n {...rest}\n initializer={code`await import(\"${importPath}\").then(m => m.${exportName});`}></VarDeclaration>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAkDA,SAAgB,uBAAuB,OAAoC;CACzE,MAAM,EACJ,YACA,aAAa,WACb,OAAO,UAAU,MACjB,GAAG,SACD;AAEJ,QACE,oBAAC,gBAAD;EACE,OAAO;EACP,GAAI;EACJ,aAAa,IAAI,iBAAiB,WAAW,iBAAiB,WAAW;EAAsB"}
1
+ {"version":3,"file":"dynamic-import-statement.mjs","names":[],"sources":["../../../src/typescript/components/dynamic-import-statement.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 } from \"@alloy-js/core\";\nimport { VarDeclaration, VarDeclarationProps } from \"@alloy-js/typescript\";\n\nexport interface DynamicImportStatementProps extends Omit<\n VarDeclarationProps,\n \"initializer\"\n> {\n /**\n * The path of the module to import.\n */\n importPath: string;\n\n /**\n * The name of the export to import from the module.\n *\n * @defaultValue \"default\"\n */\n exportName?: string;\n}\n\n/**\n * Generates a dynamic import statement for a given module path and export name.\n *\n * @example\n * ```tsx\n * <DynamicImportStatement importPath=\"./my-module\" exportName=\"myExport\" const={true} name=\"myVar\" />\n * // const myVar = await import(\"./my-module\").then(m => m.myExport);\n * ```\n *\n * @param props - The properties for the dynamic import statement.\n * @returns A `VarDeclaration` component representing the dynamic import statement.\n */\nexport function DynamicImportStatement(props: DynamicImportStatementProps) {\n const {\n importPath,\n exportName = \"default\",\n const: isConst = true,\n ...rest\n } = props;\n\n return (\n <VarDeclaration\n const={isConst}\n {...rest}\n initializer={code`await import(\"${importPath}\").then(m => m.${exportName});`}></VarDeclaration>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAiCA,SAAM,uBAAqB,OAAA;CACzB,MAAE,EACF,YACF,aAAA,kCAEE,GAAA,SACC;AACF,QAAA,gBAAA,gBAAA,WAAA,EACG,SAAA,SACD,EAAE,MAAC,EACF,aAAA,IAAA,iBAAkC,WAAM,iBAAoB,WAAU,KACvE,CAAC,CAAC"}
@@ -2,13 +2,13 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  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_typescript_file = require('./typescript-file.cjs');
5
- let _alloy_js_core = require("@alloy-js/core");
6
5
  let _stryke_path_file_path_fns = require("@stryke/path/file-path-fns");
6
+ let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
7
+ let _alloy_js_core = require("@alloy-js/core");
7
8
  let _stryke_path_append = require("@stryke/path/append");
8
9
  let _stryke_path_replace = require("@stryke/path/replace");
9
10
  let defu = require("defu");
10
11
  defu = require_runtime.__toESM(defu);
11
- let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
12
12
  let _stryke_type_checks_is_set = require("@stryke/type-checks/is-set");
13
13
 
14
14
  //#region src/typescript/components/entry-file.tsx
@@ -28,12 +28,15 @@ function EntryFile(props) {
28
28
  ]);
29
29
  const context = require_core_contexts_context.usePowerlinesSafe();
30
30
  const fullPath = (0, _alloy_js_core.computed)(() => context ? (0, _stryke_path_append.appendPath)(`${!(0, _stryke_type_checks_is_set.isSet)(tsx) ? path : (0, _stryke_path_replace.replaceExtension)(path)}${tsx ? ".tsx" : (0, _stryke_path_file_path_fns.hasFileExtension)(path) ? "" : ".ts"}`, (0, _stryke_path_replace.replacePath)(context.entryPath, context.config.cwd)) : path);
31
- return /* @__PURE__ */ (0, _alloy_js_core_jsx_runtime.jsx)(require_typescript_components_typescript_file.TypescriptFile, {
32
- ...rest,
33
- path: fullPath.value,
34
- meta: (0, defu.default)({ kind: "entry" }, meta ?? {}, { typeDefinition }),
31
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_typescript_file.TypescriptFile, (0, _alloy_js_core_jsx_runtime.mergeProps)(rest, {
32
+ get path() {
33
+ return fullPath.value;
34
+ },
35
+ get meta() {
36
+ return (0, defu.default)({ kind: "entry" }, meta ?? {}, { typeDefinition });
37
+ },
35
38
  children
36
- });
39
+ }));
37
40
  }
38
41
 
39
42
  //#endregion
@@ -1,11 +1,11 @@
1
1
  import { usePowerlinesSafe } from "../../core/contexts/context.mjs";
2
2
  import { TypescriptFile } from "./typescript-file.mjs";
3
- import { computed, splitProps } from "@alloy-js/core";
4
3
  import { hasFileExtension } from "@stryke/path/file-path-fns";
4
+ import { createComponent, mergeProps } from "@alloy-js/core/jsx-runtime";
5
+ import { computed, splitProps } from "@alloy-js/core";
5
6
  import { appendPath } from "@stryke/path/append";
6
7
  import { replaceExtension, replacePath } from "@stryke/path/replace";
7
8
  import defu from "defu";
8
- import { jsx } from "@alloy-js/core/jsx-runtime";
9
9
  import { isSet } from "@stryke/type-checks/is-set";
10
10
 
11
11
  //#region src/typescript/components/entry-file.tsx
@@ -25,12 +25,15 @@ function EntryFile(props) {
25
25
  ]);
26
26
  const context = usePowerlinesSafe();
27
27
  const fullPath = computed(() => context ? appendPath(`${!isSet(tsx) ? path : replaceExtension(path)}${tsx ? ".tsx" : hasFileExtension(path) ? "" : ".ts"}`, replacePath(context.entryPath, context.config.cwd)) : path);
28
- return /* @__PURE__ */ jsx(TypescriptFile, {
29
- ...rest,
30
- path: fullPath.value,
31
- meta: defu({ kind: "entry" }, meta ?? {}, { typeDefinition }),
28
+ return createComponent(TypescriptFile, mergeProps(rest, {
29
+ get path() {
30
+ return fullPath.value;
31
+ },
32
+ get meta() {
33
+ return defu({ kind: "entry" }, meta ?? {}, { typeDefinition });
34
+ },
32
35
  children
33
- });
36
+ }));
34
37
  }
35
38
 
36
39
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"entry-file.mjs","names":[],"sources":["../../../src/typescript/components/entry-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 { appendPath } from \"@stryke/path/append\";\nimport { hasFileExtension } from \"@stryke/path/file-path-fns\";\nimport { replaceExtension, replacePath } from \"@stryke/path/replace\";\nimport { isSet } from \"@stryke/type-checks/is-set\";\nimport defu from \"defu\";\nimport { ResolvedEntryTypeDefinition } from \"powerlines\";\nimport { usePowerlinesSafe } from \"../../core/contexts/context\";\nimport { TypescriptFile, TypescriptFileProps } from \"./typescript-file\";\n\nexport type EntryFileProps = TypescriptFileProps & {\n /**\n * Whether the file is a TSX file.\n *\n * @defaultValue false\n */\n tsx?: boolean;\n\n /**\n * Render metadata information about the entrypoint\n */\n typeDefinition?: ResolvedEntryTypeDefinition;\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 EntryFile(props: EntryFileProps) {\n const [{ children, meta, tsx, path, typeDefinition }, rest] = splitProps(\n props,\n [\"children\", \"meta\", \"tsx\", \"path\", \"typeDefinition\"]\n );\n\n const context = usePowerlinesSafe();\n const fullPath = computed(() =>\n context\n ? appendPath(\n `${\n !isSet(tsx) ? path : replaceExtension(path)\n }${tsx ? \".tsx\" : hasFileExtension(path) ? \"\" : \".ts\"}`,\n replacePath(context.entryPath, context.config.cwd)\n )\n : path\n );\n\n return (\n <TypescriptFile\n {...rest}\n path={fullPath.value}\n meta={defu(\n {\n kind: \"entry\"\n },\n meta ?? {},\n {\n typeDefinition\n }\n )}>\n {children}\n </TypescriptFile>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAgDA,SAAgB,UAAU,OAAuB;CAC/C,MAAM,CAAC,EAAE,UAAU,MAAM,KAAK,MAAM,kBAAkB,QAAQ,WAC5D,OACA;EAAC;EAAY;EAAQ;EAAO;EAAQ;EAAiB,CACtD;CAED,MAAM,UAAU,mBAAmB;CACnC,MAAM,WAAW,eACf,UACI,WACE,GACE,CAAC,MAAM,IAAI,GAAG,OAAO,iBAAiB,KAAK,GAC1C,MAAM,SAAS,iBAAiB,KAAK,GAAG,KAAK,SAChD,YAAY,QAAQ,WAAW,QAAQ,OAAO,IAAI,CACnD,GACD,KACL;AAED,QACE,oBAAC,gBAAD;EACE,GAAI;EACJ,MAAM,SAAS;EACf,MAAM,KACJ,EACE,MAAM,SACP,EACD,QAAQ,EAAE,EACV,EACE,gBACD,CACF;EACA;EACc"}
1
+ {"version":3,"file":"entry-file.mjs","names":[],"sources":["../../../src/typescript/components/entry-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 { appendPath } from \"@stryke/path/append\";\nimport { hasFileExtension } from \"@stryke/path/file-path-fns\";\nimport { replaceExtension, replacePath } from \"@stryke/path/replace\";\nimport { isSet } from \"@stryke/type-checks/is-set\";\nimport defu from \"defu\";\nimport { ResolvedEntryTypeDefinition } from \"powerlines\";\nimport { usePowerlinesSafe } from \"../../core/contexts/context\";\nimport { TypescriptFile, TypescriptFileProps } from \"./typescript-file\";\n\nexport type EntryFileProps = TypescriptFileProps & {\n /**\n * Whether the file is a TSX file.\n *\n * @defaultValue false\n */\n tsx?: boolean;\n\n /**\n * Render metadata information about the entrypoint\n */\n typeDefinition?: ResolvedEntryTypeDefinition;\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 EntryFile(props: EntryFileProps) {\n const [{ children, meta, tsx, path, typeDefinition }, rest] = splitProps(\n props,\n [\"children\", \"meta\", \"tsx\", \"path\", \"typeDefinition\"]\n );\n\n const context = usePowerlinesSafe();\n const fullPath = computed(() =>\n context\n ? appendPath(\n `${\n !isSet(tsx) ? path : replaceExtension(path)\n }${tsx ? \".tsx\" : hasFileExtension(path) ? \"\" : \".ts\"}`,\n replacePath(context.entryPath, context.config.cwd)\n )\n : path\n );\n\n return (\n <TypescriptFile\n {...rest}\n path={fullPath.value}\n meta={defu(\n {\n kind: \"entry\"\n },\n meta ?? {},\n {\n typeDefinition\n }\n )}>\n {children}\n </TypescriptFile>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAkCA,SAAe,UAAA,OAAA;UAEX,UACA,MACA,KACF,MACD;;;;;;;CAEC,MAAA,UAAA,mBAAA;CACA,MAAG,WAAc,eAAe,UAAC,WAAoB,GAAC,CAAA,MAAA,IAAW,GAAA,OAAW,iBAAA,KAAA,GAAA,MAAA,SAAA,iBAAA,KAAA,GAAA,KAAA,SAAA,YAAA,QAAA,WAAA,QAAA,OAAA,IAAA,CAAA,GAAA,KAAA;AAC7E,QAAA,gBAAA,gBAAA,WAAA,MAAA;EACG,IAAA,OAAW;AACX,UAAQ,SAAI;;EAEhB,IAAO,OAAQ;AACb,UAAS,KAAA,EACP,MAAK,SACH,EAAA,QAAW,EAAC,EAAA,EACf;;EAGK;EACL,CAAC,CAAA"}