Commit e38c256
authored
feat: show re-exported symbols for barrel files (#515)
* feat: show re-exported symbols in exports command for barrel files
Barrel/re-export files like src/db/index.js previously showed "No
exported symbols found" despite being heavily-imported entry points.
The exports command now follows outgoing reexport edges to gather
symbols from target modules, displaying them grouped by origin file.
Supports --unused filtering and JSON/MCP output.
Impact: 5 functions changed, 4 affected
* fix: add re-export counters and paginate reexportedSymbols
- Add totalReexported and totalReexportedUnused fields so barrel file
statistics accurately reflect re-exported symbols (previously both
were always 0 for pure barrel files)
- Apply limit/offset pagination to reexportedSymbols (previously
returned in full regardless of pagination options)
- Update integration tests to verify new counter fields
* fix: deduplicate reexport targets and align pagination guard
- SQL query now selects DISTINCT n.file (was DISTINCT n.id, n.file)
to avoid duplicate symbol entries when multiple reexport edges target
the same file
- Pagination guard for reexportedSymbols now triggers only when
opts.limit is set, matching paginateResult's own behaviour
Impact: 2 functions changed, 2 affected
* fix: use pre-pagination counters in barrel file CLI header
The CLI header used reexportedSymbols.length which reflects the current
page size after pagination. Now uses totalReexported/totalReexportedUnused
from the domain layer to display accurate totals.
Impact: 1 functions changed, 0 affected
* fix: add fallback for reexported symbols and correct barrel pagination
When hasExportedCol is false (older databases), reexported symbols now
use the same findCrossFileCallTargets fallback as direct exports instead
of silently returning an empty array.
_pagination.hasMore now accounts for reexportedSymbols in barrel-only
files where direct results are empty, preventing API consumers from
truncating results without knowing more pages exist.
Impact: 2 functions changed, 1 affected1 parent 8199db7 commit e38c256
3 files changed
Lines changed: 167 additions & 10 deletions
File tree
- src
- domain/analysis
- presentation/queries-cli
- tests/integration
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
38 | 48 | | |
39 | 49 | | |
40 | 50 | | |
| |||
46 | 56 | | |
47 | 57 | | |
48 | 58 | | |
| 59 | + | |
49 | 60 | | |
50 | 61 | | |
51 | 62 | | |
| 63 | + | |
| 64 | + | |
52 | 65 | | |
53 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
54 | 81 | | |
55 | 82 | | |
56 | 83 | | |
| |||
87 | 114 | | |
88 | 115 | | |
89 | 116 | | |
90 | | - | |
91 | | - | |
92 | | - | |
| 117 | + | |
93 | 118 | | |
94 | 119 | | |
95 | 120 | | |
| |||
109 | 134 | | |
110 | 135 | | |
111 | 136 | | |
112 | | - | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
113 | 140 | | |
114 | 141 | | |
115 | 142 | | |
| |||
122 | 149 | | |
123 | 150 | | |
124 | 151 | | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
125 | 184 | | |
| 185 | + | |
126 | 186 | | |
127 | 187 | | |
| 188 | + | |
128 | 189 | | |
129 | 190 | | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
130 | 194 | | |
131 | 195 | | |
132 | 196 | | |
133 | 197 | | |
| 198 | + | |
134 | 199 | | |
135 | 200 | | |
136 | 201 | | |
| 202 | + | |
| 203 | + | |
137 | 204 | | |
138 | 205 | | |
139 | 206 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
33 | 59 | | |
34 | 60 | | |
35 | 61 | | |
36 | 62 | | |
37 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
38 | 66 | | |
39 | 67 | | |
40 | 68 | | |
| |||
43 | 71 | | |
44 | 72 | | |
45 | 73 | | |
46 | | - | |
47 | | - | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
48 | 98 | | |
49 | 99 | | |
50 | | - | |
| 100 | + | |
51 | 101 | | |
52 | 102 | | |
53 | 103 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
202 | 242 | | |
0 commit comments