-
Notifications
You must be signed in to change notification settings - Fork 1
docs: add Rstack CLI migration guide #218
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
Merged
Merged
Changes from all commits
Commits
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| --- | ||
| description: 'Migrate an existing project to Rstack CLI with the recommended migration Skill.' | ||
| --- | ||
|
|
||
| # Migrate to Rstack CLI | ||
|
|
||
| To migrate an existing project, we recommend using the `migrate-to-rstack-cli` Skill. It inspects the project and automatically migrates supported tools used in the repository—including Rstack tools, Prettier, and Husky—to Rstack CLI. | ||
|
|
||
| ## Use the migration skill | ||
|
|
||
| First, install the Skill: | ||
|
|
||
| ```bash | ||
| npx skills add rstackjs/rstack-cli --skill migrate-to-rstack-cli | ||
| ``` | ||
|
|
||
| Then ask your coding agent to perform the migration with this prompt: | ||
|
|
||
| ```text | ||
| Use the migrate-to-rstack-cli Skill to migrate this project to Rstack CLI. | ||
| ``` | ||
|
|
||
| ## Supported tools | ||
|
|
||
| The Skill can directly migrate the following standalone tools: | ||
|
|
||
| - **Rstack toolchain:** [Rsbuild](https://rsbuild.rs/), [Rslib](https://rslib.rs/), [Rstest](https://rstest.rs/), [Rslint](https://rslint.rs/), and [Rspress](https://rspress.rs/) | ||
| - **Code formatting:** [Prettier](https://github.com/prettier/prettier) | ||
| - **Staged-file tasks:** [lint-staged](https://github.com/lint-staged/lint-staged) and [nano-staged](https://github.com/usmanyunusov/nano-staged) | ||
| - **Git hooks:** [Husky](https://github.com/typicode/husky) and [simple-git-hooks](https://github.com/toplenboren/simple-git-hooks) | ||
|
|
||
| ## Unsupported tools | ||
|
|
||
| The Skill does not directly migrate tools outside the list above. If your project uses any of the following tools, migrate it to the corresponding Rstack tool first, then run the `migrate-to-rstack-cli` Skill: | ||
|
|
||
| - **Application builds:** Follow the Rsbuild [webpack migration guide](https://rsbuild.rs/guide/migration/webpack), [Vite migration guide](https://rsbuild.rs/guide/migration/vite), [Create React App migration guide](https://rsbuild.rs/guide/migration/cra), or [Vue CLI migration guide](https://rsbuild.rs/guide/migration/vue-cli) to migrate the project to Rsbuild. | ||
| - **Library builds:** Follow the Rslib [tsup migration guide](https://rslib.rs/guide/migration/tsup) or [tsc migration guide](https://rslib.rs/guide/migration/tsc) to migrate the library to Rslib. | ||
| - **Testing:** Follow the Rstest [Jest migration guide](https://rstest.rs/guide/migration/jest) or [Vitest migration guide](https://rstest.rs/guide/migration/vitest) to migrate the project to Rstest. | ||
| - **Linting:** Follow the [Rslint getting started guide](https://rslint.rs/guide/) to migrate ESLint or other linters to Rslint. | ||
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,39 @@ | ||
| --- | ||
| description: '使用推荐的迁移 Skill,将现有项目迁移到 Rstack CLI。' | ||
| --- | ||
|
|
||
| # 迁移到 Rstack CLI \{#migrate-to-rstack-cli} | ||
|
|
||
| 迁移现有项目时,推荐使用 `migrate-to-rstack-cli` Skill。该 Skill 会分析项目,并自动将仓库中使用的 Rstack 工具及 Prettier、Husky 等受支持工具迁移到 Rstack CLI。 | ||
|
|
||
| ## 使用迁移 Skill \{#use-the-migration-skill} | ||
|
|
||
| 首先安装该 Skill: | ||
|
|
||
| ```bash | ||
| npx skills add rstackjs/rstack-cli --skill migrate-to-rstack-cli | ||
| ``` | ||
|
|
||
| 安装完成后,向 Coding Agent 发送以下 Prompt: | ||
|
|
||
| ```text | ||
| 使用 migrate-to-rstack-cli Skill 将当前项目迁移到 Rstack CLI。 | ||
| ``` | ||
|
|
||
| ## 支持的工具 \{#supported-tools} | ||
|
|
||
| 该 Skill 可以直接迁移以下独立工具: | ||
|
|
||
| - **Rstack 工具链:**[Rsbuild](https://rsbuild.rs/zh/)、[Rslib](https://rslib.rs/zh/)、[Rstest](https://rstest.rs/zh/)、[Rslint](https://rslint.rs/) 和 [Rspress](https://rspress.rs/zh/) | ||
| - **代码格式化:**[Prettier](https://github.com/prettier/prettier) | ||
| - **暂存文件处理:**[lint-staged](https://github.com/lint-staged/lint-staged) 和 [nano-staged](https://github.com/usmanyunusov/nano-staged) | ||
| - **Git hooks:**[Husky](https://github.com/typicode/husky) 和 [simple-git-hooks](https://github.com/toplenboren/simple-git-hooks) | ||
|
|
||
| ## 不支持的工具 \{#unsupported-tools} | ||
|
|
||
| 该 Skill 不会直接迁移上面列表之外的工具。如果项目使用以下工具,请先将其迁移到对应的 Rstack 工具,再运行 `migrate-to-rstack-cli` Skill: | ||
|
|
||
| - **应用构建:**参考 Rsbuild 的 [webpack 迁移指南](https://rsbuild.rs/zh/guide/migration/webpack)、[Vite 迁移指南](https://rsbuild.rs/zh/guide/migration/vite)、[Create React App 迁移指南](https://rsbuild.rs/zh/guide/migration/cra) 或 [Vue CLI 迁移指南](https://rsbuild.rs/zh/guide/migration/vue-cli),将项目迁移到 Rsbuild。 | ||
| - **库构建:**参考 Rslib 的 [tsup 迁移指南](https://rslib.rs/zh/guide/migration/tsup) 或 [tsc 迁移指南](https://rslib.rs/zh/guide/migration/tsc),将库迁移到 Rslib。 | ||
| - **测试:**参考 Rstest 的 [Jest 迁移指南](https://rstest.rs/zh/guide/migration/jest) 或 [Vitest 迁移指南](https://rstest.rs/zh/guide/migration/vitest),将项目迁移到 Rstest。 | ||
| - **代码检查:**参考 [Rslint 入门指南](https://rslint.rs/guide/),将 ESLint 或其他代码检查工具迁移到 Rslint。 |
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
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.
Uh oh!
There was an error while loading. Please reload this page.