Skip to content

Commit 03ade50

Browse files
committed
fix: handle @link jsdoc comment
1 parent e97c1b9 commit 03ade50

File tree

5 files changed

+12
-24
lines changed

5 files changed

+12
-24
lines changed

packages/analyzer/browser/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/analyzer/custom-elements.json

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,9 @@
1212
"name": "CustomElementSchemaViewerElement",
1313
"members": [
1414
{
15-
"type": {
16-
"text": "boolean"
17-
},
18-
"description": "this is desc",
19-
"name": "src",
2015
"kind": "field",
21-
"privacy": "public"
22-
}
23-
],
24-
"attributes": [
25-
{
2616
"name": "src",
27-
"fieldName": "src"
17+
"description": "Any valid path to load a JSON file that adheres to the custom element manifest schema: https://github.com/webcomponents/custom-elements-manifest/"
2818
}
2919
],
3020
"superclass": {
Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
1-
/**
2-
* @property {boolean} src this is desc
3-
*/
41
@customElement("customelement-schema-viewer")
52
export class CustomElementSchemaViewerElement extends LitElement {
6-
7-
8-
static get properties() {
9-
return {
10-
src: { type: Boolean }
11-
}
12-
}
3+
/**
4+
* Any valid path to load a JSON file that adheres to the custom element manifest schema: {@link https://github.com/webcomponents/custom-elements-manifest/}
5+
*/
6+
src;
137
}

packages/analyzer/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@custom-elements-manifest/analyzer",
3-
"version": "0.3.0",
3+
"version": "0.3.1",
44
"description": "",
55
"license": "MIT",
66
"type": "module",

packages/analyzer/src/features/analyse-phase/creators/handlers.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,11 @@ export function handleModifiers(doc, node) {
3838
export function handleJsDoc(doc, node) {
3939
node?.jsDoc?.forEach(jsDocComment => {
4040
if(jsDocComment?.comment) {
41-
doc.description = jsDocComment.comment;
41+
if(has(jsDocComment?.comment)) {
42+
doc.description = jsDocComment.comment.map(com => `${safe(() => com?.name?.getText()) ?? ''}${com.text}`).join('');
43+
} else {
44+
doc.description = jsDocComment.comment;
45+
}
4246
}
4347

4448
jsDocComment?.tags?.forEach(tag => {

0 commit comments

Comments
 (0)