Files
supabase/.github/CODEOWNERS
Mert YEREKAPAN fe8e912993 refactor(www): split redirects into static and dynamic files and add redirect checks (#54194)
## Problem

`apps/www/lib/redirects.js` was a single file with static and dynamic
rules mixed together, and the redirects had no automated checks. `/docs`
redirects already moved to `apps/docs/lib/redirects/`, so www was the
odd one out.

## Solution

I applied the docs layout to www without changing how redirects are
served:

- `apps/www/lib/redirects/static-redirects.json`: 220 one-to-one
entries, including fixed redirects to external `https://` URLs.
- `apps/www/lib/redirects/dynamic-redirects.js`: 14 entries with params,
splats, regex, escapes, or `has`.
- `apps/www/lib/redirects/index.js`: combines both (static first) for
`next.config.mjs` and `scripts/generateMdContent.mjs`.
- `apps/www/lib/redirects/redirects.test.ts`: checks for loops, chains,
duplicate sources, invalid sources and destinations (anchors, missing
`/` or `https://`), dynamic entries in the static file, and internal
destinations that do not exist.
- README for the folder, plus updates to `apps/www/README.md`,
`DEVELOPERS.md`, `CODEOWNERS`, and the `www-tests` path filter and
sparse checkout.

Bulk redirects are not part of this PR: www has 234 redirects, well
under the route limit, so they stay in `next.config.mjs`.

### Missing-destination check

Internal destinations are checked against the same sources the site
serves from:

- `app/` and `pages/` routes, and `public/` files.
- Blog, customer, event, and alternative slugs, derived the way
`lib/posts.tsx` derives them. Events with `disable_page_build` do not
count.
- Feature and `/go` page slugs.
- `.md` destinations must be a page that `generateMdContent.mjs`
publishes. An existing HTML page is not enough.
- `/docs/guides` destinations, against the docs content and guide
routes.

Other zones and build-generated files are not checked. A destination
with params is probed with one sample value, so value-specific loops or
chains are not caught. The README lists these limits.

### Behavior notes

- The rule set matches `master`, with one exception:
`/blog/2021/07/30/1-the-supabase-hackathon` now points at the canonical
slug `/blog/1-the-supabase-hackathon`. The old destination
`/blog/the-supabase-hackathon` also resolves today, because the blog
route matches posts by filename suffix. The check requires canonical
slugs.
- First-match results on `supabase.com` are identical on 241 probe
paths.
- Static entries now precede dynamic ones. On the `supabase.design`
host, 25 static sources that used to sit after its catch-all rule now
come before it. Those paths now take two hops to reach the design system
instead of one.
- Comments on static entries were dropped, because JSON has no comments.

## To test

1. Open the www preview and visit `/about`. It redirects to `/company`.
2. Visit `/buildersday`. It redirects to `/builderday`.
3. Visit `/sign-in`. It redirects to the dashboard sign-in page.
4. Visit `/blog/2021/07/30/1-the-supabase-hackathon`. It lands on the
hackathon post.

## Linear

- fixes GROWTH-1571
2026-11-30 15:52:59 +00:00

53 lines
2.2 KiB
Plaintext

/packages/ui/ @supabase/design
/packages/shared-data/pricing.ts @supabase/billing
/packages/shared-data/plans.ts @supabase/billing
/packages/shared-data/scoped-access-token-permissions.ts @supabase/Dashboard @supabase/docs
/packages/common/telemetry-constants.ts @supabase/growth-eng
/packages/common/posthog-client* @supabase/growth-eng
/packages/common/telemetry-event* @supabase/growth-eng
/.agents/skills/telemetry-standards/ @supabase/growth-eng
/packages/dev-tools/ @supabase/growth-eng
# /packages/pg-meta @supabase/postgres @avallete
/packages/ui-patterns @supabase/design
/apps/studio/ @supabase/Dashboard
/apps/docs/ @supabase/docs
/apps/docs/content/guides/self-hosting* @supabase/docs @supabase/self-hosted
/apps/docs/content/guides/**/*self-hosted* @supabase/docs @supabase/self-hosted
# intentionally blank so anyone with write access can approve here
/apps/docs/public/humans.txt
/apps/kb/ @supabase/knowledgebase
/apps/www/ @supabase/marketing
/apps/www/public/images/blog @supabase/marketing
/apps/www/public/schemas/ @supabase/cli
/apps/www/lib/redirects/
/apps/www/data/legal/ @supabase/frontend
/apps/www/pages/legal/ @supabase/frontend
/apps/www/public/legal/ @supabase/frontend
/apps/www/_go/legal/ @supabase/frontend
/apps/www/pages/aup.tsx @supabase/frontend
/apps/www/pages/privacy.tsx @supabase/frontend
/apps/www/pages/terms.tsx @supabase/frontend
/apps/www/pages/sla.tsx @supabase/frontend
/apps/www/pages/enterprise-terms.tsx @supabase/frontend
/apps/www/pages/support-policy.tsx @supabase/frontend
/apps/www/components/Legal/ @supabase/frontend
/apps/www/lib/addenda.ts @supabase/frontend
/apps/www/lib/addenda-utils.ts @supabase/frontend
/docker/ @supabase/cli @supabase/self-hosted
/apps/studio/csp.ts @supabase/security
/apps/studio/components/interfaces/Billing/Payment @supabase/security
/apps/studio/components/interfaces/Organization/Documents/ @supabase/security
/apps/studio/routes/_app/new/index.tsx @supabase/security
/apps/studio/lib/ai/ @supabase/ai
/apps/studio/routes/api/ai/ @supabase/ai
/packages/shared-data/compute-disk-limits.ts @supabase/platform