@doccov/spec 0.26.0 → 0.27.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.
Files changed (2) hide show
  1. package/dist/index.d.ts +68 -8
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -29,7 +29,47 @@ type ExampleAnalysis = {
29
29
  runtimeDrifts?: ExampleRuntimeDrift[];
30
30
  };
31
31
  type MissingDocRule = "description" | "params" | "returns" | "examples" | "throws";
32
- type DocCovSpecVersion = "0.1.0";
32
+ /**
33
+ * Unified documentation health score combining completeness and accuracy.
34
+ */
35
+ type DocumentationHealth = {
36
+ /** Overall health score (0-100), weighted combination of completeness + accuracy */
37
+ score: number;
38
+ /** Completeness (coverage) metrics */
39
+ completeness: {
40
+ /** Completeness score (0-100) */
41
+ score: number;
42
+ /** Number of documented exports */
43
+ documented: number;
44
+ /** Total exports analyzed */
45
+ total: number;
46
+ /** Missing docs by rule */
47
+ missing: Record<MissingDocRule, number>;
48
+ };
49
+ /** Accuracy (drift) metrics */
50
+ accuracy: {
51
+ /** Accuracy score (0-100) - penalized by drift issues */
52
+ score: number;
53
+ /** Total drift issues found */
54
+ issues: number;
55
+ /** Issues that can be auto-fixed */
56
+ fixable: number;
57
+ /** Issues by category */
58
+ byCategory: Record<DriftCategory, number>;
59
+ };
60
+ /** Example validation metrics (if run) */
61
+ examples?: {
62
+ /** Example score (0-100) */
63
+ score: number;
64
+ /** Examples that passed validation */
65
+ passed: number;
66
+ /** Examples that failed validation */
67
+ failed: number;
68
+ /** Total examples analyzed */
69
+ total: number;
70
+ };
71
+ };
72
+ type DocCovSpecVersion = "0.1.0" | "1.0.0";
33
73
  type DocCovSpec = {
34
74
  $schema?: string;
35
75
  doccov: DocCovSpecVersion;
@@ -49,21 +89,39 @@ type DocCovSpec = {
49
89
  apiSurface?: ApiSurfaceResult;
50
90
  };
51
91
  type DocCovSummary = {
52
- /** Overall coverage score (0-100) */
92
+ /**
93
+ * Overall coverage score (0-100)
94
+ * @deprecated Use `health.completeness.score` instead. Will be removed in next major.
95
+ */
53
96
  score: number;
54
- /** Total exports analyzed */
97
+ /**
98
+ * Total exports analyzed
99
+ * @deprecated Use `health.completeness.total` instead. Will be removed in next major.
100
+ */
55
101
  totalExports: number;
56
- /** Exports with complete documentation */
102
+ /**
103
+ * Exports with complete documentation
104
+ * @deprecated Use `health.completeness.documented` instead. Will be removed in next major.
105
+ */
57
106
  documentedExports: number;
58
- /** Missing documentation by rule */
107
+ /**
108
+ * Missing documentation by rule
109
+ * @deprecated Use `health.completeness.missing` instead. Will be removed in next major.
110
+ */
59
111
  missingByRule: Record<MissingDocRule, number>;
60
- /** Drift summary */
112
+ /**
113
+ * Drift summary
114
+ * @deprecated Use `health.accuracy` instead. Will be removed in next major.
115
+ */
61
116
  drift: {
62
117
  total: number;
63
118
  fixable: number;
64
119
  byCategory: Record<DriftCategory, number>;
65
120
  };
66
- /** Example validation summary (if run) */
121
+ /**
122
+ * Example validation summary (if run)
123
+ * @deprecated Use `health.examples` instead. Will be removed in next major.
124
+ */
67
125
  examples?: {
68
126
  total: number;
69
127
  withExamples: number;
@@ -72,6 +130,8 @@ type DocCovSummary = {
72
130
  runtimePassed?: number;
73
131
  runtimeFailed?: number;
74
132
  };
133
+ /** Unified documentation health metrics */
134
+ health?: DocumentationHealth;
75
135
  };
76
136
  type ExportAnalysis = {
77
137
  /** Coverage score for this (0-100) */
@@ -134,4 +194,4 @@ declare function validateDocCovSpec(spec: unknown, version?: DocCovSchemaVersion
134
194
  declare function assertDocCovSpec(spec: unknown, version?: DocCovSchemaVersion): asserts spec is DocCovSpec;
135
195
  declare function getDocCovValidationErrors(spec: unknown, version?: DocCovSchemaVersion): DocCovSpecError[];
136
196
  declare function getAvailableDocCovVersions(): string[];
137
- export { validateDocCovSpec, getDocCovValidationErrors, getAvailableDocCovVersions, assertDocCovSpec, TypeReferenceLocation, SCHEMA_VERSION, SCHEMA_URL, MissingDocRule, LATEST_VERSION, ForgottenExport, ExportAnalysis, ExampleTypecheckError, ExampleRuntimeDrift, ExampleAnalysis, DriftType, DriftCategory, DocCovSummary, DocCovSpecVersion, DocCovSpecError, DocCovSpec, DocCovSchemaVersion, DocCovDrift, DRIFT_CATEGORY_LABELS, DRIFT_CATEGORY_DESCRIPTIONS, DRIFT_CATEGORIES, ApiSurfaceResult };
197
+ export { validateDocCovSpec, getDocCovValidationErrors, getAvailableDocCovVersions, assertDocCovSpec, TypeReferenceLocation, SCHEMA_VERSION, SCHEMA_URL, MissingDocRule, LATEST_VERSION, ForgottenExport, ExportAnalysis, ExampleTypecheckError, ExampleRuntimeDrift, ExampleAnalysis, DriftType, DriftCategory, DocumentationHealth, DocCovSummary, DocCovSpecVersion, DocCovSpecError, DocCovSpec, DocCovSchemaVersion, DocCovDrift, DRIFT_CATEGORY_LABELS, DRIFT_CATEGORY_DESCRIPTIONS, DRIFT_CATEGORIES, ApiSurfaceResult };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@doccov/spec",
3
- "version": "0.26.0",
3
+ "version": "0.27.0",
4
4
  "description": "DocCov specification schema, types, and validation",
5
5
  "keywords": [
6
6
  "doccov",