Skip to content

Commit 626332b

Browse files
committed
refactor(website): switch from 'nextra' to 'fumadocs'
1 parent 41ee491 commit 626332b

File tree

127 files changed

+1510
-3232
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+1510
-3232
lines changed

cspell.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@
6161
"metas",
6262
"monaspace",
6363
"neovov",
64-
"nextra",
6564
"nocheck",
6665
"noninteractive",
6766
"noto",

examples/next-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"@eslint-react/eslint-plugin": "^1.24.1",
2020
"@eslint/config-inspector": "^1.0.0",
2121
"@eslint/js": "^9.18.0",
22-
"@next/eslint-plugin-next": "^15.1.5",
22+
"@next/eslint-plugin-next": "^15.1.6",
2323
"@types/negotiator": "^0.6.3",
2424
"@types/node": "^22.10.7",
2525
"@types/react": "^19.0.7",

package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,6 @@
118118
"@types/react": "^19.0.7",
119119
"@types/react-dom": "^19.0.3",
120120
"cross-spawn": "^7.0.6",
121-
"next": "^15.1.5",
122-
"nextra": "^3.3.1",
123-
"nextra-theme-docs": "^3.3.1",
124121
"react": "^19.0.0",
125122
"react-dom": "^19.0.0",
126123
"ts-api-utils": "^2.0.0",

pnpm-lock.yaml

Lines changed: 723 additions & 2438 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

website/.gitignore

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,28 @@
1-
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2-
*.log
3-
# dependencies
1+
# deps
42
/node_modules
5-
/.pnp
6-
.pnp.js
73

8-
# testing
9-
/coverage
10-
/dev
4+
# generated content
5+
.contentlayer
6+
.content-collections
7+
.source
118

12-
# next.js
9+
# test & build
10+
/coverage
1311
/.next/
1412
/out/
15-
16-
# production
1713
/build
14+
*.tsbuildinfo
1815

1916
# misc
2017
.DS_Store
2118
*.pem
22-
23-
# debug
19+
/.pnp
20+
.pnp.js
2421
npm-debug.log*
2522
yarn-debug.log*
2623
yarn-error.log*
27-
.pnpm-debug.log*
2824

29-
# local env files
25+
# others
3026
.env*.local
31-
32-
# vercel
3327
.vercel
34-
35-
# typescript
36-
*.tsbuildinfo
37-
38-
# direnv
39-
.direnv/
28+
next-env.d.ts

website/app/(home)/layout.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import type { ReactNode } from "react";
2+
import { HomeLayout } from "fumadocs-ui/layouts/home";
3+
import { baseOptions } from "#/app/layout.config";
4+
5+
export default function Layout({ children }: { children: ReactNode }) {
6+
return <HomeLayout {...baseOptions}>{children}</HomeLayout>;
7+
}

website/app/(home)/page.tsx

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
import { ESLintReact } from "#/components/eslint-react";
2+
import { TweetCards } from "#/components/tweet-cards";
3+
import { Link } from "next-view-transitions";
4+
5+
const features = [
6+
["Flexible", "Increased flexibility with more granular severity control."],
7+
["Comprehensive", "First-class support for TypeScript, React 19, polymorphic components."],
8+
["Advanced Analysis", "Handles complex scenarios and identifies problems that other tools might miss."],
9+
] as const;
10+
11+
const packages = [
12+
["eslint-plugin-react-x", "Core rules (renderer-agnostic, compatible with x-platform)."],
13+
["eslint-plugin-react-dom", "DOM specific rules for React DOM."],
14+
["eslint-plugin-react-web-api", "Rules for interacting with Web APIs."],
15+
["eslint-plugin-react-hooks-extra", "Extra React Hooks rules."],
16+
["eslint-plugin-react-naming-convention", "Naming convention rules."],
17+
] as const;
18+
19+
const tweets = [
20+
"1865166494709026873",
21+
"1839913920984678890",
22+
"1841248980354941038",
23+
"1859137094976696467",
24+
];
25+
26+
export default function HomePage() {
27+
return (
28+
<main className="w-full min-w-0 max-w-6xl px-8 pt-4 pb-12 md:px-12 mx-auto">
29+
<ESLintReact />
30+
<article className="prose max-w-none">
31+
<p>Welcome to the ESLint React documentation.</p>
32+
<p>A set of composable ESLint rules for libraries and frameworks that use React as a UI runtime.</p>
33+
<h2>Features</h2>
34+
<ul>
35+
{features.map(([title, description]) => (
36+
<li key={title}>
37+
<strong>{title}</strong>: {description}
38+
</li>
39+
))}
40+
</ul>
41+
<h2>Public packages</h2>
42+
<h3>All-in-one plugins</h3>
43+
<ul>
44+
<li>
45+
<span>
46+
<Link href="https://www.npmjs.com/package/@eslint-react/eslint-plugin">
47+
@eslint-react/eslint-plugin
48+
</Link>{" "}
49+
- The main ESLint plugin package including all rules and config presets in this repository.
50+
</span>
51+
</li>
52+
</ul>
53+
<h3>Modular plugins</h3>
54+
<ul>
55+
{packages.map(([name, description]) => (
56+
<li key={name}>
57+
<span>
58+
<Link href={`https://www.npmjs.com/package/${name}`}>
59+
{name}
60+
</Link>{" "}
61+
- {description}
62+
</span>
63+
</li>
64+
))}
65+
</ul>
66+
<TweetCards
67+
className="not-prose"
68+
tweets={tweets}
69+
/>
70+
<h2>FAQ</h2>
71+
<Link href="/docs/faq">Frequently Asked Questions ↗</Link>
72+
<h2>License</h2>
73+
This project is licensed under the MIT License - see the{" "}
74+
<a href="https://github.com/Rel1cx/eslint-react/blob/main/LICENSE">LICENSE</a> file for details.
75+
</article>
76+
</main>
77+
);
78+
}

website/app/api/search/route.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { source } from "#/lib/source";
2+
import { createFromSource } from "fumadocs-core/search/server";
3+
4+
export const { GET } = createFromSource(source);

website/styles/base.css renamed to website/app/base.css

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
@import "tailwindcss";
1+
/* @import "tailwindcss"; */
2+
@tailwind base;
3+
@tailwind components;
4+
@tailwind utilities;
25

36
:root {
47
--font-family-body:
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import { source } from "#/lib/source";
2+
import { DocsPage, DocsBody, DocsDescription, DocsTitle } from "fumadocs-ui/page";
3+
import { notFound } from "next/navigation";
4+
import defaultMdxComponents from "fumadocs-ui/mdx";
5+
6+
export default async function Page(props: {
7+
params: Promise<{ slug?: string[] }>;
8+
}) {
9+
const params = await props.params;
10+
const page = source.getPage(params.slug);
11+
if (!page) notFound();
12+
13+
const MDX = page.data.body;
14+
15+
return (
16+
<DocsPage toc={page.data.toc} full={!!page.data.full}>
17+
<DocsTitle>{page.data.title}</DocsTitle>
18+
<DocsDescription>{page.data.description}</DocsDescription>
19+
<DocsBody>
20+
<MDX components={{ ...defaultMdxComponents }} />
21+
</DocsBody>
22+
</DocsPage>
23+
);
24+
}
25+
26+
export async function generateStaticParams() {
27+
return source.generateParams();
28+
}
29+
30+
export async function generateMetadata(props: {
31+
params: Promise<{ slug?: string[] }>;
32+
}) {
33+
const params = await props.params;
34+
const page = source.getPage(params.slug);
35+
if (!page) notFound();
36+
37+
return {
38+
title: page.data.title,
39+
description: page.data.description,
40+
};
41+
}

0 commit comments

Comments
 (0)