@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.
- package/dist/core/components/output.cjs +7 -19
- package/dist/core/components/output.mjs +7 -19
- package/dist/core/components/output.mjs.map +1 -1
- package/dist/core/components/single-line-comment.cjs +8 -7
- package/dist/core/components/single-line-comment.mjs +8 -7
- package/dist/core/components/single-line-comment.mjs.map +1 -1
- package/dist/core/components/source-file.cjs +7 -12
- package/dist/core/components/source-file.mjs +7 -12
- package/dist/core/components/source-file.mjs.map +1 -1
- package/dist/core/components/spacing.cjs +6 -7
- package/dist/core/components/spacing.mjs +6 -7
- package/dist/core/components/spacing.mjs.map +1 -1
- package/dist/core/contexts/context.mjs.map +1 -1
- package/dist/core/contexts/meta.mjs.map +1 -1
- package/dist/core/contexts/reflection.mjs.map +1 -1
- package/dist/core/helpers/code.mjs.map +1 -1
- package/dist/helpers/capnp.mjs.map +1 -1
- package/dist/helpers/create-builtin.mjs.map +1 -1
- package/dist/helpers/refkey.mjs.map +1 -1
- package/dist/helpers/typescript.mjs.map +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/markdown/components/front-matter.cjs +9 -14
- package/dist/markdown/components/front-matter.mjs +9 -14
- package/dist/markdown/components/front-matter.mjs.map +1 -1
- package/dist/markdown/components/markdown-file.cjs +41 -89
- package/dist/markdown/components/markdown-file.mjs +41 -89
- package/dist/markdown/components/markdown-file.mjs.map +1 -1
- package/dist/markdown/components/markdown-table.cjs +20 -52
- package/dist/markdown/components/markdown-table.mjs +20 -52
- package/dist/markdown/components/markdown-table.mjs.map +1 -1
- package/dist/markdown/contexts/markdown-table.mjs.map +1 -1
- package/dist/render.cjs +4 -10
- package/dist/render.mjs +4 -10
- package/dist/render.mjs.map +1 -1
- package/dist/typescript/components/builtin-file.cjs +9 -31
- package/dist/typescript/components/builtin-file.mjs +9 -31
- package/dist/typescript/components/builtin-file.mjs.map +1 -1
- package/dist/typescript/components/class-declaration.cjs +80 -193
- package/dist/typescript/components/class-declaration.mjs +80 -193
- package/dist/typescript/components/class-declaration.mjs.map +1 -1
- package/dist/typescript/components/dynamic-import-statement.cjs +1 -2
- package/dist/typescript/components/dynamic-import-statement.mjs +1 -2
- package/dist/typescript/components/dynamic-import-statement.mjs.map +1 -1
- package/dist/typescript/components/entry-file.cjs +3 -10
- package/dist/typescript/components/entry-file.mjs +3 -10
- package/dist/typescript/components/entry-file.mjs.map +1 -1
- package/dist/typescript/components/infrastructure-file.cjs +3 -10
- package/dist/typescript/components/infrastructure-file.mjs +3 -10
- package/dist/typescript/components/infrastructure-file.mjs.map +1 -1
- package/dist/typescript/components/interface-declaration.cjs +47 -134
- package/dist/typescript/components/interface-declaration.mjs +47 -134
- package/dist/typescript/components/interface-declaration.mjs.map +1 -1
- package/dist/typescript/components/object-declaration.cjs +35 -79
- package/dist/typescript/components/object-declaration.mjs +35 -79
- package/dist/typescript/components/object-declaration.mjs.map +1 -1
- package/dist/typescript/components/property-name.cjs +3 -3
- package/dist/typescript/components/property-name.mjs +3 -3
- package/dist/typescript/components/property-name.mjs.map +1 -1
- package/dist/typescript/components/record-expression.mjs.map +1 -1
- package/dist/typescript/components/tsdoc-reflection.cjs +53 -232
- package/dist/typescript/components/tsdoc-reflection.mjs +53 -232
- package/dist/typescript/components/tsdoc-reflection.mjs.map +1 -1
- package/dist/typescript/components/tsdoc.cjs +140 -306
- package/dist/typescript/components/tsdoc.mjs +140 -306
- package/dist/typescript/components/tsdoc.mjs.map +1 -1
- package/dist/typescript/components/type-declaration.cjs +9 -22
- package/dist/typescript/components/type-declaration.mjs +9 -22
- package/dist/typescript/components/type-declaration.mjs.map +1 -1
- package/dist/typescript/components/type-parameters.cjs +33 -60
- package/dist/typescript/components/type-parameters.mjs +33 -60
- package/dist/typescript/components/type-parameters.mjs.map +1 -1
- package/dist/typescript/components/typescript-file.cjs +65 -155
- package/dist/typescript/components/typescript-file.mjs +65 -155
- package/dist/typescript/components/typescript-file.mjs.map +1 -1
- package/dist/typescript/contexts/lexical-scope.cjs +1 -7
- package/dist/typescript/contexts/lexical-scope.mjs +1 -7
- package/dist/typescript/contexts/lexical-scope.mjs.map +1 -1
- package/dist/typescript/contexts/member-scope.cjs +2 -7
- package/dist/typescript/contexts/member-scope.mjs +2 -7
- package/dist/typescript/contexts/member-scope.mjs.map +1 -1
- package/dist/typescript/helpers/get-call-signature-props.mjs.map +1 -1
- package/dist/typescript/helpers/utilities.mjs.map +1 -1
- package/dist/yaml/components/yaml-file.cjs +48 -103
- package/dist/yaml/components/yaml-file.mjs +48 -103
- package/dist/yaml/components/yaml-file.mjs.map +1 -1
- package/package.json +7 -7
- 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 &&
|
|
51
|
-
const implementsPart = props.implements && props.implements.length > 0 &&
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
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
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
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
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
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
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
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
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
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
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
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
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
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
|