About rspress-v2-upgrade
A skill for upgrading Rspress projects from v1 to v2. It guides developers through dependency, configuration, and theme changes, then validates the migration with a build and dev server.
Key features
- 01Inspect Rspress packages and project configuration
- 02Identify applicable breaking changes
- 03Update dependencies and import paths
- 04Validate with build and dev server
Use cases
- 01Plan a v1-to-v2 migration
- 02Update a project with a custom theme
- 03Check an upgrade for migration errors
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ rstackjs/ agent-skills --skill rspress-v2-upgradeAfter installing, type/rspress-v2-upgradein Claude Code to confirm it loaded.
Details
From the project READMERspress v1 to v2 upgrade
Workflow
-
Confirm current setup
- Read
package.jsonto 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.
- Read
-
Open the official upgrade guide
- Use the v1 → v2 guide as the source of truth:
-
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.
-
Update dependencies
- Replace
rspresswith@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.
- Replace
-
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
themedirectory), use@rspress/core/theme-originalto import the original theme components. - Update the Rspress config to match v2 options and defaults.
- Remove deprecated or unsupported settings.
- Update import paths (
-
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 and first check if it's caused by any omitted or incomplete migration steps.
Comments
Markdown supported