rspress-v2-upgrade
$
npx mdskill add rstackjs/agent-skills/rspress-v2-upgradeMigrate Rspress projects from v1 to v2 with automated dependency updates.
- Handles breaking changes and config updates for v1 to v2 migration.
- Depends on official v1 to v2 guide and package.json analysis.
- Executes dependency swaps and config path corrections automatically.
- Delivers a validated upgraded project ready for production use.
SKILL.md
.github/skills/rspress-v2-upgradeView on GitHub ↗
---
name: rspress-v2-upgrade
description: Migrate Rspress projects from v1 to v2. Use when a user asks to upgrade Rspress, follow the v1-to-v2 guide, update configs/themes, or validate the upgrade.
---
# Rspress v1 to v2 Upgrade
## Workflow
1. **Confirm current setup**
- Read `package.json` to identify Rspress and plugin packages in use.
- Locate the Rspress config file (commonly `rspress.config.(ts|js|mjs|cjs)`).
- Check for custom theme files and MDX usage.
2. **Open the official upgrade guide**
- Use the v1 → v2 guide as the source of truth:
- <https://rspress.rs/guide/migration/rspress-1-x>
3. **Plan the upgrade path**
- List breaking changes that apply to the project's current config, plugins, and theme.
- Note any removed or renamed packages, options, and APIs.
4. **Update dependencies**
- Replace `rspress` with `@rspress/core@^2.0.0`.
- Remove packages now built into `@rspress/core` (e.g. `rspress`, `@rspress/plugin-shiki`, `@rspress/plugin-auto-nav-sidebar`, `@rspress/plugin-container-syntax`, `@rspress/plugin-last-updated`, `@rspress/plugin-medium-zoom`, `@rspress/theme-default`, `@rspress/runtime`).
- Bump remaining Rspress plugins to latest versions via `npx taze major --include /rspress/ -w -r`.
- Ensure Node.js >= 20.9.0.
5. **Apply config and code changes**
- Update import paths (`rspress/runtime` → `@rspress/core/runtime`, `rspress/theme` → `@rspress/core/theme`, `@rspress/theme-default` → `@rspress/core/theme-original`).
- If the project has a custom theme (in `theme` directory), use `@rspress/core/theme-original` to import the original theme components.
- Update the Rspress config to match v2 options and defaults.
- Remove deprecated or unsupported settings.
6. **Validate**
- Run the build and dev server.
- Fix any warnings or errors that appear in the new version. If errors or warnings occur, please refer to the [Official Upgrade Guide](https://rspress.rs/guide/migration/rspress-1-x) and first check if it's caused by any omitted or incomplete migration steps.
More from rstackjs/agent-skills
- migrate-to-rsbuildMigrate webpack, Vite, create-react-app (CRA/CRACO), or Vue CLI projects to Rsbuild.
- migrate-to-rslibMigrate tsc or tsup library projects to Rslib.
- migrate-to-rstestMigrate Jest or Vitest test suites and configs to Rstest. Use when asked to move from Jest/Vitest to Rstest, replace framework APIs with `@rstest/core`, translate test config to `rstest.config.ts`, or update test scripts and setup files for Rstest equivalents.
- pr-creatorUse when asked to create a pull request for this repository. It helps the PR follow the repository's branch safety rules, title convention, pull request template, and concise English writing style.
- rsbuild-best-practicesRsbuild best practices for config, CLI workflow, type checking, bundle optimization, assets, and debugging. Use when writing, reviewing, or troubleshooting Rsbuild projects.
- rsbuild-v2-upgradeUse when upgrading a Rsbuild 1.x project to v2, including dependency and configuration updates.
- rsdoctor-analysisUse when analyzing Rspack/Webpack bundles from local `rsdoctor-data.json` and producing evidence-based optimization recommendations.
- rslib-best-practicesRslib best practices for config, CLI workflow, output, declaration files, dependency handling, build optimization and toolchain integration. Use when writing, reviewing, or troubleshooting Rslib projects.
- rspack-best-practicesRspack best practices for config, CLI workflow, type checking, CSS, bundle optimization, assets and profiling. Use when writing, reviewing, or troubleshooting Rspack projects.
- rspack-debuggingHelps Rspack users and developers debug crashes or deadlocks/hangs in the Rspack build process using LLDB. Use this Skill when users encounter "Segmentation fault" errors during Rspack builds or when the build progress gets stuck.