@travetto/transformer 8.0.0-alpha.10 → 8.0.0-alpha.11
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/package.json +2 -2
- package/src/resolver/service.ts +1 -1
- package/src/resolver/types.ts +5 -1
- package/src/types/shared.ts +1 -0
- package/src/util/doc.ts +5 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/transformer",
|
|
3
|
-
"version": "8.0.0-alpha.
|
|
3
|
+
"version": "8.0.0-alpha.11",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Functionality for AST transformations, with transformer registration, and general utils",
|
|
6
6
|
"keywords": [
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"directory": "module/transformer"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@travetto/manifest": "^8.0.0-alpha.
|
|
28
|
+
"@travetto/manifest": "^8.0.0-alpha.8",
|
|
29
29
|
"tslib": "^2.8.1",
|
|
30
30
|
"typescript": "^6.0.3"
|
|
31
31
|
},
|
package/src/resolver/service.ts
CHANGED
|
@@ -148,7 +148,7 @@ export class SimpleResolver implements TransformResolver {
|
|
|
148
148
|
result.templateTypeName = context?.templateTypeName;
|
|
149
149
|
|
|
150
150
|
try {
|
|
151
|
-
result.
|
|
151
|
+
result.description = DocUtil.describeDocs(type).description;
|
|
152
152
|
} catch { }
|
|
153
153
|
|
|
154
154
|
if ('tsTypeArguments' in result) {
|
package/src/resolver/types.ts
CHANGED
package/src/types/shared.ts
CHANGED
package/src/util/doc.ts
CHANGED
|
@@ -32,15 +32,17 @@ export class DocUtil {
|
|
|
32
32
|
const out: DeclDocumentation = {
|
|
33
33
|
description: undefined,
|
|
34
34
|
return: undefined,
|
|
35
|
+
examples: undefined,
|
|
35
36
|
params: []
|
|
36
37
|
};
|
|
37
38
|
|
|
38
39
|
if (toDescribe) {
|
|
39
|
-
const tags = ts.getJSDocTags(toDescribe);
|
|
40
40
|
while (!this.hasJSDoc(toDescribe) && CoreUtil.hasOriginal(toDescribe)) {
|
|
41
41
|
toDescribe = transformCast<ts.Declaration>(toDescribe.original);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
const tags = ts.getJSDocTags(toDescribe);
|
|
45
|
+
|
|
44
46
|
const docs = this.hasJSDoc(toDescribe) ? toDescribe.jsDoc : undefined;
|
|
45
47
|
|
|
46
48
|
if (docs) {
|
|
@@ -59,6 +61,8 @@ export class DocUtil {
|
|
|
59
61
|
name: tag.name && tag.name.getText(),
|
|
60
62
|
description: this.getDocComment(tag, '')!
|
|
61
63
|
});
|
|
64
|
+
} else if (tag.tagName.getText() === 'example') {
|
|
65
|
+
(out.examples ??= []).push(this.getDocComment(tag, '')!);
|
|
62
66
|
}
|
|
63
67
|
}
|
|
64
68
|
}
|