Context
Tier 3 of the Hono → TanStack Start consolidation. Blocked on / runs alongside #484 (billing). Migration recipe: `packages/docs/audits/hono-to-tanstack-migration.md`.
Scope
Files in `packages/workers/src/routes/admin/`, recommended order smallest-first:
~7,200 lines total across 10 files.
Per-file recipe
- Create TanStack file route(s) under `packages/web/src/routes/api/admin/`
- These routes need an admin-role guard. If not already in `packages/web/src/server/guards/`, add one (probably `requireAdmin(request, env)` checking `user.role === 'admin'`)
- Port tests into co-located `tests/*.server.test.ts`
- Strip the Hono route to an empty stub
- Delete the corresponding Hono test file
- Run both test suites and typechecks
Notes
- Most admin routes are read-only dashboards → faster per-line than billing
- Several files are large because they bundle many endpoints; consider splitting one Hono file into multiple TanStack files along endpoint boundaries
- `billing.ts` and `billing-observability.ts` may share Stripe helpers with the billing webhook tree — don't strip those helpers
Suggested branch
`migrate-admin-routes`
Context
Tier 3 of the Hono → TanStack Start consolidation. Blocked on / runs alongside #484 (billing). Migration recipe: `packages/docs/audits/hono-to-tanstack-migration.md`.
Scope
Files in `packages/workers/src/routes/admin/`, recommended order smallest-first:
~7,200 lines total across 10 files.
Per-file recipe
Notes
Suggested branch
`migrate-admin-routes`