raggrep 0.1.7 → 0.2.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/index.js CHANGED
@@ -3199,12 +3199,16 @@ import { watch } from "chokidar";
3199
3199
  init_config2();
3200
3200
 
3201
3201
  // src/app/indexer/index.ts
3202
+ var INDEX_SCHEMA_VERSION = "1.0.0";
3202
3203
  async function indexDirectory(rootDir, options = {}) {
3203
3204
  const verbose = options.verbose ?? false;
3205
+ const quiet = options.quiet ?? false;
3204
3206
  rootDir = path11.resolve(rootDir);
3205
3207
  const location = getIndexLocation(rootDir);
3206
- console.log(`Indexing directory: ${rootDir}`);
3207
- console.log(`Index location: ${location.indexDir}`);
3208
+ if (!quiet) {
3209
+ console.log(`Indexing directory: ${rootDir}`);
3210
+ console.log(`Index location: ${location.indexDir}`);
3211
+ }
3208
3212
  const config = await loadConfig(rootDir);
3209
3213
  const introspection = new IntrospectionIndex(rootDir);
3210
3214
  await introspection.initialize();
@@ -3217,16 +3221,24 @@ async function indexDirectory(rootDir, options = {}) {
3217
3221
  await registerBuiltInModules();
3218
3222
  const enabledModules = registry.getEnabled(config);
3219
3223
  if (enabledModules.length === 0) {
3220
- console.log("No modules enabled. Check your configuration.");
3224
+ if (!quiet) {
3225
+ console.log("No modules enabled. Check your configuration.");
3226
+ }
3221
3227
  return [];
3222
3228
  }
3223
- console.log(`Enabled modules: ${enabledModules.map((m) => m.id).join(", ")}`);
3229
+ if (!quiet) {
3230
+ console.log(`Enabled modules: ${enabledModules.map((m) => m.id).join(", ")}`);
3231
+ }
3224
3232
  const files = await findFiles(rootDir, config);
3225
- console.log(`Found ${files.length} files to index`);
3233
+ if (!quiet) {
3234
+ console.log(`Found ${files.length} files to index`);
3235
+ }
3226
3236
  const results = [];
3227
3237
  for (const module of enabledModules) {
3228
- console.log(`
3238
+ if (!quiet) {
3239
+ console.log(`
3229
3240
  [${module.name}] Starting indexing...`);
3241
+ }
3230
3242
  const moduleConfig = getModuleConfig(config, module.id);
3231
3243
  if (module.initialize && moduleConfig) {
3232
3244
  const configWithOverrides = { ...moduleConfig };
@@ -3241,7 +3253,9 @@ async function indexDirectory(rootDir, options = {}) {
3241
3253
  const result = await indexWithModule(rootDir, files, module, config, verbose, introspection);
3242
3254
  results.push(result);
3243
3255
  if (module.finalize) {
3244
- console.log(`[${module.name}] Building secondary indexes...`);
3256
+ if (!quiet) {
3257
+ console.log(`[${module.name}] Building secondary indexes...`);
3258
+ }
3245
3259
  const ctx = {
3246
3260
  rootDir,
3247
3261
  config,
@@ -3257,7 +3271,9 @@ async function indexDirectory(rootDir, options = {}) {
3257
3271
  };
3258
3272
  await module.finalize(ctx);
3259
3273
  }
3260
- console.log(`[${module.name}] Complete: ${result.indexed} indexed, ${result.skipped} skipped, ${result.errors} errors`);
3274
+ if (!quiet) {
3275
+ console.log(`[${module.name}] Complete: ${result.indexed} indexed, ${result.skipped} skipped, ${result.errors} errors`);
3276
+ }
3261
3277
  }
3262
3278
  await introspection.save(config);
3263
3279
  await updateGlobalManifest(rootDir, enabledModules, config);
@@ -3368,7 +3384,7 @@ async function writeFileIndex(rootDir, moduleId, filepath, fileIndex, config) {
3368
3384
  async function updateGlobalManifest(rootDir, modules, config) {
3369
3385
  const manifestPath = getGlobalManifestPath(rootDir, config);
3370
3386
  const manifest = {
3371
- version: config.version,
3387
+ version: INDEX_SCHEMA_VERSION,
3372
3388
  lastUpdated: new Date().toISOString(),
3373
3389
  modules: modules.map((m) => m.id)
3374
3390
  };
@@ -3611,4 +3627,4 @@ export {
3611
3627
  cleanup
3612
3628
  };
3613
3629
 
3614
- //# debugId=B36BFBBC8240BDFB64756E2164756E21
3630
+ //# debugId=DEB2F8AAF72AF0A164756E2164756E21