Skip to content

Commit

Permalink
style: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
c100k committed Mar 4, 2025
1 parent 364dc24 commit 0b2cd62
Show file tree
Hide file tree
Showing 14 changed files with 160 additions and 168 deletions.
8 changes: 7 additions & 1 deletion biome.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
{
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
"files": {
"ignore": ["dist", "examples", "node_modules"],
"ignore": [
"docs-fd/.source",
"docs-fd/node_modules",
"dist",
"examples",
"node_modules"
],
"ignoreUnknown": true
},
"formatter": {
Expand Down
2 changes: 1 addition & 1 deletion docs-fd/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const withMDX = createMDX();

/** @type {import('next').NextConfig} */
const config = {
reactStrictMode: true,
reactStrictMode: true,
};

export default withMDX(config);
56 changes: 28 additions & 28 deletions docs-fd/package.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
{
"name": "docs-fd",
"version": "0.0.0",
"private": true,
"scripts": {
"build": "next build",
"dev": "next dev",
"start": "next start",
"postinstall": "fumadocs-mdx"
},
"dependencies": {
"next": "15.2.0",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"fumadocs-ui": "15.0.15",
"fumadocs-core": "15.0.15",
"fumadocs-mdx": "11.5.6"
},
"devDependencies": {
"@types/node": "22.13.8",
"@types/react": "^19.0.10",
"@types/react-dom": "^19.0.4",
"typescript": "^5.8.2",
"@types/mdx": "^2.0.13",
"@tailwindcss/postcss": "^4.0.9",
"tailwindcss": "^4.0.9",
"postcss": "^8.5.3"
}
}
"name": "docs-fd",
"version": "0.0.0",
"private": true,
"scripts": {
"build": "next build",
"dev": "next dev",
"start": "next start",
"postinstall": "fumadocs-mdx"
},
"dependencies": {
"next": "15.2.0",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"fumadocs-ui": "15.0.15",
"fumadocs-core": "15.0.15",
"fumadocs-mdx": "11.5.6"
},
"devDependencies": {
"@types/node": "22.13.8",
"@types/react": "^19.0.10",
"@types/react-dom": "^19.0.4",
"typescript": "^5.8.2",
"@types/mdx": "^2.0.13",
"@tailwindcss/postcss": "^4.0.9",
"tailwindcss": "^4.0.9",
"postcss": "^8.5.3"
}
}
6 changes: 3 additions & 3 deletions docs-fd/postcss.config.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export default {
plugins: {
'@tailwindcss/postcss': {},
},
plugins: {
'@tailwindcss/postcss': {},
},
};
10 changes: 5 additions & 5 deletions docs-fd/source.config.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { defineDocs, defineConfig } from 'fumadocs-mdx/config';
import { defineConfig, defineDocs } from 'fumadocs-mdx/config';

export const docs = defineDocs({
dir: 'content/docs',
dir: 'content/docs',
});

export default defineConfig({
mdxOptions: {
// MDX options
},
mdxOptions: {
// MDX options
},
});
6 changes: 3 additions & 3 deletions docs-fd/src/app/(home)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { ReactNode } from 'react';
import { HomeLayout } from 'fumadocs-ui/layouts/home';
import { baseOptions } from '@/app/layout.config';
import { HomeLayout } from 'fumadocs-ui/layouts/home';
import type { ReactNode } from 'react';

export default function Layout({ children }: { children: ReactNode }) {
return <HomeLayout {...baseOptions}>{children}</HomeLayout>;
return <HomeLayout {...baseOptions}>{children}</HomeLayout>;
}
30 changes: 15 additions & 15 deletions docs-fd/src/app/(home)/page.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import Link from 'next/link';

export default function HomePage() {
return (
<main className="flex flex-1 flex-col justify-center text-center">
<h1 className="mb-4 text-2xl font-bold">Hello World</h1>
<p className="text-fd-muted-foreground">
You can open{' '}
<Link
href="/docs"
className="text-fd-foreground font-semibold underline"
>
/docs
</Link>{' '}
and see the documentation.
</p>
</main>
);
return (
<main className="flex flex-1 flex-col justify-center text-center">
<h1 className="mb-4 text-2xl font-bold">Hello World</h1>
<p className="text-fd-muted-foreground">
You can open{' '}
<Link
href="/docs"
className="text-fd-foreground font-semibold underline"
>
/docs
</Link>{' '}
and see the documentation.
</p>
</main>
);
}
56 changes: 28 additions & 28 deletions docs-fd/src/app/docs/[[...slug]]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
import { source } from '@/lib/source';
import defaultMdxComponents from 'fumadocs-ui/mdx';
import {
DocsPage,
DocsBody,
DocsDescription,
DocsTitle,
DocsBody,
DocsDescription,
DocsPage,
DocsTitle,
} from 'fumadocs-ui/page';
import { notFound } from 'next/navigation';
import defaultMdxComponents from 'fumadocs-ui/mdx';

export default async function Page(props: {
params: Promise<{ slug?: string[] }>;
params: Promise<{ slug?: string[] }>;
}) {
const params = await props.params;
const page = source.getPage(params.slug);
if (!page) notFound();
const params = await props.params;
const page = source.getPage(params.slug);
if (!page) notFound();

const MDX = page.data.body;
const MDX = page.data.body;

return (
<DocsPage toc={page.data.toc} full={page.data.full}>
<DocsTitle>{page.data.title}</DocsTitle>
<DocsDescription>{page.data.description}</DocsDescription>
<DocsBody>
<MDX components={{ ...defaultMdxComponents }} />
</DocsBody>
</DocsPage>
);
return (
<DocsPage toc={page.data.toc} full={page.data.full}>
<DocsTitle>{page.data.title}</DocsTitle>
<DocsDescription>{page.data.description}</DocsDescription>
<DocsBody>
<MDX components={{ ...defaultMdxComponents }} />
</DocsBody>
</DocsPage>
);
}

export async function generateStaticParams() {
return source.generateParams();
return source.generateParams();
}

export async function generateMetadata(props: {
params: Promise<{ slug?: string[] }>;
params: Promise<{ slug?: string[] }>;
}) {
const params = await props.params;
const page = source.getPage(params.slug);
if (!page) notFound();
const params = await props.params;
const page = source.getPage(params.slug);
if (!page) notFound();

return {
title: page.data.title,
description: page.data.description,
};
return {
title: page.data.title,
description: page.data.description,
};
}
14 changes: 7 additions & 7 deletions docs-fd/src/app/docs/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { DocsLayout } from 'fumadocs-ui/layouts/docs';
import type { ReactNode } from 'react';
import { baseOptions } from '@/app/layout.config';
import { source } from '@/lib/source';
import { DocsLayout } from 'fumadocs-ui/layouts/docs';
import type { ReactNode } from 'react';

export default function Layout({ children }: { children: ReactNode }) {
return (
<DocsLayout tree={source.pageTree} {...baseOptions}>
{children}
</DocsLayout>
);
return (
<DocsLayout tree={source.pageTree} {...baseOptions}>
{children}
</DocsLayout>
);
}
6 changes: 3 additions & 3 deletions docs-fd/src/app/global.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import 'tailwindcss';
@import 'fumadocs-ui/css/neutral.css';
@import 'fumadocs-ui/css/preset.css';
@import "tailwindcss";
@import "fumadocs-ui/css/neutral.css";
@import "fumadocs-ui/css/preset.css";

@source '../../node_modules/fumadocs-ui/dist/**/*.js';
43 changes: 22 additions & 21 deletions docs-fd/src/app/layout.config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,27 @@ import type { BaseLayoutProps } from 'fumadocs-ui/layouts/shared';
* Docs Layout: app/docs/layout.tsx
*/
export const baseOptions: BaseLayoutProps = {
nav: {
title: (
<>
<svg
width="24"
height="24"
xmlns="http://www.w3.org/2000/svg"
aria-label="Logo"
>
<circle cx={12} cy={12} r={12} fill="currentColor" />
</svg>
My App
</>
),
},
links: [
{
text: 'Documentation',
url: '/docs',
active: 'nested-url',
nav: {
title: (
<>
<svg
width="24"
height="24"
xmlns="http://www.w3.org/2000/svg"
role="img"
aria-label="Logo"
>
<circle cx={12} cy={12} r={12} fill="currentColor" />
</svg>
My App
</>
),
},
],
links: [
{
text: 'Documentation',
url: '/docs',
active: 'nested-url',
},
],
};
16 changes: 8 additions & 8 deletions docs-fd/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import { Inter } from 'next/font/google';
import type { ReactNode } from 'react';

const inter = Inter({
subsets: ['latin'],
subsets: ['latin'],
});

export default function Layout({ children }: { children: ReactNode }) {
return (
<html lang="en" className={inter.className} suppressHydrationWarning>
<body className="flex flex-col min-h-screen">
<RootProvider>{children}</RootProvider>
</body>
</html>
);
return (
<html lang="en" className={inter.className} suppressHydrationWarning>
<body className="flex flex-col min-h-screen">
<RootProvider>{children}</RootProvider>
</body>
</html>
);
}
4 changes: 2 additions & 2 deletions docs-fd/src/lib/source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ import { docs } from '@/.source';
import { loader } from 'fumadocs-core/source';

export const source = loader({
baseUrl: '/docs',
source: docs.toFumadocsSource(),
baseUrl: '/docs',
source: docs.toFumadocsSource(),
});
Loading

0 comments on commit 0b2cd62

Please sign in to comment.