Skip to content

Commit 8f03897

Browse files
committed
Merge branch 'canary' into feat/package_json_for_plugins
2 parents bbafab5 + 2f1c941 commit 8f03897

File tree

10 files changed

+60
-18
lines changed

10 files changed

+60
-18
lines changed

apps/api/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "api",
3-
"version": "1.2.0-canary.59",
3+
"version": "1.2.0-canary.60",
44
"private": true,
55
"type": "module",
66
"scripts": {

apps/docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "docs",
3-
"version": "1.2.0-canary.59",
3+
"version": "1.2.0-canary.60",
44
"type": "module",
55
"private": true,
66
"scripts": {

apps/docs/source.config.ts

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,24 @@
1-
import { defineConfig, defineDocs } from "fumadocs-mdx/config";
1+
import {
2+
defineConfig,
3+
defineDocs,
4+
frontmatterSchema,
5+
metaSchema,
6+
} from "fumadocs-mdx/config";
7+
import jsonSchema from "fumadocs-mdx/plugins/json-schema";
28

39
export const docs = defineDocs({
410
dir: "content/docs",
11+
docs: {
12+
schema: frontmatterSchema,
13+
postprocess: {
14+
includeProcessedMarkdown: true,
15+
},
16+
},
17+
meta: {
18+
schema: metaSchema,
19+
},
520
});
621

722
export default defineConfig({
8-
mdxOptions: {
9-
// MDX options
10-
},
23+
plugins: [jsonSchema()],
1124
});

apps/docs/src/app/[locale]/(docs)/docs/[[...slug]]/page.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ import { source } from "@/lib/source";
1212

1313
import { ViewOptions } from "./page.client";
1414

15-
export default async function Page(props: {
16-
params: Promise<{ slug?: string[] }>;
17-
}) {
15+
export default async function Page(
16+
props: PageProps<"/[locale]/docs/[[...slug]]">,
17+
) {
1818
const params = await props.params;
1919
if (!params.slug) {
2020
await redirect("/docs/dev");
@@ -53,9 +53,9 @@ export default async function Page(props: {
5353
);
5454
}
5555

56-
export function generateStaticParams() {
57-
return source.generateParams();
58-
}
56+
// export function generateStaticParams() {
57+
// return source.generateParams();
58+
// }
5959

6060
export async function generateMetadata(props: {
6161
params: Promise<{ slug?: string[] }>;
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { getLLMText, source } from "@/lib/source";
2+
3+
export const revalidate = false;
4+
5+
export async function GET() {
6+
const scan = source.getPages().map(getLLMText);
7+
const scanned = await Promise.all(scan);
8+
9+
return new Response(scanned.join("\n\n"));
10+
}

apps/docs/src/lib/source.ts

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,33 @@
1-
import { loader } from "fumadocs-core/source";
1+
import { type InferPageType, loader } from "fumadocs-core/source";
2+
import { lucideIconsPlugin } from "fumadocs-core/source/lucide-icons";
23
import { icons } from "lucide-react";
34
import { createElement } from "react";
45

56
import { docs } from "@/.source";
67

78
export const source = loader({
89
baseUrl: "/docs",
10+
source: docs.toFumadocsSource(),
911
icon(icon) {
1012
if (icon && icon in icons)
1113
return createElement(icons[icon as keyof typeof icons]);
1214
},
13-
source: docs.toFumadocsSource(),
15+
plugins: [lucideIconsPlugin()],
1416
});
17+
18+
export function getPageImage(page: InferPageType<typeof source>) {
19+
const segments = [...page.slugs, "image.png"];
20+
21+
return {
22+
segments,
23+
url: `/og/docs/${segments.join("/")}`,
24+
};
25+
}
26+
27+
export async function getLLMText(page: InferPageType<typeof source>) {
28+
const processed = await page.data.getText("processed");
29+
30+
return `# ${page.data.title}
31+
32+
${processed}`;
33+
}

packages/config/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vitnode/config",
3-
"version": "1.2.0-canary.59",
3+
"version": "1.2.0-canary.60",
44
"description": "ESLint, Prettier, TypeScript (TSConfig) config for VitNode",
55
"author": "VitNode Team",
66
"license": "MIT",

packages/create-vitnode-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "create-vitnode-app",
3-
"version": "1.2.0-canary.59",
3+
"version": "1.2.0-canary.60",
44
"description": "Create a new VitNode app in seconds.",
55
"author": "VitNode Team",
66
"license": "MIT",

packages/vitnode/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vitnode/core",
3-
"version": "1.2.0-canary.59",
3+
"version": "1.2.0-canary.60",
44
"description": "Core package for VitNode, providing essential functionalities and configurations.",
55
"author": "VitNode Team",
66
"license": "MIT",

plugins/blog/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vitnode/blog",
3-
"version": "1.2.0-canary.59",
3+
"version": "1.2.0-canary.60",
44
"description": "Blog plugin for VitNode, providing a blogging platform with Next.js and Hono.js.",
55
"author": "VitNode Team",
66
"license": "MIT",

0 commit comments

Comments
 (0)