Skip to content

Commit c7f27e7

Browse files
committed
docs: add upgrade-rstest guide
1 parent 14667a9 commit c7f27e7

File tree

4 files changed

+136
-2
lines changed

4 files changed

+136
-2
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
["cli", "configure-rstest", "test-filter", "vscode-extension"]
1+
["cli", "configure-rstest", "test-filter", "vscode-extension", "upgrade-rstest"]
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Upgrade Rstest
2+
3+
This section explains how to upgrade the project's Rstest dependencies to the latest version.
4+
5+
:::info
6+
7+
Rstest is still in 0.x version stage, and the API may change frequently. We recommend upgrading to the latest version to access new features and bug fixes.
8+
9+
:::
10+
11+
## Using taze
12+
13+
We recommend using [Taze](https://github.com/antfu-collective/taze) to upgrade the Rstest version. Taze is a CLI tool for updating npm dependencies.
14+
15+
### Usage
16+
17+
Run the following command to upgrade all dependencies that include `rstest` and `rsbuild` in their names:
18+
19+
```bash
20+
npx taze major --include "/(rstest|rsbuild)/" -w
21+
```
22+
23+
:::tip
24+
Rstest has not yet reached version 1.0.0, so you need to add the `major` parameter when updating.
25+
:::
26+
27+
The result will look similar to:
28+
29+
```bash
30+
rstest-example - 1 patch
31+
32+
devDependencies
33+
@rstest/core ~29d ^0.6.0 → ^0.6.6 ~5d
34+
35+
ℹ changes written to package.json, run pnpm i to install updates.
36+
```
37+
38+
You can also adjust the `include` pattern to match specific packages, for example, to upgrade only packages under the `@rstest` scope:
39+
40+
```bash
41+
npx taze --include /@rstest/ -w
42+
```
43+
44+
### Options
45+
46+
Here are some examples of using taze options.
47+
48+
- In a monorepo, you can add the `-r` option to upgrade recursively:
49+
50+
```bash
51+
npx taze --include /(rstest|rsbuild)/ -w -r
52+
```
53+
54+
- Add `-l` to upgrade locked versions:
55+
56+
```bash
57+
npx taze --include /(rstest|rsbuild)/ -w -l
58+
```
59+
60+
- To upgrade to a major version:
61+
62+
```bash
63+
npx taze major --include /(rstest|rsbuild)/ -w
64+
```
65+
66+
> For more options, please refer to the [taze documentation](https://github.com/antfu-collective/taze).
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
["cli", "configure-rstest", "test-filter", "vscode-extension"]
1+
["cli", "configure-rstest", "test-filter", "vscode-extension", "upgrade-rstest"]
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# 升级 Rstest
2+
3+
本节介绍如何将项目中的 Rstest 依赖升级到最新版本。
4+
5+
:::info
6+
7+
Rstest 仍处于 0.x 版本,API 可能会频繁变化。我们建议升级到最新版本以使用新功能和已修复的 bug。
8+
9+
:::
10+
11+
## 使用 Taze
12+
13+
我们推荐使用 [Taze](https://github.com/antfu-collective/taze) 来升级 Rstest 版本。Taze 是一个用于更新 npm 依赖的 CLI 工具。
14+
15+
### 使用方法
16+
17+
运行以下命令以升级所有名称中包含 `rstest``rsbuild` 的依赖项:
18+
19+
```bash
20+
npx taze major --include "/(rstest|rsbuild)/" -w
21+
```
22+
23+
:::tip
24+
25+
Rstest 尚未达到 1.0.0 版本,因此你需要在更新时添加 `major` 参数。
26+
27+
:::
28+
29+
结果将类似于:
30+
31+
```bash
32+
rstest-example - 1 patch
33+
34+
devDependencies
35+
@rstest/core ~29d ^0.6.0 → ^0.6.6 ~5d
36+
37+
ℹ changes written to package.json, run pnpm i to install updates.
38+
```
39+
40+
你可以调整 `include` 模式以匹配特定包,例如,仅升级 `@rstest` 范围内的包:
41+
42+
```bash
43+
npx taze --include /@rstest/ -w
44+
```
45+
46+
### 选项
47+
48+
以下是一些使用 taze 选项的示例。
49+
50+
- 在 monorepo 中,你可以添加 `-r` 选项以递归升级:
51+
52+
```bash
53+
npx taze --include /(rstest|rsbuild)/ -w -r
54+
```
55+
56+
- 添加 `-l` 选项以升级锁定版本:
57+
58+
```bash
59+
npx taze --include /(rstest|rsbuild)/ -w -l
60+
```
61+
62+
- 升级到 major 版本:
63+
64+
```bash
65+
npx taze major --include /(rstest|rsbuild)/ -w
66+
```
67+
68+
> 更多选项请参考 [taze 文档](https://github.com/antfu-collective/taze)

0 commit comments

Comments
 (0)