@doccov/cli 0.5.4 → 0.5.6

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 +48 -7
  2. package/package.json +2 -2
package/dist/cli.js CHANGED
@@ -743,8 +743,8 @@ function registerDiffCommand(program, dependencies = {}) {
743
743
  let docsPatterns = options.docs;
744
744
  if (!docsPatterns || docsPatterns.length === 0) {
745
745
  const configResult = await loadDocCovConfig(process.cwd());
746
- if (configResult.config?.docs?.include) {
747
- docsPatterns = configResult.config.docs.include;
746
+ if (configResult?.docs?.include) {
747
+ docsPatterns = configResult.docs.include;
748
748
  log(chalk2.gray(`Using docs patterns from config: ${docsPatterns.join(", ")}`));
749
749
  }
750
750
  }
@@ -864,6 +864,37 @@ function printTextDiff(diff, log, _error) {
864
864
  }
865
865
  }
866
866
  }
867
+ if (diff.memberChanges && diff.memberChanges.length > 0) {
868
+ log("");
869
+ log(chalk2.bold("Member Changes"));
870
+ const byClass = new Map;
871
+ for (const mc of diff.memberChanges) {
872
+ const list = byClass.get(mc.className) ?? [];
873
+ list.push(mc);
874
+ byClass.set(mc.className, list);
875
+ }
876
+ for (const [className, changes] of byClass) {
877
+ log(chalk2.cyan(` ${className}:`));
878
+ const removed = changes.filter((c) => c.changeType === "removed");
879
+ const added = changes.filter((c) => c.changeType === "added");
880
+ const changed = changes.filter((c) => c.changeType === "signature-changed");
881
+ for (const mc of removed.slice(0, 3)) {
882
+ const suggestion = mc.suggestion ? ` (${mc.suggestion})` : "";
883
+ log(chalk2.red(` - ${mc.memberName}()${suggestion}`));
884
+ }
885
+ for (const mc of added.slice(0, 3)) {
886
+ log(chalk2.green(` + ${mc.memberName}()`));
887
+ }
888
+ for (const mc of changed.slice(0, 3)) {
889
+ log(chalk2.yellow(` ~ ${mc.memberName}() signature changed`));
890
+ }
891
+ const total = removed.length + added.length + changed.length;
892
+ const shown = Math.min(removed.length, 3) + Math.min(added.length, 3) + Math.min(changed.length, 3);
893
+ if (total > shown) {
894
+ log(chalk2.gray(` ... and ${total - shown} more member change(s)`));
895
+ }
896
+ }
897
+ }
867
898
  log("");
868
899
  log(chalk2.bold("Docs Health"));
869
900
  if (diff.newUndocumented.length > 0) {
@@ -904,12 +935,22 @@ function printTextDiff(diff, log, _error) {
904
935
  log(chalk2.yellow(` ${impactedFiles.length} file(s) need updates:`));
905
936
  for (const file of impactedFiles.slice(0, 10)) {
906
937
  log(chalk2.yellow(` \uD83D\uDCC4 ${file.file}`));
907
- for (const ref of file.references.slice(0, 3)) {
908
- const changeLabel = ref.changeType === "signature-changed" ? "signature changed" : ref.changeType === "removed" ? "removed" : "deprecated";
909
- log(chalk2.gray(` Line ${ref.line}: ${ref.exportName} (${changeLabel})`));
938
+ for (const ref of file.references.slice(0, 5)) {
939
+ if (ref.memberName) {
940
+ const changeLabel = ref.changeType === "method-removed" ? "removed" : ref.changeType === "method-changed" ? "signature changed" : ref.changeType === "method-deprecated" ? "deprecated" : "changed";
941
+ log(chalk2.gray(` Line ${ref.line}: ${ref.memberName}() ${changeLabel}`));
942
+ if (ref.replacementSuggestion) {
943
+ log(chalk2.cyan(` → ${ref.replacementSuggestion}`));
944
+ }
945
+ } else if (ref.isInstantiation) {
946
+ log(chalk2.gray(` Line ${ref.line}: new ${ref.exportName}() (class changed)`));
947
+ } else {
948
+ const changeLabel = ref.changeType === "signature-changed" ? "signature changed" : ref.changeType === "removed" ? "removed" : "deprecated";
949
+ log(chalk2.gray(` Line ${ref.line}: ${ref.exportName} (${changeLabel})`));
950
+ }
910
951
  }
911
- if (file.references.length > 3) {
912
- log(chalk2.gray(` ... and ${file.references.length - 3} more reference(s)`));
952
+ if (file.references.length > 5) {
953
+ log(chalk2.gray(` ... and ${file.references.length - 5} more reference(s)`));
913
954
  }
914
955
  }
915
956
  if (impactedFiles.length > 10) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@doccov/cli",
3
- "version": "0.5.4",
3
+ "version": "0.5.6",
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.7",
52
+ "@doccov/sdk": "^0.5.6",
53
53
  "@openpkg-ts/spec": "^0.3.1",
54
54
  "ai": "^4.0.0",
55
55
  "chalk": "^5.4.1",