@doccov/cli 0.17.0 → 0.19.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,15 +1,13 @@
1
1
  import { z } from "zod";
2
- import { CheckConfig, DocCovConfig, DocsConfig, QualityRulesConfig } from "@doccov/sdk";
2
+ import { CheckConfig, DocCovConfig, DocsConfig } 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
- /** Quality rule severity levels */
12
- declare const severitySchema: z.ZodEnum<["error", "warn", "off"]>;
13
11
  /** Example validation mode */
14
12
  declare const exampleModeSchema: z.ZodEnum<["presence", "typecheck", "run"]>;
15
13
  /** Example validation modes - can be single, array, or comma-separated */
@@ -18,30 +16,23 @@ declare const exampleModesSchema: z.ZodUnion<[typeof exampleModeSchema, z.ZodArr
18
16
  * Check command configuration schema.
19
17
  */
20
18
  declare const checkConfigSchema: z.ZodObject<{
21
- examples: z.ZodOptional<typeof exampleModesSchema>
22
- minCoverage: z.ZodOptional<z.ZodNumber>
23
- maxDrift: z.ZodOptional<z.ZodNumber>
24
- }>;
25
- /**
26
- * Quality rules configuration schema
27
- */
28
- declare const qualityConfigSchema: z.ZodObject<{
29
- rules: z.ZodOptional<z.ZodRecord<z.ZodString, typeof severitySchema>>
19
+ examples: z.ZodOptional<typeof exampleModesSchema>;
20
+ minCoverage: z.ZodOptional<z.ZodNumber>;
21
+ maxDrift: z.ZodOptional<z.ZodNumber>;
30
22
  }>;
31
23
  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>
24
+ include: z.ZodOptional<typeof stringList>;
25
+ exclude: z.ZodOptional<typeof stringList>;
26
+ plugins: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
27
+ docs: z.ZodOptional<typeof docsConfigSchema>;
28
+ check: z.ZodOptional<typeof checkConfigSchema>;
38
29
  }>;
39
30
  type DocCovConfigInput = z.infer<typeof docCovConfigSchema>;
40
31
  type NormalizedDocCovConfig = DocCovConfig;
41
- declare const DOCCOV_CONFIG_FILENAMES: readonly ["doccov.config.ts", "doccov.config.mts", "doccov.config.cts", "doccov.config.js", "doccov.config.mjs", "doccov.config.cjs", "doccov.yml", "doccov.yaml"];
32
+ declare const DOCCOV_CONFIG_FILENAMES: readonly ["doccov.config.ts", "doccov.config.mts", "doccov.config.js", "doccov.config.mjs"];
42
33
  interface LoadedDocCovConfig extends NormalizedDocCovConfig {
43
34
  filePath: string;
44
35
  }
45
36
  declare const loadDocCovConfig: (cwd: string) => Promise<LoadedDocCovConfig | null>;
46
37
  declare const defineConfig: (config: DocCovConfigInput) => DocCovConfigInput;
47
- export { loadDocCovConfig, defineConfig, QualityRulesConfig, NormalizedDocCovConfig, LoadedDocCovConfig, DocsConfig, DocCovConfigInput, DOCCOV_CONFIG_FILENAMES, CheckConfig };
38
+ export { loadDocCovConfig, defineConfig, NormalizedDocCovConfig, LoadedDocCovConfig, DocsConfig, DocCovConfigInput, DOCCOV_CONFIG_FILENAMES, CheckConfig };
@@ -1,8 +1,7 @@
1
1
  // src/config/doccov-config.ts
2
- import { access, readFile } from "node:fs/promises";
2
+ import { access } from "node:fs/promises";
3
3
  import path from "node:path";
4
4
  import { pathToFileURL } from "node:url";
5
- import { parse as parseYaml } from "yaml";
6
5
 
7
6
  // src/config/schema.ts
8
7
  import { z } from "zod";
@@ -14,7 +13,6 @@ var docsConfigSchema = z.object({
14
13
  include: stringList.optional(),
15
14
  exclude: stringList.optional()
16
15
  });
17
- var severitySchema = z.enum(["error", "warn", "off"]);
18
16
  var exampleModeSchema = z.enum([
19
17
  "presence",
20
18
  "typecheck",
@@ -30,16 +28,12 @@ var checkConfigSchema = z.object({
30
28
  minCoverage: z.number().min(0).max(100).optional(),
31
29
  maxDrift: z.number().min(0).max(100).optional()
32
30
  });
33
- var qualityConfigSchema = z.object({
34
- rules: z.record(severitySchema).optional()
35
- });
36
31
  var docCovConfigSchema = z.object({
37
32
  include: stringList.optional(),
38
33
  exclude: stringList.optional(),
39
34
  plugins: z.array(z.unknown()).optional(),
40
35
  docs: docsConfigSchema.optional(),
41
- check: checkConfigSchema.optional(),
42
- quality: qualityConfigSchema.optional()
36
+ check: checkConfigSchema.optional()
43
37
  });
44
38
  var normalizeList = (value) => {
45
39
  if (!value) {
@@ -71,19 +65,12 @@ var normalizeConfig = (input) => {
71
65
  maxDrift: input.check.maxDrift
72
66
  };
73
67
  }
74
- let quality;
75
- if (input.quality) {
76
- quality = {
77
- rules: input.quality.rules
78
- };
79
- }
80
68
  return {
81
69
  include,
82
70
  exclude,
83
71
  plugins: input.plugins,
84
72
  docs,
85
- check,
86
- quality
73
+ check
87
74
  };
88
75
  };
89
76
 
@@ -91,12 +78,8 @@ var normalizeConfig = (input) => {
91
78
  var DOCCOV_CONFIG_FILENAMES = [
92
79
  "doccov.config.ts",
93
80
  "doccov.config.mts",
94
- "doccov.config.cts",
95
81
  "doccov.config.js",
96
- "doccov.config.mjs",
97
- "doccov.config.cjs",
98
- "doccov.yml",
99
- "doccov.yaml"
82
+ "doccov.config.mjs"
100
83
  ];
101
84
  var fileExists = async (filePath) => {
102
85
  try {
@@ -123,11 +106,6 @@ var findConfigFile = async (cwd) => {
123
106
  }
124
107
  };
125
108
  var importConfigModule = async (absolutePath) => {
126
- const ext = path.extname(absolutePath);
127
- if (ext === ".yml" || ext === ".yaml") {
128
- const content = await readFile(absolutePath, "utf-8");
129
- return parseYaml(content);
130
- }
131
109
  const fileUrl = pathToFileURL(absolutePath);
132
110
  fileUrl.searchParams.set("t", Date.now().toString());
133
111
  const module = await import(fileUrl.href);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@doccov/cli",
3
- "version": "0.17.0",
3
+ "version": "0.19.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.19.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