A dead-export audit over packages/ found three distinct groups, and only the smallest is actually dead:
| signal |
count |
what to do |
| exported, zero references anywhere |
21 |
delete (tracked separately) |
| exported, referenced only by tests |
40 |
mostly legitimate test seams; leave |
| exported, referenced only inside its own file |
185 |
drop the export, keep the code |
That last group is the one worth a sweep. Nothing outside the file uses them, so the export is noise that makes the module surface look larger than it is and defeats dead-code detection for everything else — a symbol exported for no reason can never be reported as unused.
What to do
Remove the export keyword where nothing outside the file references the symbol. Mechanical, wide, and the compiler proves each one: if pnpm typecheck passes, the removal was safe.
Worth doing package by package rather than as one enormous PR — packages/core and packages/server first, since they carry the most.
Care needed: a symbol referenced only by its own .test.ts is a test seam, not dead. Those stay exported. The audit counted them separately for exactly this reason.
A dead-export audit over
packages/found three distinct groups, and only the smallest is actually dead:export, keep the codeThat last group is the one worth a sweep. Nothing outside the file uses them, so the
exportis noise that makes the module surface look larger than it is and defeats dead-code detection for everything else — a symbol exported for no reason can never be reported as unused.What to do
Remove the
exportkeyword where nothing outside the file references the symbol. Mechanical, wide, and the compiler proves each one: ifpnpm typecheckpasses, the removal was safe.Worth doing package by package rather than as one enormous PR —
packages/coreandpackages/serverfirst, since they carry the most.Care needed: a symbol referenced only by its own
.test.tsis a test seam, not dead. Those stay exported. The audit counted them separately for exactly this reason.