From 353cb948e0aadffd537e3794138e55bdf8a73cb2 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 21 Aug 2026 14:11:15 +0000 Subject: [PATCH] fix(docs): migrate apps/docs to the Next 16 `proxy` file convention `middleware.ts` is deprecated in Next 16.3.1 and every `pnpm docs:dev` boot printed the migration warning. The runtime had already renamed the slot -- request timing lines read `proxy.ts: 6ms` while the file was still spelled `middleware.ts` -- so this only aligns the repo with the name Next already uses. Produced by the vendor codemod (`@next/codemod@canary middleware-to-proxy`), scoped to `apps/docs`: it renames the file and the default-exported function. The unrelated `packages/runtime/src/middleware.ts` is deliberately untouched. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01DdCnBGcHeufjrq7drTD3wt --- apps/docs/{middleware.ts => proxy.ts} | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) rename apps/docs/{middleware.ts => proxy.ts} (95%) diff --git a/apps/docs/middleware.ts b/apps/docs/proxy.ts similarity index 95% rename from apps/docs/middleware.ts rename to apps/docs/proxy.ts index 167fa2d014..4c8540cfdb 100644 --- a/apps/docs/middleware.ts +++ b/apps/docs/proxy.ts @@ -45,9 +45,10 @@ function getPreferredLanguage(request: NextRequest): string { } /** - * Middleware for automatic language detection and redirection + * Proxy (Next `proxy` file convention) for automatic language detection and + * redirection * - * This middleware: + * This proxy: * - Detects the user's preferred language from browser settings or cookies * - Redirects users to the appropriate localized version * - For the default language (en): keeps URL as "/" (with internal rewrite) @@ -56,7 +57,7 @@ function getPreferredLanguage(request: NextRequest): string { * The docs are English-only by decision (2026-07); the i18n plumbing stays so a * future language only needs entries in lib/i18n.ts and content, not new routing. */ -export default function middleware(request: NextRequest) { +export default function proxy(request: NextRequest) { const { pathname } = request.nextUrl; // Check if the pathname already has a locale