$npx -y skills add rstackjs/agent-skills --skill rspress-v2-upgradeMigrate 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.
| 1 | # Rspress v1 to v2 Upgrade |
| 2 | |
| 3 | ## Workflow |
| 4 | |
| 5 | 1. **Confirm current setup** |
| 6 | - Read `package.json` to identify Rspress and plugin packages in use. |
| 7 | - Locate the Rspress config file (commonly `rspress.config.(ts|js|mjs|cjs)`). |
| 8 | - Check for custom theme files and MDX usage. |
| 9 | |
| 10 | 2. **Open the official upgrade guide** |
| 11 | - Use the v1 → v2 guide as the source of truth: |
| 12 | - <https://rspress.rs/guide/migration/rspress-1-x> |
| 13 | |
| 14 | 3. **Plan the upgrade path** |
| 15 | - List breaking changes that apply to the project's current config, plugins, and theme. |
| 16 | - Note any removed or renamed packages, options, and APIs. |
| 17 | |
| 18 | 4. **Update dependencies** |
| 19 | - Replace `rspress` with `@rspress/core@^2.0.0`. |
| 20 | - 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`). |
| 21 | - Bump remaining Rspress plugins to latest versions via `npx taze major --include /rspress/ -w -r`. |
| 22 | - Ensure Node.js >= 20.9.0. |
| 23 | |
| 24 | 5. **Apply config and code changes** |
| 25 | - Update import paths (`rspress/runtime` → `@rspress/core/runtime`, `rspress/theme` → `@rspress/core/theme`, `@rspress/theme-default` → `@rspress/core/theme-original`). |
| 26 | - If the project has a custom theme (in `theme` directory), use `@rspress/core/theme-original` to import the original theme components. |
| 27 | - Update the Rspress config to match v2 options and defaults. |
| 28 | - Remove deprecated or unsupported settings. |
| 29 | |
| 30 | 6. **Validate** |
| 31 | - Run the build and dev server. |
| 32 | - 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. |