Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ jobs:
npm install -g corepack@latest --force
corepack enable

- name: Setup Node.js 18.x
- name: Setup Node.js 22.x
uses: actions/setup-node@v4
with:
node-version: 18.x
node-version: 22.x
cache: 'pnpm'

- name: Install Dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
node-version: [18.x]
node-version: [22.x]

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
runs-on: windows-latest
strategy:
matrix:
node-version: [18.x]
node-version: [22.x]

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lts/hydrogen
lts/jod
16 changes: 8 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,25 @@ own GitHub account and then [clone](https://help.github.com/articles/cloning-a-r

### Install Node.js

We recommend using Node.js 18. You can check your currently used Node.js version with the following command:
We recommend using Node.js 22. You can check your currently used Node.js version with the following command:

```bash
node -v
```

If you do not have Node.js installed in your current environment, you can use [nvm](https://github.com/nvm-sh/nvm) or [fnm](https://github.com/Schniz/fnm) to install it.

Here is an example of how to install the Node.js 18 LTS version via nvm:
Here is an example of how to install the Node.js 22 LTS version via nvm:

```bash
# Install the LTS version of Node.js 18
nvm install 18 --lts
# Install the LTS version of Node.js 22
nvm install 22 --lts

# Make the newly installed Node.js 18 as the default version
nvm alias default 18
# Make the newly installed Node.js 22 as the default version
nvm alias default 22

# Switch to the newly installed Node.js 18
nvm use 18
# Switch to the newly installed Node.js 22
nvm use 22
```

### Install pnpm
Expand Down
2 changes: 1 addition & 1 deletion packages/document/docs/en/guide/start/cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ import { execute } from '@rsdoctor/cli';

**execute()**

The `execute` asynchronous function is the execution function of Rsdoctor CLI. By calling the `execute` function, it will automatically parse [process.argv](https://nodejs.org/dist/latest-v18.x/docs/api/process.html#processargv) and invoke different commands.
The `execute` asynchronous function is the execution function of Rsdoctor CLI. By calling the `execute` function, it will automatically parse [process.argv](https://nodejs.org/dist/latest-v22.x/docs/api/process.html#processargv) and invoke different commands.

**execute('analyze', \{...\})**

Expand Down
2 changes: 1 addition & 1 deletion packages/document/docs/en/guide/usage/compile-overall.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The following table explains the meaning and code implementation of each phase i

| Phase Name | Description | Code Implementation |
| ---------------------------------------- | ------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <b><i>Bootstrap -> BeforeCompile</i></b> | Represents the time taken from project startup to before compilation starts | <ul><li>In `Webpack` or `Rspack` projects: Reports [process.uptime()](https://nodejs.org/dist/latest-v18.x/docs/api/process.html#processuptime) as the <b>duration</b> when **compiler.hooks.beforeCompile** is called</li></ul> |
| <b><i>Bootstrap -> BeforeCompile</i></b> | Represents the time taken from project startup to before compilation starts | <ul><li>In `Webpack` or `Rspack` projects: Reports [process.uptime()](https://nodejs.org/dist/latest-v22.x/docs/api/process.html#processuptime) as the <b>duration</b> when **compiler.hooks.beforeCompile** is called</li></ul> |
| <b><i>Compile</i></b> | Represents the total time taken for the project compilation | <ul><li>In `Webpack` or `Rspack` projects: The <b>start time</b> is the time when **compiler.hooks.beforeCompile** is called, and the <b>end time</b> is the time when **compiler.hooks.afterCompile** is called</li></ul> |
| <b><i>AfterCompile -> Done</i></b> | Represents the time taken from compilation completion to the end of the entire process | <ul><li>In `Webpack` or `Rspack` projects: The <b>start time</b> is the time when **compiler.hooks.afterCompile** is called, and the <b>end time</b> is the time when **compiler.hooks.done** is called</li></ul> |
| <b><i>Minify</i></b> | Represents the time taken for file compression during the compilation process in most cases | <ul><li>In `Webpack` or `Rspack` projects: Calculates the sum of the time taken for each call of **compilation.hooks.optimizeChunkAssets** and **compilation.hooks.processAssets**</li></ul> |
Expand Down
2 changes: 1 addition & 1 deletion packages/document/docs/en/guide/usage/project-overall.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ In the main page of **Rsdoctor**, we can see a card named `Project Overall`, whi
| <b><i>errors</i></b> | Represents the **error** level rules detected by Rsdoctor during the current run |
| <b><i>warns</i></b> | Represents the **warn** level rules detected by Rsdoctor during the current run |
| <b><i>webpack</i></b> | Represents the Webpack version obtained during the current run |
| <b><i>cwd</i></b> | Represents the current working directory during the current run, i.e., [process.cwd()](https://nodejs.org/dist/latest-v18.x/docs/api/process.html#processcwd) |
| <b><i>cwd</i></b> | Represents the current working directory during the current run, i.e., [process.cwd()](https://nodejs.org/dist/latest-v22.x/docs/api/process.html#processcwd) |
| <b><i>cpu</i></b> | Represents the CPU information |
| <b><i>memory</i></b> | Represents the memory information during the current run |
| <b><i>node</i></b> | Represents the version number of [Node.js](https://nodejs.org/) |
Expand Down
2 changes: 1 addition & 1 deletion packages/document/docs/zh/guide/start/cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ import { execute } from '@rsdoctor/cli';

**execute()**

`execute` 异步函数是 Rsdoctor CLI 的执行函数,通过调用 `execute` 函数就会自动解析 [process.argv](https://nodejs.org/dist/latest-v18.x/docs/api/process.html#processargv),然后调用不同的命令。
`execute` 异步函数是 Rsdoctor CLI 的执行函数,通过调用 `execute` 函数就会自动解析 [process.argv](https://nodejs.org/dist/latest-v22.x/docs/api/process.html#processargv),然后调用不同的命令。

**execute('analyze', \{...\})**

Expand Down
2 changes: 1 addition & 1 deletion packages/document/docs/zh/guide/usage/compile-overall.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

| 阶段名称 | 描述说明 | 代码实现 |
| ---------------------------------------- | ------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <b><i>Bootstrap -> BeforeCompile</i></b> | 代表项目从启动到开始编译之前的耗时 | <ul><li>`Webpack` or `Rspack` 项目中:在 **compiler.hooks.beforeCompile** 被调用时上报 [process.uptime()](https://nodejs.org/dist/latest-v18.x/docs/api/process.html#processuptime) 作为<b>本阶段耗时</b></li></ul> |
| <b><i>Bootstrap -> BeforeCompile</i></b> | 代表项目从启动到开始编译之前的耗时 | <ul><li>`Webpack` or `Rspack` 项目中:在 **compiler.hooks.beforeCompile** 被调用时上报 [process.uptime()](https://nodejs.org/dist/latest-v22.x/docs/api/process.html#processuptime) 作为<b>本阶段耗时</b></li></ul> |
| <b><i>Compile</i></b> | 代表项目的整个编译耗时 | <ul><li>`Webpack` or `Rspack` 项目中:在 **compiler.hooks.beforeCompile** 被调用时的时间点作为<b>开始时间</b>,在 **compiler.hooks.afterCompile** 被调用时的时间点作为<b>结束时间</b></li></ul> |
| <b><i>AfterCompile -> Done</i></b> | 代表编译结束到整个流程结束的耗时 | <ul><li>`Webpack` or `Rspack` 项目中:在 **compiler.hooks.afterCompile** 被调用时的时间点作为<b>开始时间</b>,在 **compiler.hooks.done** 被调用时的时间点作为<b>结束时间</b></li></ul> |
| <b><i>Minify</i></b> | 绝大部分情况下,代表项目编译流程内文件压缩的耗时 | <ul><li>`Webpack` or `Rspack` 项目中:统计 **compilation.hooks.optimizeChunkAssets** 和 **compilation.hooks.processAssets** 每次<b>调用时间之和</b></li></ul> |
Expand Down
2 changes: 1 addition & 1 deletion packages/document/docs/zh/guide/usage/project-overall.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
| <b><i>errors</i></b> | 代表 Rsdoctor 在当次运行中检测出的 **error** 级别的规则 |
| <b><i>warns</i></b> | 代表 Rsdoctor 在当次运行中检测出的 **warn** 级别的规则 |
| <b><i>webpack</i></b> | 代表当次运行时获取到的 Webpack 版本 |
| <b><i>cwd</i></b> | 代表当次运行时的进程执行目录,即 [process.cwd()](https://nodejs.org/dist/latest-v18.x/docs/api/process.html#processcwd) |
| <b><i>cwd</i></b> | 代表当次运行时的进程执行目录,即 [process.cwd()](https://nodejs.org/dist/latest-v22.x/docs/api/process.html#processcwd) |
| <b><i>cpu</i></b> | 代表 cpu 信息 |
| <b><i>memory</i></b> | 代表当次运行时的 memory 信息 |
| <b><i>node</i></b> | 代表 [Node.js](https://nodejs.org/) 版本号 |
Expand Down
Loading