fix: repoint dead .com hosts to live .dev (#1819 §A+§B)

Merged
SW
5mo ago
+35-23

Part of the recoupable.com -> .dev migration (tracking issue recoupable/chat#1819, sections A + B). Repoints dead .com hosts to their verified-live .dev equivalents and DRYs the URLs through shared constants.

DRY constants added (lib/consts.ts)

  • APP_BASE_URL = "https://chat.recoupable.dev" — public chat app origin
  • DOCS_BASE_URL = "https://docs.recoupable.dev" — docs host
  • API_PUBLIC_BASE_URL = "https://api.recoupable.dev" — canonical public API host for in-app doc examples

(NEW_API_BASE_URL already points at api.recoupable.dev on main.)

Changes

  • lib/chat/getChatUrl.ts — chat.recoupable.com -> APP_BASE_URL
  • components/ApiKeyPage/ApiKeyManager.tsx — docs link -> DOCS_BASE_URL
  • components/Sidebar/UserProfileDropdown/ExternalLinksGroup.tsx — developers.recoupable.com Help & Docs link -> DOCS_BASE_URL. Apex recoupable.com home link left intact (still live 200).
  • app/docs/{account,fans,posts}/constants.ts — in-app API example snippets api.recoupable.com/api/... -> api.recoupable.dev/... via API_PUBLIC_BASE_URL interpolation in the template literals
  • app/docs/{fans,posts}/page.tsx — endpoint <code> literals -> api.recoupable.dev
  • JSDoc @see hosts -> docs.recoupable.dev: lib/tasks/{deleteTask,getTasks,updateTask}.ts, hooks/useElapsedMs.ts, lib/chat/getConversations.tsx
  • lib/chat/__tests__/getChatUrl.test.ts — assertion updated to the new .dev origin (behavioral test for the changed function)

Left untouched (out of scope)

  • Apex recoupable.com / www.recoupable.com links and the privacy/terms redirects (all still live 200)
  • RECOUP_FROM_EMAIL and any email addresses

Gate results

  • pnpm exec tsc --noEmit: only the pre-existing lib/emails/__tests__/extractSendEmailResults.test.ts UIMessage type-drift errors remain (unrelated). No new errors mention any touched file.
  • pnpm exec vitest run lib/chat: 6 files, 19 tests passed
  • pnpm exec vitest run lib/tasks: 7 files, 16 tests passed

🤖 Generated with Claude Code


Summary by cubic

Repointed dead recoupable.com hosts to their live .dev equivalents and centralized URLs in shared constants to avoid drift. Apex recoupable.com links remain as-is.

  • Refactors
    • Added APP_BASE_URL, DOCS_BASE_URL, API_PUBLIC_BASE_URL in lib/consts.ts.
    • getChatUrl now uses APP_BASE_URL (chat.recoupable.dev); updated test.
    • In-app docs and code examples now use API_PUBLIC_BASE_URL (api.recoupable.dev); endpoint labels updated.
    • Help & Docs links now use DOCS_BASE_URL (docs.recoupable.dev).
    • Updated JSDoc @see links to docs.recoupable.dev.