@doccov/cli 0.34.1 → 0.34.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.
Files changed (2) hide show
  1. package/dist/drift.js +27 -1
  2. package/package.json +1 -1
package/dist/drift.js CHANGED
@@ -175382,12 +175382,38 @@ function findPackageJson2(entryFile) {
175382
175382
  function hashString(s) {
175383
175383
  return createHash("sha256").update(s).digest("hex").slice(0, 16);
175384
175384
  }
175385
+ function getSourceMaxMtime(entryFile) {
175386
+ const pkgJson = findPackageJson2(entryFile);
175387
+ if (!pkgJson)
175388
+ return 0;
175389
+ const pkgDir = path12.dirname(pkgJson);
175390
+ const srcDir = path12.join(pkgDir, "src");
175391
+ return walkMaxMtime(existsSync9(srcDir) ? srcDir : pkgDir);
175392
+ }
175393
+ function walkMaxMtime(dir) {
175394
+ let max = 0;
175395
+ try {
175396
+ for (const entry of readdirSync2(dir, { withFileTypes: true })) {
175397
+ if (entry.isDirectory() && !entry.name.startsWith(".") && entry.name !== "node_modules" && entry.name !== "dist") {
175398
+ const sub = walkMaxMtime(path12.join(dir, entry.name));
175399
+ if (sub > max)
175400
+ max = sub;
175401
+ } else if (entry.isFile() && (entry.name.endsWith(".ts") || entry.name.endsWith(".tsx"))) {
175402
+ const mt = getMtime(path12.join(dir, entry.name));
175403
+ if (mt > max)
175404
+ max = mt;
175405
+ }
175406
+ }
175407
+ } catch {}
175408
+ return max;
175409
+ }
175385
175410
  function buildCacheKey(input) {
175386
175411
  const absEntry = path12.resolve(input.entryFile);
175387
175412
  const entryMtime = getMtime(absEntry);
175388
175413
  const pkgJson = findPackageJson2(absEntry);
175389
175414
  const pkgMtime = pkgJson ? getMtime(pkgJson) : 0;
175390
- const parts = [absEntry, String(entryMtime), String(pkgMtime)];
175415
+ const srcMtime = getSourceMaxMtime(absEntry);
175416
+ const parts = [absEntry, String(entryMtime), String(pkgMtime), String(srcMtime)];
175391
175417
  if (input.configHash)
175392
175418
  parts.push(input.configHash);
175393
175419
  return hashString(parts.join("|"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@doccov/cli",
3
- "version": "0.34.1",
3
+ "version": "0.34.2",
4
4
  "description": "DocCov CLI - Documentation coverage and drift detection for TypeScript",
5
5
  "keywords": [
6
6
  "typescript",