Self-review: drop the formatter re-export shim, import @shared/format directly

The prior commit kept a pass-through `export { fmtBytes, fmtSpeed, fmtEta }` in
main/lib/formatters.ts purely so existing importers wouldn't have to change —
which re-exported fmtSpeed (zero importers, dead) and left download.ts re-
exporting fmtBytes/fmtEta with no consumer at all, undercutting the "one home"
goal.

Now the real consumers import from the canonical module directly:
- probe.ts and the download.test import from @shared/format.
- formatters.ts keeps only its internal `import { fmtBytes }` (for parseProgress)
  and no longer re-exports.
- download.ts re-exports only parseProgress (its own function); the dead
  fmtBytes/fmtEta re-export is removed.

No behavior change. typecheck + 248 tests + eslint + prettier green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-30 21:10:11 -04:00
parent 3d09174c16
commit 4492eee054
4 changed files with 10 additions and 10 deletions
+3 -2
View File
@@ -1,6 +1,7 @@
import { describe, it, expect } from 'vitest'
// Import from the pure formatter module directly — no electron import chain (L37).
import { fmtBytes, fmtEta, parseProgress } from '../src/main/lib/formatters'
// Import from the pure modules directly — no electron import chain (L37).
import { parseProgress } from '../src/main/lib/formatters'
import { fmtBytes, fmtEta } from '../src/shared/format'
describe('fmtBytes', () => {
it('formats bytes under 1 KB verbatim', () => {