From 13e7d3a9ee6a3adabe6675828b048bff3cce9089 Mon Sep 17 00:00:00 2001 From: Aman Varshney Date: Tue, 12 Aug 2025 18:17:18 +0530 Subject: [PATCH] Revert "chore(web): test" This reverts commit 16e22726c84528d3ee066b41d5ee3b423e16d49b. --- apps/web/src/app/llms-full.txt/route.ts | 1 - .../web/src/app/llms.mdx/[[...slug]]/route.ts | 4 ++-- apps/web/src/lib/get-llm-text.ts | 19 ++++--------------- apps/web/wrangler.jsonc | 2 +- 4 files changed, 7 insertions(+), 19 deletions(-) diff --git a/apps/web/src/app/llms-full.txt/route.ts b/apps/web/src/app/llms-full.txt/route.ts index 1f85318..ed54c01 100644 --- a/apps/web/src/app/llms-full.txt/route.ts +++ b/apps/web/src/app/llms-full.txt/route.ts @@ -3,7 +3,6 @@ import { source } from "@/lib/source"; // cached forever export const revalidate = false; -export const dynamic = 'force-static'; export async function GET() { const scan = source.getPages().map(getLLMText); diff --git a/apps/web/src/app/llms.mdx/[[...slug]]/route.ts b/apps/web/src/app/llms.mdx/[[...slug]]/route.ts index a7f3d82..80ebdfb 100644 --- a/apps/web/src/app/llms.mdx/[[...slug]]/route.ts +++ b/apps/web/src/app/llms.mdx/[[...slug]]/route.ts @@ -1,10 +1,10 @@ +import { notFound } from "next/navigation"; import { type NextRequest, NextResponse } from "next/server"; import { getLLMText } from "@/lib/get-llm-text"; import { source } from "@/lib/source"; -import { notFound } from "next/navigation"; export const revalidate = false; -export const dynamic = "force-static"; + export async function GET( _req: NextRequest, { params }: { params: Promise<{ slug?: string[] }> }, diff --git a/apps/web/src/lib/get-llm-text.ts b/apps/web/src/lib/get-llm-text.ts index a46262b..1a5e231 100644 --- a/apps/web/src/lib/get-llm-text.ts +++ b/apps/web/src/lib/get-llm-text.ts @@ -1,20 +1,9 @@ +import type { InferPageType } from "fumadocs-core/source"; +import { remarkInclude } from "fumadocs-mdx/config"; import { remark } from "remark"; import remarkGfm from "remark-gfm"; import remarkMdx from "remark-mdx"; -import { remarkInclude } from "fumadocs-mdx/config"; -// Avoid importing `source` at runtime to keep bundle small -// import { source } from '@/lib/source'; -// import type { InferPageType } from 'fumadocs-core/source'; - -type LLMPage = { - url: string; - data: { - title: string; - description?: string; - content: string; - _file: { absolutePath: string; path: string }; - }; -}; +import type { source } from "@/lib/source"; const processor = remark() .use(remarkMdx) @@ -22,7 +11,7 @@ const processor = remark() .use(remarkInclude) .use(remarkGfm); -export async function getLLMText(page: LLMPage) { +export async function getLLMText(page: InferPageType) { const processed = await processor.process({ path: page.data._file.absolutePath, value: page.data.content, diff --git a/apps/web/wrangler.jsonc b/apps/web/wrangler.jsonc index f9fc56c..2af5e88 100644 --- a/apps/web/wrangler.jsonc +++ b/apps/web/wrangler.jsonc @@ -4,8 +4,8 @@ "name": "better-t-stack", "compatibility_date": "2025-07-13", "compatibility_flags": ["nodejs_compat", "global_fetch_strictly_public"], - "minify": true, "keep_names": false, + "minify": true, "assets": { "directory": ".open-next/assets", "binding": "ASSETS"