@snevins/repo-mapper 1.3.0 → 1.4.1

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/output.js +1 -13
  2. package/package.json +1 -1
package/dist/output.js CHANGED
@@ -1,16 +1,4 @@
1
1
  import { estimateTokens } from "./tokens.js";
2
- /**
3
- * Get files that a given file depends on (outgoing edges).
4
- * Returns file paths sorted by edge weight descending.
5
- */
6
- function getFileDependencies(file, graph) {
7
- const edges = graph.edges.get(file);
8
- if (!edges)
9
- return [];
10
- return [...edges.entries()]
11
- .sort((a, b) => b[1] - a[1])
12
- .map(([target]) => target);
13
- }
14
2
  /**
15
3
  * Get files that depend on a given file (incoming edges).
16
4
  * Returns file paths sorted by edge weight descending.
@@ -222,7 +210,7 @@ export function formatOutput(defs, graph, fileRanks, focusFiles, maxFilesPerModu
222
210
  continue;
223
211
  const fileRank = fileRanks.get(file) ?? 0;
224
212
  const deps = getFileDependents(file, graph);
225
- const depsStr = deps.length > 0 ? ` (used-by: ${deps.slice(0, 3).join(", ")}${deps.length > 3 ? ", ..." : ""})` : "";
213
+ const depsStr = deps.length > 0 ? ` (used-by: ${deps.slice(0, 10).join(", ")}${deps.length > 10 ? ", ..." : ""})` : "";
226
214
  lines.push(`${file}: ${formatRankDisplay(fileRank, allRanks)}${depsStr}`);
227
215
  // Sort definitions by line ascending
228
216
  const sorted = [...fileDefs].sort((a, b) => a.tag.line - b.tag.line);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@snevins/repo-mapper",
3
- "version": "1.3.0",
3
+ "version": "1.4.1",
4
4
  "description": "Generate token-budgeted repo maps for LLM context using tree-sitter and PageRank",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",