- +
Invoiceinterface · 6 fields - +
LineIteminterface · 4 fields - +
TaxRate'standard' | 'reduced' | 'zero' - +
Moneynumber, branded
any loggedPacks one module
Types come from how your code is called, not from guesses.
Haul types one module at a time, runs your tests, and opens a small pull request for a person to review. Main keeps shipping the whole way.
Invoiceinterface · 6 fieldsLineIteminterface · 4 fieldsTaxRate'standard' | 'reduced' | 'zero'Moneynumber, brandedany loggedTypes come from how your code is called, not from guesses.
$ haul check src/billing
✓ tsc --strict --noEmit0 errors
✓ vitest run src/billing212 passed · 4.1s
✓ eslint --max-warnings 0clean
✓ emitted JS vs mainidentical
Your own tests decide. The compiled output has to match main, byte for byte.
Move src/billing to TypeScript
- function total(invoice) {+ function total(invoice: Invoice): Money {
One box per pull request, routed to whoever owns the folder.
Runs inside the repo and CI you already have.
Why box by box
412 modules · 38 boxes · leaves first
Trip 1
npx haul survey reads your import graph and packs modules into boxes, leaves first, so nothing gets typed before the code it depends on.
Trip 2
Haul runs as a step in your CI on the schedule you set. Each box is one pull request. A box that fails a test stays where it was, with a note.
- "allowJs": true,+ "allowJs": false,+ "strict": true,
✓ 412 of 412 modules moved
Trip 3
When the last box is in, one final pull request turns off allowJs and turns on strict. No JavaScript can sneak back in.
A sample pull request
any listed with a reason, not hidden.Box 21 of 38. Types inferred from 38 call sites. 2 any left: legacyDiscount() is called with 4 shapes, and one CSV row type. Both are logged in MOVING.md.
12+ export type TaxRate = 'standard' | 'reduced' | 'zero' 13 14- export function total(invoice) { 14+ export function total(invoice: Invoice): Money { 15 return invoice.lines.reduce( 16- (sum, line) => sum + line.qty * line.unitPrice, 0) 16+ (sum: Money, line: LineItem) => sum + line.qty * line.unitPrice, 0 as Money)
When a test fails
✗ test/geo.test.js › distance › rounds to 2dp Cannot find module '../src/geo/distance.js' from test/geo.test.js:3 jest.mock(…)
Why: 3 tests mock distance.js by its file path. Renaming it to .ts would break them.
MOVING.md · Box 23
Kept as JavaScript. Suggested fix: mock '../src/geo/distance' without the extension, then re-run haul pack src/geo.
Example repo: acme/storefront
Moved
247
In the van
14
At the old house
151
The moving contract
Haul adds types and renames files. If the compiled JavaScript differs from main, the box doesn’t ship.
anyEvery any and @ts-expect-error Haul leaves is listed in MOVING.md with the reason.
Haul runs as a step in your pipeline. The open-source CLI runs on your laptop.
Cancel and you keep merged boxes and untouched JavaScript. Never a half-typed module.
Same engine in both. Team adds the nightly runs, the board and the triage.
Carry it yourself
$0
free, forever
haul survey, pack and check on your machineWe bring the van
$40
per engineer, per month
Moving a monorepo?
Tell us the size and the test runner. An engineer replies, usually within a working day.
moves@haul.exampleNo. It adds type annotations, type files and renames. Every box is compiled and compared with main; if the emitted JavaScript differs, the box is held.
From the TypeScript compiler’s inference plus your call sites, tests and JSDoc. When a value genuinely has several shapes, Haul writes any and logs it instead of guessing.
The box stays as JavaScript, nothing is merged, and the failure and a suggested fix go into MOVING.md. The next night Haul moves on to the next box.
No. Team runs as a step inside your own CI runners; the open-source CLI runs locally. The hosted board only receives module paths and status.
Yes. Set how many boxes a night, which folders to skip, and which days to stay quiet, such as release weeks.
Survey your repo in about a minute. Nothing changes until you merge a pull request.
npx haul survey
Priya N. Approved
Read the whole thing in four minutes. The TaxRate union is nicer than what we had.