raggrep 0.10.7 → 0.10.8

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/index.js CHANGED
@@ -12101,6 +12101,10 @@ async function ensureIndexFresh(rootDir, options = {}) {
12101
12101
  let filesStatChecked = 0;
12102
12102
  let filesWithChanges = 0;
12103
12103
  let filesReindexed = 0;
12104
+ let totalDiagNewFiles = 0;
12105
+ let totalDiagNoFileSize = 0;
12106
+ let totalDiagSizeMismatch = 0;
12107
+ let totalDiagNoContentHash = 0;
12104
12108
  const logger = options.logger ? options.logger : quiet ? createSilentLogger() : createLogger({ verbose });
12105
12109
  rootDir = path21.resolve(rootDir);
12106
12110
  const status = await getIndexStatus(rootDir);
@@ -12254,18 +12258,36 @@ async function ensureIndexFresh(rootDir, options = {}) {
12254
12258
  return null;
12255
12259
  }
12256
12260
  };
12261
+ const moduleFiles = module2.supportsFile ? currentFiles.filter((f) => module2.supportsFile(f)) : currentFiles;
12257
12262
  const statCheckStart = Date.now();
12258
- const statResults = await parallelMap(currentFiles, statCheck, STAT_CONCURRENCY);
12263
+ const statResults = await parallelMap(moduleFiles, statCheck, STAT_CONCURRENCY);
12259
12264
  statCheckMs += Date.now() - statCheckStart;
12260
- filesStatChecked += currentFiles.length;
12265
+ filesStatChecked += moduleFiles.length;
12261
12266
  const filesToProcess = [];
12262
12267
  const filesWithMtimeOnlyChange = [];
12263
12268
  let unchangedCount = 0;
12269
+ let diagNewFiles = 0;
12270
+ let diagNoFileSize = 0;
12271
+ let diagSizeMismatch = 0;
12272
+ let diagNoContentHash = 0;
12264
12273
  for (const result2 of statResults) {
12265
12274
  if (!result2.success || !result2.value)
12266
12275
  continue;
12267
12276
  if (result2.value.needsCheck) {
12268
12277
  filesToProcess.push(result2.value);
12278
+ if (result2.value.isNew) {
12279
+ diagNewFiles++;
12280
+ } else {
12281
+ const existingEntry = manifest.files[result2.value.relativePath];
12282
+ if (existingEntry) {
12283
+ if (existingEntry.fileSize === undefined)
12284
+ diagNoFileSize++;
12285
+ else if (existingEntry.fileSize !== result2.value.fileSize)
12286
+ diagSizeMismatch++;
12287
+ else if (!existingEntry.contentHash)
12288
+ diagNoContentHash++;
12289
+ }
12290
+ }
12269
12291
  } else {
12270
12292
  unchangedCount++;
12271
12293
  const existingEntry = manifest.files[result2.value.relativePath];
@@ -12274,6 +12296,13 @@ async function ensureIndexFresh(rootDir, options = {}) {
12274
12296
  }
12275
12297
  }
12276
12298
  }
12299
+ totalDiagNewFiles += diagNewFiles;
12300
+ totalDiagNoFileSize += diagNoFileSize;
12301
+ totalDiagSizeMismatch += diagSizeMismatch;
12302
+ totalDiagNoContentHash += diagNoContentHash;
12303
+ if (filesToProcess.length > 100 && verbose) {
12304
+ logger.info(` [Diagnostic] Phase 2 reasons: new=${diagNewFiles}, noSize=${diagNoFileSize}, sizeMismatch=${diagSizeMismatch}, noHash=${diagNoContentHash}`);
12305
+ }
12277
12306
  let mtimeOnlyUpdates = 0;
12278
12307
  for (const file of filesWithMtimeOnlyChange) {
12279
12308
  const existingEntry = manifest.files[file.relativePath];
@@ -12412,7 +12441,13 @@ async function ensureIndexFresh(rootDir, options = {}) {
12412
12441
  filesStatChecked,
12413
12442
  filesWithChanges,
12414
12443
  filesReindexed: totalIndexed,
12415
- fromCache: false
12444
+ fromCache: false,
12445
+ phase2Reasons: {
12446
+ newFiles: totalDiagNewFiles,
12447
+ noFileSize: totalDiagNoFileSize,
12448
+ sizeMismatch: totalDiagSizeMismatch,
12449
+ noContentHash: totalDiagNoContentHash
12450
+ }
12416
12451
  };
12417
12452
  }
12418
12453
  let finalManifestMtime = currentManifestMtime;
@@ -14152,4 +14187,4 @@ export {
14152
14187
  ConsoleLogger
14153
14188
  };
14154
14189
 
14155
- //# debugId=120D75FB1F633A7A64756E2164756E21
14190
+ //# debugId=3F7DE957CF0C467164756E2164756E21