@zuvia-software-solutions/code-mapper 2.0.1 → 2.0.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.
@@ -59,11 +59,16 @@ const processParsingWithWorkers = async (graph, files, symbolTable, _astCache, w
59
59
  ...(sym.parameterTypes !== undefined ? { parameterTypes: sym.parameterTypes } : {}),
60
60
  });
61
61
  }
62
- allImports.push(...result.imports);
63
- allCalls.push(...result.calls);
64
- allHeritage.push(...result.heritage);
65
- allRoutes.push(...result.routes);
66
- allConstructorBindings.push(...result.constructorBindings);
62
+ for (const item of result.imports)
63
+ allImports.push(item);
64
+ for (const item of result.calls)
65
+ allCalls.push(item);
66
+ for (const item of result.heritage)
67
+ allHeritage.push(item);
68
+ for (const item of result.routes)
69
+ allRoutes.push(item);
70
+ for (const item of result.constructorBindings)
71
+ allConstructorBindings.push(item);
67
72
  }
68
73
  // Merge and log skipped languages
69
74
  const skippedLanguages = new Map();
@@ -201,9 +201,12 @@ export const runPipelineFromRepo = async (repoPath, onProgress, opts) => {
201
201
  });
202
202
  }, repoPath, importCtx);
203
203
  // COLLECT calls for deferred resolution (don't resolve yet — callee may be in later chunk)
204
- allExtractedCalls.push(...chunkWorkerData.calls);
204
+ // Use loop instead of spread to avoid stack overflow on large codebases (100K+ calls)
205
+ for (const call of chunkWorkerData.calls)
206
+ allExtractedCalls.push(call);
205
207
  if (chunkWorkerData.constructorBindings) {
206
- allConstructorBindings.push(...chunkWorkerData.constructorBindings);
208
+ for (const cb of chunkWorkerData.constructorBindings)
209
+ allConstructorBindings.push(cb);
207
210
  }
208
211
  // Heritage + Routes can resolve per-chunk (class-level, usually same-file)
209
212
  await Promise.all([
@@ -1072,15 +1072,24 @@ let accumulated = {
1072
1072
  imports: [], calls: [], heritage: [], routes: [], constructorBindings: [], skippedLanguages: {}, fileCount: 0,
1073
1073
  };
1074
1074
  let cumulativeProcessed = 0;
1075
+ /** Append src arrays into target without spread (avoids stack overflow on large codebases) */
1075
1076
  const mergeResult = (target, src) => {
1076
- target.nodes.push(...src.nodes);
1077
- target.relationships.push(...src.relationships);
1078
- target.symbols.push(...src.symbols);
1079
- target.imports.push(...src.imports);
1080
- target.calls.push(...src.calls);
1081
- target.heritage.push(...src.heritage);
1082
- target.routes.push(...src.routes);
1083
- target.constructorBindings.push(...src.constructorBindings);
1077
+ for (const item of src.nodes)
1078
+ target.nodes.push(item);
1079
+ for (const item of src.relationships)
1080
+ target.relationships.push(item);
1081
+ for (const item of src.symbols)
1082
+ target.symbols.push(item);
1083
+ for (const item of src.imports)
1084
+ target.imports.push(item);
1085
+ for (const item of src.calls)
1086
+ target.calls.push(item);
1087
+ for (const item of src.heritage)
1088
+ target.heritage.push(item);
1089
+ for (const item of src.routes)
1090
+ target.routes.push(item);
1091
+ for (const item of src.constructorBindings)
1092
+ target.constructorBindings.push(item);
1084
1093
  for (const [lang, count] of Object.entries(src.skippedLanguages)) {
1085
1094
  target.skippedLanguages[lang] = (target.skippedLanguages[lang] || 0) + count;
1086
1095
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zuvia-software-solutions/code-mapper",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "Graph-powered code intelligence for AI agents. Index any codebase, query via MCP or CLI.",
5
5
  "author": "Abhigyan Patwari",
6
6
  "license": "PolyForm-Noncommercial-1.0.0",