@danielsimonjr/repo-tools 2.2.2 → 2.2.3

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/CHANGELOG.md CHANGED
@@ -6,6 +6,18 @@ All notable changes to this project are recorded in this file. The format follow
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [2.2.3] - 2026-10-16
10
+
11
+ ### Fixed
12
+
13
+ - `repo-tools map` reads a `.tsx` or `.jsx` file with the TSX grammar. It read the file with the TypeScript grammar,
14
+ which cannot read JSX. That grammar gives error nodes, and the export statements that survive the error recovery
15
+ depend on the text of the file. The same component file gave 1 export without doc comments and 2 exports with doc
16
+ comments. In one application repository of 746 source files, the export count rises from 3259 to 3406, and the
17
+ count is the same with and without the doc comments. A drift gate (`repo-tools check`) that holds the earlier count
18
+ fails until `repo-tools map` writes the reports again.
19
+ A `.js`, `.mjs` or `.cjs` file that holds JSX still uses the TypeScript grammar.
20
+
9
21
  ## [2.2.2] - 2026-10-15
10
22
 
11
23
  ### Changed
package/README.md CHANGED
@@ -13,7 +13,7 @@
13
13
  | `query` | Answers structural questions from the graph of `map`, and writes two derived reports. |
14
14
  | `ste` | Checks Markdown or docstring prose against Simplified Technical English. |
15
15
 
16
- Status: version 2.2.2.
16
+ Status: version 2.2.3.
17
17
 
18
18
  - `map`, `check` and `query` read their settings from `repo-tools.config.json` in the root. The
19
19
  section of `map` is `map` (its old name, `depgraph`, is also read). `--config=<file>` makes any
@@ -41,7 +41,7 @@ repo-tools --version
41
41
 
42
42
  The executable holds the tool and the Bun runtime. It needs no Bun, Node or `node_modules`.
43
43
  Download the file for your platform and `SHA256SUMS` from the
44
- [GitHub release](https://github.com/danielsimonjr/repo-tools/releases/tag/v2.2.2):
44
+ [GitHub release](https://github.com/danielsimonjr/repo-tools/releases/tag/v2.2.3):
45
45
 
46
46
  | Platform | File |
47
47
  |---|---|
package/dist/cli.js CHANGED
@@ -2,7 +2,7 @@
2
2
  // package.json
3
3
  var package_default = {
4
4
  name: "@danielsimonjr/repo-tools",
5
- version: "2.2.2",
5
+ version: "2.2.3",
6
6
  description: "One CLI for repository analysis: dependency graphs creation and query with per-export API facts, file chunking, and context compression. TypeScript on Bun, compiled to a single executable.",
7
7
  type: "module",
8
8
  license: "MIT",
@@ -10895,6 +10895,9 @@ function loadGrammar(name2) {
10895
10895
  }
10896
10896
  return pending;
10897
10897
  }
10898
+ function grammarFor(path) {
10899
+ return path.endsWith(".tsx") || path.endsWith(".jsx") ? "tsx" : "typescript";
10900
+ }
10898
10901
  function parserFor(name2) {
10899
10902
  const parser = parsers.get(name2);
10900
10903
  if (!parser)
@@ -11122,8 +11125,8 @@ function addDynamicImportEdges(mod, calls) {
11122
11125
  });
11123
11126
  }
11124
11127
  }
11125
- function parseTs(source) {
11126
- const tree = parserFor("typescript").parse(source);
11128
+ function parseTs(source, path = "") {
11129
+ const tree = parserFor(grammarFor(path)).parse(source);
11127
11130
  if (!tree)
11128
11131
  throw new Error("tree-sitter returned no tree");
11129
11132
  const mod = emptyModule();
@@ -12568,6 +12571,8 @@ async function buildGraph(root) {
12568
12571
  }
12569
12572
  if (language === "typescript" || language === "python")
12570
12573
  await loadGrammar(language);
12574
+ if (language === "typescript" && found.some((f) => grammarFor(f.path) === "tsx"))
12575
+ await loadGrammar("tsx");
12571
12576
  const resolver = getResolver(language);
12572
12577
  const read = READERS[language];
12573
12578
  const parsed = new Map;
@@ -12576,7 +12581,7 @@ async function buildGraph(root) {
12576
12581
  const text = readSource(join11(root, f.path)).replace(/\r\n?/g, `
12577
12582
  `);
12578
12583
  sources.set(f.path, text);
12579
- parsed.set(f.path, read(text));
12584
+ parsed.set(f.path, read(text, f.path));
12580
12585
  }
12581
12586
  resolver.indexNamespaces?.(parsed);
12582
12587
  const files = new Map;
@@ -18164,9 +18169,6 @@ var DECLARATIONS = {
18164
18169
  method_definition: "method"
18165
18170
  };
18166
18171
  var DECLARATION_TYPES = Object.keys(DECLARATIONS);
18167
- function grammarFor(path) {
18168
- return path.endsWith(".tsx") || path.endsWith(".jsx") ? "tsx" : "typescript";
18169
- }
18170
18172
  var SPACE_CLASS = "[ \\t\\n\\r\\f\\v]";
18171
18173
  var ABSTRACT_PROPERTY = new RegExp(`\\babstract(${SPACE_CLASS}*\\??${SPACE_CLASS}*:)`, "g");
18172
18174
  var EXPORT_TYPE_STAR = new RegExp(`(\\bexport${SPACE_CLASS}+)type(${SPACE_CLASS}*\\*)`, "g");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danielsimonjr/repo-tools",
3
- "version": "2.2.2",
3
+ "version": "2.2.3",
4
4
  "description": "One CLI for repository analysis: dependency graphs creation and query with per-export API facts, file chunking, and context compression. TypeScript on Bun, compiled to a single executable.",
5
5
  "type": "module",
6
6
  "license": "MIT",