create-fumadocs-app 12.3.3 → 12.3.5
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-73OMMFUE.js → chunk-MR25BIJ7.js} +9 -14
- package/dist/create-app.js +1 -1
- package/dist/index.js +2 -2
- package/package.json +1 -1
- package/template/+shared/example.gitignore +1 -0
- package/template/{contentlayer → content-collections}/app/api/search/route.ts +2 -2
- package/template/{contentlayer → content-collections}/app/docs/[[...slug]]/page.tsx +11 -13
- package/template/content-collections/app/source.ts +8 -0
- package/template/content-collections/content-collections.ts +25 -0
- package/template/content-collections/next.config.mjs +8 -0
- package/template/{contentlayer → content-collections}/tsconfig.json +1 -1
- package/template/contentlayer/app/docs/[[...slug]]/content.tsx +0 -14
- package/template/contentlayer/app/source.ts +0 -9
- package/template/contentlayer/contentlayer.config.ts +0 -4
- package/template/contentlayer/next.config.js +0 -8
|
@@ -3,7 +3,7 @@ import path from "node:path";
|
|
|
3
3
|
import fs from "node:fs/promises";
|
|
4
4
|
|
|
5
5
|
// versions.json
|
|
6
|
-
var versions_default = { "fumadocs-core": "12.3.
|
|
6
|
+
var versions_default = { "fumadocs-core": "12.3.5", "fumadocs-ui": "12.3.5", "fumadocs-mdx": "8.2.33", "@fumadocs/content-collections": "1.0.0" };
|
|
7
7
|
|
|
8
8
|
// ../create-app-versions/package.json
|
|
9
9
|
var package_default = {
|
|
@@ -13,22 +13,19 @@ var package_default = {
|
|
|
13
13
|
description: "Used to track dependency versions in create-fumadocs-app",
|
|
14
14
|
license: "MIT",
|
|
15
15
|
dependencies: {
|
|
16
|
+
"@content-collections/core": "^0.6.0",
|
|
17
|
+
"@content-collections/mdx": "^0.1.3",
|
|
18
|
+
"@content-collections/next": "^0.2.0",
|
|
16
19
|
"@types/mdx": "^2.0.13",
|
|
17
20
|
"@types/react": "^18.3.3",
|
|
18
21
|
"@types/react-dom": "^18.3.0",
|
|
19
22
|
autoprefixer: "^10.4.19",
|
|
20
|
-
contentlayer: "^0.3.4",
|
|
21
23
|
next: "^14.2.4",
|
|
22
|
-
"next-contentlayer": "^0.3.4",
|
|
23
24
|
postcss: "^8.4.38",
|
|
24
25
|
react: "^18.3.1",
|
|
25
26
|
"react-dom": "^18.3.1",
|
|
26
27
|
tailwindcss: "^3.4.4",
|
|
27
28
|
typescript: "^5.5.2"
|
|
28
|
-
},
|
|
29
|
-
overrides: {
|
|
30
|
-
unified: "^11.0.4",
|
|
31
|
-
"mdx-bundler": "^10.0.1"
|
|
32
29
|
}
|
|
33
30
|
};
|
|
34
31
|
|
|
@@ -140,14 +137,12 @@ function createPackageJson(projectName, { template, tailwindcss }) {
|
|
|
140
137
|
typescript: package_default.dependencies.typescript
|
|
141
138
|
}
|
|
142
139
|
};
|
|
143
|
-
if (template === "
|
|
140
|
+
if (template === "content-collections") {
|
|
144
141
|
Object.assign(packageJson.dependencies, {
|
|
145
|
-
"fumadocs-
|
|
146
|
-
|
|
147
|
-
"
|
|
148
|
-
|
|
149
|
-
Object.assign(packageJson, {
|
|
150
|
-
overrides: package_default.overrides
|
|
142
|
+
"@fumadocs/content-collections": versions_default["@fumadocs/content-collections"],
|
|
143
|
+
"@content-collections/core": package_default.dependencies["@content-collections/core"],
|
|
144
|
+
"@content-collections/mdx": package_default.dependencies["@content-collections/mdx"],
|
|
145
|
+
"@content-collections/next": package_default.dependencies["@content-collections/next"]
|
|
151
146
|
});
|
|
152
147
|
}
|
|
153
148
|
if (template === "fuma-docs-mdx") {
|
package/dist/create-app.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
create,
|
|
4
4
|
cwd,
|
|
5
5
|
getPackageManager
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-MR25BIJ7.js";
|
|
7
7
|
|
|
8
8
|
// src/index.ts
|
|
9
9
|
import { existsSync } from "node:fs";
|
|
@@ -36,7 +36,7 @@ async function main() {
|
|
|
36
36
|
initialValue: "fuma-docs-mdx",
|
|
37
37
|
options: [
|
|
38
38
|
{ value: "fuma-docs-mdx", label: "Fumadocs MDX" },
|
|
39
|
-
{ value: "
|
|
39
|
+
{ value: "content-collections", label: "Content Collections" }
|
|
40
40
|
]
|
|
41
41
|
}),
|
|
42
42
|
tailwindcss: () => confirm({ message: "Use Tailwind CSS for styling?" }),
|
package/package.json
CHANGED
|
@@ -3,9 +3,9 @@ import { createSearchAPI } from 'fumadocs-core/search/server';
|
|
|
3
3
|
|
|
4
4
|
export const { GET } = createSearchAPI('advanced', {
|
|
5
5
|
indexes: getPages().map((page) => ({
|
|
6
|
-
id: page.data._id,
|
|
7
6
|
title: page.data.title,
|
|
8
|
-
url: page.url,
|
|
9
7
|
structuredData: page.data.structuredData,
|
|
8
|
+
id: page.url,
|
|
9
|
+
url: page.url,
|
|
10
10
|
})),
|
|
11
11
|
});
|
|
@@ -1,31 +1,29 @@
|
|
|
1
|
-
import { Content } from './content';
|
|
2
1
|
import { getPage, getPages } from '@/app/source';
|
|
3
2
|
import type { Metadata } from 'next';
|
|
4
3
|
import { DocsPage, DocsBody } from 'fumadocs-ui/page';
|
|
5
4
|
import { notFound } from 'next/navigation';
|
|
5
|
+
import { MDXContent } from '@content-collections/mdx/react';
|
|
6
|
+
import defaultMdxComponents from 'fumadocs-ui/mdx';
|
|
6
7
|
|
|
7
|
-
export default
|
|
8
|
-
params,
|
|
9
|
-
}: {
|
|
10
|
-
params: { slug?: string[] };
|
|
11
|
-
}) {
|
|
8
|
+
export default function Page({ params }: { params: { slug?: string[] } }) {
|
|
12
9
|
const page = getPage(params.slug);
|
|
13
10
|
|
|
14
|
-
if (page
|
|
15
|
-
notFound();
|
|
16
|
-
}
|
|
11
|
+
if (!page) notFound();
|
|
17
12
|
|
|
18
13
|
return (
|
|
19
|
-
<DocsPage toc={page.data.toc}>
|
|
14
|
+
<DocsPage toc={page.data.toc} full={page.data.full}>
|
|
20
15
|
<DocsBody>
|
|
21
16
|
<h1>{page.data.title}</h1>
|
|
22
|
-
<
|
|
17
|
+
<MDXContent
|
|
18
|
+
code={page.data.body}
|
|
19
|
+
components={{ ...defaultMdxComponents }}
|
|
20
|
+
/>
|
|
23
21
|
</DocsBody>
|
|
24
22
|
</DocsPage>
|
|
25
23
|
);
|
|
26
24
|
}
|
|
27
25
|
|
|
28
|
-
export
|
|
26
|
+
export function generateStaticParams() {
|
|
29
27
|
return getPages().map((page) => ({
|
|
30
28
|
slug: page.slugs,
|
|
31
29
|
}));
|
|
@@ -34,7 +32,7 @@ export async function generateStaticParams(): Promise<{ slug: string[] }[]> {
|
|
|
34
32
|
export function generateMetadata({ params }: { params: { slug?: string[] } }) {
|
|
35
33
|
const page = getPage(params.slug);
|
|
36
34
|
|
|
37
|
-
if (page
|
|
35
|
+
if (!page) notFound();
|
|
38
36
|
|
|
39
37
|
return {
|
|
40
38
|
title: page.data.title,
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { allDocs, allMetas } from 'content-collections';
|
|
2
|
+
import { loader } from 'fumadocs-core/source';
|
|
3
|
+
import { createMDXSource } from '@fumadocs/content-collections';
|
|
4
|
+
|
|
5
|
+
export const { getPage, getPages, pageTree } = loader({
|
|
6
|
+
baseUrl: '/docs',
|
|
7
|
+
source: createMDXSource(allDocs, allMetas),
|
|
8
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { defineCollection, defineConfig } from '@content-collections/core';
|
|
2
|
+
import {
|
|
3
|
+
createMetaSchema,
|
|
4
|
+
createDocSchema,
|
|
5
|
+
transformMDX,
|
|
6
|
+
} from '@fumadocs/content-collections/configuration';
|
|
7
|
+
|
|
8
|
+
const docs = defineCollection({
|
|
9
|
+
name: 'docs',
|
|
10
|
+
directory: 'content/docs',
|
|
11
|
+
include: '**/*.mdx',
|
|
12
|
+
schema: createDocSchema,
|
|
13
|
+
transform: transformMDX,
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
const metas = defineCollection({
|
|
17
|
+
name: 'meta',
|
|
18
|
+
directory: 'content/docs',
|
|
19
|
+
include: '**/meta.json',
|
|
20
|
+
schema: createMetaSchema,
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
export default defineConfig({
|
|
24
|
+
collections: [docs, metas],
|
|
25
|
+
});
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { useMDXComponent } from 'next-contentlayer/hooks';
|
|
4
|
-
import defaultComponents from 'fumadocs-ui/mdx';
|
|
5
|
-
|
|
6
|
-
const components = {
|
|
7
|
-
...defaultComponents,
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
export function Content({ code }: { code: string }) {
|
|
11
|
-
const MDX = useMDXComponent(code);
|
|
12
|
-
|
|
13
|
-
return <MDX components={components} />;
|
|
14
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { allDocs, allMeta } from 'contentlayer/generated';
|
|
2
|
-
import { createContentlayerSource } from 'fumadocs-contentlayer';
|
|
3
|
-
import { loader } from 'fumadocs-core/source';
|
|
4
|
-
|
|
5
|
-
export const { getPage, pageTree, getPages } = loader({
|
|
6
|
-
baseUrl: '/docs',
|
|
7
|
-
rootDir: 'docs',
|
|
8
|
-
source: createContentlayerSource(allMeta, allDocs),
|
|
9
|
-
});
|