@rsdoctor/docs 1.4.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/en/blog/release/release-note-1_0.mdx +1 -1
- package/docs/en/config/options/experiments.mdx +1 -1
- package/docs/en/config/options/options.mdx +1 -1
- package/docs/en/config/options/output.mdx +3 -1
- package/docs/en/guide/rules/rules.mdx +1 -3
- package/docs/en/guide/start/action.mdx +13 -1
- package/docs/en/guide/start/intro.mdx +1 -1
- package/docs/zh/blog/release/release-note-1_0.mdx +1 -1
- package/docs/zh/config/options/experiments.mdx +1 -1
- package/docs/zh/config/options/options.mdx +1 -1
- package/docs/zh/config/options/output.mdx +3 -1
- package/docs/zh/guide/rules/rules.mdx +1 -3
- package/docs/zh/guide/start/action.mdx +13 -1
- package/docs/zh/guide/start/intro.mdx +1 -1
- package/package.json +5 -5
|
@@ -46,7 +46,7 @@ Based on the above situation, we decided to develop a build analyzer focused on
|
|
|
46
46
|
|
|
47
47
|
We designed an intuitive user interface for Rsdoctor, and Rsdoctor extends the **loader profiling capability** by combining the advantages of multiple tools to more deeply analyze the loader behavior in the compilation phase, **built-in the scanning and detection rules for artifacts and compilation**, and supports user **custom rules**.
|
|
48
48
|
|
|
49
|
-
Rsdoctor not only supports Rspack and webpack, but also supports all tools and frameworks based on Rspack or webpack, such as: [Docusaurus](https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-rsdoctor), [Rspeedy (Lynx)](https://lynxjs.org/rspeedy/), [Storybook](https://github.com/
|
|
49
|
+
Rsdoctor not only supports Rspack and webpack, but also supports all tools and frameworks based on Rspack or webpack, such as: [Docusaurus](https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-rsdoctor), [Rspeedy (Lynx)](https://lynxjs.org/rspeedy/), [Storybook](https://github.com/rstackjs/storybook-rsbuild), [Next.js](https://nextjs.org/), [Nuxt](https://nuxt.com/), [Re.Pack](https://re-pack.dev/), [Modern.js](https://modernjs.dev/), [Rsbuild](https://rsbuild.rs/), [Rspress](https://rspress.rs/) and [Rslib](https://rslib.rs/).
|
|
50
50
|
|
|
51
51
|
Rsdoctor can be used to:
|
|
52
52
|
|
|
@@ -8,7 +8,7 @@ import { Badge } from '@theme';
|
|
|
8
8
|
|
|
9
9
|
- **Type:** `boolean`
|
|
10
10
|
- **Optional:** `true`
|
|
11
|
-
- **Default:** `
|
|
11
|
+
- **Default:** `true`
|
|
12
12
|
|
|
13
13
|
By enabling the enableNativePlugin option, the Rspack native plugin moves the time-consuming data processing logic from Rsdoctor to the Rspack build stage, significantly improving build analysis efficiency and greatly reducing Rsdoctor's own analysis time.
|
|
14
14
|
|
|
@@ -194,7 +194,9 @@ NormalModeOptions currently has an empty Object type.
|
|
|
194
194
|
|
|
195
195
|
```js
|
|
196
196
|
new RsdoctorRspackPlugin({
|
|
197
|
-
|
|
197
|
+
output: {
|
|
198
|
+
reportCodeType: { noModuleSource: true } // { noAssetsAndModuleSource: true }
|
|
199
|
+
}
|
|
198
200
|
}),
|
|
199
201
|
```
|
|
200
202
|
|
|
@@ -31,11 +31,9 @@ Please refer to the [Linter Type](#linter-type) in this document for the type de
|
|
|
31
31
|
<img src="https://assets.rspack.rs/others/assets/rsdoctor/bundle-alerts.png" />
|
|
32
32
|
|
|
33
33
|
- Clicking the icon to expand the duplicate package details allows you to see: the name, version, size, and reference files of the duplicate package.
|
|
34
|
-
|
|
35
34
|
- Clicking the **「Show Relations」** on the far right can view the specific reference chain and the corresponding reference file code position of this third-party package.
|
|
36
35
|
|
|
37
36
|
<img src="https://assets.rspack.rs/others/assets/rsdoctor/bundle-alters-relations.png" />
|
|
38
|
-
|
|
39
37
|
- Clicking the **「!(exclamation mark)」** icon on the far right can view the specific explanation of the rule for the duplicate third-party package.
|
|
40
38
|
|
|
41
39
|
<img src="https://assets.rspack.rs/others/assets/rsdoctor/bundle-alters-rule.png" />
|
|
@@ -203,7 +201,7 @@ type CheckSyntaxOptions = {
|
|
|
203
201
|
};
|
|
204
202
|
```
|
|
205
203
|
|
|
206
|
-
For more `ECMA Version Check` configuration options, please refer to [ECMA Version Check Options](https://github.com/
|
|
204
|
+
For more `ECMA Version Check` configuration options, please refer to [ECMA Version Check Options](https://github.com/rstackjs/rsbuild-plugin-check-syntax?tab=readme-ov-file#options)
|
|
207
205
|
|
|
208
206
|
### [E1005] Default import check
|
|
209
207
|
|
|
@@ -58,9 +58,12 @@ Create a `.github/workflows/ci.yml` file in your GitHub repository as shown in t
|
|
|
58
58
|
target_branch: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.ref || github.event.repository.default_branch }}
|
|
59
59
|
```
|
|
60
60
|
|
|
61
|
-
- `
|
|
61
|
+
- `dispatch_target_branch`: Optional, used to specify the target branch when manually triggered (workflow_dispatch).
|
|
62
|
+
|
|
63
|
+
- `on` indicates when the workflow runs, commonly set to `pull_request` and `push`, and also supports `workflow_dispatch` for manual triggering.
|
|
62
64
|
- On `pull_request`, Rsdoctor Action fetches baseline and current and performs bundle diff analysis.
|
|
63
65
|
- On `push` (i.e., after PR merge), it updates and uploads the baseline.
|
|
66
|
+
- `workflow_dispatch` allows you to manually trigger the workflow from the GitHub Actions page. This mode combines the behavior of `push` and `pull_request`: it uploads baseline data, and if `dispatch_target_branch` is specified, it also performs baseline comparison analysis.
|
|
64
67
|
- Before executing rsdoctor-action, build your project with the Rsdoctor plugin enabled to generate the Rsdoctor JSON data file.
|
|
65
68
|
|
|
66
69
|
```yaml
|
|
@@ -72,6 +75,13 @@ on:
|
|
|
72
75
|
push:
|
|
73
76
|
branches:
|
|
74
77
|
- main # or your target branch name
|
|
78
|
+
workflow_dispatch: # Optional, allows manual triggering
|
|
79
|
+
inputs:
|
|
80
|
+
target_branch:
|
|
81
|
+
description: 'Target branch to compare against'
|
|
82
|
+
required: false
|
|
83
|
+
default: 'main'
|
|
84
|
+
type: string
|
|
75
85
|
|
|
76
86
|
jobs:
|
|
77
87
|
bundle-analysis:
|
|
@@ -115,6 +125,8 @@ jobs:
|
|
|
115
125
|
# Default 'main'. If you want to use a dynamic target branch, i.e., automatically get the target branch of the current pull request instead of a fixed main branch, you can use the following configuration:
|
|
116
126
|
# ${{ github.event_name == 'pull_request' && github.event.pull_request.base.ref || github.event.repository.default_branch }}
|
|
117
127
|
target_branch: 'main'
|
|
128
|
+
# Target branch for manual trigger
|
|
129
|
+
dispatch_target_branch: ${{ github.event.inputs.target_branch }}
|
|
118
130
|
```
|
|
119
131
|
|
|
120
132
|
## View Reports
|
|
@@ -4,7 +4,7 @@ Rsdoctor is a build analyzer tailored for the [Rspack](https://rspack.rs/) ecosy
|
|
|
4
4
|
|
|
5
5
|
Rsdoctor is committed to being a one-stop, intelligent build analyzer that makes the build process transparent, predictable, and optimizable through visualization and smart analysis, helping development teams precisely identify bottlenecks, optimize performance, and improve engineering quality.
|
|
6
6
|
|
|
7
|
-
Rsdoctor supports all tools and frameworks based on Rspack or webpack, such as: [Docusaurus](https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-rsdoctor), [Rspeedy (Lynx)](https://lynxjs.org/rspeedy/), [Storybook](https://github.com/
|
|
7
|
+
Rsdoctor supports all tools and frameworks based on Rspack or webpack, such as: [Docusaurus](https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-rsdoctor), [Rspeedy (Lynx)](https://lynxjs.org/rspeedy/), [Storybook](https://github.com/rstackjs/storybook-rsbuild), [Next.js](https://nextjs.org/), [Nuxt](https://nuxt.com/), [Re.Pack](https://re-pack.dev/), [Modern.js](https://modernjs.dev/), [Rsbuild](https://rsbuild.rs/), [Rspress](https://rspress.rs/) and [Rslib](https://rslib.rs/).
|
|
8
8
|
|
|
9
9
|
<video
|
|
10
10
|
src="https://assets.rspack.rs/others/assets/rsdoctor/rsdoctor-1.0-ui.mp4"
|
|
@@ -46,7 +46,7 @@ Rsdoctor 致力于成为一站式、智能化的构建分析工具,通过可
|
|
|
46
46
|
|
|
47
47
|
我们为 Rsdoctor 设计了直观的用户界面,将构建数据可视化。同时,Rsdoctor 在结合多种工具的基础上,额外扩展了 loader 分析能力以更深入 loader 的编译行为,内置了产物及编译的扫描和检测规则,并支持用户自定义规则。
|
|
48
48
|
|
|
49
|
-
Rsdoctor 不仅支持 Rspack 和 webpack,也支持所有基于 Rspack 或 webpack 的工具和框架,例如:[Docusaurus](https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-rsdoctor)、[Rspeedy (Lynx)](https://lynxjs.org/rspeedy/)、[Storybook](https://github.com/
|
|
49
|
+
Rsdoctor 不仅支持 Rspack 和 webpack,也支持所有基于 Rspack 或 webpack 的工具和框架,例如:[Docusaurus](https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-rsdoctor)、[Rspeedy (Lynx)](https://lynxjs.org/rspeedy/)、[Storybook](https://github.com/rstackjs/storybook-rsbuild)、[Next.js](https://nextjs.org/)、[Nuxt](https://nuxt.com/)、[Re.Pack](https://re-pack.dev/)、[Modern.js](https://modernjs.dev/)、[Rsbuild](https://rsbuild.rs/)、[Rspress](https://rspress.rs/) 和 [Rslib](https://rslib.rs/) 等。
|
|
50
50
|
|
|
51
51
|
Rsdoctor 可以被用于:
|
|
52
52
|
|
|
@@ -191,7 +191,9 @@ NormalModeOptions 目前类型为空 Object。
|
|
|
191
191
|
|
|
192
192
|
```js
|
|
193
193
|
new RsdoctorRspackPlugin({
|
|
194
|
-
|
|
194
|
+
output: {
|
|
195
|
+
reportCodeType: { noModuleSource: true } // { noAssetsAndModuleSource: true }
|
|
196
|
+
}
|
|
195
197
|
}),
|
|
196
198
|
```
|
|
197
199
|
|
|
@@ -28,11 +28,9 @@
|
|
|
28
28
|
<img src="https://assets.rspack.rs/others/assets/rsdoctor/bundle-alerts.png" />
|
|
29
29
|
|
|
30
30
|
- 点击图标展开重复包详情,可以看到:重复包的包名、版本、大小、引用文件。
|
|
31
|
-
|
|
32
31
|
- 点击最右侧 **「Show Relations」** 可以查看具体这个第三方的引用链路和对应的引用文件代码位置。
|
|
33
32
|
|
|
34
33
|
<img src="https://assets.rspack.rs/others/assets/rsdoctor/bundle-alters-relations.png" />
|
|
35
|
-
|
|
36
34
|
- 点击最右侧 **「!(叹号)」** 图标,可以查看重复第三方包的规则的具体解释。
|
|
37
35
|
|
|
38
36
|
<img src="https://assets.rspack.rs/others/assets/rsdoctor/bundle-alters-rule.png" />
|
|
@@ -200,7 +198,7 @@ type CheckSyntaxOptions = {
|
|
|
200
198
|
};
|
|
201
199
|
```
|
|
202
200
|
|
|
203
|
-
更多 `ECMA Version Check` 配置请参考 [ECMA Version Check Options](https://github.com/
|
|
201
|
+
更多 `ECMA Version Check` 配置请参考 [ECMA Version Check Options](https://github.com/rstackjs/rsbuild-plugin-check-syntax?tab=readme-ov-file#options)
|
|
204
202
|
|
|
205
203
|
### [E1005] Default import check
|
|
206
204
|
|
|
@@ -58,9 +58,12 @@ export default defineConfig({
|
|
|
58
58
|
target_branch: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.ref || github.event.repository.default_branch }}
|
|
59
59
|
```
|
|
60
60
|
|
|
61
|
-
- `
|
|
61
|
+
- `dispatch_target_branch`:非必需,用于手动触发 (workflow_dispatch) 时指定目标分支。
|
|
62
|
+
|
|
63
|
+
- `on` 是指 workflow 运行的时机,通常设置为 `pull_request` 和 `push`,也支持 `workflow_dispatch` 手动触发。
|
|
62
64
|
- 在 `pull_request` 时,Rsdoctor Action 会拉取 baseline 和 current,进行 bundle diff 分析。
|
|
63
65
|
- 在 `push`(即 PR 合并)时,会进行 baseline 的更新和上传操作。
|
|
66
|
+
- `workflow_dispatch` 允许在 GitHub Actions 页面手动触发工作流。此模式结合了 `push` 和 `pull_request` 的行为:会上传 baseline 数据,同时如果指定了 `dispatch_target_branch`,还会进行 baseline 对比分析。
|
|
64
67
|
- 在执行 rsdoctor-action 之前,需要先将项目进行构建,构建时需要开启 Rsdoctor 插件,并生成 Rsdoctor JSON 数据文件。
|
|
65
68
|
|
|
66
69
|
```yaml
|
|
@@ -72,6 +75,13 @@ on:
|
|
|
72
75
|
push:
|
|
73
76
|
branches:
|
|
74
77
|
- main # 或者其他目标分支
|
|
78
|
+
workflow_dispatch: # 可选,允许手动触发
|
|
79
|
+
inputs:
|
|
80
|
+
target_branch:
|
|
81
|
+
description: '用于对比的目标分支'
|
|
82
|
+
required: false
|
|
83
|
+
default: 'main'
|
|
84
|
+
type: string
|
|
75
85
|
|
|
76
86
|
jobs:
|
|
77
87
|
bundle-analysis:
|
|
@@ -115,6 +125,8 @@ jobs:
|
|
|
115
125
|
# 默认 'main',如果想用不固定的目标分支,即自动获取当前 pull request 的 target branch,则可以使用下方配置:
|
|
116
126
|
# ${{ github.event_name == 'pull_request' && github.event.pull_request.base.ref || github.event.repository.default_branch }}
|
|
117
127
|
target_branch: 'main'
|
|
128
|
+
# 手动触发时使用的目标分支
|
|
129
|
+
dispatch_target_branch: ${{ github.event.inputs.target_branch }}
|
|
118
130
|
```
|
|
119
131
|
|
|
120
132
|
## 查看报告
|
|
@@ -4,7 +4,7 @@ Rsdoctor 是一款为 [Rspack](https://rspack.rs/) 生态量身打造的构建
|
|
|
4
4
|
|
|
5
5
|
Rsdoctor 致力于成为一站式、智能化的构建分析工具,通过可视化与智能分析,使整个构建流程变得透明、可预测和可优化,从而帮助开发团队精准定位瓶颈、优化性能并提升工程质量。
|
|
6
6
|
|
|
7
|
-
Rsdoctor 支持所有基于 Rspack 或 webpack 的工具和框架,例如:[Docusaurus](https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-rsdoctor)、[Rspeedy (Lynx)](https://lynxjs.org/rspeedy/)、[Storybook](https://github.com/
|
|
7
|
+
Rsdoctor 支持所有基于 Rspack 或 webpack 的工具和框架,例如:[Docusaurus](https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-rsdoctor)、[Rspeedy (Lynx)](https://lynxjs.org/rspeedy/)、[Storybook](https://github.com/rstackjs/storybook-rsbuild)、[Next.js](https://nextjs.org/)、[Nuxt](https://nuxt.com/)、[Re.Pack](https://re-pack.dev/)、[Modern.js](https://modernjs.dev/)、[Rsbuild](https://rsbuild.rs/)、[Rspress](https://rspress.rs/) 和 [Rslib](https://rslib.rs/) 等。
|
|
8
8
|
|
|
9
9
|
<video
|
|
10
10
|
src="https://assets.rspack.rs/others/assets/rsdoctor/rsdoctor-1.0-ui.mp4"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsdoctor/docs",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/web-infra-dev/rsdoctor",
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"registry": "https://registry.npmjs.org/"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@rspress/plugin-algolia": "2.0.0-rc.
|
|
22
|
-
"@rspress/plugin-llms": "2.0.0-rc.
|
|
21
|
+
"@rspress/plugin-algolia": "2.0.0-rc.5",
|
|
22
|
+
"@rspress/plugin-llms": "2.0.0-rc.5",
|
|
23
23
|
"@rspress/plugin-rss": "2.0.0-rc.0",
|
|
24
24
|
"@types/node": "^22.8.1",
|
|
25
25
|
"@types/react": "^18.3.27",
|
|
@@ -33,13 +33,13 @@
|
|
|
33
33
|
"rspress-plugin-sitemap": "^1.2.1",
|
|
34
34
|
"typescript": "^5.9.2",
|
|
35
35
|
"@rsbuild/plugin-sass": "^1.4.0",
|
|
36
|
-
"@rsdoctor/types": "1.
|
|
36
|
+
"@rsdoctor/types": "1.5.0"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@rstack-dev/doc-ui": "1.12.2",
|
|
40
40
|
"clsx": "^2.1.1",
|
|
41
41
|
"react-markdown": "^9.1.0",
|
|
42
|
-
"@rspress/core": "2.0.0-rc.
|
|
42
|
+
"@rspress/core": "2.0.0-rc.5"
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|
|
45
45
|
"dev": "cross-env RSPRESS_PERSIST_CACHE=false rspress dev",
|