Files
supabase/apps/studio/scripts
Alaister Young a2f86ae362 build(studio): fail the build on server boot crashes
Both recent staging 500s (module-scope createClient with an unset env var;
libpg-query wasm missing from the function bundle) were boot-time crashes:
the TanStack server imports the whole route tree at init, so one bad route
module 500s every route. They only surfaced at runtime on Vercel.

Add two guards so they fail earlier:

- scripts/smoke-server.mjs: post-build smoke test that boots the built server
  with a platform-like env (self-hosted secrets removed) and requests a route.
  Any boot crash returns 5xx and exits non-zero. Wired into build:tanstack so
  the Vercel build fails. Accepts a custom entry path so CI can reuse it
  against the 'vercel build' function output to also catch missing-asset bugs
  (libpg-query.wasm), which local node_modules masks.

- eslint: no-restricted-syntax banning module-scope createClient in
  pages/api/** and routes/** (analytics-SQL selectors factored into a shared
  const so the new block doesn't drop that guard for overlapping files).
2026-06-19 13:57:21 +08:00
..