@powerlines/plugin-alloy 0.24.0 → 0.24.2
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/single-line-comment.d.cts +2 -2
- package/dist/core/components/source-file.d.cts +2 -2
- package/dist/core/components/source-file.d.cts.map +1 -1
- package/dist/core/components/spacing.d.cts +2 -2
- package/dist/markdown/components/front-matter.d.cts +2 -2
- package/dist/markdown/components/front-matter.d.cts.map +1 -1
- package/dist/markdown/components/front-matter.d.mts +2 -2
- package/dist/markdown/components/markdown-file.d.cts +3 -3
- package/dist/markdown/components/markdown-file.d.mts +3 -3
- package/dist/markdown/components/markdown-table.d.cts +4 -4
- package/dist/markdown/components/markdown-table.d.cts.map +1 -1
- package/dist/markdown/components/markdown-table.d.mts +4 -4
- package/dist/markdown/contexts/markdown-table.d.cts.map +1 -1
- package/dist/typescript/components/builtin-file.d.cts +2 -2
- package/dist/typescript/components/dynamic-import-statement.d.cts +2 -2
- package/dist/typescript/components/dynamic-import-statement.d.mts +2 -2
- package/dist/typescript/components/entry-file.d.cts +2 -2
- package/dist/typescript/components/entry-file.d.mts +2 -2
- package/dist/typescript/components/interface-declaration.d.cts +2 -2
- package/dist/typescript/components/interface-declaration.d.mts +2 -2
- package/dist/typescript/components/object-declaration.cjs +4 -2
- package/dist/typescript/components/object-declaration.d.cts +3 -3
- package/dist/typescript/components/object-declaration.d.mts +3 -3
- package/dist/typescript/components/object-declaration.mjs +4 -2
- package/dist/typescript/components/object-declaration.mjs.map +1 -1
- package/dist/typescript/components/property-name.d.cts +2 -2
- package/dist/typescript/components/property-name.d.mts +2 -2
- package/dist/typescript/components/tsdoc-reflection.cjs +34 -6
- package/dist/typescript/components/tsdoc-reflection.d.cts +7 -7
- package/dist/typescript/components/tsdoc-reflection.d.cts.map +1 -1
- package/dist/typescript/components/tsdoc-reflection.d.mts +7 -7
- package/dist/typescript/components/tsdoc-reflection.d.mts.map +1 -1
- package/dist/typescript/components/tsdoc-reflection.mjs +34 -6
- package/dist/typescript/components/tsdoc-reflection.mjs.map +1 -1
- package/dist/typescript/components/tsdoc.cjs +11 -7
- package/dist/typescript/components/tsdoc.d.cts.map +1 -1
- package/dist/typescript/components/tsdoc.d.mts.map +1 -1
- package/dist/typescript/components/tsdoc.mjs +12 -8
- package/dist/typescript/components/tsdoc.mjs.map +1 -1
- package/dist/typescript/components/type-declaration.d.mts +2 -2
- package/dist/typescript/contexts/lexical-scope.d.cts +2 -2
- package/dist/typescript/contexts/lexical-scope.d.cts.map +1 -1
- package/package.json +16 -16
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TSDocProps } from "./tsdoc.cjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as _alloy_js_core18 from "@alloy-js/core";
|
|
3
3
|
import { ReflectionClass, ReflectionMethod, ReflectionProperty } from "@powerlines/deepkit/vendor/type";
|
|
4
4
|
|
|
5
5
|
//#region src/typescript/components/tsdoc-reflection.d.ts
|
|
@@ -9,33 +9,33 @@ interface TSDocReflectionClassProps<T extends Record<string, any> = Record<strin
|
|
|
9
9
|
/**
|
|
10
10
|
* Generates a TSDoc documentation block for the given reflection class. This component will render the description of the reflection as the main content of the documentation block, and will render any additional attributes (such as title, alias, domain, permission, etc.) as tags in the documentation block. If there are child elements provided, they will be rendered as a list below the main content of the documentation block. This is useful for rendering additional details about the reflection that may not be included in the description, such as information about properties or methods of a class.
|
|
11
11
|
*/
|
|
12
|
-
declare function TSDocReflectionClass<T extends Record<string, any> = Record<string, any>>(props: TSDocReflectionClassProps<T>):
|
|
12
|
+
declare function TSDocReflectionClass<T extends Record<string, any> = Record<string, any>>(props: TSDocReflectionClassProps<T>): _alloy_js_core18.Children;
|
|
13
13
|
/**
|
|
14
14
|
* Uses the `useReflectionClass` hook to retrieve the reflection class from the context, and then renders a `TSDocReflectionClass` component with the retrieved reflection class. This is a convenience component that allows you to easily render a TSDoc documentation block for the current reflection class without having to manually retrieve the reflection class from the context.
|
|
15
15
|
*/
|
|
16
|
-
declare function TSDocContextClass<T extends Record<string, any> = Record<string, any>>(props: TSDocProps):
|
|
16
|
+
declare function TSDocContextClass<T extends Record<string, any> = Record<string, any>>(props: TSDocProps): _alloy_js_core18.Children;
|
|
17
17
|
interface TSDocReflectionPropertyProps extends TSDocProps {
|
|
18
18
|
reflection: ReflectionProperty;
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
21
|
* Generates a TSDoc documentation block for the given reflection property. This component will render the description of the reflection as the main content of the documentation block, and will render any additional attributes (such as title, alias, domain, permission, etc.) as tags in the documentation block. If there are child elements provided, they will be rendered as a list below the main content of the documentation block. This is useful for rendering additional details about the reflection that may not be included in the description, such as information about parameters of a method or properties of a class.
|
|
22
22
|
*/
|
|
23
|
-
declare function TSDocReflectionProperty(props: TSDocReflectionPropertyProps):
|
|
23
|
+
declare function TSDocReflectionProperty(props: TSDocReflectionPropertyProps): _alloy_js_core18.Children;
|
|
24
24
|
/**
|
|
25
25
|
* Uses the `useReflectionProperty` hook to retrieve the reflection property from the context, and then renders a `TSDocReflectionProperty` component with the retrieved reflection property. This is a convenience component that allows you to easily render a TSDoc documentation block for the current reflection property without having to manually retrieve the reflection property from the context.
|
|
26
26
|
*/
|
|
27
|
-
declare function TSDocContextProperty(props: TSDocProps):
|
|
27
|
+
declare function TSDocContextProperty(props: TSDocProps): _alloy_js_core18.Children;
|
|
28
28
|
interface TSDocReflectionMethodProps extends TSDocProps {
|
|
29
29
|
reflection: ReflectionMethod;
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
32
32
|
* Generates a TSDoc documentation block for the given reflection method. This component will render the description of the reflection as the main content of the documentation block, and will render any additional attributes (such as title, alias, domain, permission, etc.) as tags in the documentation block. If there are child elements provided, they will be rendered as a list below the main content of the documentation block. Additionally, this component will render information about the parameters and return type of the method, if available.
|
|
33
33
|
*/
|
|
34
|
-
declare function TSDocReflectionMethod(props: TSDocReflectionMethodProps):
|
|
34
|
+
declare function TSDocReflectionMethod(props: TSDocReflectionMethodProps): _alloy_js_core18.Children;
|
|
35
35
|
/**
|
|
36
36
|
* Uses the `useReflectionMethod` hook to retrieve the reflection method from the context, and then renders a `TSDocReflectionMethod` component with the retrieved reflection method. This is a convenience component that allows you to easily render a TSDoc documentation block for the current reflection method without having to manually retrieve the reflection method from the context.
|
|
37
37
|
*/
|
|
38
|
-
declare function TSDocContextMethod(props: TSDocProps):
|
|
38
|
+
declare function TSDocContextMethod(props: TSDocProps): _alloy_js_core18.Children;
|
|
39
39
|
declare type __ΩTSDocReflectionClassProps = any[];
|
|
40
40
|
declare type __ΩTSDocReflectionPropertyProps = any[];
|
|
41
41
|
declare type __ΩTSDocReflectionMethodProps = any[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tsdoc-reflection.d.cts","names":[],"sources":["../../../src/typescript/components/tsdoc-reflection.tsx"],"sourcesContent":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"tsdoc-reflection.d.cts","names":[],"sources":["../../../src/typescript/components/tsdoc-reflection.tsx"],"sourcesContent":[],"mappings":";;;;;UAqDiB,oCACL,sBAAsB,6BACxB;cACI,gBAAgB;;AAH9B;;;AAG8B,iBAMd,oBANc,CAAA,UAOlB,MAPkB,CAAA,MAAA,EAAA,GAAA,CAAA,GAOI,MAPJ,CAAA,MAAA,EAAA,GAAA,CAAA,CAAA,CAAA,KAAA,EAQrB,yBARqB,CAQK,CARL,CAAA,CAAA,EAQI,gBAAA,CAAG,QARP;;;;AAMd,iBAoFA,iBApFoB,CAAA,UAqFxB,MArFwB,CAAA,MAAA,EAAA,GAAA,CAAA,GAqFF,MArFE,CAAA,MAAA,EAAA,GAAA,CAAA,CAAA,CAAA,KAAA,EAsF3B,UAtF2B,CAAA,EAsFjB,gBAAA,CAAA,QAtFiB;AACxB,UAkGK,4BAAA,SAAqC,UAlG1C,CAAA;EAAsB,UAAA,EAmGpB,kBAnGoB;;;;;AAmFlB,iBAsBA,uBAAA,CAtBiB,KAAA,EAsBc,4BAtBd,CAAA,EAsB0C,gBAAA,CAAA,QAtB1C;;;;AAEd,iBA8EH,oBAAA,CA9EG,KAAA,EA8EyB,UA9EzB,CAAA,EA8EmC,gBAAA,CAAA,QA9EnC;AAAA,UAwFF,0BAAA,SAAmC,UAxFjC,CAAA;EAaF,UAAA,EA4EH,gBA5EG;AAOjB;AA0DA;AAUA;AAOA;AAoEgB,iBApEA,qBAAA,CAoE0B,KAAU,EApEP,0BAoEO,CAAA,EApEmB,gBAAA,CAAA,QAoEnB;;;;iBAApC,kBAAA,QAA0B,aAAU,gBAAA,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TSDocProps } from "./tsdoc.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as _alloy_js_core16 from "@alloy-js/core";
|
|
3
3
|
import { ReflectionClass, ReflectionMethod, ReflectionProperty } from "@powerlines/deepkit/vendor/type";
|
|
4
4
|
|
|
5
5
|
//#region src/typescript/components/tsdoc-reflection.d.ts
|
|
@@ -9,33 +9,33 @@ interface TSDocReflectionClassProps<T extends Record<string, any> = Record<strin
|
|
|
9
9
|
/**
|
|
10
10
|
* Generates a TSDoc documentation block for the given reflection class. This component will render the description of the reflection as the main content of the documentation block, and will render any additional attributes (such as title, alias, domain, permission, etc.) as tags in the documentation block. If there are child elements provided, they will be rendered as a list below the main content of the documentation block. This is useful for rendering additional details about the reflection that may not be included in the description, such as information about properties or methods of a class.
|
|
11
11
|
*/
|
|
12
|
-
declare function TSDocReflectionClass<T extends Record<string, any> = Record<string, any>>(props: TSDocReflectionClassProps<T>):
|
|
12
|
+
declare function TSDocReflectionClass<T extends Record<string, any> = Record<string, any>>(props: TSDocReflectionClassProps<T>): _alloy_js_core16.Children;
|
|
13
13
|
/**
|
|
14
14
|
* Uses the `useReflectionClass` hook to retrieve the reflection class from the context, and then renders a `TSDocReflectionClass` component with the retrieved reflection class. This is a convenience component that allows you to easily render a TSDoc documentation block for the current reflection class without having to manually retrieve the reflection class from the context.
|
|
15
15
|
*/
|
|
16
|
-
declare function TSDocContextClass<T extends Record<string, any> = Record<string, any>>(props: TSDocProps):
|
|
16
|
+
declare function TSDocContextClass<T extends Record<string, any> = Record<string, any>>(props: TSDocProps): _alloy_js_core16.Children;
|
|
17
17
|
interface TSDocReflectionPropertyProps extends TSDocProps {
|
|
18
18
|
reflection: ReflectionProperty;
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
21
|
* Generates a TSDoc documentation block for the given reflection property. This component will render the description of the reflection as the main content of the documentation block, and will render any additional attributes (such as title, alias, domain, permission, etc.) as tags in the documentation block. If there are child elements provided, they will be rendered as a list below the main content of the documentation block. This is useful for rendering additional details about the reflection that may not be included in the description, such as information about parameters of a method or properties of a class.
|
|
22
22
|
*/
|
|
23
|
-
declare function TSDocReflectionProperty(props: TSDocReflectionPropertyProps):
|
|
23
|
+
declare function TSDocReflectionProperty(props: TSDocReflectionPropertyProps): _alloy_js_core16.Children;
|
|
24
24
|
/**
|
|
25
25
|
* Uses the `useReflectionProperty` hook to retrieve the reflection property from the context, and then renders a `TSDocReflectionProperty` component with the retrieved reflection property. This is a convenience component that allows you to easily render a TSDoc documentation block for the current reflection property without having to manually retrieve the reflection property from the context.
|
|
26
26
|
*/
|
|
27
|
-
declare function TSDocContextProperty(props: TSDocProps):
|
|
27
|
+
declare function TSDocContextProperty(props: TSDocProps): _alloy_js_core16.Children;
|
|
28
28
|
interface TSDocReflectionMethodProps extends TSDocProps {
|
|
29
29
|
reflection: ReflectionMethod;
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
32
32
|
* Generates a TSDoc documentation block for the given reflection method. This component will render the description of the reflection as the main content of the documentation block, and will render any additional attributes (such as title, alias, domain, permission, etc.) as tags in the documentation block. If there are child elements provided, they will be rendered as a list below the main content of the documentation block. Additionally, this component will render information about the parameters and return type of the method, if available.
|
|
33
33
|
*/
|
|
34
|
-
declare function TSDocReflectionMethod(props: TSDocReflectionMethodProps):
|
|
34
|
+
declare function TSDocReflectionMethod(props: TSDocReflectionMethodProps): _alloy_js_core16.Children;
|
|
35
35
|
/**
|
|
36
36
|
* Uses the `useReflectionMethod` hook to retrieve the reflection method from the context, and then renders a `TSDocReflectionMethod` component with the retrieved reflection method. This is a convenience component that allows you to easily render a TSDoc documentation block for the current reflection method without having to manually retrieve the reflection method from the context.
|
|
37
37
|
*/
|
|
38
|
-
declare function TSDocContextMethod(props: TSDocProps):
|
|
38
|
+
declare function TSDocContextMethod(props: TSDocProps): _alloy_js_core16.Children;
|
|
39
39
|
declare type __ΩTSDocReflectionClassProps = any[];
|
|
40
40
|
declare type __ΩTSDocReflectionPropertyProps = any[];
|
|
41
41
|
declare type __ΩTSDocReflectionMethodProps = any[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tsdoc-reflection.d.mts","names":[],"sources":["../../../src/typescript/components/tsdoc-reflection.tsx"],"sourcesContent":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"tsdoc-reflection.d.mts","names":[],"sources":["../../../src/typescript/components/tsdoc-reflection.tsx"],"sourcesContent":[],"mappings":";;;;;UAqDiB,oCACL,sBAAsB,6BACxB;cACI,gBAAgB;;AAH9B;;;AAG8B,iBAMd,oBANc,CAAA,UAOlB,MAPkB,CAAA,MAAA,EAAA,GAAA,CAAA,GAOI,MAPJ,CAAA,MAAA,EAAA,GAAA,CAAA,CAAA,CAAA,KAAA,EAQrB,yBARqB,CAQK,CARL,CAAA,CAAA,EAQI,gBAAA,CAAG,QARP;;;;AAMd,iBAoFA,iBApFoB,CAAA,UAqFxB,MArFwB,CAAA,MAAA,EAAA,GAAA,CAAA,GAqFF,MArFE,CAAA,MAAA,EAAA,GAAA,CAAA,CAAA,CAAA,KAAA,EAsF3B,UAtF2B,CAAA,EAsFjB,gBAAA,CAAA,QAtFiB;AACxB,UAkGK,4BAAA,SAAqC,UAlG1C,CAAA;EAAsB,UAAA,EAmGpB,kBAnGoB;;;;;AAmFlB,iBAsBA,uBAAA,CAtBiB,KAAA,EAsBc,4BAtBd,CAAA,EAsB0C,gBAAA,CAAA,QAtB1C;;;;AAEd,iBA8EH,oBAAA,CA9EG,KAAA,EA8EyB,UA9EzB,CAAA,EA8EmC,gBAAA,CAAA,QA9EnC;AAAA,UAwFF,0BAAA,SAAmC,UAxFjC,CAAA;EAaF,UAAA,EA4EH,gBA5EG;AAOjB;AA0DA;AAUA;AAOA;AAoEgB,iBApEA,qBAAA,CAoE0B,KAAU,EApEP,0BAoEO,CAAA,EApEmB,gBAAA,CAAA,QAoEnB;;;;iBAApC,kBAAA,QAA0B,aAAU,gBAAA,CAAA"}
|
|
@@ -7,6 +7,7 @@ import { titleCase } from "@stryke/string-format/title-case";
|
|
|
7
7
|
import { isUndefined } from "@stryke/type-checks/is-undefined";
|
|
8
8
|
import { ReflectionKind, stringifyType } from "@powerlines/deepkit/vendor/type";
|
|
9
9
|
import { isString } from "@stryke/type-checks/is-string";
|
|
10
|
+
import { isSetObject } from "@stryke/type-checks";
|
|
10
11
|
import { isSetString } from "@stryke/type-checks/is-set-string";
|
|
11
12
|
|
|
12
13
|
//#region src/typescript/components/tsdoc-reflection.tsx
|
|
@@ -19,6 +20,7 @@ function TSDocReflectionClass(props) {
|
|
|
19
20
|
"children",
|
|
20
21
|
"reflection"
|
|
21
22
|
]);
|
|
23
|
+
if (!isSetObject(reflection)) return null;
|
|
22
24
|
const title = computed(() => reflection.getTitle() || titleCase(reflection.getName()));
|
|
23
25
|
const computedHeading = computed(() => heading || reflection.getDescription() || title.value);
|
|
24
26
|
const alias = computed(() => reflection.getAlias());
|
|
@@ -92,15 +94,23 @@ function TSDocReflectionClass(props) {
|
|
|
92
94
|
*/
|
|
93
95
|
function TSDocContextClass(props) {
|
|
94
96
|
const reflectionClass = useReflectionClass();
|
|
95
|
-
return createComponent(
|
|
96
|
-
|
|
97
|
-
|
|
97
|
+
return createComponent(Show, {
|
|
98
|
+
get when() {
|
|
99
|
+
return isSetObject(reflectionClass.reflection);
|
|
100
|
+
},
|
|
101
|
+
get children() {
|
|
102
|
+
return createComponent(TSDocReflectionClass, mergeProps(props, { get reflection() {
|
|
103
|
+
return reflectionClass.reflection;
|
|
104
|
+
} }));
|
|
105
|
+
}
|
|
106
|
+
});
|
|
98
107
|
}
|
|
99
108
|
/**
|
|
100
109
|
* Generates a TSDoc documentation block for the given reflection property. This component will render the description of the reflection as the main content of the documentation block, and will render any additional attributes (such as title, alias, domain, permission, etc.) as tags in the documentation block. If there are child elements provided, they will be rendered as a list below the main content of the documentation block. This is useful for rendering additional details about the reflection that may not be included in the description, such as information about parameters of a method or properties of a class.
|
|
101
110
|
*/
|
|
102
111
|
function TSDocReflectionProperty(props) {
|
|
103
112
|
const [{ children, reflection }, rest] = splitProps(props, ["children", "reflection"]);
|
|
113
|
+
if (!isSetObject(reflection)) return null;
|
|
104
114
|
const hasAttributes = computed(() => isSetString(reflection.getTitle()) || !isUndefined(reflection.getAlias()) && reflection.getAlias().length > 0 || !isUndefined(reflection.getPermission()) && reflection.getPermission().length > 0 || isSetString(reflection.getDomain()) || !isUndefined(reflection.isReadonly()) || !isUndefined(reflection.isInternal()) || !isUndefined(reflection.isIgnored()) || !isUndefined(reflection.isHidden()) || reflection.hasDefault() && !isUndefined(reflection.getDefaultValue()));
|
|
105
115
|
return createComponent(TSDoc, mergeProps({ get heading() {
|
|
106
116
|
return reflection.getDescription();
|
|
@@ -164,15 +174,25 @@ function TSDocReflectionProperty(props) {
|
|
|
164
174
|
* Uses the `useReflectionProperty` hook to retrieve the reflection property from the context, and then renders a `TSDocReflectionProperty` component with the retrieved reflection property. This is a convenience component that allows you to easily render a TSDoc documentation block for the current reflection property without having to manually retrieve the reflection property from the context.
|
|
165
175
|
*/
|
|
166
176
|
function TSDocContextProperty(props) {
|
|
167
|
-
|
|
177
|
+
const reflection = useReflectionProperty();
|
|
178
|
+
return createComponent(Show, {
|
|
179
|
+
get when() {
|
|
180
|
+
return isSetObject(reflection);
|
|
181
|
+
},
|
|
182
|
+
get children() {
|
|
183
|
+
return createComponent(TSDocReflectionProperty, mergeProps(props, { reflection }));
|
|
184
|
+
}
|
|
185
|
+
});
|
|
168
186
|
}
|
|
169
187
|
/**
|
|
170
188
|
* Generates a TSDoc documentation block for the given reflection method. This component will render the description of the reflection as the main content of the documentation block, and will render any additional attributes (such as title, alias, domain, permission, etc.) as tags in the documentation block. If there are child elements provided, they will be rendered as a list below the main content of the documentation block. Additionally, this component will render information about the parameters and return type of the method, if available.
|
|
171
189
|
*/
|
|
172
190
|
function TSDocReflectionMethod(props) {
|
|
173
191
|
const [{ children, reflection }, rest] = splitProps(props, ["children", "reflection"]);
|
|
192
|
+
if (!isSetObject(reflection)) return null;
|
|
193
|
+
const heading = computed(() => reflection.getDescription() || (isString(reflection.getName()) ? code`${String(reflection.getName())} method definition` : void 0));
|
|
174
194
|
return createComponent(TSDoc, mergeProps({ get heading() {
|
|
175
|
-
return
|
|
195
|
+
return heading.value;
|
|
176
196
|
} }, rest, { get children() {
|
|
177
197
|
return [
|
|
178
198
|
createComponent(TSDocAttributesTags, {
|
|
@@ -268,7 +288,15 @@ function TSDocReflectionMethod(props) {
|
|
|
268
288
|
* Uses the `useReflectionMethod` hook to retrieve the reflection method from the context, and then renders a `TSDocReflectionMethod` component with the retrieved reflection method. This is a convenience component that allows you to easily render a TSDoc documentation block for the current reflection method without having to manually retrieve the reflection method from the context.
|
|
269
289
|
*/
|
|
270
290
|
function TSDocContextMethod(props) {
|
|
271
|
-
|
|
291
|
+
const reflection = useReflectionMethod();
|
|
292
|
+
return createComponent(Show, {
|
|
293
|
+
get when() {
|
|
294
|
+
return isSetObject(reflection);
|
|
295
|
+
},
|
|
296
|
+
get children() {
|
|
297
|
+
return createComponent(TSDocReflectionMethod, mergeProps(props, { reflection }));
|
|
298
|
+
}
|
|
299
|
+
});
|
|
272
300
|
}
|
|
273
301
|
|
|
274
302
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tsdoc-reflection.mjs","names":["childrenArray","code","computed","For","List","Show","splitProps","ReflectionKind","stringifyType","titleCase","isSetString","isString","isUndefined","Spacing","useReflectionClass","useReflectionMethod","useReflectionProperty","TSDoc","TSDocAttributesTags","TSDocParam","TSDocReturns","TSDocReflectionClass","props","children","heading","reflection","rest","title","getTitle","getName","computedHeading","getDescription","value","alias","getAlias","domain","getDomain","permission","getPermission","readonly","isReadonly","internal","isInternal","ignore","isIgnored","hidden","isHidden","trim","hasAttributes","length","_$createComponent","_$mergeProps","_$memo","when","filter","Boolean","TSDocContextClass","reflectionClass","TSDocReflectionProperty","hasDefault","getDefaultValue","type","defaultValue","TSDocContextProperty","TSDocReflectionMethod","String","undefined","getParameters","each","hardline","ender","_$createIntrinsic","param","name","optional","isOptional","parameter","description","fallback","getReturnType","kind","void","TSDocContextMethod"],"sources":["../../../src/typescript/components/tsdoc-reflection.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 childrenArray,\n code,\n computed,\n For,\n List,\n Show,\n splitProps\n} from \"@alloy-js/core\";\nimport {\n ReflectionClass,\n ReflectionKind,\n ReflectionMethod,\n ReflectionProperty,\n stringifyType\n} from \"@powerlines/deepkit/vendor/type\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport { isUndefined } from \"@stryke/type-checks/is-undefined\";\nimport { Spacing } from \"../../core/components/spacing\";\nimport {\n useReflectionClass,\n useReflectionMethod,\n useReflectionProperty\n} from \"../../core/contexts/reflection\";\nimport {\n TSDoc,\n TSDocAttributesTags,\n TSDocParam,\n TSDocProps,\n TSDocReturns\n} from \"./tsdoc\";\n\nexport interface TSDocReflectionClassProps<\n T extends Record<string, any> = Record<string, any>\n> extends TSDocProps {\n reflection: ReflectionClass<T>;\n}\n\n/**\n * Generates a TSDoc documentation block for the given reflection class. This component will render the description of the reflection as the main content of the documentation block, and will render any additional attributes (such as title, alias, domain, permission, etc.) as tags in the documentation block. If there are child elements provided, they will be rendered as a list below the main content of the documentation block. This is useful for rendering additional details about the reflection that may not be included in the description, such as information about properties or methods of a class.\n */\nexport function TSDocReflectionClass<\n T extends Record<string, any> = Record<string, any>\n>(props: TSDocReflectionClassProps<T>) {\n const [{ children, heading, reflection }, rest] = splitProps(props, [\n \"heading\",\n \"children\",\n \"reflection\"\n ]);\n\n const title = computed(\n () => reflection.getTitle() || titleCase(reflection.getName())\n );\n const computedHeading = computed(\n () => heading || reflection.getDescription() || title.value\n );\n\n const alias = computed(() => reflection.getAlias());\n const domain = computed(() => reflection.getDomain());\n const permission = computed(() => reflection.getPermission());\n const readonly = computed(() => reflection.isReadonly());\n const internal = computed(() => reflection.isInternal());\n const ignore = computed(() => reflection.isIgnored());\n const hidden = computed(() => reflection.isHidden());\n\n if (\n !computedHeading.value ||\n (isSetString(computedHeading.value) && computedHeading.value.trim() === \"\")\n ) {\n return null;\n }\n\n const hasAttributes = computed(\n () =>\n isSetString(title.value) ||\n (!isUndefined(alias.value) && alias.value.length > 0) ||\n (!isUndefined(permission.value) && permission.value.length > 0) ||\n isSetString(domain.value) ||\n !isUndefined(readonly.value) ||\n !isUndefined(internal.value) ||\n !isUndefined(ignore.value) ||\n !isUndefined(hidden.value)\n );\n\n return (\n <TSDoc\n {...rest}\n heading={\n isSetString(computedHeading.value)\n ? computedHeading.value.trim()\n : computedHeading.value\n }>\n <Show when={hasAttributes.value}>\n <TSDocAttributesTags\n title={title.value}\n alias={alias.value}\n domain={domain.value}\n permission={permission.value}\n readonly={readonly.value}\n internal={internal.value}\n ignore={ignore.value}\n hidden={hidden.value}\n />\n </Show>\n <Show\n when={\n !isUndefined(children) &&\n childrenArray(() => children).filter(Boolean).length > 0\n }>\n <Show when={hasAttributes.value}>\n <Spacing />\n </Show>\n <List>{childrenArray(() => children)}</List>\n </Show>\n </TSDoc>\n );\n}\n\n/**\n * Uses the `useReflectionClass` hook to retrieve the reflection class from the context, and then renders a `TSDocReflectionClass` component with the retrieved reflection class. This is a convenience component that allows you to easily render a TSDoc documentation block for the current reflection class without having to manually retrieve the reflection class from the context.\n */\nexport function TSDocContextClass<\n T extends Record<string, any> = Record<string, any>\n>(props: TSDocProps) {\n const reflectionClass = useReflectionClass<T>();\n\n return (\n <TSDocReflectionClass {...props} reflection={reflectionClass.reflection} />\n );\n}\n\nexport interface TSDocReflectionPropertyProps extends TSDocProps {\n reflection: ReflectionProperty;\n}\n\n/**\n * Generates a TSDoc documentation block for the given reflection property. This component will render the description of the reflection as the main content of the documentation block, and will render any additional attributes (such as title, alias, domain, permission, etc.) as tags in the documentation block. If there are child elements provided, they will be rendered as a list below the main content of the documentation block. This is useful for rendering additional details about the reflection that may not be included in the description, such as information about parameters of a method or properties of a class.\n */\nexport function TSDocReflectionProperty(props: TSDocReflectionPropertyProps) {\n const [{ children, reflection }, rest] = splitProps(props, [\n \"children\",\n \"reflection\"\n ]);\n\n const hasAttributes = computed(\n () =>\n isSetString(reflection.getTitle()) ||\n (!isUndefined(reflection.getAlias()) &&\n reflection.getAlias().length > 0) ||\n (!isUndefined(reflection.getPermission()) &&\n reflection.getPermission().length > 0) ||\n isSetString(reflection.getDomain()) ||\n !isUndefined(reflection.isReadonly()) ||\n !isUndefined(reflection.isInternal()) ||\n !isUndefined(reflection.isIgnored()) ||\n !isUndefined(reflection.isHidden()) ||\n (reflection.hasDefault() && !isUndefined(reflection.getDefaultValue()))\n );\n\n return (\n <TSDoc heading={reflection.getDescription()} {...rest}>\n <Show when={hasAttributes.value}>\n <TSDocAttributesTags\n type={reflection}\n title={reflection.getTitle()}\n alias={reflection.getAlias()}\n domain={reflection.getDomain()}\n permission={reflection.getPermission()}\n readonly={reflection.isReadonly()}\n internal={reflection.isInternal()}\n ignore={reflection.isIgnored()}\n hidden={reflection.isHidden()}\n defaultValue={reflection.getDefaultValue()}\n />\n </Show>\n <Show\n when={\n !isUndefined(children) &&\n childrenArray(() => children).filter(Boolean).length > 0\n }>\n <Show when={hasAttributes.value}>\n <Spacing />\n </Show>\n <List>{childrenArray(() => children)}</List>\n </Show>\n </TSDoc>\n );\n}\n\n/**\n * Uses the `useReflectionProperty` hook to retrieve the reflection property from the context, and then renders a `TSDocReflectionProperty` component with the retrieved reflection property. This is a convenience component that allows you to easily render a TSDoc documentation block for the current reflection property without having to manually retrieve the reflection property from the context.\n */\nexport function TSDocContextProperty(props: TSDocProps) {\n const reflection = useReflectionProperty();\n\n return <TSDocReflectionProperty {...props} reflection={reflection} />;\n}\n\nexport interface TSDocReflectionMethodProps extends TSDocProps {\n reflection: ReflectionMethod;\n}\n\n/**\n * Generates a TSDoc documentation block for the given reflection method. This component will render the description of the reflection as the main content of the documentation block, and will render any additional attributes (such as title, alias, domain, permission, etc.) as tags in the documentation block. If there are child elements provided, they will be rendered as a list below the main content of the documentation block. Additionally, this component will render information about the parameters and return type of the method, if available.\n */\nexport function TSDocReflectionMethod(props: TSDocReflectionMethodProps) {\n const [{ children, reflection }, rest] = splitProps(props, [\n \"children\",\n \"reflection\"\n ]);\n\n return (\n <TSDoc\n heading={\n reflection.getDescription() ||\n (isString(reflection.getName())\n ? code`${String(reflection.getName())} method definition`\n : undefined)\n }\n {...rest}>\n <TSDocAttributesTags\n title={reflection.getTitle()}\n alias={reflection.getAlias()}\n domain={reflection.getDomain()}\n permission={reflection.getPermission()}\n readonly={reflection.isReadonly()}\n internal={reflection.isInternal()}\n ignore={reflection.isIgnored()}\n hidden={reflection.isHidden()}\n />\n <Show\n when={Boolean(children) && childrenArray(() => children).length > 0}>\n <List>{childrenArray(() => children)}</List>\n </Show>\n <Show when={reflection.getParameters().length > 0}>\n <Spacing />\n <For each={reflection.getParameters()} hardline ender={<hbr />}>\n {param => (\n <TSDocParam\n name={param.getName()}\n optional={param.isOptional()}\n defaultValue={\n param.hasDefault() ? param.getDefaultValue() : undefined\n }>\n <Show\n when={Boolean(param.parameter.description)}\n fallback={code`A parameter to provide a ${param.getName()} value to the function.`}>\n {param.parameter.description}\n </Show>\n </TSDocParam>\n )}\n </For>\n </Show>\n <Show when={reflection.getReturnType().kind !== ReflectionKind.void}>\n <Spacing />\n <TSDocReturns>\n {code`The return value of the function, which is of type ${stringifyType(\n reflection.getReturnType()\n )}.`}\n </TSDocReturns>\n </Show>\n </TSDoc>\n );\n}\n\n/**\n * Uses the `useReflectionMethod` hook to retrieve the reflection method from the context, and then renders a `TSDocReflectionMethod` component with the retrieved reflection method. This is a convenience component that allows you to easily render a TSDoc documentation block for the current reflection method without having to manually retrieve the reflection method from the context.\n */\nexport function TSDocContextMethod(props: TSDocProps) {\n const reflection = useReflectionMethod();\n\n return <TSDocReflectionMethod {...props} reflection={reflection} />;\n}\n"],"mappings":";;;;;;;;;;;;;;;qCAuNyDyB;;;;;;eACzD,0BAAA,UAAA,IAAA,UAAA,WAAA,SAAA;yBAAA,0BAAA,WAAA,gBAAA,IAAA,MAAA;eAAA,eAAA,WAAA,UAAA,CAAA;gBAAA,eAAA,WAAA,WAAA,CAAA;;;;;;;uBAAA,4PAqBsB,iBAAA,OAAA,MAAA,iBAAA,OAAA;+BAAA,WAAA,MAAA;EAAA,IAAA,UAAA;AAAA;;;;;;;;iDAAA;MAAA;oBAAA;;MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAUR,MAAA,EAAA,IAAA,WAAA;AAAA,aAAA,oBAAA,SAAA;QAAA,CAAA,CAAA;;IAAA,CAAA,CAAA;;EAAA,CAAA,CAAA;;;;;SAAA,yBAAA;yBAAA;;;;;;;;;;0ZAIF,WAAA,UAAA,CAAA,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YAAA,WAAA,eAAA,CAAA,SAAA;;IAAA,IAAA,WAAA;AAAA,YAAA,CAAA,gBAAA,SAAA,EAAA,CAAA,EAAA,qBAAA;MAAA,IAAA,OAAA;AAAA,cAAA,WAAA,eAAA;;MAAA,UAAA;MAAA,IAAA,QAAA;AAAA,cAAA,gBAAA,OAAA,EAAA,CAAA;;MAAA,WAAA,UAAA,gBAAA,YAAA;OAAA,IAAA,OAAA;AAAA,eAAA,MAAA,SAAA;;OAAA,IAAA,WAAA;AAAA,eAAA,MAAA,YAAA;;OAAA,IAAA,eAAA;AAAA,eAAA,WAAA,CAAA,CAAA,MAAA,YAAA,CAAA,EAAA,GAAA,MAAA,iBAAA,GAAA;;OAAA,IAAA,WAAA;AAAA,eAAA,gBAAA,MAAA;SAAA,IAAA,OAAA;AAAA,iBAAA,QAAA,MAAA,UAAA,YAAA;;SAAA,IAAA,WAAA;AAAA,iBAAA,IAAA,4BAAA,MAAA,SAAA,CAAA;;SAAA,IAAA,WAAA;AAAA,iBAAA,MAAA,UAAA;;SAAA,CAAA;;OAAA,CAAA;;;;;eAAA;AAAA,YAAA,WAAA,eAAA,CAAA,SAAA,eAAA;;IAAA,IAAA,WAAA;AAAA,YAAA,CAAA,yBAAA,EAAA,CAAA,EAAA,8BAAA,EAAA,IAAA,WAAA;AAAA,iBAAA2B,sDAAAA,yBAAAA;;;;;;;;;;SAAAA,mBAAAA,OAAAA;+EAAAA,qBAAAA"}
|
|
1
|
+
{"version":3,"file":"tsdoc-reflection.mjs","names":["childrenArray","code","computed","For","List","Show","splitProps","ReflectionKind","stringifyType","titleCase","isSetObject","isSetString","isString","isUndefined","Spacing","useReflectionClass","useReflectionMethod","useReflectionProperty","TSDoc","TSDocAttributesTags","TSDocParam","TSDocReturns","TSDocReflectionClass","props","children","heading","reflection","rest","title","getTitle","getName","computedHeading","getDescription","value","alias","getAlias","domain","getDomain","permission","getPermission","readonly","isReadonly","internal","isInternal","ignore","isIgnored","hidden","isHidden","trim","hasAttributes","length","_$createComponent","_$mergeProps","_$memo","when","filter","Boolean","TSDocContextClass","reflectionClass","TSDocReflectionProperty","hasDefault","getDefaultValue","type","defaultValue","TSDocContextProperty","TSDocReflectionMethod","String","undefined","getParameters","each","hardline","ender","_$createIntrinsic","param","name","optional","isOptional","parameter","description","fallback","getReturnType","kind","void","TSDocContextMethod"],"sources":["../../../src/typescript/components/tsdoc-reflection.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 childrenArray,\n code,\n computed,\n For,\n List,\n Show,\n splitProps\n} from \"@alloy-js/core\";\nimport {\n ReflectionClass,\n ReflectionKind,\n ReflectionMethod,\n ReflectionProperty,\n stringifyType\n} from \"@powerlines/deepkit/vendor/type\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { isSetObject } from \"@stryke/type-checks\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport { isUndefined } from \"@stryke/type-checks/is-undefined\";\nimport { Spacing } from \"../../core/components/spacing\";\nimport {\n useReflectionClass,\n useReflectionMethod,\n useReflectionProperty\n} from \"../../core/contexts/reflection\";\nimport {\n TSDoc,\n TSDocAttributesTags,\n TSDocParam,\n TSDocProps,\n TSDocReturns\n} from \"./tsdoc\";\n\nexport interface TSDocReflectionClassProps<\n T extends Record<string, any> = Record<string, any>\n> extends TSDocProps {\n reflection: ReflectionClass<T>;\n}\n\n/**\n * Generates a TSDoc documentation block for the given reflection class. This component will render the description of the reflection as the main content of the documentation block, and will render any additional attributes (such as title, alias, domain, permission, etc.) as tags in the documentation block. If there are child elements provided, they will be rendered as a list below the main content of the documentation block. This is useful for rendering additional details about the reflection that may not be included in the description, such as information about properties or methods of a class.\n */\nexport function TSDocReflectionClass<\n T extends Record<string, any> = Record<string, any>\n>(props: TSDocReflectionClassProps<T>) {\n const [{ children, heading, reflection }, rest] = splitProps(props, [\n \"heading\",\n \"children\",\n \"reflection\"\n ]);\n\n if (!isSetObject(reflection)) {\n return null;\n }\n\n const title = computed(\n () => reflection.getTitle() || titleCase(reflection.getName())\n );\n const computedHeading = computed(\n () => heading || reflection.getDescription() || title.value\n );\n\n const alias = computed(() => reflection.getAlias());\n const domain = computed(() => reflection.getDomain());\n const permission = computed(() => reflection.getPermission());\n const readonly = computed(() => reflection.isReadonly());\n const internal = computed(() => reflection.isInternal());\n const ignore = computed(() => reflection.isIgnored());\n const hidden = computed(() => reflection.isHidden());\n\n if (\n !computedHeading.value ||\n (isSetString(computedHeading.value) && computedHeading.value.trim() === \"\")\n ) {\n return null;\n }\n\n const hasAttributes = computed(\n () =>\n isSetString(title.value) ||\n (!isUndefined(alias.value) && alias.value.length > 0) ||\n (!isUndefined(permission.value) && permission.value.length > 0) ||\n isSetString(domain.value) ||\n !isUndefined(readonly.value) ||\n !isUndefined(internal.value) ||\n !isUndefined(ignore.value) ||\n !isUndefined(hidden.value)\n );\n\n return (\n <TSDoc\n {...rest}\n heading={\n isSetString(computedHeading.value)\n ? computedHeading.value.trim()\n : computedHeading.value\n }>\n <Show when={hasAttributes.value}>\n <TSDocAttributesTags\n title={title.value}\n alias={alias.value}\n domain={domain.value}\n permission={permission.value}\n readonly={readonly.value}\n internal={internal.value}\n ignore={ignore.value}\n hidden={hidden.value}\n />\n </Show>\n <Show\n when={\n !isUndefined(children) &&\n childrenArray(() => children).filter(Boolean).length > 0\n }>\n <Show when={hasAttributes.value}>\n <Spacing />\n </Show>\n <List>{childrenArray(() => children)}</List>\n </Show>\n </TSDoc>\n );\n}\n\n/**\n * Uses the `useReflectionClass` hook to retrieve the reflection class from the context, and then renders a `TSDocReflectionClass` component with the retrieved reflection class. This is a convenience component that allows you to easily render a TSDoc documentation block for the current reflection class without having to manually retrieve the reflection class from the context.\n */\nexport function TSDocContextClass<\n T extends Record<string, any> = Record<string, any>\n>(props: TSDocProps) {\n const reflectionClass = useReflectionClass<T>();\n\n return (\n <Show when={isSetObject(reflectionClass.reflection)}>\n <TSDocReflectionClass\n {...props}\n reflection={reflectionClass.reflection}\n />\n </Show>\n );\n}\n\nexport interface TSDocReflectionPropertyProps extends TSDocProps {\n reflection: ReflectionProperty;\n}\n\n/**\n * Generates a TSDoc documentation block for the given reflection property. This component will render the description of the reflection as the main content of the documentation block, and will render any additional attributes (such as title, alias, domain, permission, etc.) as tags in the documentation block. If there are child elements provided, they will be rendered as a list below the main content of the documentation block. This is useful for rendering additional details about the reflection that may not be included in the description, such as information about parameters of a method or properties of a class.\n */\nexport function TSDocReflectionProperty(props: TSDocReflectionPropertyProps) {\n const [{ children, reflection }, rest] = splitProps(props, [\n \"children\",\n \"reflection\"\n ]);\n\n if (!isSetObject(reflection)) {\n return null;\n }\n\n const hasAttributes = computed(\n () =>\n isSetString(reflection.getTitle()) ||\n (!isUndefined(reflection.getAlias()) &&\n reflection.getAlias().length > 0) ||\n (!isUndefined(reflection.getPermission()) &&\n reflection.getPermission().length > 0) ||\n isSetString(reflection.getDomain()) ||\n !isUndefined(reflection.isReadonly()) ||\n !isUndefined(reflection.isInternal()) ||\n !isUndefined(reflection.isIgnored()) ||\n !isUndefined(reflection.isHidden()) ||\n (reflection.hasDefault() && !isUndefined(reflection.getDefaultValue()))\n );\n\n return (\n <TSDoc heading={reflection.getDescription()} {...rest}>\n <Show when={hasAttributes.value}>\n <TSDocAttributesTags\n type={reflection}\n title={reflection.getTitle()}\n alias={reflection.getAlias()}\n domain={reflection.getDomain()}\n permission={reflection.getPermission()}\n readonly={reflection.isReadonly()}\n internal={reflection.isInternal()}\n ignore={reflection.isIgnored()}\n hidden={reflection.isHidden()}\n defaultValue={reflection.getDefaultValue()}\n />\n </Show>\n <Show\n when={\n !isUndefined(children) &&\n childrenArray(() => children).filter(Boolean).length > 0\n }>\n <Show when={hasAttributes.value}>\n <Spacing />\n </Show>\n <List>{childrenArray(() => children)}</List>\n </Show>\n </TSDoc>\n );\n}\n\n/**\n * Uses the `useReflectionProperty` hook to retrieve the reflection property from the context, and then renders a `TSDocReflectionProperty` component with the retrieved reflection property. This is a convenience component that allows you to easily render a TSDoc documentation block for the current reflection property without having to manually retrieve the reflection property from the context.\n */\nexport function TSDocContextProperty(props: TSDocProps) {\n const reflection = useReflectionProperty();\n\n return (\n <Show when={isSetObject(reflection)}>\n <TSDocReflectionProperty {...props} reflection={reflection} />\n </Show>\n );\n}\n\nexport interface TSDocReflectionMethodProps extends TSDocProps {\n reflection: ReflectionMethod;\n}\n\n/**\n * Generates a TSDoc documentation block for the given reflection method. This component will render the description of the reflection as the main content of the documentation block, and will render any additional attributes (such as title, alias, domain, permission, etc.) as tags in the documentation block. If there are child elements provided, they will be rendered as a list below the main content of the documentation block. Additionally, this component will render information about the parameters and return type of the method, if available.\n */\nexport function TSDocReflectionMethod(props: TSDocReflectionMethodProps) {\n const [{ children, reflection }, rest] = splitProps(props, [\n \"children\",\n \"reflection\"\n ]);\n\n if (!isSetObject(reflection)) {\n return null;\n }\n\n const heading = computed(\n () =>\n reflection.getDescription() ||\n (isString(reflection.getName())\n ? code`${String(reflection.getName())} method definition`\n : undefined)\n );\n\n return (\n <TSDoc heading={heading.value} {...rest}>\n <TSDocAttributesTags\n title={reflection.getTitle()}\n alias={reflection.getAlias()}\n domain={reflection.getDomain()}\n permission={reflection.getPermission()}\n readonly={reflection.isReadonly()}\n internal={reflection.isInternal()}\n ignore={reflection.isIgnored()}\n hidden={reflection.isHidden()}\n />\n <Show\n when={Boolean(children) && childrenArray(() => children).length > 0}>\n <List>{childrenArray(() => children)}</List>\n </Show>\n <Show when={reflection.getParameters().length > 0}>\n <Spacing />\n <For each={reflection.getParameters()} hardline ender={<hbr />}>\n {param => (\n <TSDocParam\n name={param.getName()}\n optional={param.isOptional()}\n defaultValue={\n param.hasDefault() ? param.getDefaultValue() : undefined\n }>\n <Show\n when={Boolean(param.parameter.description)}\n fallback={code`A parameter to provide a ${param.getName()} value to the function.`}>\n {param.parameter.description}\n </Show>\n </TSDocParam>\n )}\n </For>\n </Show>\n <Show when={reflection.getReturnType().kind !== ReflectionKind.void}>\n <Spacing />\n <TSDocReturns>\n {code`The return value of the function, which is of type ${stringifyType(\n reflection.getReturnType()\n )}.`}\n </TSDocReturns>\n </Show>\n </TSDoc>\n );\n}\n\n/**\n * Uses the `useReflectionMethod` hook to retrieve the reflection method from the context, and then renders a `TSDocReflectionMethod` component with the retrieved reflection method. This is a convenience component that allows you to easily render a TSDoc documentation block for the current reflection method without having to manually retrieve the reflection method from the context.\n */\nexport function TSDocContextMethod(props: TSDocProps) {\n const reflection = useReflectionMethod();\n\n return (\n <Show when={isSetObject(reflection)}>\n <TSDocReflectionMethod {...props} reflection={reflection} />\n </Show>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;SAsOS,4BAAA;;;;;;kBAAA,WAAA;eAAA,0BAAA,UAAA,IAAA,UAAA,WAAA,SAAA;yBAAA,0BAAA,WAAA,gBAAA,IAAA,MAAA;;gBAAA;mCAAA,WAAA,eAAA,CAAA;kBAAA,eAAA,WAAA,YAAA,CAAA;kBAAA,eAAA,WAAA,YAAA,CAAA;gBAAA,eAAA,WAAA,WAAA,CAAA;gBAAA,eAAA,WAAA,UAAA,CAAA;sBAAA;sKAA8B,MAAA,SAAA,iBAAA,OAAA,MAAA,iBAAA,SAAA,uBAAA,SAAA,MAAA,iBAAA,OAAA,MAAA,iBAAA,OAAA;wBAAA,OAAA,WAAA,MAAA;EAAA;;;;2BAc5BwB,MAAAA;IAAAA,IAAAA,OAAAA;AAAAA,YAAAA,cAAAA;;IAAAA,IAAAA,WAAAA;AAAAA,YAAAA,gBAA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,GAAAA;;OAAAA,IAAAA,WAAAA;AAAAA,eAAAA,gBAAc,MAAA;SAAA,IAAA,OAAA;AAAA,iBAAA,QAAA,MAAA,UAAA,YAAA;;SAAA,IAAA,WAAA;AAAA,iBAAA,IAAA,4BAAA,MAAA,SAAA,CAAA;;SAAA,IAAA,WAAA;AAAA,iBAAA,MAAA,UAAA;;SAAA,CAAA;;OAAA,CAAA;;;;;eAAA;AAAA,YAAA,WAAA,eAAA,CAAA,SAAA,eAAA;;IAAA,IAAA,WAAA;AAAA,YAAA,CAAA,yBAAA,EAAA,CAAA,EAAA,8BAAA,EAAA,IAAA,WAAA;AAAA,iBAAA,sDAAA,yBAAA;QAAA,CAAA,CAAA;;IAAA,CAAA;GAAA;IAAA,CAAA,CAAA;;;;;4BAAMwB,OAAAA;oBAAAA,qBAAAA;;aAAAA;AAAAA,UAAAA,YAAAA,WAAAA;;EAAAA,IAAAA,WAAAA;AAAAA,UAAAA"}
|
|
@@ -239,25 +239,27 @@ function TSDocHidden() {
|
|
|
239
239
|
* Generates a TypeScript interface property for the given reflection class.
|
|
240
240
|
*/
|
|
241
241
|
function TSDocAttributesTags(props) {
|
|
242
|
-
const [{ type,
|
|
242
|
+
const [{ type, alias, permission, readonly, internal, ignore, hidden, defaultValue }] = (0, __alloy_js_core.splitProps)(props, [
|
|
243
243
|
"type",
|
|
244
|
-
"title",
|
|
245
244
|
"alias",
|
|
246
245
|
"permission",
|
|
247
|
-
"domain",
|
|
248
246
|
"readonly",
|
|
249
247
|
"internal",
|
|
250
248
|
"ignore",
|
|
251
249
|
"hidden",
|
|
252
250
|
"defaultValue"
|
|
253
251
|
]);
|
|
252
|
+
const title = (0, __alloy_js_core.computed)(() => props.title?.trim() || "");
|
|
253
|
+
const domain = (0, __alloy_js_core.computed)(() => props.domain?.trim() || "");
|
|
254
254
|
return [
|
|
255
255
|
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
|
|
256
256
|
get when() {
|
|
257
|
-
return (0, __stryke_type_checks_is_set_string.isSetString)(title
|
|
257
|
+
return (0, __stryke_type_checks_is_set_string.isSetString)(title.value);
|
|
258
258
|
},
|
|
259
259
|
get children() {
|
|
260
|
-
return (0, __alloy_js_core_jsx_runtime.createComponent)(TSDocTitle, { children
|
|
260
|
+
return (0, __alloy_js_core_jsx_runtime.createComponent)(TSDocTitle, { get children() {
|
|
261
|
+
return title.value;
|
|
262
|
+
} });
|
|
261
263
|
}
|
|
262
264
|
}),
|
|
263
265
|
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
|
|
@@ -275,10 +277,12 @@ function TSDocAttributesTags(props) {
|
|
|
275
277
|
}),
|
|
276
278
|
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
|
|
277
279
|
get when() {
|
|
278
|
-
return (0, __stryke_type_checks_is_set_string.isSetString)(domain
|
|
280
|
+
return (0, __stryke_type_checks_is_set_string.isSetString)(domain.value);
|
|
279
281
|
},
|
|
280
282
|
get children() {
|
|
281
|
-
return (0, __alloy_js_core_jsx_runtime.createComponent)(TSDocDomain, { children
|
|
283
|
+
return (0, __alloy_js_core_jsx_runtime.createComponent)(TSDocDomain, { get children() {
|
|
284
|
+
return domain.value;
|
|
285
|
+
} });
|
|
282
286
|
}
|
|
283
287
|
}),
|
|
284
288
|
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tsdoc.d.cts","names":[],"sources":["../../../src/typescript/components/tsdoc.tsx"],"sourcesContent":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"tsdoc.d.cts","names":[],"sources":["../../../src/typescript/components/tsdoc.tsx"],"sourcesContent":[],"mappings":";;;;;;UAyCiB,UAAA,SAAmB;YACxB;AADZ;AAOA;AA2BA;AAOA;AAgBiB,iBAlDD,KAAA,CAkDiB,KAAA,EAlDJ,UAmDf,CAAA,EAnDyB,QAmDN;AAMjB,UA9B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AAkB,kBAAe;;;;iBAiDjC,YAAA,QAAoB,iBAAc;;;;iBAOlC,WAAA,QAAmB,iBAAc;UAIhC,gBAAA,SAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;QA2BlC;;;;;iBAMQ,WAAA,QAAmB,mBAAgB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tsdoc.d.mts","names":[],"sources":["../../../src/typescript/components/tsdoc.tsx"],"sourcesContent":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"tsdoc.d.mts","names":[],"sources":["../../../src/typescript/components/tsdoc.tsx"],"sourcesContent":[],"mappings":";;;;;;UAyCiB,UAAA,SAAmB;YACxB;AADZ;AAOA;AA2BA;AAOA;AAgBiB,iBAlDD,KAAA,CAkDiB,KAAA,EAlDJ,UAmDf,CAAA,EAnDyB,QAmDN;AAMjB,UA9BC,aAAA,SAAsB,cA8BY,CAAA;EA2BnC,GAAA,EAAA,MAAA;AAahB;AAaA;AAaA;AAUA;AACQ,iBApGQ,QAAA,CAoGR,KAAA,EApGwB,aAoGxB,CAAA,EApGqC,QAoGrC;AAAiB,UApFR,gBAAA,CAoFQ;EAAqB,UAAA,EAnFhC,mBAmFgC,EAAA,GAAA,MAAA,EAAA;;;AAO9C;AAkBA;AAagB,iBAnHA,WAAA,CAmHiB,KAAA,EAnHE,gBAmHY,CAAA,EAnHI,QAmHJ;AAI/C;AAYA;AA4BA;AAOgB,iBA3IA,UAAA,CA2Ia,KAAA,EA3IK,cA2IL,CAAA,EA3ImB,QA2InB;AAO7B;AAOA;AAIA;AACS,iBAjJO,WAAA,CAiJP,KAAA,EAjJ0B,cAiJ1B,CAAA,EAjJwC,QAiJxC;;;;AAeO,iBAnJA,UAAA,CAmJmB,KAAQ,EAnJT,cAmJS,CAAA,EAnJK,QAmJmB;AA8EnE;;;AAIiB,iBAxND,eAAA,CAwNC,KAAA,EAxNsB,cAwNtB,CAAA,EAxNoC,QAwNpC;AAAQ,UA9MR,sBAAA,SAA+B,cA8MvB,CAAA;EAMT,IAAA,EAnNR,cAmNkB,GAnND,kBAmNS,GAnNY,mBAmNG;EAiDjC,YAAA,EAAA,GAAY;AAO5B;AAIA;AAiCA;;iBAzSgB,iBAAA,QAAyB,yBAAsB;;;;iBAkB/C,YAAA,QAAoB,iBAAc;;;;iBAalC,SAAA,QAAiB,iBAAc;UAI9B,iBAAA,SAA0B;;;;;;;;;;;iBAY3B,YAAA,QAAoB,oBAAiB;;;;iBA4BrC,aAAA,CAAA,GAAa;;;;iBAOb,aAAA,CAAA,GAAa;;;;iBAOb,WAAA,CAAA,GAAW;;;;iBAOX,WAAA,CAAA,GAAW;UAIV,wBAAA;SACR,iBAAiB,qBAAqB;;;;;;;;;;;;;;iBAe/B,mBAAA,QAA2B,2BAAwB;UA8ElD,eAAA;QACT;aACK;;iBAEI;;;;;iBAMD,UAAA,QAAkB,kBAAe;;;;iBAiDjC,YAAA,QAAoB,iBAAc;;;;iBAOlC,WAAA,QAAmB,iBAAc;UAIhC,gBAAA,SAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;QA2BlC;;;;;iBAMQ,WAAA,QAAmB,mBAAgB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { usePowerlinesSafe } from "../../core/contexts/context.mjs";
|
|
2
2
|
import { Spacing } from "../../core/components/spacing.mjs";
|
|
3
3
|
import { createComponent, createIntrinsic, memo, mergeProps } from "@alloy-js/core/jsx-runtime";
|
|
4
|
-
import { For, List, Prose, Show, childrenArray, splitProps } from "@alloy-js/core";
|
|
4
|
+
import { For, List, Prose, Show, childrenArray, computed, splitProps } from "@alloy-js/core";
|
|
5
5
|
import { stringifyDefaultValue } from "@powerlines/deepkit/utilities";
|
|
6
6
|
import { isUndefined } from "@stryke/type-checks/is-undefined";
|
|
7
7
|
import { isSetString } from "@stryke/type-checks/is-set-string";
|
|
@@ -238,25 +238,27 @@ function TSDocHidden() {
|
|
|
238
238
|
* Generates a TypeScript interface property for the given reflection class.
|
|
239
239
|
*/
|
|
240
240
|
function TSDocAttributesTags(props) {
|
|
241
|
-
const [{ type,
|
|
241
|
+
const [{ type, alias, permission, readonly, internal, ignore, hidden, defaultValue }] = splitProps(props, [
|
|
242
242
|
"type",
|
|
243
|
-
"title",
|
|
244
243
|
"alias",
|
|
245
244
|
"permission",
|
|
246
|
-
"domain",
|
|
247
245
|
"readonly",
|
|
248
246
|
"internal",
|
|
249
247
|
"ignore",
|
|
250
248
|
"hidden",
|
|
251
249
|
"defaultValue"
|
|
252
250
|
]);
|
|
251
|
+
const title = computed(() => props.title?.trim() || "");
|
|
252
|
+
const domain = computed(() => props.domain?.trim() || "");
|
|
253
253
|
return [
|
|
254
254
|
createComponent(Show, {
|
|
255
255
|
get when() {
|
|
256
|
-
return isSetString(title
|
|
256
|
+
return isSetString(title.value);
|
|
257
257
|
},
|
|
258
258
|
get children() {
|
|
259
|
-
return createComponent(TSDocTitle, { children
|
|
259
|
+
return createComponent(TSDocTitle, { get children() {
|
|
260
|
+
return title.value;
|
|
261
|
+
} });
|
|
260
262
|
}
|
|
261
263
|
}),
|
|
262
264
|
createComponent(Show, {
|
|
@@ -274,10 +276,12 @@ function TSDocAttributesTags(props) {
|
|
|
274
276
|
}),
|
|
275
277
|
createComponent(Show, {
|
|
276
278
|
get when() {
|
|
277
|
-
return isSetString(domain
|
|
279
|
+
return isSetString(domain.value);
|
|
278
280
|
},
|
|
279
281
|
get children() {
|
|
280
|
-
return createComponent(TSDocDomain, { children
|
|
282
|
+
return createComponent(TSDocDomain, { get children() {
|
|
283
|
+
return domain.value;
|
|
284
|
+
} });
|
|
281
285
|
}
|
|
282
286
|
}),
|
|
283
287
|
createComponent(Show, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tsdoc.mjs","names":["childrenArray","For","List","Prose","Show","splitProps","stringifyDefaultValue","isSetString","isUndefined","Spacing","usePowerlinesSafe","TSDoc","props","children","heading","_$createIntrinsic","string","_$createComponent","when","_$memo","filter","Boolean","length","TSDocTag","tag","width","TSDocParams","parameters","normalizeParametersForDoc","each","param","TSDocParam","name","optional","doc","some","p","TSDocTitle","rest","_$mergeProps","TSDocDomain","TSDocAlias","TSDocPermission","TSDocDefaultValue","type","defaultValue","TSDocRemarks","hardline","TSDocLink","TSDocExample","tsx","fenced","language","TSDocReadonly","TSDocInternal","TSDocIgnore","TSDocHidden","TSDocAttributesTags","title","alias","permission","domain","readonly","internal","ignore","hidden","trim","a","TSDocParamName","TSDocParamDescription","TSDocReturns","TSDocThrows","TSDocModule","prefix","context","config","framework"],"sources":["../../../src/typescript/components/tsdoc.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport {\n Children,\n childrenArray,\n For,\n List,\n Prose,\n Show,\n splitProps\n} from \"@alloy-js/core\";\nimport { JSDocExampleProps, ParameterDescriptor } from \"@alloy-js/typescript\";\nimport { stringifyDefaultValue } from \"@powerlines/deepkit/utilities\";\nimport {\n ReflectionKind,\n ReflectionParameter,\n ReflectionProperty\n} from \"@powerlines/deepkit/vendor/type\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { isUndefined } from \"@stryke/type-checks/is-undefined\";\nimport { Spacing } from \"../../core/components/spacing\";\nimport { usePowerlinesSafe } from \"../../core/contexts/context\";\nimport { ComponentProps } from \"../../types/components\";\n\nexport interface TSDocProps extends ComponentProps {\n heading?: Children;\n}\n\n/**\n * Generates a TypeScript interface for the given reflection class.\n */\nexport function TSDoc(props: TSDocProps) {\n const [{ children, heading }] = splitProps(props, [\"children\", \"heading\"]);\n\n return (\n <>\n /**\n <align string=\" * \">\n <hbr />\n <Show when={!isUndefined(heading)}>{heading}</Show>\n <Show\n when={\n !isUndefined(children) &&\n childrenArray(() => children).filter(Boolean).length > 0\n }>\n <Show when={!isUndefined(heading)}>\n <Spacing />\n </Show>\n <List>{childrenArray(() => children)}</List>\n </Show>\n </align>\n <hbr />\n {`*/`}\n <hbr />\n </>\n );\n}\n\nexport interface TSDocTagProps extends ComponentProps {\n tag: string;\n}\n\n/**\n * Create a TSDoc `@<props.tag>` tag.\n */\nexport function TSDocTag(props: TSDocTagProps) {\n const [{ children, tag }] = splitProps(props, [\"children\", \"tag\"]);\n\n return (\n <>\n {`@${tag} `}\n <Show when={Boolean(children)}>\n <align width={2}>\n <Prose>{children}</Prose>\n </align>\n </Show>\n <sbr />\n </>\n );\n}\n\nexport interface TSDocParamsProps {\n parameters: ParameterDescriptor[] | string[];\n}\n\n/**\n * A component that creates a TSDoc block with `@param` tags for each parameter.\n */\nexport function TSDocParams(props: TSDocParamsProps) {\n const parameters = normalizeParametersForDoc(props.parameters);\n\n return (\n <For each={parameters}>\n {param => (\n <TSDocParam name={param.name} optional={param.optional}>\n {param.doc}\n </TSDocParam>\n )}\n </For>\n );\n}\n\nfunction normalizeParametersForDoc(\n parameters: ParameterDescriptor[] | string[]\n): ParameterDescriptor[] {\n if (parameters.some(p => typeof p === \"string\")) {\n return [];\n }\n\n return parameters as ParameterDescriptor[];\n}\n\n/**\n * Create a TSDoc `@title` tag.\n */\nexport function TSDocTitle(props: ComponentProps) {\n const [{ children }, rest] = splitProps(props, [\"children\"]);\n\n return (\n <TSDocTag {...rest} tag=\"title\">\n {children}\n </TSDocTag>\n );\n}\n\n/**\n * Create a TSDoc `@domain` tag.\n */\nexport function TSDocDomain(props: ComponentProps) {\n const [{ children }, rest] = splitProps(props, [\"children\"]);\n\n return (\n <TSDocTag {...rest} tag=\"domain\">\n {children}\n </TSDocTag>\n );\n}\n\n/**\n * Create a TSDoc `@alias` tag.\n */\nexport function TSDocAlias(props: ComponentProps) {\n const [{ children }, rest] = splitProps(props, [\"children\"]);\n\n return (\n <TSDocTag {...rest} tag=\"alias\">\n {children}\n </TSDocTag>\n );\n}\n\n/**\n * Create a TSDoc `@permission` tag.\n */\nexport function TSDocPermission(props: ComponentProps) {\n const [{ children }, rest] = splitProps(props, [\"children\"]);\n\n return (\n <TSDocTag {...rest} tag=\"permission\">\n {children}\n </TSDocTag>\n );\n}\n\nexport interface TSDocDefaultValueProps extends ComponentProps {\n type: ReflectionKind | ReflectionProperty | ReflectionParameter;\n defaultValue: any;\n}\n\n/**\n * Create a TSDoc `@defaultValue` tag.\n */\nexport function TSDocDefaultValue(props: TSDocDefaultValueProps) {\n const [{ type, defaultValue }] = splitProps(props, [\"type\", \"defaultValue\"]);\n\n return (\n <>\n {\"@defaultValue \"}\n <Show when={!isUndefined(defaultValue)}>\n <align width={2}>\n <Prose>{stringifyDefaultValue(type, defaultValue)}</Prose>\n </align>\n </Show>\n </>\n );\n}\n\n/**\n * Create a TSDoc `@remarks` tag.\n */\nexport function TSDocRemarks(props: ComponentProps) {\n return (\n <>\n {\"@remarks \"}\n <hbr />\n <List hardline={true}>{childrenArray(() => props.children)}</List>\n </>\n );\n}\n\n/**\n * Create a TSDoc `@see` tag.\n */\nexport function TSDocLink(props: ComponentProps) {\n return <TSDocTag {...props} tag=\"see\" />;\n}\n\nexport interface TSDocExampleProps extends JSDocExampleProps {\n /**\n * Whether the file is a TSX file.\n *\n * @defaultValue false\n */\n tsx?: boolean;\n}\n\n/**\n * Create a TSDoc `@example` tag.\n */\nexport function TSDocExample(props: TSDocExampleProps) {\n const [{ tsx, fenced = true, language, children }] = splitProps(props, [\n \"tsx\",\n \"fenced\",\n \"language\",\n \"children\"\n ]);\n\n return (\n <>\n {\"@example \"}\n <hbr />\n <Show when={fenced}>\n ```{language || (tsx ? \"tsx\" : \"ts\")}\n <hbr />\n </Show>\n {children}\n <Show when={fenced}>\n <hbr />\n ```\n </Show>\n </>\n );\n}\n\n/**\n * Create a TSDoc `@readonly` tag.\n */\nexport function TSDocReadonly() {\n return <TSDocTag tag=\"readonly\" />;\n}\n\n/**\n * Create a TSDoc `@internal` tag.\n */\nexport function TSDocInternal() {\n return <TSDocTag tag=\"internal\" />;\n}\n\n/**\n * Create a TSDoc `@ignore` tag.\n */\nexport function TSDocIgnore() {\n return <TSDocTag tag=\"ignore\" />;\n}\n\n/**\n * Create a TSDoc `@hidden` tag.\n */\nexport function TSDocHidden() {\n return <TSDocTag tag=\"hidden\" />;\n}\n\nexport interface TSDocAttributesTagsProps {\n type?: ReflectionKind | ReflectionProperty | ReflectionParameter;\n title?: string;\n alias?: string[];\n permission?: string[];\n domain?: string;\n readonly?: boolean;\n internal?: boolean;\n ignore?: boolean;\n hidden?: boolean;\n defaultValue?: any;\n}\n\n/**\n * Generates a TypeScript interface property for the given reflection class.\n */\nexport function TSDocAttributesTags(props: TSDocAttributesTagsProps) {\n const [\n {\n type,\n title,\n alias,\n permission,\n domain,\n readonly,\n internal,\n ignore,\n hidden,\n defaultValue\n }\n ] = splitProps(props, [\n \"type\",\n \"title\",\n \"alias\",\n \"permission\",\n \"domain\",\n \"readonly\",\n \"internal\",\n \"ignore\",\n \"hidden\",\n \"defaultValue\"\n ]);\n\n return (\n <>\n <Show when={isSetString(title?.trim())}>\n <TSDocTitle>{title}</TSDocTitle>\n </Show>\n <Show\n when={\n !isUndefined(alias) &&\n alias.length > 0 &&\n alias.some(a => isSetString(a?.trim()))\n }>\n <For each={alias?.filter(a => isSetString(a?.trim())) ?? []}>\n {alias => <TSDocAlias>{alias}</TSDocAlias>}\n </For>\n </Show>\n <Show when={isSetString(domain?.trim())}>\n <TSDocDomain>{domain}</TSDocDomain>\n </Show>\n <Show\n when={\n !isUndefined(permission) &&\n permission.length > 0 &&\n permission.some(p => isSetString(p?.trim()))\n }>\n <For each={permission?.filter(p => isSetString(p?.trim())) ?? []}>\n {permission => <TSDocPermission>{permission}</TSDocPermission>}\n </For>\n </Show>\n <Show when={readonly === true}>\n <TSDocReadonly />\n </Show>\n <Show when={internal === true}>\n <TSDocInternal />\n </Show>\n <Show when={ignore === true}>\n <TSDocIgnore />\n </Show>\n <Show when={hidden === true}>\n <TSDocHidden />\n </Show>\n <Show when={!isUndefined(type) && !isUndefined(defaultValue)}>\n <TSDocDefaultValue\n type={\n type as ReflectionKind | ReflectionProperty | ReflectionParameter\n }\n defaultValue={defaultValue}\n />\n </Show>\n </>\n );\n}\n\nexport interface TSDocParamProps {\n name: Children;\n children?: Children;\n optional?: boolean;\n defaultValue?: Children;\n}\n\n/**\n * Create a TSDoc parameter set off with `@param`.\n */\nexport function TSDocParam(props: TSDocParamProps) {\n return (\n <>\n {\"@param \"}\n <TSDocParamName\n name={props.name}\n optional={props.optional}\n defaultValue={props.defaultValue}\n />\n <TSDocParamDescription children={props.children} />\n </>\n );\n}\n\ninterface TSDocParamNameProps {\n name: Children;\n optional?: boolean;\n defaultValue?: Children;\n}\n\nfunction TSDocParamName(props: TSDocParamNameProps) {\n return (\n <>\n <Show when={props.optional}>{\"[\"}</Show>\n {props.name}\n <Show when={Boolean(props.defaultValue)}>={props.defaultValue}</Show>\n <Show when={props.optional}>{\"]\"}</Show>\n </>\n );\n}\n\ninterface TSDocParamDescriptionProps {\n children?: Children;\n}\n\nfunction TSDocParamDescription(props: TSDocParamDescriptionProps) {\n return (\n <Show when={Boolean(props.children)}>\n {\" - \"}\n <align width={2}>\n <Prose>{props.children}</Prose>\n </align>\n </Show>\n );\n}\n\n/**\n * Create a TSDoc `@returns` tag.\n */\nexport function TSDocReturns(props: ComponentProps) {\n return <TSDocTag {...props} tag=\"returns\" />;\n}\n\n/**\n * Create a TSDoc `@throws` tag.\n */\nexport function TSDocThrows(props: ComponentProps) {\n return <TSDocTag {...props} tag=\"throws\" />;\n}\n\nexport interface TSDocModuleProps extends ComponentProps {\n /**\n * The prefix for the builtin module name\n *\n * @remarks\n * This value is populated from the Powerlines configuration output builtin prefix by default.\n *\n * @example\n * ```ts\n * /**\n * @module powerlines:my-module\n * \\/\n * ```\n */\n prefix?: string;\n\n /**\n * The name of the module\n *\n * @remarks\n * This will be used in the `@module` tag as well as the import path for the module, e.g. `storm:<name>`.\n *\n * @example\n * ```ts\n * import { MyModule } from \"powerlines:my-module\";\n * ```\n */\n name: Children;\n}\n\n/**\n * Generates a TSDoc `@module` tag for the given module name.\n */\nexport function TSDocModule(props: TSDocModuleProps) {\n const [{ children, name, prefix }] = splitProps(props, [\n \"children\",\n \"name\",\n \"prefix\"\n ]);\n\n const context = usePowerlinesSafe();\n\n return (\n <>\n /**\n <align string=\" * \">\n <hbr />\n <Show when={Boolean(children)}>\n <List hardline={true}>{childrenArray(() => children)}</List>\n <Spacing />\n </Show>\n {\"@module \"}\n {prefix || context?.config?.framework || \"powerlines\"}:{name}\n </align>\n <hbr />\n {` */`}\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;4CAuGA,OAAA,CAAA,YAAA,UAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAsEE,KAAA;EAAA;EAAA,WACyB,UAAA;;;;;;;;;;;;;SAeV6C,sCAAAA;AAEf,KAAA,WAAA,MAAA,MAGc,OAAA,MAAA,SAAA,CAAA,QAAA,EAAA;;;;;;SAE2C,WAAA,OAAA;OAAA,CAAA,EAAA,YAAA,QAAA,WAAA,OAAA,CAAA,WAAA,CAAA;wBAS3D,UAAA,WAAA,MAAA;EAAA,KAAA;EAAA;EAAA,CAAA,CAAA;;;;;SAIkB5B,YAAAA,OAAAA;OAAAA,CAAAA,EAAAA,YAAAA,QAAAA,WAAAA,OAAAA,CAAAA,WAAAA,CAAAA;wBAQlB,UAAA,WAAA,MAAA;EAAA,KAAA;EAAA;EAAA,CAAA,CAAA;;;;;SAGiC,WAAA,OAAA;OAAA,CAAA,EAAA,YAAA,QAAA,WAAA,OAAA,CAAA,WAAA,CAAA;;;;;;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AAA,EAAA,CAAA;;GAAA,CAAA;EAAA,gBAAA,MAAA;GAAA,MAAA,aAAA;GAAA,IAAA,WAAA;AAAA,WAAA"}
|
|
1
|
+
{"version":3,"file":"tsdoc.mjs","names":["childrenArray","computed","For","List","Prose","Show","splitProps","stringifyDefaultValue","isSetString","isUndefined","Spacing","usePowerlinesSafe","TSDoc","props","children","heading","_$createIntrinsic","string","_$createComponent","when","_$memo","filter","Boolean","length","TSDocTag","tag","width","TSDocParams","parameters","normalizeParametersForDoc","each","param","TSDocParam","name","optional","doc","some","p","TSDocTitle","rest","_$mergeProps","TSDocDomain","TSDocAlias","TSDocPermission","TSDocDefaultValue","type","defaultValue","TSDocRemarks","hardline","TSDocLink","TSDocExample","tsx","fenced","language","TSDocReadonly","TSDocInternal","TSDocIgnore","TSDocHidden","TSDocAttributesTags","alias","permission","readonly","internal","ignore","hidden","title","trim","domain","value","a","TSDocParamName","TSDocParamDescription","TSDocReturns","TSDocThrows","TSDocModule","prefix","context","config","framework"],"sources":["../../../src/typescript/components/tsdoc.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport {\n Children,\n childrenArray,\n computed,\n For,\n List,\n Prose,\n Show,\n splitProps\n} from \"@alloy-js/core\";\nimport { JSDocExampleProps, ParameterDescriptor } from \"@alloy-js/typescript\";\nimport { stringifyDefaultValue } from \"@powerlines/deepkit/utilities\";\nimport {\n ReflectionKind,\n ReflectionParameter,\n ReflectionProperty\n} from \"@powerlines/deepkit/vendor/type\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { isUndefined } from \"@stryke/type-checks/is-undefined\";\nimport { Spacing } from \"../../core/components/spacing\";\nimport { usePowerlinesSafe } from \"../../core/contexts/context\";\nimport { ComponentProps } from \"../../types/components\";\n\nexport interface TSDocProps extends ComponentProps {\n heading?: Children;\n}\n\n/**\n * Generates a TypeScript interface for the given reflection class.\n */\nexport function TSDoc(props: TSDocProps) {\n const [{ children, heading }] = splitProps(props, [\"children\", \"heading\"]);\n\n return (\n <>\n /**\n <align string=\" * \">\n <hbr />\n <Show when={!isUndefined(heading)}>{heading}</Show>\n <Show\n when={\n !isUndefined(children) &&\n childrenArray(() => children).filter(Boolean).length > 0\n }>\n <Show when={!isUndefined(heading)}>\n <Spacing />\n </Show>\n <List>{childrenArray(() => children)}</List>\n </Show>\n </align>\n <hbr />\n {`*/`}\n <hbr />\n </>\n );\n}\n\nexport interface TSDocTagProps extends ComponentProps {\n tag: string;\n}\n\n/**\n * Create a TSDoc `@<props.tag>` tag.\n */\nexport function TSDocTag(props: TSDocTagProps) {\n const [{ children, tag }] = splitProps(props, [\"children\", \"tag\"]);\n\n return (\n <>\n {`@${tag} `}\n <Show when={Boolean(children)}>\n <align width={2}>\n <Prose>{children}</Prose>\n </align>\n </Show>\n <sbr />\n </>\n );\n}\n\nexport interface TSDocParamsProps {\n parameters: ParameterDescriptor[] | string[];\n}\n\n/**\n * A component that creates a TSDoc block with `@param` tags for each parameter.\n */\nexport function TSDocParams(props: TSDocParamsProps) {\n const parameters = normalizeParametersForDoc(props.parameters);\n\n return (\n <For each={parameters}>\n {param => (\n <TSDocParam name={param.name} optional={param.optional}>\n {param.doc}\n </TSDocParam>\n )}\n </For>\n );\n}\n\nfunction normalizeParametersForDoc(\n parameters: ParameterDescriptor[] | string[]\n): ParameterDescriptor[] {\n if (parameters.some(p => typeof p === \"string\")) {\n return [];\n }\n\n return parameters as ParameterDescriptor[];\n}\n\n/**\n * Create a TSDoc `@title` tag.\n */\nexport function TSDocTitle(props: ComponentProps) {\n const [{ children }, rest] = splitProps(props, [\"children\"]);\n\n return (\n <TSDocTag {...rest} tag=\"title\">\n {children}\n </TSDocTag>\n );\n}\n\n/**\n * Create a TSDoc `@domain` tag.\n */\nexport function TSDocDomain(props: ComponentProps) {\n const [{ children }, rest] = splitProps(props, [\"children\"]);\n\n return (\n <TSDocTag {...rest} tag=\"domain\">\n {children}\n </TSDocTag>\n );\n}\n\n/**\n * Create a TSDoc `@alias` tag.\n */\nexport function TSDocAlias(props: ComponentProps) {\n const [{ children }, rest] = splitProps(props, [\"children\"]);\n\n return (\n <TSDocTag {...rest} tag=\"alias\">\n {children}\n </TSDocTag>\n );\n}\n\n/**\n * Create a TSDoc `@permission` tag.\n */\nexport function TSDocPermission(props: ComponentProps) {\n const [{ children }, rest] = splitProps(props, [\"children\"]);\n\n return (\n <TSDocTag {...rest} tag=\"permission\">\n {children}\n </TSDocTag>\n );\n}\n\nexport interface TSDocDefaultValueProps extends ComponentProps {\n type: ReflectionKind | ReflectionProperty | ReflectionParameter;\n defaultValue: any;\n}\n\n/**\n * Create a TSDoc `@defaultValue` tag.\n */\nexport function TSDocDefaultValue(props: TSDocDefaultValueProps) {\n const [{ type, defaultValue }] = splitProps(props, [\"type\", \"defaultValue\"]);\n\n return (\n <>\n {\"@defaultValue \"}\n <Show when={!isUndefined(defaultValue)}>\n <align width={2}>\n <Prose>{stringifyDefaultValue(type, defaultValue)}</Prose>\n </align>\n </Show>\n </>\n );\n}\n\n/**\n * Create a TSDoc `@remarks` tag.\n */\nexport function TSDocRemarks(props: ComponentProps) {\n return (\n <>\n {\"@remarks \"}\n <hbr />\n <List hardline={true}>{childrenArray(() => props.children)}</List>\n </>\n );\n}\n\n/**\n * Create a TSDoc `@see` tag.\n */\nexport function TSDocLink(props: ComponentProps) {\n return <TSDocTag {...props} tag=\"see\" />;\n}\n\nexport interface TSDocExampleProps extends JSDocExampleProps {\n /**\n * Whether the file is a TSX file.\n *\n * @defaultValue false\n */\n tsx?: boolean;\n}\n\n/**\n * Create a TSDoc `@example` tag.\n */\nexport function TSDocExample(props: TSDocExampleProps) {\n const [{ tsx, fenced = true, language, children }] = splitProps(props, [\n \"tsx\",\n \"fenced\",\n \"language\",\n \"children\"\n ]);\n\n return (\n <>\n {\"@example \"}\n <hbr />\n <Show when={fenced}>\n ```{language || (tsx ? \"tsx\" : \"ts\")}\n <hbr />\n </Show>\n {children}\n <Show when={fenced}>\n <hbr />\n ```\n </Show>\n </>\n );\n}\n\n/**\n * Create a TSDoc `@readonly` tag.\n */\nexport function TSDocReadonly() {\n return <TSDocTag tag=\"readonly\" />;\n}\n\n/**\n * Create a TSDoc `@internal` tag.\n */\nexport function TSDocInternal() {\n return <TSDocTag tag=\"internal\" />;\n}\n\n/**\n * Create a TSDoc `@ignore` tag.\n */\nexport function TSDocIgnore() {\n return <TSDocTag tag=\"ignore\" />;\n}\n\n/**\n * Create a TSDoc `@hidden` tag.\n */\nexport function TSDocHidden() {\n return <TSDocTag tag=\"hidden\" />;\n}\n\nexport interface TSDocAttributesTagsProps {\n type?: ReflectionKind | ReflectionProperty | ReflectionParameter;\n title?: string;\n alias?: string[];\n permission?: string[];\n domain?: string;\n readonly?: boolean;\n internal?: boolean;\n ignore?: boolean;\n hidden?: boolean;\n defaultValue?: any;\n}\n\n/**\n * Generates a TypeScript interface property for the given reflection class.\n */\nexport function TSDocAttributesTags(props: TSDocAttributesTagsProps) {\n const [\n {\n type,\n alias,\n permission,\n readonly,\n internal,\n ignore,\n hidden,\n defaultValue\n }\n ] = splitProps(props, [\n \"type\",\n \"alias\",\n \"permission\",\n \"readonly\",\n \"internal\",\n \"ignore\",\n \"hidden\",\n \"defaultValue\"\n ]);\n\n const title = computed(() => props.title?.trim() || \"\");\n const domain = computed(() => props.domain?.trim() || \"\");\n\n return (\n <>\n <Show when={isSetString(title.value)}>\n <TSDocTitle>{title.value}</TSDocTitle>\n </Show>\n <Show\n when={\n !isUndefined(alias) &&\n alias.length > 0 &&\n alias.some(a => isSetString(a?.trim()))\n }>\n <For each={alias?.filter(a => isSetString(a?.trim())) ?? []}>\n {alias => <TSDocAlias>{alias}</TSDocAlias>}\n </For>\n </Show>\n <Show when={isSetString(domain.value)}>\n <TSDocDomain>{domain.value}</TSDocDomain>\n </Show>\n <Show\n when={\n !isUndefined(permission) &&\n permission.length > 0 &&\n permission.some(p => isSetString(p?.trim()))\n }>\n <For each={permission?.filter(p => isSetString(p?.trim())) ?? []}>\n {permission => <TSDocPermission>{permission}</TSDocPermission>}\n </For>\n </Show>\n <Show when={readonly === true}>\n <TSDocReadonly />\n </Show>\n <Show when={internal === true}>\n <TSDocInternal />\n </Show>\n <Show when={ignore === true}>\n <TSDocIgnore />\n </Show>\n <Show when={hidden === true}>\n <TSDocHidden />\n </Show>\n <Show when={!isUndefined(type) && !isUndefined(defaultValue)}>\n <TSDocDefaultValue\n type={\n type as ReflectionKind | ReflectionProperty | ReflectionParameter\n }\n defaultValue={defaultValue}\n />\n </Show>\n </>\n );\n}\n\nexport interface TSDocParamProps {\n name: Children;\n children?: Children;\n optional?: boolean;\n defaultValue?: Children;\n}\n\n/**\n * Create a TSDoc parameter set off with `@param`.\n */\nexport function TSDocParam(props: TSDocParamProps) {\n return (\n <>\n {\"@param \"}\n <TSDocParamName\n name={props.name}\n optional={props.optional}\n defaultValue={props.defaultValue}\n />\n <TSDocParamDescription children={props.children} />\n </>\n );\n}\n\ninterface TSDocParamNameProps {\n name: Children;\n optional?: boolean;\n defaultValue?: Children;\n}\n\nfunction TSDocParamName(props: TSDocParamNameProps) {\n return (\n <>\n <Show when={props.optional}>{\"[\"}</Show>\n {props.name}\n <Show when={Boolean(props.defaultValue)}>={props.defaultValue}</Show>\n <Show when={props.optional}>{\"]\"}</Show>\n </>\n );\n}\n\ninterface TSDocParamDescriptionProps {\n children?: Children;\n}\n\nfunction TSDocParamDescription(props: TSDocParamDescriptionProps) {\n return (\n <Show when={Boolean(props.children)}>\n {\" - \"}\n <align width={2}>\n <Prose>{props.children}</Prose>\n </align>\n </Show>\n );\n}\n\n/**\n * Create a TSDoc `@returns` tag.\n */\nexport function TSDocReturns(props: ComponentProps) {\n return <TSDocTag {...props} tag=\"returns\" />;\n}\n\n/**\n * Create a TSDoc `@throws` tag.\n */\nexport function TSDocThrows(props: ComponentProps) {\n return <TSDocTag {...props} tag=\"throws\" />;\n}\n\nexport interface TSDocModuleProps extends ComponentProps {\n /**\n * The prefix for the builtin module name\n *\n * @remarks\n * This value is populated from the Powerlines configuration output builtin prefix by default.\n *\n * @example\n * ```ts\n * /**\n * @module powerlines:my-module\n * \\/\n * ```\n */\n prefix?: string;\n\n /**\n * The name of the module\n *\n * @remarks\n * This will be used in the `@module` tag as well as the import path for the module, e.g. `storm:<name>`.\n *\n * @example\n * ```ts\n * import { MyModule } from \"powerlines:my-module\";\n * ```\n */\n name: Children;\n}\n\n/**\n * Generates a TSDoc `@module` tag for the given module name.\n */\nexport function TSDocModule(props: TSDocModuleProps) {\n const [{ children, name, prefix }] = splitProps(props, [\n \"children\",\n \"name\",\n \"prefix\"\n ]);\n\n const context = usePowerlinesSafe();\n\n return (\n <>\n /**\n <align string=\" * \">\n <hbr />\n <Show when={Boolean(children)}>\n <List hardline={true}>{childrenArray(() => children)}</List>\n <Spacing />\n </Show>\n {\"@module \"}\n {prefix || context?.config?.framework || \"powerlines\"}:{name}\n </align>\n <hbr />\n {` */`}\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiIA;EAAA,gBAAA,OAAA,EAAA,CAAA;EAAA;;;;;SAeA,SAAA,OAAA;OAAA,CAAA,EAAA,UAAA,SAAA,WAAA,OAAA,CAAA,YAAA,MAAA,CAAA;AAAA,QAAA;;;;;;;;;;;;;;;;;;;;;;wBAgCe,KAAA;EAAA;EAAA,WAAA,UAAA;;;;;;;;;;;;;SAc+D,0BAAA;KAKlC,WAAA,MAAA,MAAA,OAAA,MAAA,SAAA,CAAA,QAAA,EAAA;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A,KAAA,CAAA,EAAA,IAAA,CAAA,YAAA,aAAA;;GAAA,IAAA,WAAA;AAAA,WAAA,gBAAA,mBAAA;KAAA;KAAA;KAAA,CAAA;;GAAA,CAAA;EAAA;;;;;SAqCd,WAAA,OAAA;AAAA,QAAA;EAAA;EAAA,gBAAA,gBAAA;GAAA,IAAA,OAAA;AAAA,WAAA,MAAA;;GAAA,IAAA,WAAA;AAAA,WAAA,MAAA;;GAAA,IAAA,eAAA;AAAA,WAAA,MAAA;;GAAA,CAAA;EAAA,uCAAA,EAAA,IAAA,WAAA;AAAA,UAAA,MAAA;KAAA,CAAA;EAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _alloy_js_core10 from "@alloy-js/core";
|
|
2
2
|
import { CommonDeclarationProps, TypeParameterDescriptor } from "@alloy-js/typescript";
|
|
3
3
|
|
|
4
4
|
//#region src/typescript/components/type-declaration.d.ts
|
|
@@ -11,7 +11,7 @@ interface TypeDeclarationProps extends CommonDeclarationProps {
|
|
|
11
11
|
/**
|
|
12
12
|
* Renders a TypeScript type declaration, including its name, optional TSDoc comment, and generic type parameters.
|
|
13
13
|
*/
|
|
14
|
-
declare const TypeDeclaration:
|
|
14
|
+
declare const TypeDeclaration: _alloy_js_core10.Component<TypeDeclarationProps>;
|
|
15
15
|
declare type __ΩTypeDeclarationProps = any[];
|
|
16
16
|
//#endregion
|
|
17
17
|
export { TypeDeclaration, TypeDeclarationProps, __ΩTypeDeclarationProps };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _alloy_js_core9 from "@alloy-js/core";
|
|
2
2
|
import { ScopePropsWithInfo, ScopePropsWithValue } from "@alloy-js/core";
|
|
3
3
|
|
|
4
4
|
//#region src/typescript/contexts/lexical-scope.d.ts
|
|
@@ -8,7 +8,7 @@ type LexicalScopeProps = LexicalScopePropsWithScopeValue | LexicalScopePropsWith
|
|
|
8
8
|
/**
|
|
9
9
|
* A lexical scope for TypeScript, which contains declaration spaces for types and values. Declaration components will create symbols in this scope.
|
|
10
10
|
*/
|
|
11
|
-
declare function LexicalScope(props: LexicalScopeProps):
|
|
11
|
+
declare function LexicalScope(props: LexicalScopeProps): _alloy_js_core9.Children;
|
|
12
12
|
declare type __ΩLexicalScopePropsWithScopeValue = any[];
|
|
13
13
|
declare type __ΩLexicalScopePropsWithScopeInfo = any[];
|
|
14
14
|
declare type __ΩLexicalScopeProps = any[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lexical-scope.d.cts","names":[],"sources":["../../../src/typescript/contexts/lexical-scope.tsx"],"sourcesContent":[],"mappings":";;;;UAqBiB,+BAAA,SAAwC;UACxC,8BAAA,SAAuC,oBADxD;AACiB,KAEL,iBAAA,GACR,+BAHoD,GAIpD,8BAJsE;AAE1E;AAOA;;iBAAgB,YAAA,QAAoB,oBAAiB,
|
|
1
|
+
{"version":3,"file":"lexical-scope.d.cts","names":[],"sources":["../../../src/typescript/contexts/lexical-scope.tsx"],"sourcesContent":[],"mappings":";;;;UAqBiB,+BAAA,SAAwC;UACxC,8BAAA,SAAuC,oBADxD;AACiB,KAEL,iBAAA,GACR,+BAHoD,GAIpD,8BAJsE;AAE1E;AAOA;;iBAAgB,YAAA,QAAoB,oBAAiB,eAAA,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-alloy",
|
|
3
|
-
"version": "0.24.
|
|
3
|
+
"version": "0.24.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A package containing various Alloy framework components and helper utilities.",
|
|
6
6
|
"repository": {
|
|
@@ -754,28 +754,28 @@
|
|
|
754
754
|
"@alloy-js/markdown": "0.23.0-dev.1",
|
|
755
755
|
"@alloy-js/rollup-plugin": "^0.1.0",
|
|
756
756
|
"@alloy-js/typescript": "0.23.0-dev.4",
|
|
757
|
-
"@powerlines/deepkit": "^0.6.
|
|
758
|
-
"@powerlines/plugin-babel": "^0.12.
|
|
757
|
+
"@powerlines/deepkit": "^0.6.90",
|
|
758
|
+
"@powerlines/plugin-babel": "^0.12.317",
|
|
759
759
|
"@storm-software/config-tools": "^1.189.11",
|
|
760
|
-
"@stryke/capnp": "^0.12.
|
|
761
|
-
"@stryke/convert": "^0.6.
|
|
762
|
-
"@stryke/fs": "^0.33.
|
|
763
|
-
"@stryke/helpers": "^0.9.
|
|
764
|
-
"@stryke/json": "^0.
|
|
765
|
-
"@stryke/path": "^0.26.
|
|
766
|
-
"@stryke/string-format": "^0.14.
|
|
767
|
-
"@stryke/type-checks": "^0.5.
|
|
768
|
-
"@stryke/types": "^0.10.
|
|
769
|
-
"@stryke/unique-id": "^0.3.
|
|
760
|
+
"@stryke/capnp": "^0.12.73",
|
|
761
|
+
"@stryke/convert": "^0.6.45",
|
|
762
|
+
"@stryke/fs": "^0.33.48",
|
|
763
|
+
"@stryke/helpers": "^0.9.47",
|
|
764
|
+
"@stryke/json": "^0.13.0",
|
|
765
|
+
"@stryke/path": "^0.26.11",
|
|
766
|
+
"@stryke/string-format": "^0.14.7",
|
|
767
|
+
"@stryke/type-checks": "^0.5.30",
|
|
768
|
+
"@stryke/types": "^0.10.44",
|
|
769
|
+
"@stryke/unique-id": "^0.3.59",
|
|
770
770
|
"defu": "^6.1.4",
|
|
771
|
-
"powerlines": "^0.39.
|
|
771
|
+
"powerlines": "^0.39.19",
|
|
772
772
|
"prettier": "^3.8.1",
|
|
773
773
|
"unctx": "^2.5.0"
|
|
774
774
|
},
|
|
775
775
|
"devDependencies": {
|
|
776
|
-
"@powerlines/plugin-plugin": "^0.12.
|
|
776
|
+
"@powerlines/plugin-plugin": "^0.12.262",
|
|
777
777
|
"@types/node": "^25.3.3"
|
|
778
778
|
},
|
|
779
779
|
"publishConfig": { "access": "public" },
|
|
780
|
-
"gitHead": "
|
|
780
|
+
"gitHead": "3f823906b5b7bd335149bcb369fbff776444b9dc"
|
|
781
781
|
}
|