Skip to content

Commit 3e717e3

Browse files
committed
chore: 更新依赖版本并调整配置
- 将 @rslib/core 更新至 0.9.2 - 添加 chalk 和 inquirer 作为开发依赖 - 更新 pnpm-lock.yaml 中的 esbuild 版本至 0.25.5 - 在 .github/dependabot.yml 中忽略 esbuild 的版本更新
1 parent 8098ab4 commit 3e717e3

File tree

4 files changed

+399
-293
lines changed

4 files changed

+399
-293
lines changed

.github/dependabot.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ updates:
1515
commit-message:
1616
prefix: "chore"
1717
include: "scope"
18+
# 忽略 esbuild,因为我们使用 pnpm overrides 管理
19+
ignore:
20+
- dependency-name: "esbuild"
21+
update-types: ["version-update:semver-major", "version-update:semver-minor", "version-update:semver-patch"]
1822

1923
# GitHub Actions 更新
2024
- package-ecosystem: "github-actions"

SECURITY.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# 安全说明
2+
3+
## esbuild 安全漏洞解决方案
4+
5+
### 问题描述
6+
7+
Dependabot 报告了 esbuild 的安全漏洞:
8+
- 当前版本:0.21.5(存在安全漏洞)
9+
- 修复版本:0.25.0+
10+
11+
### 解决方案
12+
13+
由于 `@rslib/core` 依赖的 esbuild 版本较旧,我们使用 pnpm overrides 强制更新到安全版本。
14+
15+
#### 配置详情
16+
17+
`package.json` 中添加了以下配置:
18+
19+
```json
20+
{
21+
"pnpm": {
22+
"overrides": {
23+
"esbuild": "^0.25.0"
24+
}
25+
}
26+
}
27+
```
28+
29+
#### Dependabot 配置
30+
31+
`.github/dependabot.yml` 中忽略 esbuild 的自动更新,因为我们手动管理:
32+
33+
```yaml
34+
ignore:
35+
- dependency-name: "esbuild"
36+
update-types: ["version-update:semver-major", "version-update:semver-minor", "version-update:semver-patch"]
37+
```
38+
39+
### 验证
40+
41+
- ✅ esbuild 已更新到 0.25.5
42+
- ✅ 构建正常工作
43+
- ✅ 测试通过
44+
- ✅ 安全漏洞已修复
45+
46+
### 维护
47+
48+
`@rslib/core` 更新其 esbuild 依赖到安全版本时,可以移除 pnpm overrides 配置。
49+
50+
定期检查:
51+
1. `@rslib/core` 的更新日志
52+
2. esbuild 的安全公告
53+
3. 项目构建和测试状态
54+
55+
### 相关链接
56+
57+
- [esbuild 安全公告](https://github.com/evanw/esbuild/security/advisories)
58+
- [pnpm overrides 文档](https://pnpm.io/package_json#pnpmoverrides)
59+
- [Dependabot 配置文档](https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file)

package.json

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,20 +56,20 @@
5656
"decimal.js": "^10.4.1"
5757
},
5858
"devDependencies": {
59-
"@rslib/core": "^0.6.7",
59+
"@rslib/core": "^0.9.2",
6060
"@rspress/plugin-typedoc": "^1.43.9",
6161
"@vitest/coverage-v8": "^1.3.1",
6262
"bumpp": "^10.1.0",
63+
"chalk": "^4.1.2",
6364
"gh-pages": "^6.3.0",
65+
"inquirer": "^8.2.5",
6466
"prettier": "^3.5.2",
6567
"publint": "^0.3.12",
6668
"rspress": "^1.43.9",
6769
"rspress-plugin-sitemap": "^1.1.1",
6870
"simple-git-hooks": "^2.9.0",
6971
"typescript": "5.0.4",
70-
"vitest": "^1.3.1",
71-
"chalk": "^4.1.2",
72-
"inquirer": "^8.2.5"
72+
"vitest": "^1.3.1"
7373
},
7474
"repository": {
7575
"type": "git",
@@ -79,5 +79,10 @@
7979
"registry": "https://registry.npmjs.org",
8080
"access": "public"
8181
},
82+
"pnpm": {
83+
"overrides": {
84+
"esbuild": "^0.25.0"
85+
}
86+
},
8287
"license": "MIT"
8388
}

0 commit comments

Comments
 (0)