@powerlines/plugin-alloy 0.25.26 → 0.25.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 (87) hide show
  1. package/dist/core/components/output.cjs +7 -19
  2. package/dist/core/components/output.mjs +7 -19
  3. package/dist/core/components/output.mjs.map +1 -1
  4. package/dist/core/components/single-line-comment.cjs +8 -7
  5. package/dist/core/components/single-line-comment.mjs +8 -7
  6. package/dist/core/components/single-line-comment.mjs.map +1 -1
  7. package/dist/core/components/source-file.cjs +7 -12
  8. package/dist/core/components/source-file.mjs +7 -12
  9. package/dist/core/components/source-file.mjs.map +1 -1
  10. package/dist/core/components/spacing.cjs +6 -7
  11. package/dist/core/components/spacing.mjs +6 -7
  12. package/dist/core/components/spacing.mjs.map +1 -1
  13. package/dist/core/contexts/context.mjs.map +1 -1
  14. package/dist/core/contexts/meta.mjs.map +1 -1
  15. package/dist/core/contexts/reflection.mjs.map +1 -1
  16. package/dist/core/helpers/code.mjs.map +1 -1
  17. package/dist/helpers/capnp.mjs.map +1 -1
  18. package/dist/helpers/create-builtin.mjs.map +1 -1
  19. package/dist/helpers/refkey.mjs.map +1 -1
  20. package/dist/helpers/typescript.mjs.map +1 -1
  21. package/dist/index.mjs.map +1 -1
  22. package/dist/markdown/components/front-matter.cjs +9 -14
  23. package/dist/markdown/components/front-matter.mjs +9 -14
  24. package/dist/markdown/components/front-matter.mjs.map +1 -1
  25. package/dist/markdown/components/markdown-file.cjs +41 -89
  26. package/dist/markdown/components/markdown-file.mjs +41 -89
  27. package/dist/markdown/components/markdown-file.mjs.map +1 -1
  28. package/dist/markdown/components/markdown-table.cjs +20 -52
  29. package/dist/markdown/components/markdown-table.mjs +20 -52
  30. package/dist/markdown/components/markdown-table.mjs.map +1 -1
  31. package/dist/markdown/contexts/markdown-table.mjs.map +1 -1
  32. package/dist/render.cjs +4 -10
  33. package/dist/render.mjs +4 -10
  34. package/dist/render.mjs.map +1 -1
  35. package/dist/typescript/components/builtin-file.cjs +9 -31
  36. package/dist/typescript/components/builtin-file.mjs +9 -31
  37. package/dist/typescript/components/builtin-file.mjs.map +1 -1
  38. package/dist/typescript/components/class-declaration.cjs +80 -193
  39. package/dist/typescript/components/class-declaration.mjs +80 -193
  40. package/dist/typescript/components/class-declaration.mjs.map +1 -1
  41. package/dist/typescript/components/dynamic-import-statement.cjs +1 -2
  42. package/dist/typescript/components/dynamic-import-statement.mjs +1 -2
  43. package/dist/typescript/components/dynamic-import-statement.mjs.map +1 -1
  44. package/dist/typescript/components/entry-file.cjs +3 -10
  45. package/dist/typescript/components/entry-file.mjs +3 -10
  46. package/dist/typescript/components/entry-file.mjs.map +1 -1
  47. package/dist/typescript/components/infrastructure-file.cjs +3 -10
  48. package/dist/typescript/components/infrastructure-file.mjs +3 -10
  49. package/dist/typescript/components/infrastructure-file.mjs.map +1 -1
  50. package/dist/typescript/components/interface-declaration.cjs +47 -134
  51. package/dist/typescript/components/interface-declaration.mjs +47 -134
  52. package/dist/typescript/components/interface-declaration.mjs.map +1 -1
  53. package/dist/typescript/components/object-declaration.cjs +35 -79
  54. package/dist/typescript/components/object-declaration.mjs +35 -79
  55. package/dist/typescript/components/object-declaration.mjs.map +1 -1
  56. package/dist/typescript/components/property-name.cjs +3 -3
  57. package/dist/typescript/components/property-name.mjs +3 -3
  58. package/dist/typescript/components/property-name.mjs.map +1 -1
  59. package/dist/typescript/components/record-expression.mjs.map +1 -1
  60. package/dist/typescript/components/tsdoc-reflection.cjs +53 -232
  61. package/dist/typescript/components/tsdoc-reflection.mjs +53 -232
  62. package/dist/typescript/components/tsdoc-reflection.mjs.map +1 -1
  63. package/dist/typescript/components/tsdoc.cjs +140 -306
  64. package/dist/typescript/components/tsdoc.mjs +140 -306
  65. package/dist/typescript/components/tsdoc.mjs.map +1 -1
  66. package/dist/typescript/components/type-declaration.cjs +9 -22
  67. package/dist/typescript/components/type-declaration.mjs +9 -22
  68. package/dist/typescript/components/type-declaration.mjs.map +1 -1
  69. package/dist/typescript/components/type-parameters.cjs +33 -60
  70. package/dist/typescript/components/type-parameters.mjs +33 -60
  71. package/dist/typescript/components/type-parameters.mjs.map +1 -1
  72. package/dist/typescript/components/typescript-file.cjs +65 -155
  73. package/dist/typescript/components/typescript-file.mjs +65 -155
  74. package/dist/typescript/components/typescript-file.mjs.map +1 -1
  75. package/dist/typescript/contexts/lexical-scope.cjs +1 -7
  76. package/dist/typescript/contexts/lexical-scope.mjs +1 -7
  77. package/dist/typescript/contexts/lexical-scope.mjs.map +1 -1
  78. package/dist/typescript/contexts/member-scope.cjs +2 -7
  79. package/dist/typescript/contexts/member-scope.mjs +2 -7
  80. package/dist/typescript/contexts/member-scope.mjs.map +1 -1
  81. package/dist/typescript/helpers/get-call-signature-props.mjs.map +1 -1
  82. package/dist/typescript/helpers/utilities.mjs.map +1 -1
  83. package/dist/yaml/components/yaml-file.cjs +48 -103
  84. package/dist/yaml/components/yaml-file.mjs +48 -103
  85. package/dist/yaml/components/yaml-file.mjs.map +1 -1
  86. package/package.json +7 -7
  87. package/dist/_virtual/_rolldown/runtime.mjs +0 -3
@@ -6,15 +6,11 @@ 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";
10
9
  import { Block, For, MemberDeclaration, Name, Show, code, splitProps } from "@alloy-js/core";
11
10
  import { CallSignature, Declaration as Declaration$1, TSSymbolFlags, TypeRefContext, createMemberSymbol, createTypeAndValueSymbol, useTSNamePolicy } from "@alloy-js/typescript";
12
11
 
13
12
  //#region src/typescript/components/class-declaration.tsx
14
13
  /**
15
- * Props for the ClassDeclaration component, which represents a TypeScript class declaration
16
- */
17
- /**
18
14
  * Create a TypeScript class declaration.
19
15
  *
20
16
  * @example
@@ -45,20 +41,14 @@ import { CallSignature, Declaration as Declaration$1, TSSymbolFlags, TypeRefCont
45
41
  * ```
46
42
  */
47
43
  function ClassDeclaration(props) {
48
- const extendsPart = props.extends && [" extends ", memo(() => props.extends)];
49
- const implementsPart = props.implements && props.implements.length > 0 && [
50
- " ",
51
- "implements",
52
- " ",
53
- createComponent(For, {
54
- get each() {
55
- return props.implements;
56
- },
57
- comma: true,
58
- space: true,
59
- children: (implement) => implement
60
- })
61
- ];
44
+ const extendsPart = props.extends && <> extends {props.extends}</>;
45
+ const implementsPart = props.implements && props.implements.length > 0 && <>
46
+ {" "}
47
+ implements{" "}
48
+ <For each={props.implements} comma space>
49
+ {(implement) => implement}
50
+ </For>
51
+ </>;
62
52
  const sym = createTypeAndValueSymbol(props.name, {
63
53
  refkeys: props.refkey,
64
54
  export: props.export,
@@ -67,52 +57,23 @@ function ClassDeclaration(props) {
67
57
  hasInstanceMembers: true,
68
58
  namePolicy: useTSNamePolicy().for("class")
69
59
  });
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, {
80
- symbol: sym,
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
- })];
60
+ return <>
61
+ <Show when={Boolean(props.doc)}>
62
+ <TSDoc heading={props.doc} />
63
+ </Show>
64
+ <Declaration$1 symbol={sym} export={props.export} default={props.default}>
65
+ <MemberScope$1 ownerSymbol={sym}>
66
+ {props.abstract && code`abstract `} class <Name />
67
+ {props.typeParameters && <TypeParameters parameters={props.typeParameters} />}
68
+ {extendsPart}
69
+ {implementsPart} <Block>{props.children}</Block>
70
+ </MemberScope$1>
71
+ </Declaration$1>
72
+ </>;
109
73
  }
110
74
  ClassDeclaration.TypeParameters = TypeParameters;
111
75
  /**
112
76
  * 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.
116
77
  *
117
78
  * @param props - The properties of the class member, including its name, visibility, and other modifiers.
118
79
  * @returns A JSX element representing the class member declaration, which can be used within a ClassDeclaration component.
@@ -125,34 +86,22 @@ function ClassMember(props) {
125
86
  tsFlags,
126
87
  namePolicy: useTSNamePolicy().for("class-member-data")
127
88
  });
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, {
138
- symbol: sym,
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
- })];
89
+ return <>
90
+ <Show when={Boolean(props.doc)}>
91
+ <TSDoc heading={props.doc} />
92
+ </Show>
93
+ <MemberDeclaration symbol={sym}>
94
+ {props.public && "public "}
95
+ {props.private && "private "}
96
+ {props.protected && "protected "}
97
+ {props.abstract && "abstract "}
98
+ {props.override && "override "}
99
+ {props.static && "static "}
100
+ {props.children}
101
+ </MemberDeclaration>
102
+ </>;
151
103
  }
152
104
  /**
153
- * Props for a class field, which is a specific type of class member that represents a property of the class.
154
- */
155
- /**
156
105
  * Generates a TypeScript class field declaration for the given reflection class.
157
106
  *
158
107
  * @param props - The properties of the class field, including its name, type, optionality, and other modifiers.
@@ -160,66 +109,37 @@ function ClassMember(props) {
160
109
  */
161
110
  function ClassField(props) {
162
111
  const optionality = props.optional ? "?" : "";
163
- const typeSection = props.type && [
164
- optionality,
165
- ": ",
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
- }));
112
+ const typeSection = props.type && <>
113
+ {optionality}: <TypeRefContext>{props.type}</TypeRefContext>
114
+ </>;
115
+ const initializerSection = props.children && <> = {props.children}</>;
116
+ const nullish = props.nullish ?? props.optional;
117
+ return <ClassMember {...props} nullish={nullish}>
118
+ <PropertyName private={props.isPrivateMember} name={props.isPrivateMember ? props.name : void 0} />
119
+ {typeSection}
120
+ {initializerSection}
121
+ </ClassMember>;
188
122
  }
189
123
  /**
190
- * Props for a class field, which is a specific type of class member that represents a property of the class.
191
- */
192
- /**
193
124
  * Generates a TypeScript class property setter declaration for the given reflection class.
194
125
  *
195
126
  * @param props - The properties of the class property, including its name, type, and other modifiers.
196
127
  * @returns A JSX element representing the class property setter declaration, which can be used within a ClassDeclaration component.
197
128
  */
198
129
  function ClassPropertySet(props) {
199
- return [createComponent(ClassMember, mergeProps(props, { get children() {
200
- return [
201
- "set ",
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
- } }))];
130
+ return <>
131
+ <ClassMember {...props}>
132
+ {"set "}
133
+ <PropertyName name={props.name} />
134
+ <LexicalScope>
135
+ <CallSignature parameters={[{
136
+ name: "value",
137
+ type: <TypeRefContext>{props.type}</TypeRefContext>
138
+ }]} />{" "}
139
+ <Block>{props.children}</Block>
140
+ </LexicalScope>
141
+ </ClassMember>
142
+ </>;
223
143
  }
224
144
  /**
225
145
  * Generates a TypeScript class property getter declaration for the given reflection class.
@@ -228,32 +148,16 @@ function ClassPropertySet(props) {
228
148
  * @returns A JSX element representing the class property getter declaration, which can be used within a ClassDeclaration component.
229
149
  */
230
150
  function ClassPropertyGet(props) {
231
- return createComponent(ClassMember, mergeProps(props, { get children() {
232
- return [
233
- "get ",
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
- } }));
151
+ return <ClassMember {...props}>
152
+ {"get "}
153
+ <PropertyName name={props.name} />
154
+ <LexicalScope>
155
+ <CallSignature returnType={<TypeRefContext>{props.type}</TypeRefContext>} />{" "}
156
+ <Block>{props.children}</Block>
157
+ </LexicalScope>
158
+ </ClassMember>;
252
159
  }
253
160
  /**
254
- * Props for a class method, which is a specific type of class member that represents a function defined within the class.
255
- */
256
- /**
257
161
  * Generates a TypeScript class method declaration for the given reflection class.
258
162
  *
259
163
  * @param props - The properties of the class method, including its name, visibility, and other modifiers.
@@ -262,37 +166,20 @@ function ClassPropertyGet(props) {
262
166
  function ClassMethod(props) {
263
167
  const callProps = getCallSignatureProps(props);
264
168
  const [_, rest] = splitProps(props, ["doc"]);
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
- } }))];
169
+ return <>
170
+ <Show when={Boolean(props.doc)}>
171
+ <TSDoc heading={props.doc}>
172
+ {Array.isArray(rest.parameters) && <TSDocParams parameters={rest.parameters} />}
173
+ </TSDoc>
174
+ </Show>
175
+ <ClassMember {...rest}>
176
+ {props.async && "async "}
177
+ <PropertyName />
178
+ <LexicalScope>
179
+ <CallSignature {...callProps} /> <Block>{props.children}</Block>
180
+ </LexicalScope>
181
+ </ClassMember>
182
+ </>;
296
183
  }
297
184
 
298
185
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"class-declaration.mjs","names":["Block","code","For","MemberDeclaration","Name","Show","splitProps","CallSignature","createMemberSymbol","createTypeAndValueSymbol","Declaration","TSSymbolFlags","TypeRefContext","useTSNamePolicy","LexicalScope","MemberScope","getCallSignatureProps","PropertyName","TSDoc","TSDocParams","TypeParameters","ClassDeclaration","props","extendsPart","extends","_$memo","implementsPart","implements","length","_$createComponent","each","comma","space","children","implement","sym","name","refkeys","refkey","export","default","metadata","hasInstanceMembers","namePolicy","for","when","Boolean","doc","heading","symbol","ownerSymbol","abstract","typeParameters","parameters","ClassMember","tsFlags","None","nullish","Nullish","public","private","protected","override","static","ClassField","optionality","optional","typeSection","type","initializerSection","_$mergeProps","isPrivateMember","undefined","ClassPropertySet","ClassPropertyGet","returnType","ClassMethod","callProps","_","rest","Array","isArray","async"],"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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAySA;;;;;;;;;;;;;;;;UAqBW;EAAA,KAAA,YAAA;AAAA,UAAA,MAAA;;EAAA,KAAA,aAAA;AAAA,UAAA,MAAA;;EAAA,IAAA,WAAA;AAAA,UAAA;iBAAA;IAAA,IAAA,WAAA;AAAA,YAAA;MAAA"}
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":"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"}
@@ -1,6 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
3
- let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
4
3
  let _alloy_js_core = require("@alloy-js/core");
5
4
  let _alloy_js_typescript = require("@alloy-js/typescript");
6
5
 
@@ -19,7 +18,7 @@ let _alloy_js_typescript = require("@alloy-js/typescript");
19
18
  */
20
19
  function DynamicImportStatement(props) {
21
20
  const { importPath, exportName = "default", const: isConst = true, ...rest } = props;
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});` }));
21
+ return <_alloy_js_typescript.VarDeclaration const={isConst} {...rest} initializer={_alloy_js_core.code`await import("${importPath}").then(m => m.${exportName});`}></_alloy_js_typescript.VarDeclaration>;
23
22
  }
24
23
 
25
24
  //#endregion
@@ -1,4 +1,3 @@
1
- import { createComponent, mergeProps } from "@alloy-js/core/jsx-runtime";
2
1
  import { code } from "@alloy-js/core";
3
2
  import { VarDeclaration } from "@alloy-js/typescript";
4
3
 
@@ -17,7 +16,7 @@ import { VarDeclaration } from "@alloy-js/typescript";
17
16
  */
18
17
  function DynamicImportStatement(props) {
19
18
  const { importPath, exportName = "default", const: isConst = true, ...rest } = props;
20
- return createComponent(VarDeclaration, mergeProps({ "const": isConst }, rest, { initializer: code`await import("${importPath}").then(m => m.${exportName});` }));
19
+ return <VarDeclaration const={isConst} {...rest} initializer={code`await import("${importPath}").then(m => m.${exportName});`}></VarDeclaration>;
21
20
  }
22
21
 
23
22
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"dynamic-import-statement.mjs","names":["code","VarDeclaration","DynamicImportStatement","props","importPath","exportName","const","isConst","rest","_$createComponent","_$mergeProps","initializer"],"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":""}
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,CAAC,eACC,OAAO,aACH,MACJ,aAAa,IAAI,iBAAiB,WAAW,iBAAiB,WAAW,KAAK,EAAE"}
@@ -2,7 +2,6 @@ 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_jsx_runtime = require("@alloy-js/core/jsx-runtime");
6
5
  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 _stryke_path_append = require("@stryke/path/append");
@@ -28,15 +27,9 @@ function EntryFile(props) {
28
27
  ]);
29
28
  const context = require_core_contexts_context.usePowerlinesSafe();
30
29
  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.workspaceConfig.workspaceRoot)) : path);
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
- },
38
- children
39
- }));
30
+ return <require_typescript_components_typescript_file.TypescriptFile {...rest} path={fullPath.value} meta={(0, defu.default)({ kind: "entry" }, meta ?? {}, { typeDefinition })}>
31
+ {children}
32
+ </require_typescript_components_typescript_file.TypescriptFile>;
40
33
  }
41
34
 
42
35
  //#endregion
@@ -1,6 +1,5 @@
1
1
  import { usePowerlinesSafe } from "../../core/contexts/context.mjs";
2
2
  import { TypescriptFile } from "./typescript-file.mjs";
3
- import { createComponent, mergeProps } from "@alloy-js/core/jsx-runtime";
4
3
  import { computed, splitProps } from "@alloy-js/core";
5
4
  import { hasFileExtension } from "@stryke/path/file-path-fns";
6
5
  import { appendPath } from "@stryke/path/append";
@@ -25,15 +24,9 @@ function EntryFile(props) {
25
24
  ]);
26
25
  const context = usePowerlinesSafe();
27
26
  const fullPath = computed(() => context ? appendPath(`${!isSet(tsx) ? path : replaceExtension(path)}${tsx ? ".tsx" : hasFileExtension(path) ? "" : ".ts"}`, replacePath(context.entryPath, context.workspaceConfig.workspaceRoot)) : path);
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
- },
35
- children
36
- }));
27
+ return <TypescriptFile {...rest} path={fullPath.value} meta={defu({ kind: "entry" }, meta ?? {}, { typeDefinition })}>
28
+ {children}
29
+ </TypescriptFile>;
37
30
  }
38
31
 
39
32
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"entry-file.mjs","names":["computed","splitProps","appendPath","hasFileExtension","replaceExtension","replacePath","isSet","defu","usePowerlinesSafe","TypescriptFile","EntryFile","props","children","meta","tsx","path","typeDefinition","rest","context","fullPath","entryPath","workspaceConfig","workspaceRoot","_$createComponent","_$mergeProps","value","kind"],"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.workspaceConfig.workspaceRoot)\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":""}
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.workspaceConfig.workspaceRoot)\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,gBAAgB,cAAc,CACtE,GACD,KACL;AAED,QACE,CAAC,mBACK,MACJ,MAAM,SAAS,OACf,MAAM,KACJ,EACE,MAAM,SACP,EACD,QAAQ,EAAE,EACV,EACE,gBACD,CACF,EAAE;OACF,SAAS;IACZ,EAAE"}
@@ -2,7 +2,6 @@ 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_jsx_runtime = require("@alloy-js/core/jsx-runtime");
6
5
  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 _stryke_path_append = require("@stryke/path/append");
@@ -25,15 +24,9 @@ function InfrastructureFile(props) {
25
24
  ]);
26
25
  const context = require_core_contexts_context.usePowerlinesSafe();
27
26
  const fullPath = (0, _alloy_js_core.computed)(() => context ? (0, _stryke_path_append.appendPath)((0, _stryke_path_file_path_fns.hasFileExtension)(id) ? "" : ".ts", (0, _stryke_path_replace.replacePath)(context.infrastructurePath, context.workspaceConfig.workspaceRoot)) : id);
28
- return (0, _alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_typescript_file.TypescriptFile, (0, _alloy_js_core_jsx_runtime.mergeProps)(rest, {
29
- get path() {
30
- return fullPath.value;
31
- },
32
- get meta() {
33
- return (0, defu.default)({ kind: "infrastructure" }, meta ?? {});
34
- },
35
- children
36
- }));
27
+ return <require_typescript_components_typescript_file.TypescriptFile {...rest} path={fullPath.value} meta={(0, defu.default)({ kind: "infrastructure" }, meta ?? {})}>
28
+ {children}
29
+ </require_typescript_components_typescript_file.TypescriptFile>;
37
30
  }
38
31
 
39
32
  //#endregion
@@ -1,6 +1,5 @@
1
1
  import { usePowerlinesSafe } from "../../core/contexts/context.mjs";
2
2
  import { TypescriptFile } from "./typescript-file.mjs";
3
- import { createComponent, mergeProps } from "@alloy-js/core/jsx-runtime";
4
3
  import { computed, splitProps } from "@alloy-js/core";
5
4
  import { hasFileExtension } from "@stryke/path/file-path-fns";
6
5
  import { appendPath } from "@stryke/path/append";
@@ -22,15 +21,9 @@ function InfrastructureFile(props) {
22
21
  ]);
23
22
  const context = usePowerlinesSafe();
24
23
  const fullPath = computed(() => context ? appendPath(hasFileExtension(id) ? "" : ".ts", replacePath(context.infrastructurePath, context.workspaceConfig.workspaceRoot)) : id);
25
- return createComponent(TypescriptFile, mergeProps(rest, {
26
- get path() {
27
- return fullPath.value;
28
- },
29
- get meta() {
30
- return defu({ kind: "infrastructure" }, meta ?? {});
31
- },
32
- children
33
- }));
24
+ return <TypescriptFile {...rest} path={fullPath.value} meta={defu({ kind: "infrastructure" }, meta ?? {})}>
25
+ {children}
26
+ </TypescriptFile>;
34
27
  }
35
28
 
36
29
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"infrastructure-file.mjs","names":["computed","splitProps","appendPath","hasFileExtension","replacePath","defu","usePowerlinesSafe","TypescriptFile","InfrastructureFile","props","children","meta","id","rest","context","fullPath","infrastructurePath","workspaceConfig","workspaceRoot","_$createComponent","_$mergeProps","path","value","kind"],"sources":["../../../src/typescript/components/infrastructure-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 { replacePath } from \"@stryke/path/replace\";\nimport defu from \"defu\";\nimport { usePowerlinesSafe } from \"../../core/contexts/context\";\nimport { TypescriptFile, TypescriptFileProps } from \"./typescript-file\";\n\nexport type InfrastructureFileProps = Omit<TypescriptFileProps, \"path\"> & {\n /**\n * The infrastructure module identifier.\n */\n id: string;\n};\n\n/**\n * A base component representing a Powerlines generated Typescript infrastructure file.\n *\n * @param props - The properties for the infrastructure file.\n * @returns The rendered infrastructure file component.\n */\nexport function InfrastructureFile(props: InfrastructureFileProps) {\n const [{ children, meta, id }, rest] = splitProps(props, [\n \"children\",\n \"meta\",\n \"id\"\n ]);\n\n const context = usePowerlinesSafe();\n const fullPath = computed(() =>\n context\n ? appendPath(\n hasFileExtension(id) ? \"\" : \".ts\",\n replacePath(\n context.infrastructurePath,\n context.workspaceConfig.workspaceRoot\n )\n )\n : id\n );\n\n return (\n <TypescriptFile\n {...rest}\n path={fullPath.value}\n meta={defu(\n {\n kind: \"infrastructure\"\n },\n meta ?? {}\n )}>\n {children}\n </TypescriptFile>\n );\n}\n"],"mappings":""}
1
+ {"version":3,"file":"infrastructure-file.mjs","names":[],"sources":["../../../src/typescript/components/infrastructure-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 { replacePath } from \"@stryke/path/replace\";\nimport defu from \"defu\";\nimport { usePowerlinesSafe } from \"../../core/contexts/context\";\nimport { TypescriptFile, TypescriptFileProps } from \"./typescript-file\";\n\nexport type InfrastructureFileProps = Omit<TypescriptFileProps, \"path\"> & {\n /**\n * The infrastructure module identifier.\n */\n id: string;\n};\n\n/**\n * A base component representing a Powerlines generated Typescript infrastructure file.\n *\n * @param props - The properties for the infrastructure file.\n * @returns The rendered infrastructure file component.\n */\nexport function InfrastructureFile(props: InfrastructureFileProps) {\n const [{ children, meta, id }, rest] = splitProps(props, [\n \"children\",\n \"meta\",\n \"id\"\n ]);\n\n const context = usePowerlinesSafe();\n const fullPath = computed(() =>\n context\n ? appendPath(\n hasFileExtension(id) ? \"\" : \".ts\",\n replacePath(\n context.infrastructurePath,\n context.workspaceConfig.workspaceRoot\n )\n )\n : id\n );\n\n return (\n <TypescriptFile\n {...rest}\n path={fullPath.value}\n meta={defu(\n {\n kind: \"infrastructure\"\n },\n meta ?? {}\n )}>\n {children}\n </TypescriptFile>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAuCA,SAAgB,mBAAmB,OAAgC;CACjE,MAAM,CAAC,EAAE,UAAU,MAAM,MAAM,QAAQ,WAAW,OAAO;EACvD;EACA;EACA;EACD,CAAC;CAEF,MAAM,UAAU,mBAAmB;CACnC,MAAM,WAAW,eACf,UACI,WACE,iBAAiB,GAAG,GAAG,KAAK,OAC5B,YACE,QAAQ,oBACR,QAAQ,gBAAgB,cACzB,CACF,GACD,GACL;AAED,QACE,CAAC,mBACK,MACJ,MAAM,SAAS,OACf,MAAM,KACJ,EACE,MAAM,kBACP,EACD,QAAQ,EAAE,CACX,EAAE;OACF,SAAS;IACZ,EAAE"}