@doccov/sdk 0.30.0 → 0.30.3
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
|
@@ -2632,7 +2632,7 @@ interface SpecSummary {
|
|
|
2632
2632
|
* ```
|
|
2633
2633
|
*/
|
|
2634
2634
|
declare function extractSpecSummary(openpkg: OpenPkg8, doccov: DocCovSpec4): SpecSummary;
|
|
2635
|
-
import { OpenPkg as
|
|
2635
|
+
import { OpenPkg as OpenPkg_tlzxdiynhy } from "@openpkg-ts/spec";
|
|
2636
2636
|
/**
|
|
2637
2637
|
* Build Plan types for AI-powered repository scanning.
|
|
2638
2638
|
*/
|
|
@@ -2729,7 +2729,7 @@ interface BuildPlanExecutionResult {
|
|
|
2729
2729
|
/** Whether all required steps succeeded */
|
|
2730
2730
|
success: boolean;
|
|
2731
2731
|
/** Generated OpenPkg spec (if successful) */
|
|
2732
|
-
spec?:
|
|
2732
|
+
spec?: OpenPkg_tlzxdiynhy;
|
|
2733
2733
|
/** Results for each step */
|
|
2734
2734
|
stepResults: BuildPlanStepResult[];
|
|
2735
2735
|
/** Total execution time in milliseconds */
|
package/dist/index.js
CHANGED
|
@@ -1121,47 +1121,16 @@ var BUILTIN_GLOBALS = new Set([
|
|
|
1121
1121
|
]);
|
|
1122
1122
|
|
|
1123
1123
|
// src/analysis/drift/utils.ts
|
|
1124
|
-
function extractParamFromTag(
|
|
1125
|
-
|
|
1126
|
-
if (!trimmed) {
|
|
1127
|
-
return;
|
|
1128
|
-
}
|
|
1129
|
-
const match = trimmed.match(/^(?:\{([^}]+)\}\s+)?(\S+)(?:\s+-\s+)?/);
|
|
1130
|
-
if (!match) {
|
|
1131
|
-
return;
|
|
1132
|
-
}
|
|
1133
|
-
const [, type, rawName] = match;
|
|
1134
|
-
const isOptional = Boolean(rawName?.startsWith("[") && rawName?.endsWith("]"));
|
|
1135
|
-
const name = normalizeParamName(rawName);
|
|
1136
|
-
if (!name) {
|
|
1124
|
+
function extractParamFromTag(tag) {
|
|
1125
|
+
if (!tag.param) {
|
|
1137
1126
|
return;
|
|
1138
1127
|
}
|
|
1139
1128
|
return {
|
|
1140
|
-
name,
|
|
1141
|
-
type: type
|
|
1142
|
-
isOptional
|
|
1129
|
+
name: tag.param.name,
|
|
1130
|
+
type: tag.param.type,
|
|
1131
|
+
isOptional: tag.param.optional
|
|
1143
1132
|
};
|
|
1144
1133
|
}
|
|
1145
|
-
function normalizeParamName(raw) {
|
|
1146
|
-
if (!raw) {
|
|
1147
|
-
return;
|
|
1148
|
-
}
|
|
1149
|
-
let name = raw.trim();
|
|
1150
|
-
if (!name) {
|
|
1151
|
-
return;
|
|
1152
|
-
}
|
|
1153
|
-
if (name.startsWith("[") && name.endsWith("]")) {
|
|
1154
|
-
name = name.slice(1, -1);
|
|
1155
|
-
}
|
|
1156
|
-
const equalsIndex = name.indexOf("=");
|
|
1157
|
-
if (equalsIndex >= 0) {
|
|
1158
|
-
name = name.slice(0, equalsIndex);
|
|
1159
|
-
}
|
|
1160
|
-
if (name.endsWith(",")) {
|
|
1161
|
-
name = name.slice(0, -1);
|
|
1162
|
-
}
|
|
1163
|
-
return name;
|
|
1164
|
-
}
|
|
1165
1134
|
function extractReturnTypeFromTag(text) {
|
|
1166
1135
|
const trimmed = text.trim();
|
|
1167
1136
|
if (!trimmed) {
|
|
@@ -1640,7 +1609,7 @@ function detectParamDrift(entry) {
|
|
|
1640
1609
|
if (actualParamNames.size === 0) {
|
|
1641
1610
|
return drifts;
|
|
1642
1611
|
}
|
|
1643
|
-
const documentedParamNames = (entry.tags ?? []).filter((tag) => tag.name === "param"
|
|
1612
|
+
const documentedParamNames = (entry.tags ?? []).filter((tag) => tag.name === "param").map((tag) => extractParamFromTag(tag)?.name).filter((name) => Boolean(name));
|
|
1644
1613
|
if (documentedParamNames.length === 0) {
|
|
1645
1614
|
return drifts;
|
|
1646
1615
|
}
|
|
@@ -1712,7 +1681,7 @@ function detectOptionalityDrift(entry) {
|
|
|
1712
1681
|
if (actualOptionality.size === 0) {
|
|
1713
1682
|
return [];
|
|
1714
1683
|
}
|
|
1715
|
-
const documentedParams = (entry.tags ?? []).filter((tag) => tag.name === "param"
|
|
1684
|
+
const documentedParams = (entry.tags ?? []).filter((tag) => tag.name === "param").map((tag) => extractParamFromTag(tag)).filter((parsed) => Boolean(parsed?.name));
|
|
1716
1685
|
if (documentedParams.length === 0) {
|
|
1717
1686
|
return [];
|
|
1718
1687
|
}
|
|
@@ -1742,7 +1711,7 @@ function detectParamTypeDrift(entry) {
|
|
|
1742
1711
|
if (signatures.length === 0) {
|
|
1743
1712
|
return [];
|
|
1744
1713
|
}
|
|
1745
|
-
const documentedParams = (entry.tags ?? []).filter((tag) => tag.name === "param"
|
|
1714
|
+
const documentedParams = (entry.tags ?? []).filter((tag) => tag.name === "param").map((tag) => extractParamFromTag(tag)).filter((parsed) => Boolean(parsed?.name) && Boolean(parsed?.type));
|
|
1746
1715
|
if (documentedParams.length === 0) {
|
|
1747
1716
|
return [];
|
|
1748
1717
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@doccov/sdk",
|
|
3
|
-
"version": "0.30.
|
|
3
|
+
"version": "0.30.3",
|
|
4
4
|
"description": "DocCov SDK - Documentation coverage and drift detection for TypeScript",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
],
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@doccov/spec": "^0.27.0",
|
|
51
|
-
"@openpkg-ts/extract": "^0.
|
|
52
|
-
"@openpkg-ts/spec": "^0.
|
|
51
|
+
"@openpkg-ts/extract": "^0.23.0",
|
|
52
|
+
"@openpkg-ts/spec": "^0.23.0",
|
|
53
53
|
"@vercel/sandbox": "^1.0.3",
|
|
54
54
|
"mdast": "^3.0.0",
|
|
55
55
|
"minimatch": "^10.1.1",
|