create-fumadocs-app 13.4.5 → 13.4.6

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.
@@ -60,7 +60,7 @@ function tryGitInit(root) {
60
60
  }
61
61
 
62
62
  // versions.json
63
- var versions_default = { "fumadocs-core": "13.4.5", "fumadocs-ui": "13.4.5", "fumadocs-mdx": "10.0.1", "@fumadocs/content-collections": "1.1.4" };
63
+ var versions_default = { "fumadocs-core": "13.4.6", "fumadocs-ui": "13.4.6", "fumadocs-mdx": "10.0.1", "@fumadocs/content-collections": "1.1.4" };
64
64
 
65
65
  // ../create-app-versions/package.json
66
66
  var package_default = {
@@ -74,12 +74,12 @@ var package_default = {
74
74
  "@content-collections/mdx": "^0.1.3",
75
75
  "@content-collections/next": "^0.2.0",
76
76
  "@types/mdx": "^2.0.13",
77
- "@types/node": "22.5.2",
77
+ "@types/node": "22.5.4",
78
78
  "@types/react": "^18.3.5",
79
79
  "@types/react-dom": "^18.3.0",
80
80
  autoprefixer: "^10.4.20",
81
- next: "^14.2.7",
82
- postcss: "^8.4.42",
81
+ next: "^14.2.8",
82
+ postcss: "^8.4.45",
83
83
  react: "^18.3.1",
84
84
  "react-dom": "^18.3.1",
85
85
  tailwindcss: "^3.4.10",
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  create
3
- } from "./chunk-I7YO6DUN.js";
3
+ } from "./chunk-42HKMHLK.js";
4
4
  export {
5
5
  create
6
6
  };
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  create,
4
4
  cwd,
5
5
  getPackageManager
6
- } from "./chunk-I7YO6DUN.js";
6
+ } from "./chunk-42HKMHLK.js";
7
7
 
8
8
  // src/index.ts
9
9
  import { existsSync } from "node:fs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-fumadocs-app",
3
- "version": "13.4.5",
3
+ "version": "13.4.6",
4
4
  "description": "Create a new documentation site with Fumadocs",
5
5
  "keywords": [
6
6
  "NextJs",
@@ -21,11 +21,11 @@
21
21
  "dependencies": {
22
22
  "@clack/prompts": "^0.7.0",
23
23
  "cross-spawn": "^7.0.3",
24
- "picocolors": "^1.0.1"
24
+ "picocolors": "^1.1.0"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@types/cross-spawn": "^6.0.6",
28
- "@types/node": "22.5.2",
28
+ "@types/node": "22.5.4",
29
29
  "fast-glob": "^3.3.1",
30
30
  "eslint-config-custom": "0.0.0",
31
31
  "tsconfig": "0.0.0"
@@ -0,0 +1,11 @@
1
+ import type { ReactNode } from 'react';
2
+ import { HomeLayout } from 'fumadocs-ui/home-layout';
3
+ import { baseOptions } from '../layout.config';
4
+
5
+ export default function Layout({
6
+ children,
7
+ }: {
8
+ children: ReactNode;
9
+ }): React.ReactElement {
10
+ return <HomeLayout {...baseOptions}>{children}</HomeLayout>;
11
+ }
@@ -1,7 +1,12 @@
1
1
  import { DocsLayout } from 'fumadocs-ui/layout';
2
2
  import type { ReactNode } from 'react';
3
- import { docsOptions } from '../layout.config';
3
+ import { baseOptions } from '../layout.config';
4
+ import { source } from '@/app/source';
4
5
 
5
6
  export default function Layout({ children }: { children: ReactNode }) {
6
- return <DocsLayout {...docsOptions}>{children}</DocsLayout>;
7
+ return (
8
+ <DocsLayout tree={source.pageTree} {...baseOptions}>
9
+ {children}
10
+ </DocsLayout>
11
+ );
7
12
  }
@@ -1,8 +1,11 @@
1
- import { type DocsLayoutProps } from 'fumadocs-ui/layout';
2
1
  import { type HomeLayoutProps } from 'fumadocs-ui/home-layout';
3
- import { pageTree } from '@/app/source';
4
2
 
5
- // shared configuration
3
+ /**
4
+ * Shared layout configuration
5
+ *
6
+ * you cna configure layouts individually from:
7
+ * Home Layout:
8
+ */
6
9
  export const baseOptions: HomeLayoutProps = {
7
10
  nav: {
8
11
  title: 'My App',
@@ -15,9 +18,3 @@ export const baseOptions: HomeLayoutProps = {
15
18
  },
16
19
  ],
17
20
  };
18
-
19
- // docs layout configuration
20
- export const docsOptions: DocsLayoutProps = {
21
- ...baseOptions,
22
- tree: pageTree,
23
- };
@@ -1,8 +1,8 @@
1
- import { getPages } from '@/app/source';
1
+ import { source } from '@/app/source';
2
2
  import { createSearchAPI } from 'fumadocs-core/search/server';
3
3
 
4
4
  export const { GET } = createSearchAPI('advanced', {
5
- indexes: getPages().map((page) => ({
5
+ indexes: source.getPages().map((page) => ({
6
6
  title: page.data.title,
7
7
  structuredData: page.data.structuredData,
8
8
  id: page.url,
@@ -1,4 +1,4 @@
1
- import { getPage, getPages } from '@/app/source';
1
+ import { source } from '@/app/source';
2
2
  import type { Metadata } from 'next';
3
3
  import {
4
4
  DocsPage,
@@ -11,8 +11,7 @@ import { MDXContent } from '@content-collections/mdx/react';
11
11
  import defaultMdxComponents from 'fumadocs-ui/mdx';
12
12
 
13
13
  export default function Page({ params }: { params: { slug?: string[] } }) {
14
- const page = getPage(params.slug);
15
-
14
+ const page = source.getPage(params.slug);
16
15
  if (!page) notFound();
17
16
 
18
17
  return (
@@ -30,14 +29,11 @@ export default function Page({ params }: { params: { slug?: string[] } }) {
30
29
  }
31
30
 
32
31
  export function generateStaticParams() {
33
- return getPages().map((page) => ({
34
- slug: page.slugs,
35
- }));
32
+ return source.generateParams();
36
33
  }
37
34
 
38
35
  export function generateMetadata({ params }: { params: { slug?: string[] } }) {
39
- const page = getPage(params.slug);
40
-
36
+ const page = source.getPage(params.slug);
41
37
  if (!page) notFound();
42
38
 
43
39
  return {
@@ -2,7 +2,7 @@ import { allDocs, allMetas } from 'content-collections';
2
2
  import { loader } from 'fumadocs-core/source';
3
3
  import { createMDXSource } from '@fumadocs/content-collections';
4
4
 
5
- export const { getPage, getPages, pageTree } = loader({
5
+ export const source = loader({
6
6
  baseUrl: '/docs',
7
7
  source: createMDXSource(allDocs, allMetas),
8
8
  });
@@ -1,8 +1,8 @@
1
- import { getPages } from '@/app/source';
1
+ import { source } from '@/app/source';
2
2
  import { createSearchAPI } from 'fumadocs-core/search/server';
3
3
 
4
4
  export const { GET } = createSearchAPI('advanced', {
5
- indexes: getPages().map((page) => ({
5
+ indexes: source.getPages().map((page) => ({
6
6
  title: page.data.title,
7
7
  structuredData: page.data.structuredData,
8
8
  id: page.url,
@@ -1,4 +1,4 @@
1
- import { getPage, getPages } from '@/app/source';
1
+ import { source } from '@/app/source';
2
2
  import type { Metadata } from 'next';
3
3
  import {
4
4
  DocsPage,
@@ -7,14 +7,14 @@ import {
7
7
  DocsTitle,
8
8
  } from 'fumadocs-ui/page';
9
9
  import { notFound } from 'next/navigation';
10
- import defaultComponents from 'fumadocs-ui/mdx';
10
+ import defaultMdxComponents from 'fumadocs-ui/mdx';
11
11
 
12
12
  export default async function Page({
13
13
  params,
14
14
  }: {
15
15
  params: { slug?: string[] };
16
16
  }) {
17
- const page = getPage(params.slug);
17
+ const page = source.getPage(params.slug);
18
18
  if (!page) notFound();
19
19
 
20
20
  const MDX = page.data.body;
@@ -24,20 +24,18 @@ export default async function Page({
24
24
  <DocsTitle>{page.data.title}</DocsTitle>
25
25
  <DocsDescription>{page.data.description}</DocsDescription>
26
26
  <DocsBody>
27
- <MDX components={defaultComponents} />
27
+ <MDX components={{ ...defaultMdxComponents }} />
28
28
  </DocsBody>
29
29
  </DocsPage>
30
30
  );
31
31
  }
32
32
 
33
33
  export async function generateStaticParams() {
34
- return getPages().map((page) => ({
35
- slug: page.slugs,
36
- }));
34
+ return source.generateParams();
37
35
  }
38
36
 
39
37
  export function generateMetadata({ params }: { params: { slug?: string[] } }) {
40
- const page = getPage(params.slug);
38
+ const page = source.getPage(params.slug);
41
39
  if (!page) notFound();
42
40
 
43
41
  return {
@@ -2,7 +2,7 @@ import { docs, meta } from '@/.source';
2
2
  import { createMDXSource } from 'fumadocs-mdx';
3
3
  import { loader } from 'fumadocs-core/source';
4
4
 
5
- export const { getPage, getPages, pageTree } = loader({
5
+ export const source = loader({
6
6
  baseUrl: '/docs',
7
7
  source: createMDXSource(docs, meta),
8
8
  });