Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit60a9372

Browse files
authored
Implementllms-full.txt (#5004)
* Implement llms-full* Add fields to package.json* Fix build
1 parent3ac7bf0 commit60a9372

File tree

6 files changed

+103
-19
lines changed

6 files changed

+103
-19
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import*asfsfrom"node:fs/promises";
2+
import{join}from"node:path";
3+
import{getLLMText}from"@/loaders/get-llm-text";
4+
import{source}from"@/loaders/source";
5+
6+
exportconstrevalidate=false;
7+
8+
exportasyncfunctionGET(){
9+
constpages=source.getPages();
10+
11+
// Read meta.json to get the page order
12+
constmetaPath=join(process.cwd(),"content","meta.json");
13+
constmeta=JSON.parse(awaitfs.readFile(metaPath,"utf-8"));
14+
15+
// Create a map of page URLs to their order in meta.json
16+
constpageOrder=newMap<string,number>();
17+
meta.pages.forEach((page:string,index:number)=>{
18+
pageOrder.set(page,index);
19+
});
20+
21+
// Sort pages according to meta.json order
22+
constsortedPages=pages.sort((a,b)=>{
23+
constaOrder=pageOrder.get(a.url)??Number.MAX_SAFE_INTEGER;
24+
constbOrder=pageOrder.get(b.url)??Number.MAX_SAFE_INTEGER;
25+
returnaOrder-bOrder;
26+
});
27+
28+
// Generate content
29+
lettxt=`# Zod
30+
31+
Zod is a TypeScript-first schema validation library with static type inference. This documentation provides comprehensive coverage of Zod 4's features, API, and usage patterns.
32+
33+
`;
34+
35+
// Process each page
36+
for(constpageofsortedPages){
37+
txt+=awaitgetLLMText(page);
38+
txt+="\n\n";
39+
}
40+
41+
returnnewResponse(txt,{
42+
headers:{"Content-Type":"text/plain; charset=utf-8"},
43+
});
44+
}

‎packages/docs/content/v4/index.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title:Introducing Zod 4
2+
title:Release notes
33
description:"Zod 4 release notes and new features including performance improvements and breaking changes"
44
---
55

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import*asfsfrom"node:fs/promises";
2+
importtype{source}from"@/loaders/source";
3+
importtype{InferPageType}from"fumadocs-core/source";
4+
import{remarkInclude}from"fumadocs-mdx/config";
5+
importmatterfrom"gray-matter";
6+
import{remark}from"remark";
7+
importremarkGfmfrom"remark-gfm";
8+
importremarkMdxfrom"remark-mdx";
9+
importremarkStringifyfrom"remark-stringify";
10+
11+
constprocessor=remark().use(remarkMdx).use(remarkInclude).use(remarkGfm).use(remarkStringify);
12+
13+
exportasyncfunctiongetLLMText(page:InferPageType<typeofsource>):Promise<string>{
14+
constfilePath=page.data._file.absolutePath;
15+
constfileContent=awaitfs.readFile(filePath);
16+
const{ content, data}=matter(fileContent.toString());
17+
18+
constprocessed=awaitprocessor.process({
19+
path:filePath,
20+
value:content,
21+
});
22+
23+
return`#${page.data.title}
24+
25+
${processed}`;
26+
}

‎packages/docs/package.json‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,15 @@
1616
"fumadocs-core":"15.1.0",
1717
"fumadocs-mdx":"11.5.6",
1818
"fumadocs-ui":"15.1.0",
19+
"gray-matter":"^4.0.3",
1920
"lucide-react":"^0.483.0",
2021
"next":"15.2.2",
2122
"react":"^19.0.0",
22-
"react-dom":"^19.0.0"
23+
"react-dom":"^19.0.0",
24+
"remark":"^15.0.1",
25+
"remark-gfm":"^4.0.1",
26+
"remark-mdx":"^3.1.0",
27+
"remark-stringify":"^11.0.0"
2328
},
2429
"devDependencies": {
2530
"@tailwindcss/postcss":"^4.0.14",

‎packages/zod/package.json‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,15 @@
22
"name":"zod",
33
"version":"4.0.11",
44
"type":"module",
5+
"license":"MIT",
56
"author":"Colin McDonnell <zod@colinhacks.com>",
67
"description":"TypeScript-first schema declaration and validation library with static type inference",
8+
"homepage":"https://zod.dev",
9+
"llms":"https://zod.dev/llms.txt",
10+
"llmsFull":"https://zod.dev/llms-full.txt",
11+
"mcpServer":"https://mcp.inkeep.com/zod/mcp",
12+
"funding":"https://github.com/sponsors/colinhacks",
13+
"sideEffects":false,
714
"files": [
815
"src",
916
"**/*.js",
@@ -13,19 +20,13 @@
1320
"**/*.d.mts",
1421
"**/*.d.cts"
1522
],
16-
"funding":"https://github.com/sponsors/colinhacks",
17-
"homepage":"https://zod.dev",
18-
"llms":"https://zod.dev/llms.txt",
19-
"mcp":"https://mcp.inkeep.com/zod/mcp",
2023
"keywords": [
2124
"typescript",
2225
"schema",
2326
"validation",
2427
"type",
2528
"inference"
2629
],
27-
"license":"MIT",
28-
"sideEffects":false,
2930
"main":"./index.cjs",
3031
"types":"./index.d.cts",
3132
"module":"./index.js",

‎pnpm-lock.yaml‎

Lines changed: 19 additions & 11 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp