@powerlines/plugin-alloy 0.25.27 → 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
@@ -8,15 +8,11 @@ const require_typescript_helpers_get_call_signature_props = require('../helpers/
8
8
  require('../helpers/index.cjs');
9
9
  const require_typescript_components_property_name = require('./property-name.cjs');
10
10
  const require_typescript_components_type_parameters = require('./type-parameters.cjs');
11
- let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
12
11
  let _alloy_js_core = require("@alloy-js/core");
13
12
  let _alloy_js_typescript = require("@alloy-js/typescript");
14
13
 
15
14
  //#region src/typescript/components/class-declaration.tsx
16
15
  /**
17
- * Props for the ClassDeclaration component, which represents a TypeScript class declaration
18
- */
19
- /**
20
16
  * Create a TypeScript class declaration.
21
17
  *
22
18
  * @example
@@ -47,20 +43,14 @@ let _alloy_js_typescript = require("@alloy-js/typescript");
47
43
  * ```
48
44
  */
49
45
  function ClassDeclaration(props) {
50
- const extendsPart = props.extends && [" extends ", (0, _alloy_js_core_jsx_runtime.memo)(() => props.extends)];
51
- const implementsPart = props.implements && props.implements.length > 0 && [
52
- " ",
53
- "implements",
54
- " ",
55
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
56
- get each() {
57
- return props.implements;
58
- },
59
- comma: true,
60
- space: true,
61
- children: (implement) => implement
62
- })
63
- ];
46
+ const extendsPart = props.extends && <> extends {props.extends}</>;
47
+ const implementsPart = props.implements && props.implements.length > 0 && <>
48
+ {" "}
49
+ implements{" "}
50
+ <_alloy_js_core.For each={props.implements} comma space>
51
+ {(implement) => implement}
52
+ </_alloy_js_core.For>
53
+ </>;
64
54
  const sym = (0, _alloy_js_typescript.createTypeAndValueSymbol)(props.name, {
65
55
  refkeys: props.refkey,
66
56
  export: props.export,
@@ -69,52 +59,23 @@ function ClassDeclaration(props) {
69
59
  hasInstanceMembers: true,
70
60
  namePolicy: (0, _alloy_js_typescript.useTSNamePolicy)().for("class")
71
61
  });
72
- return [(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
73
- get when() {
74
- return Boolean(props.doc);
75
- },
76
- get children() {
77
- return (0, _alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_tsdoc.TSDoc, { get heading() {
78
- return props.doc;
79
- } });
80
- }
81
- }), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.Declaration, {
82
- symbol: sym,
83
- get ["export"]() {
84
- return props.export;
85
- },
86
- get ["default"]() {
87
- return props.default;
88
- },
89
- get children() {
90
- return (0, _alloy_js_core_jsx_runtime.createComponent)(require_typescript_contexts_member_scope.MemberScope, {
91
- ownerSymbol: sym,
92
- get children() {
93
- return [
94
- (0, _alloy_js_core_jsx_runtime.memo)(() => props.abstract && _alloy_js_core.code`abstract `),
95
- " class ",
96
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Name, {}),
97
- (0, _alloy_js_core_jsx_runtime.memo)(() => (0, _alloy_js_core_jsx_runtime.memo)(() => !!props.typeParameters)() && (0, _alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_type_parameters.TypeParameters, { get parameters() {
98
- return props.typeParameters;
99
- } })),
100
- extendsPart,
101
- implementsPart,
102
- " ",
103
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Block, { get children() {
104
- return props.children;
105
- } })
106
- ];
107
- }
108
- });
109
- }
110
- })];
62
+ return <>
63
+ <_alloy_js_core.Show when={Boolean(props.doc)}>
64
+ <require_typescript_components_tsdoc.TSDoc heading={props.doc} />
65
+ </_alloy_js_core.Show>
66
+ <_alloy_js_typescript.Declaration symbol={sym} export={props.export} default={props.default}>
67
+ <require_typescript_contexts_member_scope.MemberScope ownerSymbol={sym}>
68
+ {props.abstract && _alloy_js_core.code`abstract `} class <_alloy_js_core.Name />
69
+ {props.typeParameters && <require_typescript_components_type_parameters.TypeParameters parameters={props.typeParameters} />}
70
+ {extendsPart}
71
+ {implementsPart} <_alloy_js_core.Block>{props.children}</_alloy_js_core.Block>
72
+ </require_typescript_contexts_member_scope.MemberScope>
73
+ </_alloy_js_typescript.Declaration>
74
+ </>;
111
75
  }
112
76
  ClassDeclaration.TypeParameters = require_typescript_components_type_parameters.TypeParameters;
113
77
  /**
114
78
  * Generates a TypeScript class member declaration for the given reflection class.
115
- */
116
- /**
117
- * Generates a TypeScript class member declaration for the given reflection class.
118
79
  *
119
80
  * @param props - The properties of the class member, including its name, visibility, and other modifiers.
120
81
  * @returns A JSX element representing the class member declaration, which can be used within a ClassDeclaration component.
@@ -127,34 +88,22 @@ function ClassMember(props) {
127
88
  tsFlags,
128
89
  namePolicy: (0, _alloy_js_typescript.useTSNamePolicy)().for("class-member-data")
129
90
  });
130
- return [(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
131
- get when() {
132
- return Boolean(props.doc);
133
- },
134
- get children() {
135
- return (0, _alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_tsdoc.TSDoc, { get heading() {
136
- return props.doc;
137
- } });
138
- }
139
- }), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.MemberDeclaration, {
140
- symbol: sym,
141
- get children() {
142
- return [
143
- (0, _alloy_js_core_jsx_runtime.memo)(() => props.public && "public "),
144
- (0, _alloy_js_core_jsx_runtime.memo)(() => props.private && "private "),
145
- (0, _alloy_js_core_jsx_runtime.memo)(() => props.protected && "protected "),
146
- (0, _alloy_js_core_jsx_runtime.memo)(() => props.abstract && "abstract "),
147
- (0, _alloy_js_core_jsx_runtime.memo)(() => props.override && "override "),
148
- (0, _alloy_js_core_jsx_runtime.memo)(() => props.static && "static "),
149
- (0, _alloy_js_core_jsx_runtime.memo)(() => props.children)
150
- ];
151
- }
152
- })];
91
+ return <>
92
+ <_alloy_js_core.Show when={Boolean(props.doc)}>
93
+ <require_typescript_components_tsdoc.TSDoc heading={props.doc} />
94
+ </_alloy_js_core.Show>
95
+ <_alloy_js_core.MemberDeclaration symbol={sym}>
96
+ {props.public && "public "}
97
+ {props.private && "private "}
98
+ {props.protected && "protected "}
99
+ {props.abstract && "abstract "}
100
+ {props.override && "override "}
101
+ {props.static && "static "}
102
+ {props.children}
103
+ </_alloy_js_core.MemberDeclaration>
104
+ </>;
153
105
  }
154
106
  /**
155
- * Props for a class field, which is a specific type of class member that represents a property of the class.
156
- */
157
- /**
158
107
  * Generates a TypeScript class field declaration for the given reflection class.
159
108
  *
160
109
  * @param props - The properties of the class field, including its name, type, optionality, and other modifiers.
@@ -162,66 +111,37 @@ function ClassMember(props) {
162
111
  */
163
112
  function ClassField(props) {
164
113
  const optionality = props.optional ? "?" : "";
165
- const typeSection = props.type && [
166
- optionality,
167
- ": ",
168
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.TypeRefContext, { get children() {
169
- return props.type;
170
- } })
171
- ];
172
- const initializerSection = props.children && [" = ", (0, _alloy_js_core_jsx_runtime.memo)(() => props.children)];
173
- return (0, _alloy_js_core_jsx_runtime.createComponent)(ClassMember, (0, _alloy_js_core_jsx_runtime.mergeProps)(props, {
174
- nullish: props.nullish ?? props.optional,
175
- get children() {
176
- return [
177
- (0, _alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_property_name.PropertyName, {
178
- get ["private"]() {
179
- return props.isPrivateMember;
180
- },
181
- get name() {
182
- return props.isPrivateMember ? props.name : void 0;
183
- }
184
- }),
185
- typeSection,
186
- initializerSection
187
- ];
188
- }
189
- }));
114
+ const typeSection = props.type && <>
115
+ {optionality}: <_alloy_js_typescript.TypeRefContext>{props.type}</_alloy_js_typescript.TypeRefContext>
116
+ </>;
117
+ const initializerSection = props.children && <> = {props.children}</>;
118
+ const nullish = props.nullish ?? props.optional;
119
+ return <ClassMember {...props} nullish={nullish}>
120
+ <require_typescript_components_property_name.PropertyName private={props.isPrivateMember} name={props.isPrivateMember ? props.name : void 0} />
121
+ {typeSection}
122
+ {initializerSection}
123
+ </ClassMember>;
190
124
  }
191
125
  /**
192
- * Props for a class field, which is a specific type of class member that represents a property of the class.
193
- */
194
- /**
195
126
  * Generates a TypeScript class property setter declaration for the given reflection class.
196
127
  *
197
128
  * @param props - The properties of the class property, including its name, type, and other modifiers.
198
129
  * @returns A JSX element representing the class property setter declaration, which can be used within a ClassDeclaration component.
199
130
  */
200
131
  function ClassPropertySet(props) {
201
- return [(0, _alloy_js_core_jsx_runtime.createComponent)(ClassMember, (0, _alloy_js_core_jsx_runtime.mergeProps)(props, { get children() {
202
- return [
203
- "set ",
204
- (0, _alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_property_name.PropertyName, { get name() {
205
- return props.name;
206
- } }),
207
- (0, _alloy_js_core_jsx_runtime.createComponent)(require_typescript_contexts_lexical_scope.LexicalScope, { get children() {
208
- return [
209
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.CallSignature, { get parameters() {
210
- return [{
211
- name: "value",
212
- type: (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.TypeRefContext, { get children() {
213
- return props.type;
214
- } })
215
- }];
216
- } }),
217
- " ",
218
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Block, { get children() {
219
- return props.children;
220
- } })
221
- ];
222
- } })
223
- ];
224
- } }))];
132
+ return <>
133
+ <ClassMember {...props}>
134
+ {"set "}
135
+ <require_typescript_components_property_name.PropertyName name={props.name} />
136
+ <require_typescript_contexts_lexical_scope.LexicalScope>
137
+ <_alloy_js_typescript.CallSignature parameters={[{
138
+ name: "value",
139
+ type: <_alloy_js_typescript.TypeRefContext>{props.type}</_alloy_js_typescript.TypeRefContext>
140
+ }]} />{" "}
141
+ <_alloy_js_core.Block>{props.children}</_alloy_js_core.Block>
142
+ </require_typescript_contexts_lexical_scope.LexicalScope>
143
+ </ClassMember>
144
+ </>;
225
145
  }
226
146
  /**
227
147
  * Generates a TypeScript class property getter declaration for the given reflection class.
@@ -230,32 +150,16 @@ function ClassPropertySet(props) {
230
150
  * @returns A JSX element representing the class property getter declaration, which can be used within a ClassDeclaration component.
231
151
  */
232
152
  function ClassPropertyGet(props) {
233
- return (0, _alloy_js_core_jsx_runtime.createComponent)(ClassMember, (0, _alloy_js_core_jsx_runtime.mergeProps)(props, { get children() {
234
- return [
235
- "get ",
236
- (0, _alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_property_name.PropertyName, { get name() {
237
- return props.name;
238
- } }),
239
- (0, _alloy_js_core_jsx_runtime.createComponent)(require_typescript_contexts_lexical_scope.LexicalScope, { get children() {
240
- return [
241
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.CallSignature, { get returnType() {
242
- return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.TypeRefContext, { get children() {
243
- return props.type;
244
- } });
245
- } }),
246
- " ",
247
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Block, { get children() {
248
- return props.children;
249
- } })
250
- ];
251
- } })
252
- ];
253
- } }));
153
+ return <ClassMember {...props}>
154
+ {"get "}
155
+ <require_typescript_components_property_name.PropertyName name={props.name} />
156
+ <require_typescript_contexts_lexical_scope.LexicalScope>
157
+ <_alloy_js_typescript.CallSignature returnType={<_alloy_js_typescript.TypeRefContext>{props.type}</_alloy_js_typescript.TypeRefContext>} />{" "}
158
+ <_alloy_js_core.Block>{props.children}</_alloy_js_core.Block>
159
+ </require_typescript_contexts_lexical_scope.LexicalScope>
160
+ </ClassMember>;
254
161
  }
255
162
  /**
256
- * Props for a class method, which is a specific type of class member that represents a function defined within the class.
257
- */
258
- /**
259
163
  * Generates a TypeScript class method declaration for the given reflection class.
260
164
  *
261
165
  * @param props - The properties of the class method, including its name, visibility, and other modifiers.
@@ -264,37 +168,20 @@ function ClassPropertyGet(props) {
264
168
  function ClassMethod(props) {
265
169
  const callProps = require_typescript_helpers_get_call_signature_props.getCallSignatureProps(props);
266
170
  const [_, rest] = (0, _alloy_js_core.splitProps)(props, ["doc"]);
267
- return [(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
268
- get when() {
269
- return Boolean(props.doc);
270
- },
271
- get children() {
272
- return (0, _alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_tsdoc.TSDoc, {
273
- get heading() {
274
- return props.doc;
275
- },
276
- get children() {
277
- return (0, _alloy_js_core_jsx_runtime.memo)(() => !!Array.isArray(rest.parameters))() && (0, _alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_tsdoc.TSDocParams, { get parameters() {
278
- return rest.parameters;
279
- } });
280
- }
281
- });
282
- }
283
- }), (0, _alloy_js_core_jsx_runtime.createComponent)(ClassMember, (0, _alloy_js_core_jsx_runtime.mergeProps)(rest, { get children() {
284
- return [
285
- (0, _alloy_js_core_jsx_runtime.memo)(() => props.async && "async "),
286
- (0, _alloy_js_core_jsx_runtime.createComponent)(require_typescript_components_property_name.PropertyName, {}),
287
- (0, _alloy_js_core_jsx_runtime.createComponent)(require_typescript_contexts_lexical_scope.LexicalScope, { get children() {
288
- return [
289
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.CallSignature, callProps),
290
- " ",
291
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Block, { get children() {
292
- return props.children;
293
- } })
294
- ];
295
- } })
296
- ];
297
- } }))];
171
+ return <>
172
+ <_alloy_js_core.Show when={Boolean(props.doc)}>
173
+ <require_typescript_components_tsdoc.TSDoc heading={props.doc}>
174
+ {Array.isArray(rest.parameters) && <require_typescript_components_tsdoc.TSDocParams parameters={rest.parameters} />}
175
+ </require_typescript_components_tsdoc.TSDoc>
176
+ </_alloy_js_core.Show>
177
+ <ClassMember {...rest}>
178
+ {props.async && "async "}
179
+ <require_typescript_components_property_name.PropertyName />
180
+ <require_typescript_contexts_lexical_scope.LexicalScope>
181
+ <_alloy_js_typescript.CallSignature {...callProps} /> <_alloy_js_core.Block>{props.children}</_alloy_js_core.Block>
182
+ </require_typescript_contexts_lexical_scope.LexicalScope>
183
+ </ClassMember>
184
+ </>;
298
185
  }
299
186
 
300
187
  //#endregion