@doccov/cli 0.33.0 → 0.34.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.
- package/dist/drift.js +35 -11
- package/package.json +1 -1
package/dist/drift.js
CHANGED
|
@@ -175700,21 +175700,27 @@ function discoverPackages(cwd) {
|
|
|
175700
175700
|
if (!existsSync10(absDir))
|
|
175701
175701
|
continue;
|
|
175702
175702
|
let name = dir;
|
|
175703
|
+
let isPrivate = false;
|
|
175703
175704
|
const pkgPath = path13.join(absDir, "package.json");
|
|
175704
175705
|
if (existsSync10(pkgPath)) {
|
|
175705
175706
|
try {
|
|
175706
175707
|
const pkg = JSON.parse(readFileSync9(pkgPath, "utf-8"));
|
|
175707
175708
|
if (pkg.name)
|
|
175708
175709
|
name = pkg.name;
|
|
175710
|
+
if (pkg.private === true)
|
|
175711
|
+
isPrivate = true;
|
|
175709
175712
|
} catch {}
|
|
175710
175713
|
}
|
|
175711
175714
|
try {
|
|
175712
175715
|
const entry = detectEntry(absDir);
|
|
175713
|
-
packages.push({ name, dir, entry });
|
|
175716
|
+
packages.push({ name, dir, entry, ...isPrivate ? { private: true } : {} });
|
|
175714
175717
|
} catch {}
|
|
175715
175718
|
}
|
|
175716
175719
|
return packages;
|
|
175717
175720
|
}
|
|
175721
|
+
function filterPublic(packages) {
|
|
175722
|
+
return packages.filter((p) => !p.private);
|
|
175723
|
+
}
|
|
175718
175724
|
|
|
175719
175725
|
// src/utils/detect-entry.ts
|
|
175720
175726
|
function detectEntry(cwd = process.cwd()) {
|
|
@@ -175795,10 +175801,15 @@ function resolveToSource(cwd, filePath) {
|
|
|
175795
175801
|
const srcPath = normalized.replace(new RegExp(`^${outDir}/`), "src/");
|
|
175796
175802
|
candidates.push(srcPath.replace(/\.js$/, ".ts"));
|
|
175797
175803
|
candidates.push(srcPath.replace(/\.d\.ts$/, ".ts"));
|
|
175804
|
+
if (normalized.startsWith(`${outDir}/src/`)) {
|
|
175805
|
+
const stripped = normalized.replace(new RegExp(`^${outDir}/src/`), "src/");
|
|
175806
|
+
candidates.push(stripped.replace(/\.js$/, ".ts"));
|
|
175807
|
+
candidates.push(stripped.replace(/\.d\.ts$/, ".ts"));
|
|
175808
|
+
}
|
|
175798
175809
|
}
|
|
175799
175810
|
}
|
|
175800
175811
|
for (const c2 of candidates) {
|
|
175801
|
-
if (/\.d\.[mc]?ts$/.test(c2))
|
|
175812
|
+
if (!/\.[mc]?ts$/.test(c2) || /\.d\.[mc]?ts$/.test(c2))
|
|
175802
175813
|
continue;
|
|
175803
175814
|
const full = path14.join(cwd, c2);
|
|
175804
175815
|
if (existsSync11(full))
|
|
@@ -175921,12 +175932,14 @@ function getPackageInfo(cwd) {
|
|
|
175921
175932
|
}
|
|
175922
175933
|
}
|
|
175923
175934
|
function registerHealthCommand(program) {
|
|
175924
|
-
program.command("health [entry]", { isDefault: true }).description("Show documentation health score (default command)").option("--min <n>", "Minimum health threshold (exit 1 if below)").option("--all", "Run across all workspace packages").action(async (entry, options) => {
|
|
175935
|
+
program.command("health [entry]", { isDefault: true }).description("Show documentation health score (default command)").option("--min <n>", "Minimum health threshold (exit 1 if below)").option("--all", "Run across all workspace packages").option("--private", "Include private packages in --all mode").action(async (entry, options) => {
|
|
175925
175936
|
const startTime = Date.now();
|
|
175926
175937
|
const version = getVersion();
|
|
175927
175938
|
try {
|
|
175928
175939
|
if (options.all) {
|
|
175929
|
-
|
|
175940
|
+
let packages = discoverPackages(process.cwd());
|
|
175941
|
+
if (packages && !options.private)
|
|
175942
|
+
packages = filterPublic(packages);
|
|
175930
175943
|
if (!packages || packages.length === 0) {
|
|
175931
175944
|
formatError("health", "No workspace packages found", startTime, version);
|
|
175932
175945
|
return;
|
|
@@ -176588,7 +176601,7 @@ function buildMarkdownTable(results, pass) {
|
|
|
176588
176601
|
`);
|
|
176589
176602
|
}
|
|
176590
176603
|
function registerCiCommand(program) {
|
|
176591
|
-
program.command("ci").description("Run CI checks on changed packages").option("--all", "Check all packages, not just changed ones").action(async (options) => {
|
|
176604
|
+
program.command("ci").description("Run CI checks on changed packages").option("--all", "Check all packages, not just changed ones").option("--private", "Include private packages").action(async (options) => {
|
|
176592
176605
|
const startTime = Date.now();
|
|
176593
176606
|
const version = getVersion5();
|
|
176594
176607
|
const cwd = process.cwd();
|
|
@@ -176613,14 +176626,19 @@ function registerCiCommand(program) {
|
|
|
176613
176626
|
if (!existsSync17(absDir))
|
|
176614
176627
|
continue;
|
|
176615
176628
|
let name = dir;
|
|
176629
|
+
let isPrivate = false;
|
|
176616
176630
|
const pkgPath = path23.join(absDir, "package.json");
|
|
176617
176631
|
if (existsSync17(pkgPath)) {
|
|
176618
176632
|
try {
|
|
176619
176633
|
const pkg = JSON.parse(readFileSync20(pkgPath, "utf-8"));
|
|
176620
176634
|
if (pkg.name)
|
|
176621
176635
|
name = pkg.name;
|
|
176636
|
+
if (pkg.private === true)
|
|
176637
|
+
isPrivate = true;
|
|
176622
176638
|
} catch {}
|
|
176623
176639
|
}
|
|
176640
|
+
if (isPrivate && !options.private)
|
|
176641
|
+
continue;
|
|
176624
176642
|
try {
|
|
176625
176643
|
const entryFile = detectEntry(absDir);
|
|
176626
176644
|
const { spec } = await cachedExtract(entryFile);
|
|
@@ -176730,12 +176748,14 @@ function getVersion6() {
|
|
|
176730
176748
|
}
|
|
176731
176749
|
}
|
|
176732
176750
|
function registerCoverageCommand(program) {
|
|
176733
|
-
program.command("coverage [entry]").description("Measure documentation coverage for a TypeScript entry file").option("--min <n>", "Minimum coverage threshold (exit 1 if below)").option("--all", "Run across all workspace packages").action(async (entry, options) => {
|
|
176751
|
+
program.command("coverage [entry]").description("Measure documentation coverage for a TypeScript entry file").option("--min <n>", "Minimum coverage threshold (exit 1 if below)").option("--all", "Run across all workspace packages").option("--private", "Include private packages in --all mode").action(async (entry, options) => {
|
|
176734
176752
|
const startTime = Date.now();
|
|
176735
176753
|
const version = getVersion6();
|
|
176736
176754
|
try {
|
|
176737
176755
|
if (options.all) {
|
|
176738
|
-
|
|
176756
|
+
let packages = discoverPackages(process.cwd());
|
|
176757
|
+
if (packages && !options.private)
|
|
176758
|
+
packages = filterPublic(packages);
|
|
176739
176759
|
if (!packages || packages.length === 0) {
|
|
176740
176760
|
formatError("coverage", "No workspace packages found", startTime, version);
|
|
176741
176761
|
return;
|
|
@@ -176941,12 +176961,14 @@ function getVersion8() {
|
|
|
176941
176961
|
}
|
|
176942
176962
|
}
|
|
176943
176963
|
function registerExtractCommand(program) {
|
|
176944
|
-
program.command("extract [entry]").description("Extract OpenPkg spec from TypeScript entry file").option("-o, --output <file>", "Write JSON to file instead of stdout").option("--only <patterns>", "Include exports matching glob (comma-separated)").option("--ignore <patterns>", "Exclude exports matching glob (comma-separated)").option("--max-depth <n>", "Max type resolution depth", "10").option("--all", "Extract from all workspace packages").action(async (entry, options) => {
|
|
176964
|
+
program.command("extract [entry]").description("Extract OpenPkg spec from TypeScript entry file").option("-o, --output <file>", "Write JSON to file instead of stdout").option("--only <patterns>", "Include exports matching glob (comma-separated)").option("--ignore <patterns>", "Exclude exports matching glob (comma-separated)").option("--max-depth <n>", "Max type resolution depth", "10").option("--all", "Extract from all workspace packages").option("--private", "Include private packages in --all mode").action(async (entry, options) => {
|
|
176945
176965
|
const startTime = Date.now();
|
|
176946
176966
|
const version = getVersion8();
|
|
176947
176967
|
try {
|
|
176948
176968
|
if (options.all) {
|
|
176949
|
-
|
|
176969
|
+
let packages = discoverPackages(process.cwd());
|
|
176970
|
+
if (packages && !options.private)
|
|
176971
|
+
packages = filterPublic(packages);
|
|
176950
176972
|
if (!packages || packages.length === 0) {
|
|
176951
176973
|
formatError("extract", "No workspace packages found", startTime, version);
|
|
176952
176974
|
return;
|
|
@@ -177463,12 +177485,14 @@ function getVersion12() {
|
|
|
177463
177485
|
}
|
|
177464
177486
|
}
|
|
177465
177487
|
function registerLintCommand(program) {
|
|
177466
|
-
program.command("lint [entry]").description("Cross-reference JSDoc against code for accuracy issues").option("--all", "Run across all workspace packages").action(async (entry, options) => {
|
|
177488
|
+
program.command("lint [entry]").description("Cross-reference JSDoc against code for accuracy issues").option("--all", "Run across all workspace packages").option("--private", "Include private packages in --all mode").action(async (entry, options) => {
|
|
177467
177489
|
const startTime = Date.now();
|
|
177468
177490
|
const version = getVersion12();
|
|
177469
177491
|
try {
|
|
177470
177492
|
if (options.all) {
|
|
177471
|
-
|
|
177493
|
+
let packages = discoverPackages(process.cwd());
|
|
177494
|
+
if (packages && !options.private)
|
|
177495
|
+
packages = filterPublic(packages);
|
|
177472
177496
|
if (!packages || packages.length === 0) {
|
|
177473
177497
|
formatError("lint", "No workspace packages found", startTime, version);
|
|
177474
177498
|
return;
|