Skip to content

Commit b58439a

Browse files
committed
feat: build documentation site
1 parent 0c28916 commit b58439a

24 files changed

Lines changed: 893 additions & 2 deletions

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
"main": "pnpm -F @react-tutorial-overlay/main",
1010
"document": "pnpm -F @react-tutorial-overlay/document",
1111
"dev": "pnpm -r dev",
12-
"build": "pnpm main build",
13-
"size": "size-limit"
12+
"size": "size-limit",
13+
"build": "pnpm size-limit && pnpm main build",
14+
"docs": "pnpm document build"
1415
},
1516
"keywords": [
1617
"react",

packages/document/.eslintrc.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": [
3+
"next/babel",
4+
"next/core-web-vitals",
5+
"plugin:prettier/recommended",
6+
"plugin:tailwindcss/recommended"
7+
]
8+
}

packages/document/.gitignore

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
.yarn/install-state.gz
8+
9+
# testing
10+
/coverage
11+
12+
# next.js
13+
/.next/
14+
/out/
15+
16+
# production
17+
/build
18+
19+
# misc
20+
.DS_Store
21+
*.pem
22+
23+
# debug
24+
npm-debug.log*
25+
yarn-debug.log*
26+
yarn-error.log*
27+
28+
# local env files
29+
.env*.local
30+
31+
# vercel
32+
.vercel
33+
34+
# typescript
35+
*.tsbuildinfo
36+
next-env.d.ts

packages/document/.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules/
2+
REAMDE.md

packages/document/.prettierrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"singleQuote": true,
3+
"semi": true,
4+
"useTabs": false,
5+
"printWidth": 120,
6+
"plugins": [
7+
"prettier-plugin-tailwindcss"
8+
]
9+
}

packages/document/README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
2+
3+
## Getting Started
4+
5+
First, run the development server:
6+
7+
```bash
8+
npm run dev
9+
# or
10+
yarn dev
11+
# or
12+
pnpm dev
13+
# or
14+
bun dev
15+
```
16+
17+
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
18+
19+
You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file.
20+
21+
[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`.
22+
23+
The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.
24+
25+
This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.
26+
27+
## Learn More
28+
29+
To learn more about Next.js, take a look at the following resources:
30+
31+
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
32+
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
33+
34+
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
35+
36+
## Deploy on Vercel
37+
38+
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
39+
40+
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.

packages/document/next.config.mjs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import rehypeSlug from 'rehype-slug';
2+
import remarkGfm from 'remark-gfm';
3+
import createMDX from '@next/mdx'
4+
5+
/** @type {import('next').NextConfig} */
6+
const nextConfig = {
7+
pageExtensions: ['js', 'jsx', 'md', 'mdx', 'ts', 'tsx'],
8+
output: 'export',
9+
}
10+
11+
const withMDX = createMDX({
12+
extension: /.mdx?$/,
13+
options: {
14+
rehypePlugins: [rehypeSlug],
15+
remarkPlugins: [remarkGfm],
16+
providerImportSource: '@mdx-js/react',
17+
},
18+
})
19+
20+
export default withMDX(nextConfig)

packages/document/package.json

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"name": "@react-tutorial-overlay/document",
3+
"version": "0.1.0",
4+
"private": true,
5+
"scripts": {
6+
"dev": "next dev",
7+
"build": "next build",
8+
"start": "next start",
9+
"lint": "next lint"
10+
},
11+
"dependencies": {
12+
"@mdx-js/loader": "^3.0.1",
13+
"@mdx-js/react": "^3.0.1",
14+
"@next/mdx": "^14.2.2",
15+
"@tailwindcss/typography": "^0.5.12",
16+
"@vercel/analytics": "^1.2.2",
17+
"clsx": "^2.1.0",
18+
"next": "14.2.2",
19+
"next-seo": "^6.5.0",
20+
"prism-react-renderer": "^2.3.1",
21+
"react": "^18.2.0",
22+
"react-dom": "^18.2.0",
23+
"react-tutorial-overlay": "workspace:*",
24+
"rehype-slug": "^6.0.0",
25+
"remark-gfm": "^4.0.0"
26+
},
27+
"devDependencies": {
28+
"@types/mdx": "^2.0.13",
29+
"@types/node": "^20.12.7",
30+
"@types/prismjs": "^1.26.3",
31+
"@types/react": "^18.0.15",
32+
"@types/react-dom": "^18.0.6",
33+
"eslint": "^9.1.0",
34+
"eslint-config-next": "14.2.2",
35+
"eslint-config-prettier": "^9.1.0",
36+
"eslint-plugin-prettier": "^5.1.3",
37+
"eslint-plugin-tailwindcss": "^3.15.1",
38+
"postcss": "^8.4.38",
39+
"prettier": "^3.2.5",
40+
"prettier-plugin-tailwindcss": "^0.5.14",
41+
"tailwindcss": "^3.4.1",
42+
"typescript": "^5.4.5"
43+
}
44+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/** @type {import('postcss-load-config').Config} */
2+
const config = {
3+
plugins: {
4+
tailwindcss: {},
5+
},
6+
};
7+
8+
export default config;
25.3 KB
Binary file not shown.

0 commit comments

Comments
 (0)