mirror of
https://github.com/supabase/supabase.git
synced 2026-12-03 23:18:57 +00:00
## Problem `ui-library`, `design-system`, `learn`, `kb`, `www` and `studio` still order their build, dev and typecheck steps with pnpm `pre`/`post` hooks, `&&` chains and `run-p`. Turbo can't see those steps, so it can't cache or parallelize them. Follow-up to #52556, which migrated `apps/docs`. Part of [FE-4977](https://linear.app/supabase/issue/FE-4977/migrate-remaining-apps-pnpm-scripts-to-turbo-tasks). ## Solution The ordering now lives in each app's `turbo.jsonc` as `dependsOn`, the hooks and chains are gone, and scripts with same-package prerequisites are wrapped with `maybe-turbo`. `node .agents/skills/turbo-scripts/scripts/audit.mjs apps/<name>` reports no findings for any of the six apps. - **`ui-library`, `design-system`, `learn`:** content, registry and markdown steps are turbo tasks with declared outputs. `dev:content` uses the `with` key. `build:next` and `dev:next` are folded into `build` and `dev`. `ui-library`'s markdown task now depends on `build:registry`, which the old chain hid. `pnpm --filter library build:registry` still regenerates the committed registry output. - **`kb`:** `fetch:federated-content` is uncached, and the tasks that read its output use `jit` inputs. - **`www`:** - `build` depends on `docs#build:guides-markdown`, so federated content is fetched once instead of twice. - `build:next` is folded into `build`. - `typecheck` runs `next typegen` itself. - `turbo-build.test.ts` is updated for the new task graph. It reads `PATH` through a copy of the env, because `turbo/no-undeclared-env-vars` flags it once the `passThroughEnv: ["*"]` wildcard is gone. - `passThroughEnv: ["*"]` is gone, and the env vars the content scripts read are declared. - **`studio`:** `typecheck` runs `next typegen` inline, and `lint` depends on a new `lint:type-checks` task. The `predev` turbopack cache clean moved into `scripts/dispatch.js`. It's a local side effect, and making it a turbo task would route `dev` through turbo's strict env filtering, which drops `NODE_ENV`, `MODE` and `STUDIO_FRAMEWORK`. ## Review instructions - For each app, check that a second `pnpm build` hits the cache. `www`'s fetch and content tasks re-run by design, since they're uncached. - Not verified: the `www` and `studio` dev servers started from the repo root, a Studio production build, the e2e flow, and runs with real production credentials. - `kb`'s build reads a remote database that turbo can't hash. It stays cached, keyed on `SUPABASE_URL`. Say if you'd rather make it uncached. - Builds rewrite two tracked files, `apps/docs/public/markdown/manifest.json` and `apps/www/public/customers-rss.xml`, so a fresh checkout can miss the cache once. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>