@doccov/cli 0.5.0 → 0.5.2

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 CHANGED
@@ -243,7 +243,11 @@ async function parseAssertionsWithLLM(code) {
243
243
  // src/commands/check.ts
244
244
  var defaultDependencies = {
245
245
  createDocCov: (options) => new DocCov(options),
246
- spinner: (text) => ora(text),
246
+ spinner: (text) => ora({
247
+ text,
248
+ discardStdin: false,
249
+ hideCursor: true
250
+ }),
247
251
  log: console.log,
248
252
  error: console.error
249
253
  };
@@ -995,7 +999,11 @@ var mergeFilterOptions = (config, cliOptions) => {
995
999
  var defaultDependencies3 = {
996
1000
  createDocCov: (options) => new DocCov2(options),
997
1001
  writeFileSync: fs3.writeFileSync,
998
- spinner: (text) => ora2(text),
1002
+ spinner: (text) => ora2({
1003
+ text,
1004
+ discardStdin: false,
1005
+ hideCursor: true
1006
+ }),
999
1007
  log: console.log,
1000
1008
  error: console.error
1001
1009
  };
@@ -1472,7 +1480,11 @@ function registerReportCommand(program) {
1472
1480
  } else {
1473
1481
  entryFile = path6.resolve(targetDir, entryFile);
1474
1482
  }
1475
- const spinner = ora3("Analyzing...").start();
1483
+ const spinner = ora3({
1484
+ text: "Analyzing...",
1485
+ discardStdin: false,
1486
+ hideCursor: true
1487
+ }).start();
1476
1488
  const resolveExternalTypes = !options.skipResolve;
1477
1489
  const doccov = new DocCov3({ resolveExternalTypes });
1478
1490
  const result = await doccov.analyzeFileWithDiagnostics(entryFile);
@@ -1648,7 +1660,11 @@ async function generateBuildPlan(repoDir) {
1648
1660
  // src/commands/scan.ts
1649
1661
  var defaultDependencies5 = {
1650
1662
  createDocCov: (options) => new DocCov4(options),
1651
- spinner: (text) => ora4(text),
1663
+ spinner: (text) => ora4({
1664
+ text,
1665
+ discardStdin: false,
1666
+ hideCursor: true
1667
+ }),
1652
1668
  log: console.log,
1653
1669
  error: console.error
1654
1670
  };
@@ -1672,20 +1688,36 @@ function registerScanCommand(program, dependencies = {}) {
1672
1688
  const cloneSpinner = spinner(`Cloning ${parsed.owner}/${parsed.repo}...`);
1673
1689
  cloneSpinner.start();
1674
1690
  try {
1675
- const git = simpleGit();
1676
- await git.clone(cloneUrl, tempDir, [
1677
- "--depth",
1678
- "1",
1679
- "--branch",
1680
- parsed.ref,
1681
- "--single-branch"
1682
- ]);
1691
+ const git = simpleGit({
1692
+ timeout: {
1693
+ block: 30000
1694
+ }
1695
+ });
1696
+ const originalEnv = { ...process.env };
1697
+ process.env.GIT_TERMINAL_PROMPT = "0";
1698
+ process.env.GIT_ASKPASS = "echo";
1699
+ try {
1700
+ await git.clone(cloneUrl, tempDir, [
1701
+ "--depth",
1702
+ "1",
1703
+ "--branch",
1704
+ parsed.ref,
1705
+ "--single-branch"
1706
+ ]);
1707
+ } finally {
1708
+ process.env = originalEnv;
1709
+ }
1683
1710
  cloneSpinner.succeed(`Cloned ${parsed.owner}/${parsed.repo}`);
1684
1711
  } catch (cloneError) {
1685
1712
  cloneSpinner.fail("Failed to clone repository");
1686
1713
  const message = cloneError instanceof Error ? cloneError.message : String(cloneError);
1714
+ if (message.includes("Authentication failed") || message.includes("could not read Username") || message.includes("terminal prompts disabled") || message.includes("Invalid username or password") || message.includes("Permission denied")) {
1715
+ throw new Error(`Authentication required: This repository appears to be private. ` + `Public repositories only are currently supported.
1716
+ ` + `Repository: ${displayUrl}`);
1717
+ }
1687
1718
  if (message.includes("not found") || message.includes("404")) {
1688
- throw new Error(`Repository not accessible or does not exist: ${displayUrl}`);
1719
+ throw new Error(`Repository not accessible or does not exist: ${displayUrl}
1720
+ ` + `Note: Private repositories are not currently supported.`);
1689
1721
  }
1690
1722
  if (message.includes("Could not find remote branch")) {
1691
1723
  throw new Error(`Branch or tag not found: ${parsed.ref}`);
@@ -1,5 +1,18 @@
1
1
  import { z } from "zod";
2
- declare const docCovConfigSchema: unknown;
2
+ declare const stringList: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
3
+ /**
4
+ * Docs configuration schema
5
+ */
6
+ declare const docsConfigSchema: z.ZodObject<{
7
+ include: z.ZodOptional<typeof stringList>
8
+ exclude: z.ZodOptional<typeof stringList>
9
+ }>;
10
+ declare const docCovConfigSchema: z.ZodObject<{
11
+ include: z.ZodOptional<typeof stringList>
12
+ exclude: z.ZodOptional<typeof stringList>
13
+ plugins: z.ZodOptional<z.ZodArray<z.ZodUnknown>>
14
+ docs: z.ZodOptional<typeof docsConfigSchema>
15
+ }>;
3
16
  type DocCovConfigInput = z.infer<typeof docCovConfigSchema>;
4
17
  interface DocsConfig {
5
18
  include?: string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@doccov/cli",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "description": "DocCov CLI - Documentation coverage and drift detection for TypeScript",
5
5
  "keywords": [
6
6
  "typescript",
@@ -49,7 +49,7 @@
49
49
  "@ai-sdk/anthropic": "^1.0.0",
50
50
  "@ai-sdk/openai": "^1.0.0",
51
51
  "@inquirer/prompts": "^7.8.0",
52
- "@doccov/sdk": "^0.3.3",
52
+ "@doccov/sdk": "^0.3.7",
53
53
  "@openpkg-ts/spec": "^0.3.1",
54
54
  "ai": "^4.0.0",
55
55
  "chalk": "^5.4.1",