Migrate to Node 24, pnpm, Neon, and better-auth#1
Closed
dubscode wants to merge 3 commits into
Closed
Conversation
- replace Bun with pnpm (pnpm-workspace.yaml, pnpm-lock.yaml, .npmrc) and pin Node 24 (.nvmrc, engines) - swap bun:test for Vitest across packages (per-package vitest.config.ts, test setup updates) - update CI workflows, Dockerfiles, and setup action for pnpm/Node - remove bunfig.toml + bun.lock; vendor xlsx tarball; add smoke-test script
db: Drizzle->Neon (pooled/unpooled, no Railway replicas); add better-auth tables (session/account/verification/two_factor/jwks) + users.email unique + email_verified/updated_at/two_factor_enabled; strip 110 Supabase RLS policies + auth.users shim; fix 6 latent index opclasses; finish postgrest->Drizzle. storage: new @midday/storage over Vercel Blob (private vault + public stores), signed-file HMAC, /files/signed + /files/upload-token, 33 call-site swaps, tus->@vercel/blob/client. auth: new @midday/auth (better-auth: emailOTP, social, jwt/JWKS, twoFactor); dashboard sign-in/session/MFA; API JWKS verifier w/ aud+requiredClaims; deleteUser via FK cascade. teardown: drop Supabase Realtime + 11 consumers; delete @midday/supabase + @supabase/supabase-js; strip SUPABASE_* env/CI; health blob probe. cutover: scripts/cutover runbook + pg_dump/restore, auth identity import, storage copy, validation. BREAKING CHANGE: removes Supabase (db/auth/storage/realtime); requires Neon, Vercel Blob, better-auth env. Realtime live updates dropped.
The chat/@chat-adapter/toolpick packages are ESM-only and broke require()
at boot in the (CJS) API. Keep the API CJS (so the repo's circular package
deps stay tolerated) and dynamically import the ESM-only deps instead:
- bot: lazy async getBot() singleton dynamic-imports the 6 chat adapters;
api webhook/oauth handlers + runtime call getBot() lazily; dynamic
import("chat") for toAiMessages; dynamic import("toolpick") in chat/tools
- dashboard: serverExternalPackages for better-auth/kysely (Turbopack
mis-bundled better-auth's unused sqlite adapters); lazy Resend init +
dev OTP-to-console in @midday/auth (no crash when RESEND_API_KEY unset)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Migrates the monorepo from Bun to Node 24 + pnpm, replacing Bun workspace/lock/config files with pnpm workspace, lockfile, install policy, and CI/Docker command updates.
Adds the Neon/Drizzle, better-auth, and Vercel Blob cutover work, including new auth/storage packages, database schema/client changes, file upload/download routes, and migration validation scripts.
Updates API, dashboard, worker, jobs, bot, and package tests/configuration to run under Vitest and the new runtime, with lazy-loading fixes for ESM-only bot/chat dependencies.
Validation: not rerun during PR creation; branch is pushed and ready for GitHub CI.