Context
Tier 3 of the Hono → TanStack Start consolidation. Tier 1 + Tier 2 (user-facing /api/orgs/*) are landing separately. This issue tracks migrating the non-webhook billing routes.
Full migration recipe and conventions: packages/docs/audits/hono-to-tanstack-migration.md.
Scope
Files in packages/workers/src/routes/billing/ (non-webhook), recommended order smallest-first:
~1,400 lines total across 7 files. Each is its own pass.
Out of scope
- Stripe webhooks stay on Hono for now (raw-body signature verification). Tracked separately under the "retire Hono app" issue.
Per-file recipe
- Create TanStack file route(s) in
packages/web/src/routes/api/billing/ mirroring the path
- Port tests into co-located
__tests__/*.server.test.ts files
- Strip the Hono route to an empty stub (preserve export so parent mount compiles)
- Delete the corresponding Hono test file
- Run
pnpm --filter web test, pnpm --filter workers test, and both typechecks
- Update any client callers (most already use plain
fetch)
Risk
Billing handles money. Review each migration individually. Don't batch multiple files into one PR.
Suggested branch
`migrate-billing-routes`
Context
Tier 3 of the Hono → TanStack Start consolidation. Tier 1 + Tier 2 (user-facing
/api/orgs/*) are landing separately. This issue tracks migrating the non-webhook billing routes.Full migration recipe and conventions:
packages/docs/audits/hono-to-tanstack-migration.md.Scope
Files in
packages/workers/src/routes/billing/(non-webhook), recommended order smallest-first:sync.ts(80 lines)portal.ts(108 lines)validation.ts(126 lines)grants.ts(135 lines)invoices.ts(149 lines)subscription.ts(307 lines)checkout.ts(431 lines)~1,400 lines total across 7 files. Each is its own pass.
Out of scope
Per-file recipe
packages/web/src/routes/api/billing/mirroring the path__tests__/*.server.test.tsfilespnpm --filter web test,pnpm --filter workers test, and both typechecksfetch)Risk
Billing handles money. Review each migration individually. Don't batch multiple files into one PR.
Suggested branch
`migrate-billing-routes`