Commit Graph
5 Commits
Author SHA1 Message Date
Ivan VasilovandClaude Sonnet 5.5 2ac3b77594 chore: replace pnpm hooks and chains with turbo task dependencies in the remaining apps (#53169)
## 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>
2026-11-10 16:40:21 +01:00
Ivan Vasilov 24ce0ba5f8 chore: migrate repo to pnpm v11 (#48033)
## I have read the
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
file.

YES

## What kind of change does this PR introduce?

Chore / dependency tooling update.

## What is the current behavior?

The repo is pinned to pnpm 10.24.0. Closes
https://linear.app/supabase/issue/FE-3673/migrate-the-repo-to-use-pnpm-v11.

## What is the new behavior?

The repo is pinned to pnpm 11.13.1, pnpm v11 workspace settings are
migrated to `allowBuilds`, and the Studio Dockerfile installs pnpm
11.13.1.

## Additional context

Validated with `CI=true mise exec node@22 -- pnpm install
--frozen-lockfile`, `mise exec node@22 -- pnpm run typecheck`, and `mise
exec node@22 -- pnpm run lint`; full Prettier check still fails on
existing generated docs/router files outside this migration.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Chores**
* Updated tooling requirements (pnpm **11.13.1**, Node **>=22.13**) and
aligned container build tooling accordingly.
* Adjusted package manager behavior (scoped registry override, update
notifications disabled) and workspace build/engine validation settings.

* **Maintenance**
* Updated `clean` scripts across apps/packages to remove only
build/cache artifacts (no longer delete installed dependencies).
* Reduced Turbo `clean` task output to **errors-only** for cleaner logs.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-07-20 12:57:42 +02:00
9eab4f8fbf build(studio): Vite/TanStack-Start build pipeline behind flag (stack 1/6, from #46424) (#47107)
**Stack 1/6** of the TanStack Start migration (#46424), split into
reviewable, independently-mergeable PRs.

> [!IMPORTANT]
> **Next stays the default and only active framework after this PR.**
This wires up the Vite/TanStack-Start build pipeline behind the
`STUDIO_FRAMEWORK` flag, but there are no TanStack routes yet — so the
TanStack build isn't functional or tested until later PRs in the stack.
Nothing about the Next build, dev, or deploy changes behaviourally here.

## What's in this PR
- **Dispatch:** `dev`/`build`/`start` now go through
`scripts/dispatch.js`, which runs the Next variant unless
`STUDIO_FRAMEWORK=tanstack`. The original commands are preserved as
`dev:next`/`build:next`/`start:next`.
- **Build pipeline:** `vite.config.ts`, `serve.js`, `smoke-server.mjs`,
vite/tanstack deps, `turbo.jsonc`.
- **`tsconfig.json`:** `jsx: react-jsx`, `moduleResolution: Bundler`,
`target: ES2022`. Because `include` is `**/*.ts(x)`, this re-typechecks
the whole app, so the companion adaptations below land with it.
- **Shared adaptations (companions to the tsconfig change):**
`BufferSource` casts, `packages/ui` unused-`React` import removals, etc.
- **Routing/middleware plumbing:** `next.config.ts` +
`redirects.shared.ts` (redirect rules now shared with `vercel.ts`),
`proxy.ts`/`start.ts` middleware + `hosted-api-allowlist.ts`.

## Verification
Run locally off `master`: frozen install ✓, `studio` typecheck ✓, **Next
build ✓** (compiles + generates all routes), lint ratchet ✓ ("some rules
improved"), prettier ✓.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Added a hosted API endpoint allowlist to return 404 for non-supported
`/api/*` routes.
* Introduced a TanStack route-migration checklist and expanded TanStack
Start routing support.
* **Improvements**
* Enhanced deployment refresh/detection by tightening cookie handling
for “latest deployment” updates.
* Centralized redirect/maintenance-mode rules for consistent platform vs
self-hosted behavior.
* Improved production serving with a dedicated static + proxy server and
a post-build smoke test.
* **Dependencies**
* Updated TanStack-related packages and React Table/query tooling
versions.
* **Documentation / Chores**
* Updated formatting and tooling config; added shared build environment
parsing utilities.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com>
Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2026-06-24 17:55:22 +08:00
Ivan Vasilov 14e9f4ccef chore: Add max age to the turbo cache (#44847)
This pull request introduces improvements to the project's build and
cache management processes. The main changes focus on enhancing the
cleaning of build artifacts and optimizing Turbo's caching behavior.

**Build and cache improvements:**

* Updated the `clean` script in `package.json` to also remove the
`.turbo/cache` directory, ensuring a more thorough cleanup of build
artifacts.
* Added a `cacheMaxAge` setting of 14 days to `turbo.jsonc`, which
controls how long Turbo's cache is retained, helping to balance cache
efficiency and disk usage.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Chores**
* Optimized build system caching configuration with extended cache
validity period (14 days) to improve build performance through longer
retention of build artifacts and reduced unnecessary recompilation.
* Enhanced cleanup procedures for build artifacts, cached files, and
temporary data to maintain a consistent and clean build environment.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-04-14 11:22:53 +02:00
Ivan Vasilov 30c16da0e1 chore: Split turbo configs for apps into their own files (#44085)
This pull request refactors the Turbo build configuration by moving each
app's build settings from the root `turbo.json` file into their own
dedicated `turbo.jsonc` files within each app's directory. The root
configuration is simplified to only include generic tasks, improving
maintainability and clarity.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Chores**
  * Updated Turbo to v2.9.3 to improve build performance and stability.
* Reorganized and added per-app build pipeline configurations to
streamline builds and caching across the workspace.
* Removed a Tailwind container-queries plugin from one app's styling
setup.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-04-02 15:51:16 +02:00