mirror of
https://github.com/FranP-code/create-better-t-stack.git
synced 2025-10-12 23:52:15 +00:00
chore(web): test
This commit is contained in:
@@ -3,6 +3,7 @@ import { source } from "@/lib/source";
|
|||||||
|
|
||||||
// cached forever
|
// cached forever
|
||||||
export const revalidate = false;
|
export const revalidate = false;
|
||||||
|
export const dynamic = 'force-static';
|
||||||
|
|
||||||
export async function GET() {
|
export async function GET() {
|
||||||
const scan = source.getPages().map(getLLMText);
|
const scan = source.getPages().map(getLLMText);
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import { notFound } from "next/navigation";
|
|
||||||
import { type NextRequest, NextResponse } from "next/server";
|
import { type NextRequest, NextResponse } from "next/server";
|
||||||
import { getLLMText } from "@/lib/get-llm-text";
|
import { getLLMText } from "@/lib/get-llm-text";
|
||||||
import { source } from "@/lib/source";
|
import { source } from "@/lib/source";
|
||||||
|
import { notFound } from "next/navigation";
|
||||||
|
|
||||||
export const revalidate = false;
|
export const revalidate = false;
|
||||||
|
export const dynamic = "force-static";
|
||||||
export async function GET(
|
export async function GET(
|
||||||
_req: NextRequest,
|
_req: NextRequest,
|
||||||
{ params }: { params: Promise<{ slug?: string[] }> },
|
{ params }: { params: Promise<{ slug?: string[] }> },
|
||||||
|
|||||||
@@ -1,9 +1,20 @@
|
|||||||
import type { InferPageType } from "fumadocs-core/source";
|
|
||||||
import { remarkInclude } from "fumadocs-mdx/config";
|
|
||||||
import { remark } from "remark";
|
import { remark } from "remark";
|
||||||
import remarkGfm from "remark-gfm";
|
import remarkGfm from "remark-gfm";
|
||||||
import remarkMdx from "remark-mdx";
|
import remarkMdx from "remark-mdx";
|
||||||
import type { source } from "@/lib/source";
|
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 };
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
const processor = remark()
|
const processor = remark()
|
||||||
.use(remarkMdx)
|
.use(remarkMdx)
|
||||||
@@ -11,7 +22,7 @@ const processor = remark()
|
|||||||
.use(remarkInclude)
|
.use(remarkInclude)
|
||||||
.use(remarkGfm);
|
.use(remarkGfm);
|
||||||
|
|
||||||
export async function getLLMText(page: InferPageType<typeof source>) {
|
export async function getLLMText(page: LLMPage) {
|
||||||
const processed = await processor.process({
|
const processed = await processor.process({
|
||||||
path: page.data._file.absolutePath,
|
path: page.data._file.absolutePath,
|
||||||
value: page.data.content,
|
value: page.data.content,
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
"name": "better-t-stack",
|
"name": "better-t-stack",
|
||||||
"compatibility_date": "2025-07-13",
|
"compatibility_date": "2025-07-13",
|
||||||
"compatibility_flags": ["nodejs_compat", "global_fetch_strictly_public"],
|
"compatibility_flags": ["nodejs_compat", "global_fetch_strictly_public"],
|
||||||
|
"minify": true,
|
||||||
"keep_names": false,
|
"keep_names": false,
|
||||||
"assets": {
|
"assets": {
|
||||||
"directory": ".open-next/assets",
|
"directory": ".open-next/assets",
|
||||||
|
|||||||
Reference in New Issue
Block a user