@doccov/cli 0.17.0 → 0.18.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.
@@ -1,12 +1,12 @@
1
1
  import { z } from "zod";
2
- import { CheckConfig, DocCovConfig, DocsConfig, QualityRulesConfig } from "@doccov/sdk";
2
+ import { CheckConfig, DocCovConfig, DocsConfig, PolicyConfig, 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
6
6
  */
7
7
  declare const docsConfigSchema: z.ZodObject<{
8
- include: z.ZodOptional<typeof stringList>
9
- exclude: z.ZodOptional<typeof stringList>
8
+ include: z.ZodOptional<typeof stringList>;
9
+ exclude: z.ZodOptional<typeof stringList>;
10
10
  }>;
11
11
  /** Quality rule severity levels */
12
12
  declare const severitySchema: z.ZodEnum<["error", "warn", "off"]>;
@@ -18,23 +18,33 @@ declare const exampleModesSchema: z.ZodUnion<[typeof exampleModeSchema, z.ZodArr
18
18
  * Check command configuration schema.
19
19
  */
20
20
  declare const checkConfigSchema: z.ZodObject<{
21
- examples: z.ZodOptional<typeof exampleModesSchema>
22
- minCoverage: z.ZodOptional<z.ZodNumber>
23
- maxDrift: z.ZodOptional<z.ZodNumber>
21
+ examples: z.ZodOptional<typeof exampleModesSchema>;
22
+ minCoverage: z.ZodOptional<z.ZodNumber>;
23
+ maxDrift: z.ZodOptional<z.ZodNumber>;
24
24
  }>;
25
25
  /**
26
26
  * Quality rules configuration schema
27
27
  */
28
28
  declare const qualityConfigSchema: z.ZodObject<{
29
- rules: z.ZodOptional<z.ZodRecord<z.ZodString, typeof severitySchema>>
29
+ rules: z.ZodOptional<z.ZodRecord<z.ZodString, typeof severitySchema>>;
30
+ }>;
31
+ /**
32
+ * Per-path policy configuration schema
33
+ */
34
+ declare const policyConfigSchema: z.ZodObject<{
35
+ path: z.ZodString;
36
+ minCoverage: z.ZodOptional<z.ZodNumber>;
37
+ maxDrift: z.ZodOptional<z.ZodNumber>;
38
+ requireExamples: z.ZodOptional<z.ZodBoolean>;
30
39
  }>;
31
40
  declare const docCovConfigSchema: z.ZodObject<{
32
- include: z.ZodOptional<typeof stringList>
33
- exclude: z.ZodOptional<typeof stringList>
34
- plugins: z.ZodOptional<z.ZodArray<z.ZodUnknown>>
35
- docs: z.ZodOptional<typeof docsConfigSchema>
36
- check: z.ZodOptional<typeof checkConfigSchema>
37
- quality: z.ZodOptional<typeof qualityConfigSchema>
41
+ include: z.ZodOptional<typeof stringList>;
42
+ exclude: z.ZodOptional<typeof stringList>;
43
+ plugins: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
44
+ docs: z.ZodOptional<typeof docsConfigSchema>;
45
+ check: z.ZodOptional<typeof checkConfigSchema>;
46
+ quality: z.ZodOptional<typeof qualityConfigSchema>;
47
+ policies: z.ZodOptional<z.ZodArray<typeof policyConfigSchema>>;
38
48
  }>;
39
49
  type DocCovConfigInput = z.infer<typeof docCovConfigSchema>;
40
50
  type NormalizedDocCovConfig = DocCovConfig;
@@ -44,4 +54,4 @@ interface LoadedDocCovConfig extends NormalizedDocCovConfig {
44
54
  }
45
55
  declare const loadDocCovConfig: (cwd: string) => Promise<LoadedDocCovConfig | null>;
46
56
  declare const defineConfig: (config: DocCovConfigInput) => DocCovConfigInput;
47
- export { loadDocCovConfig, defineConfig, QualityRulesConfig, NormalizedDocCovConfig, LoadedDocCovConfig, DocsConfig, DocCovConfigInput, DOCCOV_CONFIG_FILENAMES, CheckConfig };
57
+ export { loadDocCovConfig, defineConfig, QualityRulesConfig, PolicyConfig, NormalizedDocCovConfig, LoadedDocCovConfig, DocsConfig, DocCovConfigInput, DOCCOV_CONFIG_FILENAMES, CheckConfig };
@@ -33,13 +33,20 @@ var checkConfigSchema = z.object({
33
33
  var qualityConfigSchema = z.object({
34
34
  rules: z.record(severitySchema).optional()
35
35
  });
36
+ var policyConfigSchema = z.object({
37
+ path: z.string().min(1),
38
+ minCoverage: z.number().min(0).max(100).optional(),
39
+ maxDrift: z.number().min(0).max(100).optional(),
40
+ requireExamples: z.boolean().optional()
41
+ });
36
42
  var docCovConfigSchema = z.object({
37
43
  include: stringList.optional(),
38
44
  exclude: stringList.optional(),
39
45
  plugins: z.array(z.unknown()).optional(),
40
46
  docs: docsConfigSchema.optional(),
41
47
  check: checkConfigSchema.optional(),
42
- quality: qualityConfigSchema.optional()
48
+ quality: qualityConfigSchema.optional(),
49
+ policies: z.array(policyConfigSchema).optional()
43
50
  });
44
51
  var normalizeList = (value) => {
45
52
  if (!value) {
@@ -77,13 +84,15 @@ var normalizeConfig = (input) => {
77
84
  rules: input.quality.rules
78
85
  };
79
86
  }
87
+ const policies = input.policies;
80
88
  return {
81
89
  include,
82
90
  exclude,
83
91
  plugins: input.plugins,
84
92
  docs,
85
93
  check,
86
- quality
94
+ quality,
95
+ policies
87
96
  };
88
97
  };
89
98
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@doccov/cli",
3
- "version": "0.17.0",
3
+ "version": "0.18.0",
4
4
  "description": "DocCov CLI - Documentation coverage and drift detection for TypeScript",
5
5
  "keywords": [
6
6
  "typescript",
@@ -48,9 +48,9 @@
48
48
  "dependencies": {
49
49
  "@ai-sdk/anthropic": "^1.0.0",
50
50
  "@ai-sdk/openai": "^1.0.0",
51
- "@doccov/sdk": "^0.15.1",
51
+ "@doccov/sdk": "^0.18.0",
52
52
  "@inquirer/prompts": "^7.8.0",
53
- "@openpkg-ts/spec": "^0.9.0",
53
+ "@openpkg-ts/spec": "^0.10.0",
54
54
  "ai": "^4.0.0",
55
55
  "chalk": "^5.4.1",
56
56
  "commander": "^14.0.0",
package/dist/cli.d.ts DELETED
File without changes