4 Commits
Author SHA1 Message Date
Alaister YoungandAlaister Young 6236fa4ec5 chore: remove the Cloudflare R2 asset upload and asset CDN (#53148)
Removes the dead Cloudflare R2 asset upload and asset CDN code from
Studio, docs and www. Every app now behaves as it did with
`FORCE_ASSET_CDN=-1`: Vercel serves assets from the default path.

Also fixes `.github/workflows/zizmor.yml` to download zizmor with `gh
release download`: `curl -sSLO` saved GitHub error pages as the archive,
which broke the attestation check.

> [!WARNING]
> Remove `FORCE_ASSET_CDN` from Vercel only after this deploys.

**Worth a close look**
- `apps/studio/vite.config.ts`: `SKIP_ASSET_UPLOAD` is kept because it
still gates Sentry source map upload.
- `apps/studio/turbo.jsonc`: `AWS_ACCESS_KEY_ID` /
`AWS_SECRET_ACCESS_KEY` are kept because the Bedrock credential chain
(`lib/ai/bedrock.ts`) can fall back to them.

## To test
- [ ] On the Vercel previews for studio, docs and www, open a page with
DevTools: JS, CSS and fonts load from the app's own origin
(`/dashboard/assets/…` or `/dashboard/_vercel/immutable/…` for Studio,
`/docs/_next/static/…` for docs, `/_next/static/…` for www), with no
404s or CSP errors in the console.

---------

Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com>
2026-11-10 18:21:33 +09:00
Ivan VasilovandClaude Opus 5.5 11a71d795a chore(docs): replace pnpm lifecycle hooks with turbo task dependencies (#52556)
## Problem

`apps/docs` ordered its build, dev and codegen steps with pnpm
`pre`/`post` hooks and `&&` chains. Turbo couldn't see those steps, so
it couldn't cache or parallelize them, and running the build through
turbo ran the codegen twice. Part of
[FE-4948](https://linear.app/supabase/issue/FE-4948/migrate-the-pnpm-scripts-to-use-turbo).

## Solution

The ordering now lives in `apps/docs/turbo.jsonc` as `dependsOn`, and
every pre/post hook is gone. The new `maybe-turbo` workspace bin runs a
script through `turbo run` unless it's already inside turbo, so `pnpm
build`, `pnpm dev`, `pnpm codegen:references` and the other entry points
keep running their prerequisites.

Turbo is bumped to 2.11.10 for its `jit` input mode. Tasks downstream of
the uncached remote fetches use it to hash the gitignored files those
fetches write after they finish, so a cache hit can't restore output
built from older content. Strict-mode env vars are declared.

Other changes:
- The R2 upload moves from `postbuild` to the `vercel.json` build
command, so it still runs when the build is a cache hit.
- `codegen:references:new:ensure` re-downloads when any JavaScript
TypeDoc dump is missing or empty.
- The guides manifest is now sorted, so its output is deterministic.
- A new `turbo-scripts` agent skill (listed in `AGENTS.md`) documents
these conventions for every app. Its audit script, `node
.agents/skills/turbo-scripts/scripts/audit.mjs apps/<name>`, flags
scripts that need `maybe-turbo`, leftover `pre`/`post` hooks, script
chains, and wrapped scripts without a turbo task.

## Review instructions

1. Read `packages/maybe-turbo/README.md`, `apps/docs/turbo.jsonc` and
`.agents/skills/turbo-scripts/SKILL.md`.
2. From `apps/docs`, set `GH_TOKEN=$(gh auth token)` for the federated
fetch and run `pnpm run build:markdown` a few times. Once warm, every
task except `build:federated-content` and
`codegen:references:new:ensure` should hit the cache.
3. Run `pnpm build` from `apps/docs` and check that the docs Vercel
preview deploys and renders normally.

## Checklist

Check all before review:

- [ ] I have read
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
- [ ] If I wrote a new docs topic or edited an existing topic, I used
the `/write-the-docs` or `/edit-the-docs` skill, which applies the docs
[style
guide](https://github.com/supabase/supabase/tree/master/apps/docs/style-guide)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-11-09 16:33:28 +01:00
Kody JacksonandClaude Haiku 5.5 14ca6c0455 feat(docs) - move docs redirects into docs app directly (#52248)
## Problem

Several:
- using above recommended # of redirects in the apps/www configuration
-- currently around ~1275, so 275 above the recommended limit -- which
leads to degraded performance for _every_ request going through the
first zone (including the dashboard, I'd think).
  ```
www:build: www:build:next: Warning: total number of custom routes
exceeds 1000, this can reduce performance. Route counts:
  ```
- We want to add more redirects over time. The current approach doesn't
allow us to do so without cost.
  
- No ability to test docs redirects in previews, which makes reviewing
and merging in changes riskier than it should be. The fact that we _can_
test the changes in this PR is a huge improvement.

## Solution

Diff approach, but related to #51193

Moves docs redirects into the docs app directly, splitting them between
[next.config.mjs](https://vercel.com/docs/routing/redirects/configuration-redirects)
(dynamic) and [Vercel's bulk
redirects](https://vercel.com/docs/routing/redirects/bulk-redirects)
(static).

```txt
apps/
├── docs/
│   ├── lib/
│   │   └── redirects/
│   │       ├── README.md                            # process and rules for adding redirects
│   │       ├── static-redirects.json               # source: one-to-one /docs entries (hand-edited)
│   │       ├── dynamic-redirects.js               # conditional /docs entries + dev/preview rules
│   │       └── generated/
│   │           └── static-redirects-md-variants.json  # .md guides variants generated in pre-build
```

B/c this -- in itself -- also puts us above the 1000 redirects,
separates out redirects based on their _type_:
- Dynamic redirects, live in a .js folder -> referenced in
next.config.mjs. These are not support
- Static redirects live in a json folder (required for Vercel bulk
redirects) -> then referenced in the vercel.json config

Also adds `.md` variant logic to both -- we can actually see a _lot_ of
these paths are hit within analytics. Quick sample over the past 24
hours:

```
path, code, # of hits
/docs/guides/monitoring-and-debugging.md	308	1768
/docs/guides/api/api-keys.md	308	722
/docs/guides/auth/server-side/nextjs.md	307	381
/docs/guides/auth/social-login/auth-google.md	308	231
/docs/guides/getting-started/mcp.md	308	218
/kb/troubleshooting/formatting-support-requests-for-faster-resolution.md	308	159
/docs/guides/troubleshooting/formatting-support-requests-for-faster-resolution-616717.md	308	156
/docs/guides/local-development/overview.md	308	139
/docs/guides/telemetry/logs.md	308	129
/kb/sitemap.md	308	117
/docs/guides/auth/social-login/auth-apple.md	308	103
/kb/troubleshooting/rotating-anon-service-and-jwt-secrets-1Jq6yd.md	308	97
```

The exact method for generating these .md variants could use a sanity
check:
- Dynamic - follows the existing logic from the apps/www
- Static - adds a prebuild script to automatically create .md variants
for `/docs/guides` links. I _think_ this will work even though the
output is gitignored by default... but remains to be seen.

## Preview links

- [Dynamic path, no
.md](https://docs-git-kody-devrel-723-redirects-rework-supabase.vercel.app/docs/guides/reports/reports)
- [Dynamic path,
.md](https://docs-git-kody-devrel-723-redirects-rework-supabase.vercel.app/docs/guides/reports/reports.md)
- [Static path, no
.md](https://docs-git-kody-devrel-723-redirects-rework-supabase.vercel.app/docs/guides/api/joins-and-nesting)
- [Static path,
.md](https://docs-git-kody-devrel-723-redirects-rework-supabase.vercel.app/docs/guides/api/joins-and-nesting.md)

## Builds

<img width="1128" height="289" alt="image"
src="https://github.com/user-attachments/assets/3cbbb111-e7b8-4922-ba8c-23cbc0bb3ddc"
/>

## Go-live

- [ ] Sign off on restructure from Growth Eng + Docs team.
- [ ] Reviewer double-check with agent that a) this contains largely the
same set as the current set in www and b) that these resolve to 200s.
For a, there are a few small differences due to cleanup + re-ordering
redirects that didn't previously work.
- [ ] In the docs project, purchase a batch of 25,000 bulk redirects in
Vercel (builds fail if you don't have the quota with `Bulk redirects
limit exceeded. Attempting to add 1,013 redirects to a deployment, but
only 1,000 available. Visit
https://vercel.com/supabase/docs/settings/advanced#bulk-redirects to
increase bulk redirects capacity.`)
- [ ] Move the disabled redirects back into the main folder, and confirm
builds work.
- [x] Update `write-the-docs` skill to mention redirects

---------

Co-authored-by: Claude Haiku 5.5 <noreply@anthropic.com>
2026-10-27 10:43:07 -05:00
Alaister Young f255627391 chore(docs): static assets cdn (#33347)
* chore(docs): static assets cdn

* r2 env vars

* embed asset url directly
2025-02-05 15:58:07 +00:00