@openpkg-ts/extract 0.18.3 → 0.19.0
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/bin/tspec.js
CHANGED
|
@@ -680,13 +680,27 @@ function getJSDocComment(node) {
|
|
|
680
680
|
const jsDocTags = ts3.getJSDocTags(node);
|
|
681
681
|
const tags = jsDocTags.map((tag) => {
|
|
682
682
|
const rawText = typeof tag.comment === "string" ? tag.comment : ts3.getTextOfJSDocComment(tag.comment) ?? "";
|
|
683
|
-
let text = rawText;
|
|
684
683
|
if (tag.tagName.text === "param") {
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
684
|
+
const paramTag = tag;
|
|
685
|
+
const paramName = paramTag.name?.getText() ?? "";
|
|
686
|
+
const description2 = stripParamSeparator(rawText);
|
|
687
|
+
const text = description2 ? `${paramName} - ${description2}` : paramName;
|
|
688
|
+
const typeExpr = paramTag.typeExpression;
|
|
689
|
+
const type = typeExpr ? typeExpr.type.getText() : undefined;
|
|
690
|
+
const param = { name: paramName };
|
|
691
|
+
if (type)
|
|
692
|
+
param.type = type;
|
|
693
|
+
if (description2)
|
|
694
|
+
param.description = description2;
|
|
695
|
+
if (paramTag.isBracketed)
|
|
696
|
+
param.optional = true;
|
|
697
|
+
return { name: tag.tagName.text, text, param };
|
|
698
|
+
}
|
|
699
|
+
if (tag.tagName.text === "typeParam") {
|
|
700
|
+
const text = stripTypeParamSeparator(rawText) ?? "";
|
|
701
|
+
return { name: tag.tagName.text, text };
|
|
702
|
+
}
|
|
703
|
+
return { name: tag.tagName.text, text: rawText };
|
|
690
704
|
});
|
|
691
705
|
const jsDocComments = node.jsDoc;
|
|
692
706
|
let description;
|
package/dist/src/index.js
CHANGED
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
serializeTypeAlias,
|
|
27
27
|
serializeVariable,
|
|
28
28
|
withDescription
|
|
29
|
-
} from "../shared/chunk-
|
|
29
|
+
} from "../shared/chunk-rgx6dspw.js";
|
|
30
30
|
// src/schema/registry.ts
|
|
31
31
|
function isTypeReference(type) {
|
|
32
32
|
return !!(type.flags & 524288 && type.objectFlags && type.objectFlags & 4);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openpkg-ts/extract",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.0",
|
|
4
4
|
"description": "TypeScript export extraction to OpenPkg spec",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"openpkg",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"format": "biome format --write src/"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@openpkg-ts/spec": "^0.
|
|
43
|
+
"@openpkg-ts/spec": "^0.19.0",
|
|
44
44
|
"chalk": "^5.4.1",
|
|
45
45
|
"commander": "^12.0.0",
|
|
46
46
|
"tree-sitter-wasms": "^0.1.13",
|