mirror of
https://github.com/supabase/supabase.git
synced 2026-10-11 12:25:05 +03:00
Two App Router routes (incident-banner, incident-status) and a few type-only uses elsewhere import from 'next/server'. The Vite nextCompat guard was 500ing on the build. Shim exposes NextResponse.json (the only value surface used) and a type alias NextRequest = Request.
14 lines
630 B
TypeScript
14 lines
630 B
TypeScript
// Vite-side compat for `next/server`. Workspace source uses `NextResponse`
|
|
// (only `.json()`) in two App Router routes and `NextRequest` as a type-only
|
|
// import elsewhere. Extend this file if more surface is needed.
|
|
|
|
export const NextResponse = {
|
|
json: (data: unknown, init?: ResponseInit) => Response.json(data, init),
|
|
}
|
|
|
|
// NextRequest extends Request with Next-specific fields (nextUrl, cookies,
|
|
// ip, geo). None of our workspace source reads those fields at runtime —
|
|
// the only imports are type-only. Aliasing to Request keeps TypeScript
|
|
// happy without pulling in Next internals.
|
|
export type NextRequest = Request
|