create-fumadocs-app 15.8.0 → 15.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-2GINJ73X.js → chunk-34R3NFAS.js} +48 -30
- package/dist/create-app.d.ts +7 -13
- package/dist/create-app.js +1 -1
- package/dist/index.js +2 -2
- package/package.json +1 -1
- package/template/+next+fuma-docs-mdx/app/docs/[[...slug]]/page.tsx +8 -5
- package/template/+next+fuma-docs-mdx/app/llms-full.txt/route.ts +10 -0
- package/template/+next+fuma-docs-mdx/app/og/docs/[...slug]/route.tsx +36 -0
- package/template/+next+fuma-docs-mdx/lib/source.ts +18 -2
- package/template/+next+fuma-docs-mdx/source.config.ts +4 -1
- package/template/tanstack-start/package.json +10 -10
- package/template/tanstack-start/src/routes/docs/$.tsx +1 -1
- package/template/tanstack-start/vite.config.ts +0 -1
|
@@ -59,7 +59,7 @@ async function tryGitInit(cwd2) {
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
// src/versions.js
|
|
62
|
-
var versions = { "fumadocs-core": "15.8.
|
|
62
|
+
var versions = { "fumadocs-core": "15.8.1", "fumadocs-ui": "15.8.1", "fumadocs-mdx": "12.0.1", "@fumadocs/mdx-remote": "1.4.0", "@fumadocs/content-collections": "1.2.2" };
|
|
63
63
|
|
|
64
64
|
// ../create-app-versions/package.json
|
|
65
65
|
var package_default = {
|
|
@@ -73,16 +73,16 @@ var package_default = {
|
|
|
73
73
|
"@content-collections/core": "^0.11.1",
|
|
74
74
|
"@content-collections/mdx": "^0.2.2",
|
|
75
75
|
"@content-collections/next": "^0.2.7",
|
|
76
|
-
"@react-router/dev": "^7.9.
|
|
77
|
-
"@react-router/node": "^7.9.
|
|
78
|
-
"@react-router/serve": "^7.9.
|
|
76
|
+
"@react-router/dev": "^7.9.3",
|
|
77
|
+
"@react-router/node": "^7.9.3",
|
|
78
|
+
"@react-router/serve": "^7.9.3",
|
|
79
79
|
"@tailwindcss/postcss": "^4.1.13",
|
|
80
80
|
"@tailwindcss/vite": "^4.1.13",
|
|
81
|
-
"@tanstack/react-router": "^1.132.
|
|
82
|
-
"@tanstack/react-start": "^1.132.
|
|
81
|
+
"@tanstack/react-router": "^1.132.7",
|
|
82
|
+
"@tanstack/react-start": "^1.132.13",
|
|
83
83
|
"@types/mdx": "^2.0.13",
|
|
84
84
|
"@types/node": "24.5.2",
|
|
85
|
-
"@types/react": "^19.1.
|
|
85
|
+
"@types/react": "^19.1.14",
|
|
86
86
|
"@types/react-dom": "^19.1.9",
|
|
87
87
|
"@vitejs/plugin-react": "^5.0.3",
|
|
88
88
|
"gray-matter": "^4.0.3",
|
|
@@ -91,7 +91,7 @@ var package_default = {
|
|
|
91
91
|
postcss: "^8.5.6",
|
|
92
92
|
react: "^19.1.1",
|
|
93
93
|
"react-dom": "^19.1.1",
|
|
94
|
-
"react-router": "^7.9.
|
|
94
|
+
"react-router": "^7.9.3",
|
|
95
95
|
"react-router-devtools": "^5.1.3",
|
|
96
96
|
shiki: "^3.13.0",
|
|
97
97
|
tailwindcss: "^4.1.13",
|
|
@@ -146,21 +146,39 @@ var templates = [
|
|
|
146
146
|
"tanstack-start",
|
|
147
147
|
"waku"
|
|
148
148
|
];
|
|
149
|
-
|
|
149
|
+
function defaults(options) {
|
|
150
|
+
return {
|
|
151
|
+
...options,
|
|
152
|
+
useSrcDir: options.useSrcDir ?? false,
|
|
153
|
+
tailwindcss: options.tailwindcss ?? true,
|
|
154
|
+
lint: options.lint ?? false,
|
|
155
|
+
initializeGit: options.initializeGit ?? false,
|
|
156
|
+
installDeps: options.installDeps ?? false,
|
|
157
|
+
log: console.log
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
async function create(createOptions) {
|
|
161
|
+
const options = defaults(createOptions);
|
|
150
162
|
const {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
log
|
|
163
|
+
outputDir,
|
|
164
|
+
useSrcDir,
|
|
165
|
+
log,
|
|
166
|
+
installDeps,
|
|
167
|
+
template,
|
|
168
|
+
lint,
|
|
169
|
+
initializeGit,
|
|
170
|
+
packageManager,
|
|
171
|
+
tailwindcss
|
|
154
172
|
} = options;
|
|
155
|
-
const projectName = path.basename(
|
|
156
|
-
const dest = path.resolve(cwd,
|
|
173
|
+
const projectName = path.basename(outputDir);
|
|
174
|
+
const dest = path.resolve(cwd, outputDir);
|
|
157
175
|
const isNext = options.template.startsWith("+next");
|
|
158
176
|
function isRelative(dir, file) {
|
|
159
177
|
return !path.relative(path.join(dest, dir), file).startsWith(`..${path.sep}`);
|
|
160
178
|
}
|
|
161
179
|
function defaultRename(file) {
|
|
162
180
|
file = file.replace("example.gitignore", ".gitignore");
|
|
163
|
-
if (!
|
|
181
|
+
if (!useSrcDir || !isNext) {
|
|
164
182
|
return file;
|
|
165
183
|
}
|
|
166
184
|
if (path.basename(file) === "mdx-components.tsx" || isRelative("app", file) || isRelative("lib", file)) {
|
|
@@ -171,11 +189,11 @@ async function create(options) {
|
|
|
171
189
|
if (isNext) {
|
|
172
190
|
await copy(path.join(sourceDir, `template/+next`), dest, defaultRename);
|
|
173
191
|
await copy(
|
|
174
|
-
path.join(sourceDir, `template/${
|
|
192
|
+
path.join(sourceDir, `template/${template}`),
|
|
175
193
|
dest,
|
|
176
194
|
defaultRename
|
|
177
195
|
);
|
|
178
|
-
if (
|
|
196
|
+
if (tailwindcss) {
|
|
179
197
|
await copy(
|
|
180
198
|
path.join(sourceDir, `template/+next+tailwindcss`),
|
|
181
199
|
dest,
|
|
@@ -183,15 +201,15 @@ async function create(options) {
|
|
|
183
201
|
);
|
|
184
202
|
log("Configured Tailwind CSS");
|
|
185
203
|
}
|
|
186
|
-
if (
|
|
204
|
+
if (lint) {
|
|
187
205
|
await copy(
|
|
188
|
-
path.join(sourceDir, `template/+next+${
|
|
206
|
+
path.join(sourceDir, `template/+next+${lint}`),
|
|
189
207
|
dest,
|
|
190
208
|
defaultRename
|
|
191
209
|
);
|
|
192
210
|
log("Configured Linter");
|
|
193
211
|
}
|
|
194
|
-
if (
|
|
212
|
+
if (useSrcDir) {
|
|
195
213
|
const tsconfigPath = path.join(dest, "tsconfig.json");
|
|
196
214
|
const content = (await fs2.readFile(tsconfigPath)).toString();
|
|
197
215
|
const config = JSON.parse(content);
|
|
@@ -204,7 +222,7 @@ async function create(options) {
|
|
|
204
222
|
}
|
|
205
223
|
} else {
|
|
206
224
|
await copy(
|
|
207
|
-
path.join(sourceDir, `template/${
|
|
225
|
+
path.join(sourceDir, `template/${template}`),
|
|
208
226
|
dest,
|
|
209
227
|
defaultRename
|
|
210
228
|
);
|
|
@@ -218,7 +236,7 @@ async function create(options) {
|
|
|
218
236
|
await fs2.writeFile(path.join(dest, "README.md"), readMe);
|
|
219
237
|
if (installDeps) {
|
|
220
238
|
try {
|
|
221
|
-
await autoInstall(
|
|
239
|
+
await autoInstall(packageManager, dest);
|
|
222
240
|
log("Installed dependencies");
|
|
223
241
|
} catch (err) {
|
|
224
242
|
log(`Failed to install dependencies: ${err}`);
|
|
@@ -248,7 +266,7 @@ async function copy(from, to, rename = (s) => s) {
|
|
|
248
266
|
await fs2.copyFile(from, to);
|
|
249
267
|
}
|
|
250
268
|
}
|
|
251
|
-
async function createNextPackageJson(projectName,
|
|
269
|
+
async function createNextPackageJson(projectName, { template, lint, tailwindcss }) {
|
|
252
270
|
return {
|
|
253
271
|
name: projectName,
|
|
254
272
|
version: "0.0.0",
|
|
@@ -257,15 +275,15 @@ async function createNextPackageJson(projectName, options) {
|
|
|
257
275
|
build: "next build",
|
|
258
276
|
dev: "next dev --turbo",
|
|
259
277
|
start: "next start",
|
|
260
|
-
...
|
|
278
|
+
...template === "+next+fuma-docs-mdx" && {
|
|
261
279
|
postinstall: "fumadocs-mdx"
|
|
262
280
|
},
|
|
263
|
-
...
|
|
281
|
+
...lint && {
|
|
264
282
|
eslint: {
|
|
265
283
|
lint: "eslint"
|
|
266
284
|
},
|
|
267
285
|
biome: { lint: "biome check", format: "biome format --write" }
|
|
268
|
-
}[
|
|
286
|
+
}[lint]
|
|
269
287
|
},
|
|
270
288
|
dependencies: {
|
|
271
289
|
...pick(package_default.dependencies, ["next", "react", "react-dom"]),
|
|
@@ -283,7 +301,7 @@ async function createNextPackageJson(projectName, options) {
|
|
|
283
301
|
waku: null,
|
|
284
302
|
"tanstack-start": null,
|
|
285
303
|
"react-router": null
|
|
286
|
-
}[
|
|
304
|
+
}[template]
|
|
287
305
|
},
|
|
288
306
|
devDependencies: {
|
|
289
307
|
...pick(package_default.dependencies, [
|
|
@@ -293,19 +311,19 @@ async function createNextPackageJson(projectName, options) {
|
|
|
293
311
|
"typescript",
|
|
294
312
|
"@types/mdx"
|
|
295
313
|
]),
|
|
296
|
-
...
|
|
314
|
+
...tailwindcss && pick(package_default.dependencies, [
|
|
297
315
|
"@tailwindcss/postcss",
|
|
298
316
|
"tailwindcss",
|
|
299
317
|
"postcss"
|
|
300
318
|
]),
|
|
301
|
-
...
|
|
319
|
+
...lint && {
|
|
302
320
|
eslint: {
|
|
303
321
|
eslint: "^9",
|
|
304
322
|
"eslint-config-next": package_default.dependencies.next,
|
|
305
323
|
"@eslint/eslintrc": "^3"
|
|
306
324
|
},
|
|
307
325
|
biome: pick(package_default.dependencies, ["@biomejs/biome"])
|
|
308
|
-
}[
|
|
326
|
+
}[lint]
|
|
309
327
|
}
|
|
310
328
|
};
|
|
311
329
|
}
|
package/dist/create-app.d.ts
CHANGED
|
@@ -11,23 +11,17 @@ interface Options {
|
|
|
11
11
|
*/
|
|
12
12
|
packageManager: PackageManager;
|
|
13
13
|
/**
|
|
14
|
-
* Create files inside `src`
|
|
15
|
-
*
|
|
16
|
-
* (Next.js only)
|
|
14
|
+
* (Next.js only) Create files inside `src`
|
|
15
|
+
* @defaultValue false
|
|
17
16
|
*/
|
|
18
17
|
useSrcDir?: boolean;
|
|
19
18
|
/**
|
|
20
|
-
* Configure Tailwind CSS
|
|
21
|
-
*
|
|
22
|
-
* (Next.js only)
|
|
23
|
-
*/
|
|
24
|
-
tailwindcss: boolean;
|
|
25
|
-
/**
|
|
26
|
-
* @deprecated use `lint` instead.
|
|
19
|
+
* (Next.js only) Configure Tailwind CSS
|
|
20
|
+
* @defaultValue true
|
|
27
21
|
*/
|
|
28
|
-
|
|
22
|
+
tailwindcss?: boolean;
|
|
29
23
|
/**
|
|
30
|
-
*
|
|
24
|
+
* (Next.js Only) Configure Lint
|
|
31
25
|
* @defaultValue false
|
|
32
26
|
*/
|
|
33
27
|
lint?: 'eslint' | 'biome' | false;
|
|
@@ -35,6 +29,6 @@ interface Options {
|
|
|
35
29
|
initializeGit?: boolean;
|
|
36
30
|
log?: (message: string) => void;
|
|
37
31
|
}
|
|
38
|
-
declare function create(
|
|
32
|
+
declare function create(createOptions: Options): Promise<void>;
|
|
39
33
|
|
|
40
34
|
export { type Options, type Template, create, templates };
|
package/dist/create-app.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
getPackageManager,
|
|
6
6
|
managers,
|
|
7
7
|
templates
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-34R3NFAS.js";
|
|
9
9
|
|
|
10
10
|
// src/index.ts
|
|
11
11
|
import fs from "fs/promises";
|
|
@@ -181,7 +181,7 @@ async function main(config) {
|
|
|
181
181
|
installDeps: options.installDeps,
|
|
182
182
|
lint: options.lint,
|
|
183
183
|
useSrcDir: options.src,
|
|
184
|
-
initializeGit: config.git,
|
|
184
|
+
initializeGit: config.git ?? true,
|
|
185
185
|
log: (message) => {
|
|
186
186
|
info.message(message);
|
|
187
187
|
}
|
package/package.json
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { source } from '@/lib/source';
|
|
1
|
+
import { getPageImage, source } from '@/lib/source';
|
|
2
2
|
import {
|
|
3
3
|
DocsBody,
|
|
4
4
|
DocsDescription,
|
|
5
5
|
DocsPage,
|
|
6
6
|
DocsTitle,
|
|
7
7
|
} from 'fumadocs-ui/page';
|
|
8
|
-
import type { Metadata } from 'next';
|
|
9
8
|
import { notFound } from 'next/navigation';
|
|
10
|
-
import { createRelativeLink } from 'fumadocs-ui/mdx';
|
|
11
9
|
import { getMDXComponents } from '@/mdx-components';
|
|
10
|
+
import type { Metadata } from 'next';
|
|
11
|
+
import { createRelativeLink } from 'fumadocs-ui/mdx';
|
|
12
12
|
|
|
13
13
|
export default async function Page(props: PageProps<'/docs/[[...slug]]'>) {
|
|
14
14
|
const params = await props.params;
|
|
15
15
|
const page = source.getPage(params.slug);
|
|
16
16
|
if (!page) notFound();
|
|
17
17
|
|
|
18
|
-
const
|
|
18
|
+
const MDX = page.data.body;
|
|
19
19
|
|
|
20
20
|
return (
|
|
21
21
|
<DocsPage toc={page.data.toc} full={page.data.full}>
|
|
22
22
|
<DocsTitle>{page.data.title}</DocsTitle>
|
|
23
23
|
<DocsDescription>{page.data.description}</DocsDescription>
|
|
24
24
|
<DocsBody>
|
|
25
|
-
<
|
|
25
|
+
<MDX
|
|
26
26
|
components={getMDXComponents({
|
|
27
27
|
// this allows you to link to other pages with relative file paths
|
|
28
28
|
a: createRelativeLink(source, page),
|
|
@@ -47,5 +47,8 @@ export async function generateMetadata(
|
|
|
47
47
|
return {
|
|
48
48
|
title: page.data.title,
|
|
49
49
|
description: page.data.description,
|
|
50
|
+
openGraph: {
|
|
51
|
+
images: getPageImage(page).url,
|
|
52
|
+
},
|
|
50
53
|
};
|
|
51
54
|
}
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { getPageImage, source } from '@/lib/source';
|
|
2
|
+
import { notFound } from 'next/navigation';
|
|
3
|
+
import { ImageResponse } from 'next/og';
|
|
4
|
+
import { generate as DefaultImage } from 'fumadocs-ui/og';
|
|
5
|
+
|
|
6
|
+
export const revalidate = false;
|
|
7
|
+
|
|
8
|
+
export async function GET(
|
|
9
|
+
_req: Request,
|
|
10
|
+
{ params }: RouteContext<'/og/docs/[...slug]'>,
|
|
11
|
+
) {
|
|
12
|
+
const { slug } = await params;
|
|
13
|
+
const page = source.getPage(slug.slice(0, -1));
|
|
14
|
+
if (!page) notFound();
|
|
15
|
+
|
|
16
|
+
return new ImageResponse(
|
|
17
|
+
(
|
|
18
|
+
<DefaultImage
|
|
19
|
+
title={page.data.title}
|
|
20
|
+
description={page.data.description}
|
|
21
|
+
site="My App"
|
|
22
|
+
/>
|
|
23
|
+
),
|
|
24
|
+
{
|
|
25
|
+
width: 1200,
|
|
26
|
+
height: 630,
|
|
27
|
+
},
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function generateStaticParams() {
|
|
32
|
+
return source.getPages().map((page) => ({
|
|
33
|
+
lang: page.locale,
|
|
34
|
+
slug: getPageImage(page).segments,
|
|
35
|
+
}));
|
|
36
|
+
}
|
|
@@ -1,9 +1,25 @@
|
|
|
1
1
|
import { docs } from '@/.source';
|
|
2
|
-
import { loader } from 'fumadocs-core/source';
|
|
2
|
+
import { type InferPageType, loader } from 'fumadocs-core/source';
|
|
3
3
|
|
|
4
4
|
// See https://fumadocs.vercel.app/docs/headless/source-api for more info
|
|
5
5
|
export const source = loader({
|
|
6
|
-
// it assigns a URL to your pages
|
|
7
6
|
baseUrl: '/docs',
|
|
8
7
|
source: docs.toFumadocsSource(),
|
|
9
8
|
});
|
|
9
|
+
|
|
10
|
+
export function getPageImage(page: InferPageType<typeof source>) {
|
|
11
|
+
const segments = [...page.slugs, 'image.png'];
|
|
12
|
+
|
|
13
|
+
return {
|
|
14
|
+
segments,
|
|
15
|
+
url: `/og/docs/${segments.join('/')}`,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export async function getLLMText(page: InferPageType<typeof source>) {
|
|
20
|
+
const processed = await page.data.getText('processed');
|
|
21
|
+
|
|
22
|
+
return `# ${page.data.title} (${page.url})
|
|
23
|
+
|
|
24
|
+
${processed}`;
|
|
25
|
+
}
|
|
@@ -6,10 +6,13 @@ import {
|
|
|
6
6
|
} from 'fumadocs-mdx/config';
|
|
7
7
|
|
|
8
8
|
// You can customise Zod schemas for frontmatter and `meta.json` here
|
|
9
|
-
// see https://fumadocs.dev/docs/mdx/collections
|
|
9
|
+
// see https://fumadocs.dev/docs/mdx/collections
|
|
10
10
|
export const docs = defineDocs({
|
|
11
11
|
docs: {
|
|
12
12
|
schema: frontmatterSchema,
|
|
13
|
+
postprocess: {
|
|
14
|
+
includeProcessedMarkdown: true,
|
|
15
|
+
},
|
|
13
16
|
},
|
|
14
17
|
meta: {
|
|
15
18
|
schema: metaSchema,
|
|
@@ -9,26 +9,26 @@
|
|
|
9
9
|
"start": "node .output/server/index.mjs"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@tanstack/react-router": "^1.
|
|
13
|
-
"@tanstack/react-router-devtools": "^1.
|
|
14
|
-
"@tanstack/react-start": "^1.
|
|
12
|
+
"@tanstack/react-router": "^1.132.7",
|
|
13
|
+
"@tanstack/react-router-devtools": "^1.132.11",
|
|
14
|
+
"@tanstack/react-start": "^1.132.13",
|
|
15
15
|
"fumadocs-core": "workspace:*",
|
|
16
16
|
"fumadocs-mdx": "workspace:*",
|
|
17
17
|
"fumadocs-ui": "workspace:*",
|
|
18
|
-
"lucide-static": "^0.
|
|
18
|
+
"lucide-static": "^0.544.0",
|
|
19
19
|
"react": "^19.1.1",
|
|
20
20
|
"react-dom": "^19.1.1",
|
|
21
21
|
"tailwind-merge": "^3.3.1",
|
|
22
|
-
"vite": "^7.1.
|
|
22
|
+
"vite": "^7.1.7"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@tailwindcss/vite": "^4.1.
|
|
25
|
+
"@tailwindcss/vite": "^4.1.13",
|
|
26
26
|
"@types/mdx": "^2.0.13",
|
|
27
|
-
"@types/node": "^24.
|
|
28
|
-
"@types/react": "^19.1.
|
|
27
|
+
"@types/node": "^24.5.2",
|
|
28
|
+
"@types/react": "^19.1.14",
|
|
29
29
|
"@types/react-dom": "^19.1.9",
|
|
30
|
-
"@vitejs/plugin-react": "^5.0.
|
|
31
|
-
"tailwindcss": "^4.1.
|
|
30
|
+
"@vitejs/plugin-react": "^5.0.3",
|
|
31
|
+
"tailwindcss": "^4.1.13",
|
|
32
32
|
"typescript": "^5.9.2",
|
|
33
33
|
"vite-tsconfig-paths": "^5.1.4"
|
|
34
34
|
}
|
|
@@ -27,7 +27,7 @@ export const Route = createFileRoute('/docs/$')({
|
|
|
27
27
|
const loader = createServerFn({
|
|
28
28
|
method: 'GET',
|
|
29
29
|
})
|
|
30
|
-
.
|
|
30
|
+
.inputValidator((slugs: string[]) => slugs)
|
|
31
31
|
.handler(async ({ data: slugs }) => {
|
|
32
32
|
const page = source.getPage(slugs);
|
|
33
33
|
if (!page) throw notFound();
|