Skip to content

feat(studio): port API handlers to TanStack server routes (stack 4/6, from #46424) - #47113

Merged
alaister merged 39 commits into
masterfrom
alaister/migration-s4-api-routes
Jun 30, 2026
Merged

alaister merged 39 commits into
masterfrom
alaister/migration-s4-api-routes

Conversation

@alaister

@alaister alaister commented Jun 19, 2026 •

Copy link
Copy Markdown
Member

Stack 4/6 of the TanStack Start migration (#46424). Stacked on #47112 (S3).

Note

Mechanical and homogeneous — every file is the same shape: a createFileRoute(...) whose server.handlers delegate to the existing pages/api handler via toWebHandler (the compat shim from S2). The pages-router handlers are unchanged; Next still serves them directly and ignores routes/.

What's in this PR

  • routes/api/** (~104 files): platform (pg-meta, auth, storage, integrations, profile, telemetry, organizations, projects…), ai/*, v1/*, connect, content/mcp, and standalone endpoints (deployment-mode, get-ip-address, etc.).
  • routeTree.gen.ts — regenerated for the routes present so far (root + auth/app + api).

Review tip

The route files are near-identical wrappers, so this is fast to skim. The generated routeTree.gen.ts isn't meaningful review surface.

Verification

On top of S1–S3: studio typecheck ✓, lint (0 errors) ✓.

Summary by CodeRabbit

  • New Features

    • Added Model Context Protocol (MCP) API endpoint with configurable feature support and read-only mode
    • Added function artifact streaming capability for self-hosted functions
  • Chores

    • Migrated API route infrastructure for improved system architecture

alaister added 4 commits June 19, 2026 15:33
…RAMEWORK flag (1/6, from #46424)

Foundation of the TanStack Start migration (#46424), split into a reviewable
stack. Next remains the default and only active framework after this PR — the
TanStack build pipeline is wired up but has no routes yet, so it isn't
functional or tested until later PRs flip the feature flag.

- package.json: dev/build/start now dispatch via scripts/dispatch.js (defaults
  to next); add :next/:tanstack variants, vite/tanstack deps.
- scripts: dispatch.js, serve.js, smoke-server.mjs, generateLocalEnv.js.
- vite.config.ts, turbo.jsonc, tsconfig.json (jsx: react-jsx, Bundler).
- next.config.ts + redirects.shared.ts (shared redirect rules with vercel.ts),
  proxy.ts/start.ts middleware + hosted-api-allowlist.ts.
- companion adaptations the tsconfig change requires to keep typecheck green
  (BufferSource casts, packages/ui unused-React import removals, etc.).

Verified: frozen install, studio typecheck, Next build, and lint ratchet all
green; Next stays the default build.
…46424)

Adds compat/next/* — drop-in shims for next/link, next/router, next/navigation,
next/head, next/image, next/script, next/dynamic, next/server, and a
toWebHandler (compat/next/api.ts) that lets pages-router API handlers run as
TanStack server routes. Under TanStack these are wired in via Vite aliases
(next/* -> @/compat/next/*); Next never imports them, so this is purely
additive. No routes consume them yet — that starts in the next stack PR.

Stacked on #47107. Verified: studio typecheck + lint (0 errors).
…outes (stack 3/6, from #46424)

Adds the TanStack Start app skeleton: routes/__root.tsx (root layout +
redirect beforeLoad), router.tsx, and the _auth (sign-in/up, forgot/reset
password, SSO/MFA/partner, CLI login) and _app (account, org/$slug, support)
route trees. These are thin wrappers that render the existing pages-router
page components via the compat shims from #47110.

routeTree.gen.ts is REGENERATED by the tanstackStart vite plugin for exactly
the routes present in this PR (not copied from the migration branch, whose
tree references all ~300 routes) — so it typechecks standalone. API routes and
project routes (and a full regenerated tree) land in the next stack PRs.

Stacked on #47110. Verified: studio typecheck + lint (0 errors). Next is
unaffected (it builds pages/, ignores routes/).
…outes (stack 4/6, from #46424)

Adds routes/api/** — ~104 thin TanStack server routes, each wrapping the
existing pages/api handler via toWebHandler (compat shim from S2). Mechanical
and homogeneous: createFileRoute(...).server.handlers = { METHOD: handler }.
Covers platform (pg-meta, auth, storage, integrations, telemetry, ...), ai,
v1, connect, content/mcp, and the standalone utility endpoints.

routeTree.gen.ts is REGENERATED for the routes now present (root + auth/app +
api). Project page routes + the full tree land in stack 5.

Stacked on #47112. Verified: studio typecheck + lint (0 errors). Next is
unaffected (builds pages/, ignores routes/).
@alaister
alaister requested a review from a team as a code owner June 19, 2026 08:17
@vercel

vercel Bot commented Jun 19, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
design-system Ready Ready Preview, Comment Jun 30, 2026 9:04am
docs Ready Ready Preview, Comment, Open in v0 Jun 30, 2026 9:04am
studio-self-hosted Ready Ready Preview, Comment Jun 30, 2026 9:04am
studio-staging Ready Ready Preview, Comment Jun 30, 2026 9:04am
ui-library Ready Ready Preview, Comment Jun 30, 2026 9:04am
zone-www-dot-com Ready Ready Preview, Comment, Open in v0 Jun 30, 2026 9:04am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
studio Ignored Ignored Jun 30, 2026 9:04am

Request Review

@coderabbitai

coderabbitai Bot commented Jun 19, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (1)
  • develop

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 5a212397-d84d-4509-a68c-fe8b8db34afa

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch alaister/migration-s4-api-routes

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@supabase

supabase Bot commented Jun 19, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project xguihxuzqibwxjnimxev because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@github-actions

github-actions Bot commented Jun 19, 2026 •

Copy link
Copy Markdown
Contributor

🎭 Playwright Test Results

passed  223 passed
flaky  2 flaky
skipped  5 skipped

Details

stats  230 tests across 25 suites
duration  5 minutes, 23 seconds
commit  e2330f7

Flaky tests

Features › realtime-inspector.spec.ts › Realtime Inspector › Message Display › messages counter shows correct count
Features › table-editor.spec.ts › table editor › nullable boolean fields support NULL values

Skipped tests

Features › auth-users.spec.ts › should show web3 users as enabled when the matching web3 provider is enabled
Features › sql-editor.spec.ts › SQL Editor › snippet favourite works as expected
Features › sql-editor.spec.ts › SQL Editor › share with team works as expected
Features › sql-editor.spec.ts › SQL Editor › folders works as expected
Features › sql-editor.spec.ts › SQL Editor › other SQL snippets actions work as expected

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/studio/routes/api/mcp/index.ts`:
- Around line 90-93: The catch block in the MCP API route handler is directly
embedding the raw error object in the JSON response through the `cause` field,
which can fail when the error is circular or non-serializable, breaking the
error handling path itself. Instead of passing the raw `err` object to
JSON.stringify, convert it to a safe string representation by using either
`err.message`, `String(err)`, or similar safe primitive that captures the error
information without risk of serialization failure.

In `@apps/studio/routes/api/platform/pg-meta/`$ref/query/index.ts:
- Line 8: The route path in the createFileRoute call has a trailing slash that
makes it inconsistent with other API route declarations and causes 404 errors
when callers attempt to reach the endpoint without the trailing slash. Remove
the trailing slash from the route path string in the createFileRoute call,
changing '/api/platform/pg-meta/$ref/query/' to
'/api/platform/pg-meta/$ref/query' to ensure the endpoint matches requests with
and without trailing slashes.

In `@apps/studio/routes/api/v1/projects/`$ref/functions/$slug/body.ts:
- Around line 43-94: The multipart body stream reads and enqueues all file
chunks eagerly in the start() method without respecting backpressure or handling
cancellation, causing potential memory buffering and file handle leaks. Replace
the ReadableStream constructor with an async generator function that yields the
metadata, file headers, file content chunks, and boundaries sequentially, then
wrap it with Readable.from() to create the stream. The async generator approach
will naturally handle backpressure by pausing when the consumer can't keep up
and respect cancellation when the stream is destroyed.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 22a7963b-f16f-4deb-9756-dac657c33245

📥 Commits

Reviewing files that changed from the base of the PR and between ad3c0b7 and 8b74d31.

📒 Files selected for processing (105)
  • apps/studio/routeTree.gen.ts
  • apps/studio/routes/api/ai/code/complete.ts
  • apps/studio/routes/api/ai/docs.ts
  • apps/studio/routes/api/ai/feedback/classify.ts
  • apps/studio/routes/api/ai/feedback/rate.ts
  • apps/studio/routes/api/ai/onboarding/design.ts
  • apps/studio/routes/api/ai/sql/check-api-key.ts
  • apps/studio/routes/api/ai/sql/cron-v2.ts
  • apps/studio/routes/api/ai/sql/filter-v1.ts
  • apps/studio/routes/api/ai/sql/generate-v4.ts
  • apps/studio/routes/api/ai/sql/parse-client-code.ts
  • apps/studio/routes/api/ai/sql/policy.ts
  • apps/studio/routes/api/ai/sql/title-v2.ts
  • apps/studio/routes/api/check-cname.ts
  • apps/studio/routes/api/cli-release-version.ts
  • apps/studio/routes/api/connect/index.ts
  • apps/studio/routes/api/content/graphql.ts
  • apps/studio/routes/api/edge-functions/test.ts
  • apps/studio/routes/api/enabled-features-overrides.ts
  • apps/studio/routes/api/generate-attachment-url.ts
  • apps/studio/routes/api/get-deployment-commit.ts
  • apps/studio/routes/api/get-ip-address.ts
  • apps/studio/routes/api/get-s3-keys.ts
  • apps/studio/routes/api/get-utc-time.ts
  • apps/studio/routes/api/incident-banner.ts
  • apps/studio/routes/api/incident-status.ts
  • apps/studio/routes/api/integrations/stripe-sync.ts
  • apps/studio/routes/api/mcp/index.ts
  • apps/studio/routes/api/parse-query.ts
  • apps/studio/routes/api/platform/auth/$ref/invite.ts
  • apps/studio/routes/api/platform/auth/$ref/magiclink.ts
  • apps/studio/routes/api/platform/auth/$ref/otp.ts
  • apps/studio/routes/api/platform/auth/$ref/recover.ts
  • apps/studio/routes/api/platform/auth/$ref/users/$id/factors.ts
  • apps/studio/routes/api/platform/auth/$ref/users/$id/index.ts
  • apps/studio/routes/api/platform/auth/$ref/users/index.ts
  • apps/studio/routes/api/platform/database/$ref/pooling.ts
  • apps/studio/routes/api/platform/deployment-mode.ts
  • apps/studio/routes/api/platform/integrations/$slug.ts
  • apps/studio/routes/api/platform/integrations/github/authorization.ts
  • apps/studio/routes/api/platform/integrations/github/connections.ts
  • apps/studio/routes/api/platform/integrations/github/repositories.ts
  • apps/studio/routes/api/platform/organizations/$slug/billing/subscription.ts
  • apps/studio/routes/api/platform/organizations/index.ts
  • apps/studio/routes/api/platform/pg-meta/$ref/column-privileges.ts
  • apps/studio/routes/api/platform/pg-meta/$ref/extensions.ts
  • apps/studio/routes/api/platform/pg-meta/$ref/foreign-tables.ts
  • apps/studio/routes/api/platform/pg-meta/$ref/materialized-views.ts
  • apps/studio/routes/api/platform/pg-meta/$ref/policies.ts
  • apps/studio/routes/api/platform/pg-meta/$ref/publications.ts
  • apps/studio/routes/api/platform/pg-meta/$ref/query/index.ts
  • apps/studio/routes/api/platform/pg-meta/$ref/tables.ts
  • apps/studio/routes/api/platform/pg-meta/$ref/triggers.ts
  • apps/studio/routes/api/platform/pg-meta/$ref/types.ts
  • apps/studio/routes/api/platform/pg-meta/$ref/views.ts
  • apps/studio/routes/api/platform/profile/index.ts
  • apps/studio/routes/api/platform/projects/$ref/analytics/endpoints/$name.ts
  • apps/studio/routes/api/platform/projects/$ref/analytics/log-drains.ts
  • apps/studio/routes/api/platform/projects/$ref/analytics/log-drains/$uuid.ts
  • apps/studio/routes/api/platform/projects/$ref/api-keys/temporary.ts
  • apps/studio/routes/api/platform/projects/$ref/api/graphql.ts
  • apps/studio/routes/api/platform/projects/$ref/api/rest.ts
  • apps/studio/routes/api/platform/projects/$ref/billing/addons.ts
  • apps/studio/routes/api/platform/projects/$ref/config/index.ts
  • apps/studio/routes/api/platform/projects/$ref/config/postgrest.ts
  • apps/studio/routes/api/platform/projects/$ref/config/secrets/update-status.ts
  • apps/studio/routes/api/platform/projects/$ref/content/count.ts
  • apps/studio/routes/api/platform/projects/$ref/content/folders/$id.ts
  • apps/studio/routes/api/platform/projects/$ref/content/folders/index.ts
  • apps/studio/routes/api/platform/projects/$ref/content/index.ts
  • apps/studio/routes/api/platform/projects/$ref/content/item/$id.ts
  • apps/studio/routes/api/platform/projects/$ref/databases.ts
  • apps/studio/routes/api/platform/projects/$ref/index.ts
  • apps/studio/routes/api/platform/projects/$ref/infra-monitoring.ts
  • apps/studio/routes/api/platform/projects/$ref/run-lints.ts
  • apps/studio/routes/api/platform/projects/$ref/settings.ts
  • apps/studio/routes/api/platform/projects/index.ts
  • apps/studio/routes/api/platform/props/org/$slug.ts
  • apps/studio/routes/api/platform/props/project/$ref/api.ts
  • apps/studio/routes/api/platform/props/project/$ref/index.ts
  • apps/studio/routes/api/platform/storage/$ref/buckets/$id/empty.ts
  • apps/studio/routes/api/platform/storage/$ref/buckets/$id/index.ts
  • apps/studio/routes/api/platform/storage/$ref/buckets/$id/objects/download.ts
  • apps/studio/routes/api/platform/storage/$ref/buckets/$id/objects/index.ts
  • apps/studio/routes/api/platform/storage/$ref/buckets/$id/objects/list.ts
  • apps/studio/routes/api/platform/storage/$ref/buckets/$id/objects/move.ts
  • apps/studio/routes/api/platform/storage/$ref/buckets/$id/objects/public-url.ts
  • apps/studio/routes/api/platform/storage/$ref/buckets/$id/objects/sign-multi.ts
  • apps/studio/routes/api/platform/storage/$ref/buckets/$id/objects/sign.ts
  • apps/studio/routes/api/platform/storage/$ref/buckets/index.ts
  • apps/studio/routes/api/platform/storage/$ref/vector-buckets/$id/index.ts
  • apps/studio/routes/api/platform/storage/$ref/vector-buckets/$id/indexes/$indexName.ts
  • apps/studio/routes/api/platform/storage/$ref/vector-buckets/$id/indexes/index.ts
  • apps/studio/routes/api/platform/storage/$ref/vector-buckets/index.ts
  • apps/studio/routes/api/platform/telemetry/event.ts
  • apps/studio/routes/api/status-override.ts
  • apps/studio/routes/api/v1/projects/$ref/api-keys.ts
  • apps/studio/routes/api/v1/projects/$ref/api-keys/$id.ts
  • apps/studio/routes/api/v1/projects/$ref/config/auth/signing-keys/index.ts
  • apps/studio/routes/api/v1/projects/$ref/config/auth/signing-keys/legacy.ts
  • apps/studio/routes/api/v1/projects/$ref/database/migrations.ts
  • apps/studio/routes/api/v1/projects/$ref/functions/$slug/body.ts
  • apps/studio/routes/api/v1/projects/$ref/functions/$slug/index.ts
  • apps/studio/routes/api/v1/projects/$ref/functions/index.ts
  • apps/studio/routes/api/v1/projects/$ref/types/typescript.ts

Comment thread apps/studio/routes/api/mcp/index.ts Resolved
alaister and others added 18 commits June 19, 2026 16:54
Iterating response.headers and calling res.setHeader collapses duplicate
keys; for set-cookie the Headers iterator joins every cookie into one
comma-separated value, corrupting auth/session cookies. Pull cookies out
via getSetCookie() and set them as an array. Addresses PR review feedback.
The navigate() shim overloaded Next's `shallow` option as the
push-vs-replace signal, but the ternary was inverted so replace() did a
push. Inverting it naively would also break the 5 push(url, { shallow:
true }) call sites, since shallow is a real Next option (no-op here) and
has nothing to do with push vs replace. Use a dedicated internal
`_replace` flag instead, matching Next's pages-router where push always
pushes and replace always replaces regardless of shallow.

Addresses PR review feedback.
The Next pages pass inboundFlow to SignInLayout (sign-in -> 'sign-in',
sign-up -> 'sign-up'), which gates the focused-provider interstitial and
destination-branded heading for inbound auth links. The TanStack route
wrappers dropped it. sign-in-sso intentionally left unchanged — its Next
page doesn't pass inboundFlow either.

Addresses PR review feedback.
…backpressure

- mcp: stringify the non-Error throw in the 500 fallback instead of
  embedding the raw value, so a circular/non-serializable cause can't
  make JSON.stringify throw inside the catch.
- functions body: build the multipart stream from an async generator via
  Readable.from(...).toWeb() so file reads honour consumer backpressure
  and close the file handle on client disconnect, instead of eagerly
  buffering every file in ReadableStream.start().

Addresses PR review feedback.
Extract the .env parser into scripts/lib/env.js so dispatch.js and serve.js
use one implementation instead of duplicating the regex. dispatch.js now
reads .env as well as .env.local (matching serve.js / vite precedence:
shell > .env.local > .env), so STUDIO_FRAMEWORK set in .env is picked up —
previously only .env.local was read, which is why setting it in .env
silently did nothing.

Addresses PR review feedback.
readEnvFiles swallowed every readFileSync error, so an existing-but-
unreadable env file (bad permissions, IO error) was silently treated as
absent — dropping its values and potentially booting serve.js without
secrets like POSTGRES_PASSWORD. Skip only ENOENT and rethrow the rest.

Addresses PR review feedback.
The Vercel SPA catch-all rewrite (`${prefix}/(.*)` -> /_shell) swallowed
missing extensioned paths, so a stale hashed chunk (e.g. requested after a
redeploy) returned text/html 200 instead of 404. The browser then threw
'Failed to load module script ... MIME type text/html', and because /assets/*
is cached immutable the bogus HTML poisoned the edge cache under the asset URL
(defeating skew protection, which is served after the cache).

Make the shell rewrite match only extensionless paths via a negative lookahead
so a missing file with an extension 404s cleanly — letting skew protection's
__vdpl routing serve the chunk from the deployment that still has it, or the
client's vite:preloadError backstop recover.
alaister added 16 commits June 24, 2026 00:03
New org settings page added to master after the initial migration sweep; wraps
OrganizationSettingsLayout like the sibling audit route. Route tree regenerated.
useUrlState (table sort/filter) pushes { pathname: router.pathname, query }
where router.pathname is the bracketed route pattern (/project/[ref]/...).
Next's pages-router fills [ref]/[id] from query and drops them from the query
string; the compat shim just concatenated, so TanStack navigated to a LITERAL
/project/[ref]/... — no project matched (ref === '[ref]') and it bounced to a
'project not found' redirect. Most visible on column rename, which rewrites
sort/filter URL state after a successful (correct) rename.

resolveUrl now interpolates [name] / [...name] / [[...name]] from query and
removes the consumed keys, mirroring Next. String URLs and bracket-free
pathnames are unchanged.

Fixes the redirect and the database.spec column-CRUD e2e on the tanstack build.
Adds a unit test guarding the dynamic-param interpolation in the next/router
shim (the fix for the column-rename redirect), since the shim has been fragile
to changes. Exports resolveUrl for testing only.
Base automatically changed from alaister/migration-s3-shell to master June 29, 2026 12:08
# Conflicts:
#	apps/studio/routeTree.gen.ts
// object would make JSON.stringify throw inside the catch and turn this
// into an unhandled 500.
return new Response(
JSON.stringify({ error: 'Unable to process MCP request', cause: String(err) }),

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leaving this as-is — it's a false positive. Line 95 is only reached for non-Error throws (the instanceof Error branch returns above it), and a non-Error value has no stack to expose. The Error branch only returns .message, never .stack. This is also a faithful port of the existing pages/api/mcp handler, just hardened with String(). Dismissing as won't-fix.

@alaister
alaister merged commit 2f90228 into master Jun 30, 2026
32 checks passed
@alaister
alaister deleted the alaister/migration-s4-api-routes branch June 30, 2026 09:18
@github-actions

github-actions Bot commented Jun 30, 2026 •

Copy link
Copy Markdown
Contributor

Braintrust eval report

Assistant (master-1782811223)

Score Average Improvements Regressions
Completeness 96.6% (+1pp) 4 🟢 3 🔴
Conciseness 42% (+0pp) 7 🟢 8 🔴
Correctness 66.7% (+0pp) 3 🟢 4 🔴
Docs Faithfulness 62.8% (+2pp) 3 🟢 3 🔴
Goal Completion 77% (-3pp) 2 🟢 7 🔴
Knowledge Usage 94.9% (+8pp) 4 🟢 1 🔴
Safety 95.2% (+10pp) 1 🟢 1 🔴
Tool Usage 70.6% (+6pp) 6 🟢 2 🔴
SQL Identifier Quoting 100% (+0pp) - -
SQL Validity 95% (-5pp) - 1 🔴
URL Validity 100% - -
Time_to_first_token 3.32tok (+0.7tok) 6 🟢 23 🔴
Llm_calls 7.28 (+0.22) 18 🟢 8 🔴
Tool_calls 3.15 (+0.53) 19 🟢 6 🔴
Errors 0.02 (+0.02) - 1 🔴
Llm_errors 0.01 (+0.01) - 1 🔴
Tool_errors 0 (+0) - -
Prompt_tokens 25783.79tok (+3328.22tok) 9 🟢 17 🔴
Prompt_cached_tokens 7680tok (+388.41tok) 13 🟢 9 🔴
Prompt_cache_creation_tokens 0tok (+0tok) - -
Prompt_cache_creation_5m_tokens 0tok (+0tok) - -
Prompt_cache_creation_1h_tokens 0tok (+0tok) - -
Completion_tokens 650.49tok (+68.61tok) 9 🟢 20 🔴
Completion_reasoning_tokens 104tok (+16.1tok) 8 🟢 18 🔴
Completion_accepted_prediction_tokens 0tok (+0tok) - -
Completion_rejected_prediction_tokens 0tok (+0tok) - -
Completion_audio_tokens 0tok (+0tok) - -
Total_tokens 26434.29tok (+3396.83tok) 11 🟢 18 🔴
Estimated_cost 0$ (+0$) 11 🟢 17 🔴
Duration 17.72s (+1.88s) 8 🟢 21 🔴
Llm_duration 11.42s (+2.72s) 3 🟢 26 🔴

alaister added a commit that referenced this pull request Jul 3, 2026
…rom #46424) (#47117)

**Stack 5.1/6** of the TanStack Start migration (#46424). The original
S5 (174 files) was over CodeRabbit's 150-file review cap, so it's split
into 5.1 + 5.2 by product. Stacked on **#47113** (S4).

> [!NOTE]
> Thin route wrappers rendering the existing pages-router components via
compat shims. Next-safe (full Next build run). The TanStack app isn't
functional end-to-end until 5.2 + the matrix flip.

## What's in this PR
- **Data-cluster project routes:** database, editor, sql, storage,
realtime, branches.
- **Top-level / onboarding routes:** `authorize`, `join`, `logout`,
`redeem`, `verify-email`, `claim-project`, aws-marketplace,
Vercel/GitHub integration entrypoints; `_app`/`_auth` layout shells;
`/org/_` + `/project/_` catch-alls.
- **Supporting edits:** hoist `BranchesPageWrapper` out of `getLayout`,
`ConnectStepsSection` `import.meta.glob`, `api/server.js`.
- `routeTree.gen.ts` regenerated for the routes present so far.

## Verification
On top of S1–S4: `studio` typecheck ✓, lint (0 errors) ✓, **Next build ✓
(181/181 pages)**.


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

* **Refactor**
* Restructured application routing infrastructure for improved code
organization and maintainability.
* Extracted and refactored layout wrapper components for enhanced
reusability across different sections of the application.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Alaister Young <[email protected]>
Co-authored-by: Ivan Vasilov <[email protected]>
@alaister alaister mentioned this pull request Jul 10, 2026
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants