@doccov/cli 0.8.0 → 0.10.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/cli.js +899 -739
- package/dist/config/index.d.ts +16 -12
- package/dist/config/index.js +25 -15
- package/package.json +4 -3
package/dist/config/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { CheckConfig, DocCovConfig, DocsConfig,
|
|
2
|
+
import { CheckConfig, DocCovConfig, DocsConfig, QualityRulesConfig } from "@doccov/sdk";
|
|
3
3
|
declare const stringList: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
|
|
4
4
|
/**
|
|
5
5
|
* Docs configuration schema
|
|
@@ -8,21 +8,25 @@ declare const docsConfigSchema: z.ZodObject<{
|
|
|
8
8
|
include: z.ZodOptional<typeof stringList>
|
|
9
9
|
exclude: z.ZodOptional<typeof stringList>
|
|
10
10
|
}>;
|
|
11
|
-
/**
|
|
12
|
-
declare const
|
|
11
|
+
/** Quality rule severity levels */
|
|
12
|
+
declare const severitySchema: z.ZodEnum<["error", "warn", "off"]>;
|
|
13
|
+
/** Example validation mode */
|
|
14
|
+
declare const exampleModeSchema: z.ZodEnum<["presence", "typecheck", "run"]>;
|
|
15
|
+
/** Example validation modes - can be single, array, or comma-separated */
|
|
16
|
+
declare const exampleModesSchema: z.ZodUnion<[typeof exampleModeSchema, z.ZodArray<typeof exampleModeSchema>, z.ZodString]>;
|
|
13
17
|
/**
|
|
14
|
-
* Check command configuration schema
|
|
18
|
+
* Check command configuration schema.
|
|
15
19
|
*/
|
|
16
20
|
declare const checkConfigSchema: z.ZodObject<{
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
21
|
+
examples: z.ZodOptional<typeof exampleModesSchema>
|
|
22
|
+
minCoverage: z.ZodOptional<z.ZodNumber>
|
|
23
|
+
maxDrift: z.ZodOptional<z.ZodNumber>
|
|
20
24
|
}>;
|
|
21
25
|
/**
|
|
22
|
-
*
|
|
26
|
+
* Quality rules configuration schema
|
|
23
27
|
*/
|
|
24
|
-
declare const
|
|
25
|
-
rules: z.ZodOptional<z.ZodRecord<z.ZodString, typeof
|
|
28
|
+
declare const qualityConfigSchema: z.ZodObject<{
|
|
29
|
+
rules: z.ZodOptional<z.ZodRecord<z.ZodString, typeof severitySchema>>
|
|
26
30
|
}>;
|
|
27
31
|
declare const docCovConfigSchema: z.ZodObject<{
|
|
28
32
|
include: z.ZodOptional<typeof stringList>
|
|
@@ -30,7 +34,7 @@ declare const docCovConfigSchema: z.ZodObject<{
|
|
|
30
34
|
plugins: z.ZodOptional<z.ZodArray<z.ZodUnknown>>
|
|
31
35
|
docs: z.ZodOptional<typeof docsConfigSchema>
|
|
32
36
|
check: z.ZodOptional<typeof checkConfigSchema>
|
|
33
|
-
|
|
37
|
+
quality: z.ZodOptional<typeof qualityConfigSchema>
|
|
34
38
|
}>;
|
|
35
39
|
type DocCovConfigInput = z.infer<typeof docCovConfigSchema>;
|
|
36
40
|
type NormalizedDocCovConfig = DocCovConfig;
|
|
@@ -40,4 +44,4 @@ interface LoadedDocCovConfig extends NormalizedDocCovConfig {
|
|
|
40
44
|
}
|
|
41
45
|
declare const loadDocCovConfig: (cwd: string) => Promise<LoadedDocCovConfig | null>;
|
|
42
46
|
declare const defineConfig: (config: DocCovConfigInput) => DocCovConfigInput;
|
|
43
|
-
export { loadDocCovConfig, defineConfig, NormalizedDocCovConfig, LoadedDocCovConfig,
|
|
47
|
+
export { loadDocCovConfig, defineConfig, QualityRulesConfig, NormalizedDocCovConfig, LoadedDocCovConfig, DocsConfig, DocCovConfigInput, DOCCOV_CONFIG_FILENAMES, CheckConfig };
|
package/dist/config/index.js
CHANGED
|
@@ -32,14 +32,24 @@ var docsConfigSchema = z.object({
|
|
|
32
32
|
include: stringList.optional(),
|
|
33
33
|
exclude: stringList.optional()
|
|
34
34
|
});
|
|
35
|
-
var
|
|
35
|
+
var severitySchema = z.enum(["error", "warn", "off"]);
|
|
36
|
+
var exampleModeSchema = z.enum([
|
|
37
|
+
"presence",
|
|
38
|
+
"typecheck",
|
|
39
|
+
"run"
|
|
40
|
+
]);
|
|
41
|
+
var exampleModesSchema = z.union([
|
|
42
|
+
exampleModeSchema,
|
|
43
|
+
z.array(exampleModeSchema),
|
|
44
|
+
z.string()
|
|
45
|
+
]);
|
|
36
46
|
var checkConfigSchema = z.object({
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
47
|
+
examples: exampleModesSchema.optional(),
|
|
48
|
+
minCoverage: z.number().min(0).max(100).optional(),
|
|
49
|
+
maxDrift: z.number().min(0).max(100).optional()
|
|
40
50
|
});
|
|
41
|
-
var
|
|
42
|
-
rules: z.record(
|
|
51
|
+
var qualityConfigSchema = z.object({
|
|
52
|
+
rules: z.record(severitySchema).optional()
|
|
43
53
|
});
|
|
44
54
|
var docCovConfigSchema = z.object({
|
|
45
55
|
include: stringList.optional(),
|
|
@@ -47,7 +57,7 @@ var docCovConfigSchema = z.object({
|
|
|
47
57
|
plugins: z.array(z.unknown()).optional(),
|
|
48
58
|
docs: docsConfigSchema.optional(),
|
|
49
59
|
check: checkConfigSchema.optional(),
|
|
50
|
-
|
|
60
|
+
quality: qualityConfigSchema.optional()
|
|
51
61
|
});
|
|
52
62
|
var normalizeList = (value) => {
|
|
53
63
|
if (!value) {
|
|
@@ -74,15 +84,15 @@ var normalizeConfig = (input) => {
|
|
|
74
84
|
let check;
|
|
75
85
|
if (input.check) {
|
|
76
86
|
check = {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
87
|
+
examples: input.check.examples,
|
|
88
|
+
minCoverage: input.check.minCoverage,
|
|
89
|
+
maxDrift: input.check.maxDrift
|
|
80
90
|
};
|
|
81
91
|
}
|
|
82
|
-
let
|
|
83
|
-
if (input.
|
|
84
|
-
|
|
85
|
-
rules: input.
|
|
92
|
+
let quality;
|
|
93
|
+
if (input.quality) {
|
|
94
|
+
quality = {
|
|
95
|
+
rules: input.quality.rules
|
|
86
96
|
};
|
|
87
97
|
}
|
|
88
98
|
return {
|
|
@@ -91,7 +101,7 @@ var normalizeConfig = (input) => {
|
|
|
91
101
|
plugins: input.plugins,
|
|
92
102
|
docs,
|
|
93
103
|
check,
|
|
94
|
-
|
|
104
|
+
quality
|
|
95
105
|
};
|
|
96
106
|
};
|
|
97
107
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@doccov/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "DocCov CLI - Documentation coverage and drift detection for TypeScript",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -48,13 +48,14 @@
|
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@ai-sdk/anthropic": "^1.0.0",
|
|
50
50
|
"@ai-sdk/openai": "^1.0.0",
|
|
51
|
+
"@doccov/sdk": "^0.10.0",
|
|
51
52
|
"@inquirer/prompts": "^7.8.0",
|
|
52
|
-
"@
|
|
53
|
-
"@openpkg-ts/spec": "^0.6.0",
|
|
53
|
+
"@openpkg-ts/spec": "^0.8.0",
|
|
54
54
|
"ai": "^4.0.0",
|
|
55
55
|
"chalk": "^5.4.1",
|
|
56
56
|
"commander": "^14.0.0",
|
|
57
57
|
"glob": "^11.0.0",
|
|
58
|
+
"ora": "^9.0.0",
|
|
58
59
|
"simple-git": "^3.27.0",
|
|
59
60
|
"zod": "^3.25.0"
|
|
60
61
|
},
|