-
-
Notifications
You must be signed in to change notification settings - Fork 1
Feat: Documentation site with Nextra (Next.js) #311
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Jeong-jj
wants to merge
19
commits into
main
Choose a base branch
from
feat/docs-site
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
86320f9
Chore: add gitignore list
Jeong-jj 4fee9f2
Feat: initialize Nextra 4.x documentation site
Jeong-jj 39935f9
Fix: suppress hydration warning on body tag
Jeong-jj 7795873
Refactor: migrate documentation site to TypeScript
Jeong-jj ef3d89c
Docs: update getting-started and rename _meta.js to .ts
Jeong-jj 3fdfaa0
Docs: add Literal CSS documentation
Jeong-jj 00c4b44
Chore: integrate site into yarn workspace
Jeong-jj 653973c
fix(site): update Next.js, React for security vulnerability
Jeong-jj 99ad52a
docs(site): add Rules documentation
Jeong-jj 34f270f
docs(site): add Theme documentation
Jeong-jj 0e700ec
docs(site): add CSS Methods section to Literal CSS
Jeong-jj 5ab0864
docs(site): add Theme Methods Coming Soon section
Jeong-jj e8c5150
docs(site): add Styled Components documentation
Jeong-jj 55fdf10
docs(site): add Class Name Utilities documentation
Jeong-jj 9933578
docs(site): add Define Rules documentation (Coming Soon)
Jeong-jj 381e956
docs(site): update Define Rules with implemented API documentation
Jeong-jj a01fb8d
Fix: add nextra peerDependencies extension for typescript
Jeong-jj 9275246
Fix(site): update Next.js for security vulnerability
Jeong-jj e541ae9
Chore: add site to root tsconfig project references
Jeong-jj File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| import type { MDXComponents } from 'mdx/types' | ||
| import { useMDXComponents as getNextraComponents } from 'nextra/mdx-components' | ||
| import { useMDXComponents as getDocsMDXComponents } from 'nextra-theme-docs' | ||
|
|
||
| const nextraComponents = getNextraComponents() | ||
| const docsComponents = getDocsMDXComponents() | ||
|
|
||
| export function useMDXComponents(components?: MDXComponents): MDXComponents { | ||
| return { | ||
| ...nextraComponents, | ||
| ...docsComponents, | ||
| ...components | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| /// <reference types="next" /> | ||
| /// <reference types="next/image-types/global" /> | ||
| /// <reference path="./.next/types/routes.d.ts" /> | ||
|
|
||
| // NOTE: This file should not be edited | ||
| // see https://nextjs.org/docs/app/api-reference/config/typescript for more information. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| import nextra from 'nextra' | ||
|
|
||
| const withNextra = nextra({ | ||
| contentDirBasePath: '/docs' | ||
| }) | ||
|
|
||
| export default withNextra({ | ||
| reactStrictMode: true | ||
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| { | ||
| "name": "mincho-docs", | ||
| "version": "0.1.0", | ||
| "type": "module", | ||
| "private": true, | ||
| "scripts": { | ||
| "dev": "next dev", | ||
| "build": "next build", | ||
| "start": "next start" | ||
| }, | ||
| "dependencies": { | ||
| "next": "^15.5.10", | ||
| "nextra": "^4.6.1", | ||
| "nextra-theme-docs": "^4.6.1", | ||
| "react": "^19.2.1", | ||
| "react-dom": "^19.2.1" | ||
| }, | ||
| "devDependencies": { | ||
| "@types/node": "^24.10.1", | ||
| "@types/react": "^19.2.7", | ||
| "typescript": "^5.9.3" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| import { generateStaticParamsFor, importPage } from 'nextra/pages' | ||
| import { useMDXComponents } from '../../../../mdx-components' | ||
|
|
||
| export const generateStaticParams = generateStaticParamsFor('mdxPath') | ||
|
|
||
| type PageProps = { | ||
| params: Promise<{ mdxPath?: string[] }> | ||
| } | ||
|
|
||
| export async function generateMetadata(props: PageProps) { | ||
| const params = await props.params | ||
| const { metadata } = await importPage(params.mdxPath) | ||
| return metadata | ||
| } | ||
|
|
||
| const components = useMDXComponents() | ||
| const Wrapper = components.wrapper! | ||
|
|
||
| export default async function Page(props: PageProps) { | ||
| const params = await props.params | ||
| const result = await importPage(params.mdxPath) | ||
| const { default: MDXContent, toc, metadata } = result | ||
|
|
||
| return ( | ||
| <Wrapper toc={toc} metadata={metadata}> | ||
| <MDXContent {...props} params={params} /> | ||
| </Wrapper> | ||
| ) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| import type { ReactNode } from 'react' | ||
| import { Footer, Layout, Navbar } from 'nextra-theme-docs' | ||
| import { Head } from 'nextra/components' | ||
| import { getPageMap } from 'nextra/page-map' | ||
| import 'nextra-theme-docs/style.css' | ||
|
|
||
| export const metadata = { | ||
| title: 'Mincho.js', | ||
| description: 'Natural CSS in TypeScript - A CSS-in-JS framework built on Vanilla Extract' | ||
| } | ||
|
|
||
| export default async function RootLayout({ children }: { children: ReactNode }) { | ||
| const pageMap = await getPageMap() | ||
|
|
||
| return ( | ||
| <html lang="en" suppressHydrationWarning> | ||
| <Head /> | ||
| <body suppressHydrationWarning> | ||
| <Layout | ||
| navbar={ | ||
| <Navbar | ||
| logo={<span style={{ fontWeight: 700 }}>Mincho.js</span>} | ||
| projectLink="https://github.com/mincho-js/mincho" | ||
| /> | ||
| } | ||
| pageMap={pageMap} | ||
| docsRepositoryBase="https://github.com/mincho-js/mincho/tree/main/site" | ||
| footer={<Footer>MIT {new Date().getFullYear()} © Mincho.js</Footer>} | ||
| > | ||
| {children} | ||
| </Layout> | ||
| </body> | ||
| </html> | ||
| ) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| export default function IndexPage() { | ||
| return ( | ||
| <div style={{ textAlign: 'center', padding: '100px 20px' }}> | ||
| <h1 style={{ fontSize: 48, fontWeight: 'bold', marginBottom: 16 }}> | ||
| Mincho.js | ||
| </h1> | ||
| <p style={{ fontSize: 20, color: '#666', marginBottom: 32 }}> | ||
| Natural CSS in TypeScript | ||
| </p> | ||
| <a | ||
| href="/docs" | ||
| style={{ | ||
| display: 'inline-block', | ||
| padding: '12px 24px', | ||
| backgroundColor: '#0070f3', | ||
| color: 'white', | ||
| borderRadius: 8, | ||
| textDecoration: 'none', | ||
| fontWeight: 500 | ||
| }} | ||
| > | ||
| Get Started | ||
| </a> | ||
| </div> | ||
| ) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| export default { | ||
| index: "Introduction", | ||
| "getting-started": "Getting Started", | ||
| literal: "Literal CSS", | ||
| rules: "Rules", | ||
| theme: "Theme", | ||
| styled: "Styled Components", | ||
| classname: "Class Name Utilities", | ||
| "define-rules": "Define Rules" | ||
| }; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: mincho-js/mincho
Length of output: 609
Remove the direct reference to generated
.nextroute types.Line 3 hard-codes a reference to a generated file that does not exist in the repository. This will cause TypeScript type-checking failures in clean checkouts before
next dev/buildgenerates.next.Proposed fix
/// <reference types="next" /> /// <reference types="next/image-types/global" /> -/// <reference path="./.next/types/routes.d.ts" /> // NOTE: This file should not be edited // see https://nextjs.org/docs/app/api-reference/config/typescript for more information.📝 Committable suggestion
🤖 Prompt for AI Agents