@doccov/cli 0.29.4 → 0.30.1

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/cli.js +10 -6
  2. package/package.json +3 -3
package/dist/cli.js CHANGED
@@ -1293,17 +1293,19 @@ function computeStats(openpkg, doccov) {
1293
1293
  // src/reports/writer.ts
1294
1294
  import * as fs3 from "node:fs";
1295
1295
  import * as path5 from "node:path";
1296
- import { DEFAULT_REPORT_DIR, getReportPath } from "@doccov/sdk";
1296
+ import { DEFAULT_REPORT_DIR, findProjectRoot, getDoccovDir, getReportPath } from "@doccov/sdk";
1297
1297
  import chalk5 from "chalk";
1298
1298
  function writeReport(options) {
1299
1299
  const { format, content, outputPath, cwd = process.cwd(), silent = false } = options;
1300
- const reportPath = outputPath ? path5.resolve(cwd, outputPath) : path5.resolve(cwd, getReportPath(format));
1300
+ const doccovDir = getDoccovDir(cwd);
1301
+ const reportPath = outputPath ? path5.resolve(cwd, outputPath) : path5.join(doccovDir, getReportPath(format).replace(DEFAULT_REPORT_DIR + "/", ""));
1301
1302
  const dir = path5.dirname(reportPath);
1302
1303
  if (!fs3.existsSync(dir)) {
1303
1304
  fs3.mkdirSync(dir, { recursive: true });
1304
1305
  }
1305
1306
  fs3.writeFileSync(reportPath, content);
1306
- const relativePath = path5.relative(cwd, reportPath);
1307
+ const projectRoot = findProjectRoot(cwd);
1308
+ const relativePath = path5.relative(projectRoot, reportPath);
1307
1309
  if (!silent) {
1308
1310
  console.log(chalk5.green(`✓ Wrote ${format} report to ${relativePath}`));
1309
1311
  }
@@ -1654,13 +1656,14 @@ import { validateExamples } from "@doccov/sdk";
1654
1656
  // src/commands/check/docs-fetcher.ts
1655
1657
  import * as cheerio from "cheerio";
1656
1658
 
1657
- // src/commands/check/docsCache.ts
1659
+ // src/commands/check/docs-cache.ts
1658
1660
  import * as crypto from "node:crypto";
1659
1661
  import * as fs4 from "node:fs";
1660
1662
  import * as path6 from "node:path";
1663
+ import { getDoccovDir as getDoccovDir2 } from "@doccov/sdk";
1661
1664
  var DEFAULT_TTL = 60 * 60 * 1000;
1662
1665
  function getCacheDir(cwd) {
1663
- return path6.join(cwd, ".doccov", "cache");
1666
+ return path6.join(getDoccovDir2(cwd), "cache");
1664
1667
  }
1665
1668
  function getCacheSubdir(cwd, type) {
1666
1669
  return path6.join(getCacheDir(cwd), type);
@@ -4359,6 +4362,7 @@ import {
4359
4362
  buildDocCovSpec as buildDocCovSpec2,
4360
4363
  DocCov as DocCov2,
4361
4364
  detectPackageManager,
4365
+ getDoccovDir as getDoccovDir3,
4362
4366
  NodeFileSystem as NodeFileSystem2,
4363
4367
  renderApiSurface,
4364
4368
  resolveTarget as resolveTarget2
@@ -4475,7 +4479,7 @@ function registerSpecCommand(program, dependencies = {}) {
4475
4479
  packageName = "unknown";
4476
4480
  }
4477
4481
  }
4478
- const baseOutputDir = path10.resolve(options.cwd, options.output);
4482
+ const baseOutputDir = options.output === ".doccov" ? getDoccovDir3(options.cwd) : path10.resolve(options.cwd, options.output);
4479
4483
  const outputDir = path10.join(baseOutputDir, packageName);
4480
4484
  fs7.mkdirSync(outputDir, { recursive: true });
4481
4485
  const displayPath = `${options.output}/${packageName}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@doccov/cli",
3
- "version": "0.29.4",
3
+ "version": "0.30.1",
4
4
  "description": "DocCov CLI - Documentation coverage and drift detection for TypeScript",
5
5
  "keywords": [
6
6
  "typescript",
@@ -48,10 +48,10 @@
48
48
  "dependencies": {
49
49
  "@ai-sdk/anthropic": "^1.0.0",
50
50
  "@ai-sdk/openai": "^1.0.0",
51
- "@doccov/sdk": "^0.29.4",
51
+ "@doccov/sdk": "^0.30.1",
52
52
  "@doccov/spec": "^0.27.0",
53
53
  "@inquirer/prompts": "^7.8.0",
54
- "@openpkg-ts/spec": "^0.12.0",
54
+ "@openpkg-ts/spec": "^0.19.0",
55
55
  "ai": "^4.0.0",
56
56
  "chalk": "^5.4.1",
57
57
  "cheerio": "^1.1.2",