@doccov/sdk 0.27.0 → 0.27.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/analysis/index.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1498,10 +1498,18 @@ interface JSDocTag {
|
|
|
1498
1498
|
/**
|
|
1499
1499
|
* A patchable representation of a JSDoc comment
|
|
1500
1500
|
*/
|
|
1501
|
+
/**
|
|
1502
|
+
* Represents a @throws tag in a JSDoc patch
|
|
1503
|
+
*/
|
|
1504
|
+
interface JSDocThrows {
|
|
1505
|
+
type?: string;
|
|
1506
|
+
description?: string;
|
|
1507
|
+
}
|
|
1501
1508
|
interface JSDocPatch {
|
|
1502
1509
|
description?: string;
|
|
1503
1510
|
params?: JSDocParam[];
|
|
1504
1511
|
returns?: JSDocReturn;
|
|
1512
|
+
throws?: JSDocThrows[];
|
|
1505
1513
|
examples?: string[];
|
|
1506
1514
|
deprecated?: string | false;
|
|
1507
1515
|
async?: boolean;
|
|
@@ -2679,7 +2687,7 @@ interface SpecSummary {
|
|
|
2679
2687
|
* ```
|
|
2680
2688
|
*/
|
|
2681
2689
|
declare function extractSpecSummary(openpkg: OpenPkg8, doccov: DocCovSpec4): SpecSummary;
|
|
2682
|
-
import { OpenPkg as
|
|
2690
|
+
import { OpenPkg as OpenPkg_evpdpkbkmv } from "@openpkg-ts/spec";
|
|
2683
2691
|
/**
|
|
2684
2692
|
* Build Plan types for AI-powered repository scanning.
|
|
2685
2693
|
*/
|
|
@@ -2776,7 +2784,7 @@ interface BuildPlanExecutionResult {
|
|
|
2776
2784
|
/** Whether all required steps succeeded */
|
|
2777
2785
|
success: boolean;
|
|
2778
2786
|
/** Generated OpenPkg spec (if successful) */
|
|
2779
|
-
spec?:
|
|
2787
|
+
spec?: OpenPkg_evpdpkbkmv;
|
|
2780
2788
|
/** Results for each step */
|
|
2781
2789
|
stepResults: BuildPlanStepResult[];
|
|
2782
2790
|
/** Total execution time in milliseconds */
|
package/dist/index.js
CHANGED
|
@@ -546,6 +546,21 @@ function parseJSDocToPatch(jsDocText) {
|
|
|
546
546
|
patch.deprecated = content || "Deprecated";
|
|
547
547
|
break;
|
|
548
548
|
}
|
|
549
|
+
case "throws":
|
|
550
|
+
case "throw": {
|
|
551
|
+
if (!patch.throws)
|
|
552
|
+
patch.throws = [];
|
|
553
|
+
const throwsMatch = content.match(/^(?:\{@?link\s+([^}]+)\}|\{([^}]+)\})?\s*(.*)$/s);
|
|
554
|
+
if (throwsMatch) {
|
|
555
|
+
patch.throws.push({
|
|
556
|
+
type: (throwsMatch[1] || throwsMatch[2])?.trim(),
|
|
557
|
+
description: throwsMatch[3]?.trim()
|
|
558
|
+
});
|
|
559
|
+
} else {
|
|
560
|
+
patch.throws.push({ description: content.trim() });
|
|
561
|
+
}
|
|
562
|
+
break;
|
|
563
|
+
}
|
|
549
564
|
case "async": {
|
|
550
565
|
patch.async = true;
|
|
551
566
|
break;
|
|
@@ -620,6 +635,9 @@ function applyPatchToJSDoc(existing, updates) {
|
|
|
620
635
|
...updates.returns
|
|
621
636
|
};
|
|
622
637
|
}
|
|
638
|
+
if (updates.throws !== undefined) {
|
|
639
|
+
result.throws = updates.throws;
|
|
640
|
+
}
|
|
623
641
|
if (updates.examples !== undefined) {
|
|
624
642
|
result.examples = updates.examples;
|
|
625
643
|
}
|
|
@@ -643,7 +661,7 @@ function serializeJSDoc(patch, indent = "") {
|
|
|
643
661
|
lines.push(line);
|
|
644
662
|
}
|
|
645
663
|
}
|
|
646
|
-
const hasTags = patch.params?.length || patch.returns || patch.examples?.length || patch.deprecated || patch.async || patch.type || patch.typeParams?.length || patch.otherTags?.length;
|
|
664
|
+
const hasTags = patch.params?.length || patch.returns || patch.throws?.length || patch.examples?.length || patch.deprecated || patch.async || patch.type || patch.typeParams?.length || patch.otherTags?.length;
|
|
647
665
|
if (patch.description && hasTags) {
|
|
648
666
|
lines.push("");
|
|
649
667
|
}
|
|
@@ -689,6 +707,18 @@ function serializeJSDoc(patch, indent = "") {
|
|
|
689
707
|
}
|
|
690
708
|
lines.push(tagLine);
|
|
691
709
|
}
|
|
710
|
+
if (patch.throws) {
|
|
711
|
+
for (const t of patch.throws) {
|
|
712
|
+
let tagLine = "@throws";
|
|
713
|
+
if (t.type) {
|
|
714
|
+
tagLine += ` {${t.type}}`;
|
|
715
|
+
}
|
|
716
|
+
if (t.description) {
|
|
717
|
+
tagLine += ` ${t.description}`;
|
|
718
|
+
}
|
|
719
|
+
lines.push(tagLine);
|
|
720
|
+
}
|
|
721
|
+
}
|
|
692
722
|
if (patch.deprecated && typeof patch.deprecated === "string") {
|
|
693
723
|
lines.push(`@deprecated ${patch.deprecated}`);
|
|
694
724
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@doccov/sdk",
|
|
3
|
-
"version": "0.27.
|
|
3
|
+
"version": "0.27.2",
|
|
4
4
|
"description": "DocCov SDK - Documentation coverage and drift detection for TypeScript",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
],
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@doccov/spec": "^0.27.0",
|
|
51
|
-
"@openpkg-ts/extract": "^0.16.
|
|
51
|
+
"@openpkg-ts/extract": "^0.16.1",
|
|
52
52
|
"@openpkg-ts/spec": "^0.12.0",
|
|
53
53
|
"@vercel/sandbox": "^1.0.3",
|
|
54
54
|
"mdast": "^3.0.0",
|