supabase-production.yaml workflow, and
bun sb:push / bun sb:linkpush stay off-limits in agent checkouts.
Push migrations to the dev project
Run the repo’s pinned CLI fromapps/database. Pass the access token as
SUPABASE_ACCESS_TOKEN: on macOS the pinned binary can otherwise block on a
Keychain prompt with no output.
- Remote-only versions. “Remote migration versions not found” usually
means a migration was renamed in the repo after the dev project applied it.
Check that the renamed file is idempotent, then run
supabase migration repair --status reverted <old-version>and let the renamed file apply. - Unqualified extension functions. Without a database password, the CLI
connects through a temporary
cli_login_postgresrole and switches topostgres. That session’ssearch_pathdoes not includeextensions, so a migration that calls an extension function such asgen_random_bytesoutside a function body fails withfunction ... does not exist. Apply that one file through the Management API (POST /v1/projects/<ref>/database/query, which runs aspostgreswithextensionson the path) inside a transaction. In the same transaction, insert its row intosupabase_migrations.schema_migrations. Then resumedb push. - API schemas. PostgREST must expose the same schemas as
apps/database/supabase/config.toml(public, graphql_public, storage, private). A project that only exposespublicfails onprivateRPCs, for example task list counts on a board.
apps/database/supabase/tests/task-board-sprints.sql
with psql over the temporary login role (SET ROLE postgres first). They
begin and roll back their own transaction, so the dev data is unchanged.
Share a running preview
Keep the preview in its own detached worktree under.worktrees/, so feature
branches keep moving while it serves. Build only the workspace packages that
export from dist (types, supabase, internal-api, devbox, editor,
masonry) with their tsc build scripts. These are the dev runtime’s
prerequisites, not release builds.
-
Start two quick tunnels first, because
NEXT_PUBLIC_*values are read at boot. Do not override the Host header. -
Write each app’s own
.env.local(not the root one). Both need the Supabase URL, the publishable and secret keys, and the sameTUTURUUU_APP_COORDINATION_SECRET, plus:With a hosted Supabase URL, dev sign-in requires Turnstile. Use Cloudflare’s public always-pass test keys (NEXT_PUBLIC_TURNSTILE_SITE_KEY=1x00000000000000000000AA,TURNSTILE_SECRET_KEY=1x0000000000000000000000000000000AA) and keep captcha off on the dev project. -
Next 16 rejects cross-origin dev requests, and HMR reloads the page about
every 40 seconds when its socket is refused. In the preview worktree only,
add
allowedDevOrigins: ['*.trycloudflare.com']to thecreateTuturuuuNextConfigcall inapps/web/next.config.tsandapps/tasks/next.config.ts. Never commit it. -
Start
bun run dev:appinapps/webandapps/tasks. Do not usebun dev, which wraps them in portless.
/verify-token. Keep the Mac
awake (caffeinate -dimsu) for an overnight preview. Quick-tunnel URLs change
whenever cloudflared restarts, and the env files and both apps must follow.
Known limits
- Realtime (live board updates between people, collaborative descriptions in
the task panel) needs the
meet-realtimeworker and its token secret. The preview does not run it, so the panel shows “Reconnecting”. - Sessions are tied to each quick-tunnel host. The app-session refresh fetch
targets
https://localhost:<port>and fails after about eight hours, so people have to sign in again. - Quick tunnels allow roughly 200 in-flight requests. The first cold page
load in
next devmay see a few retries.