@doccov/cli 0.27.0 → 0.28.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,49 +1,9 @@
1
- import { z } from "zod";
2
- import { CheckConfig, DocCovConfig, DocsConfig } from "@doccov/sdk";
3
- declare const stringList: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
4
- /**
5
- * Docs configuration schema
6
- */
7
- declare const docsConfigSchema: z.ZodObject<{
8
- include: z.ZodOptional<typeof stringList>;
9
- exclude: z.ZodOptional<typeof stringList>;
10
- }>;
11
- /** Example validation mode */
12
- declare const exampleModeSchema: z.ZodEnum<["presence", "typecheck", "run"]>;
13
- /** Example validation modes - can be single, array, or comma-separated */
14
- declare const exampleModesSchema: z.ZodUnion<[typeof exampleModeSchema, z.ZodArray<typeof exampleModeSchema>, z.ZodString]>;
15
- /**
16
- * API surface configuration schema.
17
- */
18
- declare const apiSurfaceConfigSchema: z.ZodObject<{
19
- minCompleteness: z.ZodOptional<z.ZodNumber>;
20
- warnBelow: z.ZodOptional<z.ZodNumber>;
21
- ignore: z.ZodOptional<z.ZodArray<z.ZodString>>;
22
- }>;
23
- /**
24
- * Check command configuration schema.
25
- */
26
- declare const checkConfigSchema: z.ZodObject<{
27
- examples: z.ZodOptional<typeof exampleModesSchema>;
28
- minHealth: z.ZodOptional<z.ZodNumber>;
29
- minCoverage: z.ZodOptional<z.ZodNumber>;
30
- maxDrift: z.ZodOptional<z.ZodNumber>;
31
- minApiSurface: z.ZodOptional<z.ZodNumber>;
32
- apiSurface: z.ZodOptional<typeof apiSurfaceConfigSchema>;
33
- }>;
34
- declare const docCovConfigSchema: z.ZodObject<{
35
- include: z.ZodOptional<typeof stringList>;
36
- exclude: z.ZodOptional<typeof stringList>;
37
- plugins: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
38
- docs: z.ZodOptional<typeof docsConfigSchema>;
39
- check: z.ZodOptional<typeof checkConfigSchema>;
40
- }>;
41
- type DocCovConfigInput = z.infer<typeof docCovConfigSchema>;
42
- type NormalizedDocCovConfig = DocCovConfig;
1
+ import { CheckConfig, DocCovConfig as DocCovConfig2, DocCovConfigInput, DocsConfig } from "@doccov/sdk";
2
+ import { DocCovConfig } from "@doccov/sdk";
43
3
  declare const DOCCOV_CONFIG_FILENAMES: readonly ["doccov.config.ts", "doccov.config.mts", "doccov.config.js", "doccov.config.mjs"];
44
- interface LoadedDocCovConfig extends NormalizedDocCovConfig {
4
+ interface LoadedDocCovConfig extends DocCovConfig {
45
5
  filePath: string;
46
6
  }
47
7
  declare const loadDocCovConfig: (cwd: string) => Promise<LoadedDocCovConfig | null>;
48
8
  declare const defineConfig: (config: DocCovConfigInput) => DocCovConfigInput;
49
- export { loadDocCovConfig, defineConfig, NormalizedDocCovConfig, LoadedDocCovConfig, DocsConfig, DocCovConfigInput, DOCCOV_CONFIG_FILENAMES, CheckConfig };
9
+ export { loadDocCovConfig, defineConfig, LoadedDocCovConfig, DocsConfig, DocCovConfigInput, DocCovConfig2 as DocCovConfig, DOCCOV_CONFIG_FILENAMES, CheckConfig };
@@ -2,90 +2,7 @@
2
2
  import { access } from "node:fs/promises";
3
3
  import path from "node:path";
4
4
  import { pathToFileURL } from "node:url";
5
-
6
- // src/config/schema.ts
7
- import { z } from "zod";
8
- var stringList = z.union([
9
- z.string(),
10
- z.array(z.string())
11
- ]);
12
- var docsConfigSchema = z.object({
13
- include: stringList.optional(),
14
- exclude: stringList.optional()
15
- });
16
- var exampleModeSchema = z.enum([
17
- "presence",
18
- "typecheck",
19
- "run"
20
- ]);
21
- var exampleModesSchema = z.union([
22
- exampleModeSchema,
23
- z.array(exampleModeSchema),
24
- z.string()
25
- ]);
26
- var apiSurfaceConfigSchema = z.object({
27
- minCompleteness: z.number().min(0).max(100).optional(),
28
- warnBelow: z.number().min(0).max(100).optional(),
29
- ignore: z.array(z.string()).optional()
30
- });
31
- var checkConfigSchema = z.object({
32
- examples: exampleModesSchema.optional(),
33
- minHealth: z.number().min(0).max(100).optional(),
34
- minCoverage: z.number().min(0).max(100).optional(),
35
- maxDrift: z.number().min(0).max(100).optional(),
36
- minApiSurface: z.number().min(0).max(100).optional(),
37
- apiSurface: apiSurfaceConfigSchema.optional()
38
- });
39
- var docCovConfigSchema = z.object({
40
- include: stringList.optional(),
41
- exclude: stringList.optional(),
42
- plugins: z.array(z.unknown()).optional(),
43
- docs: docsConfigSchema.optional(),
44
- check: checkConfigSchema.optional()
45
- });
46
- var normalizeList = (value) => {
47
- if (!value) {
48
- return;
49
- }
50
- const list = Array.isArray(value) ? value : [value];
51
- const normalized = list.map((item) => item.trim()).filter(Boolean);
52
- return normalized.length > 0 ? normalized : undefined;
53
- };
54
- var normalizeConfig = (input) => {
55
- const include = normalizeList(input.include);
56
- const exclude = normalizeList(input.exclude);
57
- let docs;
58
- if (input.docs) {
59
- const docsInclude = normalizeList(input.docs.include);
60
- const docsExclude = normalizeList(input.docs.exclude);
61
- if (docsInclude || docsExclude) {
62
- docs = {
63
- include: docsInclude,
64
- exclude: docsExclude
65
- };
66
- }
67
- }
68
- let check;
69
- if (input.check) {
70
- check = {
71
- examples: input.check.examples,
72
- minHealth: input.check.minHealth,
73
- minCoverage: input.check.minCoverage,
74
- maxDrift: input.check.maxDrift,
75
- minApiSurface: input.check.minApiSurface,
76
- apiSurface: input.check.apiSurface
77
- };
78
- }
79
- return {
80
- include,
81
- exclude,
82
- plugins: input.plugins,
83
- docs,
84
- check
85
- };
86
- };
87
-
88
- // src/config/doccov-config.ts
5
+ import { docCovConfigSchema, normalizeConfig } from "@doccov/sdk";
89
6
  var DOCCOV_CONFIG_FILENAMES = [
90
7
  "doccov.config.ts",
91
8
  "doccov.config.mts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@doccov/cli",
3
- "version": "0.27.0",
3
+ "version": "0.28.0",
4
4
  "description": "DocCov CLI - Documentation coverage and drift detection for TypeScript",
5
5
  "keywords": [
6
6
  "typescript",
@@ -48,7 +48,7 @@
48
48
  "dependencies": {
49
49
  "@ai-sdk/anthropic": "^1.0.0",
50
50
  "@ai-sdk/openai": "^1.0.0",
51
- "@doccov/sdk": "^0.27.0",
51
+ "@doccov/sdk": "^0.28.0",
52
52
  "@doccov/spec": "^0.27.0",
53
53
  "@inquirer/prompts": "^7.8.0",
54
54
  "@openpkg-ts/spec": "^0.12.0",