Skip to content

feat(rspress): upgrade Rspress examples to v2#438

Merged
SoonIter merged 7 commits intomainfrom
copilot/upgrade-rspress-to-v2
Apr 17, 2026
Merged

feat(rspress): upgrade Rspress examples to v2#438
SoonIter merged 7 commits intomainfrom
copilot/upgrade-rspress-to-v2

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 16, 2026

  • Inspect the current branch state, recent commits, and the Rspress example scripts
  • Rebase this branch onto the latest origin/main
  • Run simple validation for the upgraded Rspress examples with npm run dev, npm run build, and npm run preview
  • Share the verification result back on the PR comment

@SoonIter
Copy link
Copy Markdown
Member

@copilot rebase 到最新的 origin/main,并进行简单验证,npm run dev npm run build npm run preview 等命令都正常运行

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 16, 2026

@copilot rebase 到最新的 origin/main,并进行简单验证,npm run dev npm run build npm run preview 等命令都正常运行

已处理,提交 c2c1c91 已把分支同步到最新 origin/main 并推到当前 PR。已在 rspress/basicrspress/custom-theme 下完成简单验证:npm run build 通过,npm run dev 可正常启动,npm run preview 可正常启动并返回 200。截图:https://github.com/user-attachments/assets/e879149e-81fb-4e0d-8186-2c891ef72a8e

@SoonIter SoonIter force-pushed the copilot/upgrade-rspress-to-v2 branch from e441398 to 4eacb34 Compare April 16, 2026 12:45
@SoonIter
Copy link
Copy Markdown
Member

SoonIter commented Apr 17, 2026

image
❯ tree . -I node_modules
.
├── basic
│   ├── README.md
│   ├── docs
│   │   ├── _nav.json
│   │   ├── api
│   │   │   ├── _meta.json
│   │   │   ├── commands.mdx
│   │   │   └── index.mdx
│   │   ├── guide
│   │   │   ├── _meta.json
│   │   │   ├── start
│   │   │   │   ├── _meta.json
│   │   │   │   ├── getting-started.md
│   │   │   │   └── introduction.md
│   │   │   └── use-mdx
│   │   │       ├── _meta.json
│   │   │       ├── code-blocks
│   │   │       │   ├── _meta.json
│   │   │       │   ├── index.mdx
│   │   │       │   ├── meta.md
│   │   │       │   └── title.md
│   │   │       ├── components.mdx
│   │   │       └── container.md
│   │   ├── index.md
│   │   └── public
│   │       ├── rspress-dark-logo.png
│   │       ├── rspress-icon.png
│   │       └── rspress-light-logo.png
│   ├── package.json
│   ├── rspress.config.ts
│   └── tsconfig.json
└── custom-theme
    ├── README.md
    ├── docs
    │   ├── _nav.json
    │   ├── api
    │   │   ├── _meta.json
    │   │   ├── commands.mdx
    │   │   └── index.mdx
    │   ├── guide
    │   │   ├── _meta.json
    │   │   ├── start
    │   │   │   ├── _meta.json
    │   │   │   ├── getting-started.md
    │   │   │   └── introduction.md
    │   │   └── use-mdx
    │   │       ├── _meta.json
    │   │       ├── code-blocks
    │   │       │   ├── _meta.json
    │   │       │   ├── index.mdx
    │   │       │   ├── meta.md
    │   │       │   └── title.md
    │   │       ├── components.mdx
    │   │       └── container.md
    │   ├── index.md
    │   └── public
    │       ├── rspress-dark-logo.png
    │       ├── rspress-icon.png
    │       └── rspress-light-logo.png
    ├── package.json
    ├── rspress.config.ts
    ├── theme
    │   ├── env.d.ts
    │   ├── index.css
    │   └── index.tsx
    └── tsconfig.json

18 directories, 49 files

@SoonIter SoonIter marked this pull request as ready for review April 17, 2026 03:52
Copilot AI review requested due to automatic review settings April 17, 2026 03:52
@SoonIter SoonIter force-pushed the copilot/upgrade-rspress-to-v2 branch from 4eacb34 to fa42137 Compare April 17, 2026 03:52
@SoonIter SoonIter changed the title feat: upgrade Rspress examples to v2 feat(rspress): upgrade Rspress examples to v2 Apr 17, 2026
@SoonIter SoonIter enabled auto-merge (squash) April 17, 2026 03:52
@SoonIter SoonIter merged commit 405fdf5 into main Apr 17, 2026
4 checks passed
@SoonIter SoonIter deleted the copilot/upgrade-rspress-to-v2 branch April 17, 2026 03:54
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Upgrades the rspress/basic and rspress/custom-theme example projects from Rspress v1 to the v2 @rspress/core setup, refreshing configs, theme scaffolding, and example docs to match the newer structure.

Changes:

  • Migrate dependencies/config imports from rspress v1 to @rspress/core v2 and update TypeScript config defaults.
  • Refresh docs IA/content (new Guide/API sections, nav config, new MDX examples) and remove old placeholder pages.
  • Simplify the custom theme scaffold and add basic brand color overrides + static assets.

Reviewed changes

Copilot reviewed 48 out of 53 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
rspress/custom-theme/tsconfig.json Update TS config for v2-era module resolution/strictness + MDX checking.
rspress/custom-theme/theme/index.tsx Replace v1 theme entry with v2 theme-original re-exports + CSS import.
rspress/custom-theme/theme/index.css Add example brand color CSS variables.
rspress/custom-theme/theme/env.d.ts Add typings for CSS imports and import.meta.env usage.
rspress/custom-theme/rspress.config.ts Migrate config to @rspress/core and update site/theme metadata.
rspress/custom-theme/package.json Switch dependency to @rspress/core and set package ESM.
rspress/custom-theme/docs/public/rspress-light-logo.png Add light logo asset for the v2 scaffold.
rspress/custom-theme/docs/public/rspress-dark-logo.png Add dark logo asset for the v2 scaffold.
rspress/custom-theme/docs/index.md Update home page hero/features content and links to new doc structure.
rspress/custom-theme/docs/hello.md Remove old placeholder “Hello World” page.
rspress/custom-theme/docs/guide/use-mdx/container.md Add container syntax documentation page.
rspress/custom-theme/docs/guide/use-mdx/components.mdx Add MDX + Rspress theme component usage examples.
rspress/custom-theme/docs/guide/use-mdx/code-blocks/title.md Add code block title example page.
rspress/custom-theme/docs/guide/use-mdx/code-blocks/meta.md Add code block meta (line numbers/wrap/title) example page.
rspress/custom-theme/docs/guide/use-mdx/code-blocks/index.mdx Add code blocks section landing page.
rspress/custom-theme/docs/guide/use-mdx/code-blocks/_meta.json Define sidebar ordering for code-blocks pages.
rspress/custom-theme/docs/guide/use-mdx/_meta.json Define sidebar ordering for the use-mdx section.
rspress/custom-theme/docs/guide/start/introduction.md Add new “Introduction” page for Getting Started section.
rspress/custom-theme/docs/guide/start/getting-started.md Add new “Getting started” page describing workflows/output.
rspress/custom-theme/docs/guide/start/_meta.json Define ordering for Getting Started pages.
rspress/custom-theme/docs/guide/_meta.json Define guide sidebar section headers.
rspress/custom-theme/docs/api/index.mdx Add API overview page stub.
rspress/custom-theme/docs/api/commands.mdx Add commands page stub.
rspress/custom-theme/docs/api/_meta.json Define API section ordering.
rspress/custom-theme/docs/_nav.json Add top nav configuration (Guide/API/Document).
rspress/custom-theme/README.md Add usage instructions for the custom-theme example.
rspress/custom-theme/.gitignore Remove per-example gitignore.
rspress/basic/tsconfig.json Update TS config for v2-era module resolution/strictness + MDX checking.
rspress/basic/rspress.config.ts Migrate config to @rspress/core and update site metadata.
rspress/basic/package.json Switch dependency to @rspress/core, set package ESM, add React typings/runtime deps.
rspress/basic/docs/index.md Update home page hero/features content and links to new doc structure.
rspress/basic/docs/hello.md Remove old placeholder “Hello World” page.
rspress/basic/docs/guide/use-mdx/container.md Add container syntax documentation page.
rspress/basic/docs/guide/use-mdx/components.mdx Add MDX + Rspress theme component usage examples.
rspress/basic/docs/guide/use-mdx/code-blocks/title.md Add code block title example page.
rspress/basic/docs/guide/use-mdx/code-blocks/meta.md Add code block meta (line numbers/wrap/title) example page.
rspress/basic/docs/guide/use-mdx/code-blocks/index.mdx Add code blocks section landing page.
rspress/basic/docs/guide/use-mdx/code-blocks/_meta.json Define sidebar ordering for code-blocks pages.
rspress/basic/docs/guide/use-mdx/_meta.json Define sidebar ordering for the use-mdx section.
rspress/basic/docs/guide/start/introduction.md Add new “Introduction” page for Getting Started section.
rspress/basic/docs/guide/start/getting-started.md Add new “Getting started” page describing workflows/output.
rspress/basic/docs/guide/start/_meta.json Define ordering for Getting Started pages.
rspress/basic/docs/guide/index.md Remove old monolithic “Markdown & MDX” guide page.
rspress/basic/docs/guide/_meta.json Replace old meta with section headers for new guide layout.
rspress/basic/docs/api/index.mdx Add API overview page stub.
rspress/basic/docs/api/commands.mdx Add commands page stub.
rspress/basic/docs/api/_meta.json Define API section ordering.
rspress/basic/docs/_nav.json Add top nav configuration (Guide/API/Document).
rspress/basic/docs/_meta.json Remove old nav/meta config file.
rspress/basic/README.md Add usage instructions for the basic example.
rspress/basic/.gitignore Remove per-example gitignore.
pnpm-lock.yaml Update lockfile to reflect v2 dependency graph changes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +34 to +37
```

By default, Rspress will output to `doc_build` directory.

Copy link

Copilot AI Apr 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doc mentions the build output is doc_build, but the per-example .gitignore files were removed and the repo root .gitignore does not ignore doc_build. This makes it easy to accidentally commit generated site output; add an ignore rule (either restore a package-level .gitignore or add a repo-level ignore like **/doc_build/).

Copilot uses AI. Check for mistakes.
Comment on lines +34 to +37
```

By default, Rspress will output to `doc_build` directory.

Copy link

Copilot AI Apr 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doc mentions the build output is doc_build, but the per-example .gitignore files were removed and the repo root .gitignore does not ignore doc_build. This makes it easy to accidentally commit generated site output; add an ignore rule (either restore a package-level .gitignore or add a repo-level ignore like **/doc_build/).

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +3
import './index.css';

// to replace home footer
export function HomeFooter() {
const { siteData } = usePageData();
const { createdBy } = (siteData.themeConfig.footer || {}) as any;
// use configuration from rspress.config

return (
<footer className="absolute bottom-0 mt-12 py-8 px-6 sm:p-8 w-full border-t border-solid border-divider-light">
<div className="m-auto w-full text-center">
<div className="font-meduim text-sm text-text-2">Created by {createdBy} with love</div>
</div>
</footer>
);
}

export default Theme;
export * from 'rspress/theme';
export * from '@rspress/core/theme-original';
Copy link

Copilot AI Apr 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

export * from '@rspress/core/theme-original' does not re-export the module’s default export. If Rspress expects the theme entry to provide a default export (as the previous implementation did), this will break theme loading. Re-export the default (and keep named exports) from @rspress/core/theme-original.

Copilot uses AI. Check for mistakes.
Comment thread rspress/basic/README.md
Comment on lines +5 to +9
Install the dependencies:

```bash
npm install
```
Copy link

Copilot AI Apr 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This README instructs npm install, but this repo is a pnpm workspace (root scripts use pnpm --filter ...). Using npm here can create an extra lockfile and different resolution; update the instructions to use pnpm (e.g. pnpm install at repo root and pnpm --filter @rspress-example/basic dev / pnpm dev).

Copilot uses AI. Check for mistakes.
Comment on lines +5 to +9
Install the dependencies:

```bash
npm install
```
Copy link

Copilot AI Apr 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This README instructs npm install, but this repo is a pnpm workspace (root scripts use pnpm --filter ...). Using npm here can create an extra lockfile and different resolution; update the instructions to use pnpm (e.g. pnpm install at repo root and pnpm --filter @rspress-example/custom-theme dev / pnpm dev).

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants