-
Notifications
You must be signed in to change notification settings - Fork 315
[v1.3] 修复 npm packages vulnerabilities 问题 #1227
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
[v1.3] 修复 npm packages vulnerabilities 问题 #1227
Conversation
|
本地跑单元测试没问题,github ci出问题了 |
喔。。。 |
|
@CodFrm vitest 升級至 4.0.18 了。 ci 也過了 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
本 PR 旨在修复 npm packages 的安全漏洞问题,主要通过删除未使用的依赖和更新现有依赖到最新版本来实现。PR 同时更新了相关配置以适配新版本的工具链。
Changes:
- 删除未使用的
@crowdin/cli依赖 - 更新多个核心依赖到最新版本(rspack 1.5.8 → 1.7.6, vitest 3.2.4 → 4.0.18, eslint等)
- 更新 rspack 配置以移除过时的 API 并适配新版本
- 添加 vitest 4.x 的 adoptedStyleSheets 兼容性修复
- 移除测试中的
.concurrent以解决 vitest 4.x 的兼容性问题
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| package.json | 删除 @crowdin/cli,更新 rspack、vitest、eslint、testing-library 等依赖到最新版本 |
| rspack.config.ts | 移除 defineConfig,添加 node 配置,移除已弃用的 parallelCodeSplitting,改用 satisfies Configuration |
| tests/vitest.setup.ts | 添加 vitest 4.x 中 adoptedStyleSheets 的兼容性修复代码 |
| packages/message/*.test.ts | 移除测试中的 .concurrent 标记以适配 vitest 4.x |
| pnpm-lock.yaml | 自动生成的锁文件,反映所有依赖更新 |
|
|
||
| describe("发布方法测试", () => { | ||
| it.concurrent("publish 方法应该使用 chrome.runtime.sendMessage", () => { | ||
| it("publish 方法应该使用 chrome.runtime.sendMessage", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
concurrent 确实容易出问题,后面的单元测试我觉得也不用强求使用concurrent了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我觉得是unit test 写得不好吧
不应该每一次test 改共通
而是一次过对共通做mock
不要用 .not.toHaveBeenCalled();
用 not.toHaveBeenCalledWith({ ... });
如果是简单的 test 的话,就用 concurrent 吧
通讯系的又懒写就不加 concurrent
现在升级到 4.x.x 应该速度会有提升
都随心吧。只是一个 test
Before
After