Conversation
📝 WalkthroughWalkthrough本次变更仅修改了 Changes
Assessment against linked issues
Assessment against linked issues: Out-of-scope changes(无发现超出已关联 issue 目标范围的更改) Poem
✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
package.json (1)
16-18: 考虑直接锁定到 1.13.x 以修复已知安全漏洞
underscore≤1.12 系列仍存在 Prototype Pollution 等 CVE,社区目前维护的安全版本为 1.13.6(2024-05 发布)。如果上游依赖未限制主版本,建议改为:- "**/underscore": "1.12.0" + "**/underscore": "1.13.6"以提前消除安全隐患,再通过 CI 验证兼容性。
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
package.json(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Socket Security: Pull Request Alerts
🔇 Additional comments (1)
package.json (1)
16-18: 确认已同步更新 yarn.lock 并验证生效
把underscore改成"**/underscore"能覆盖深层依赖,思路正确。但只有在重新执行yarn install并把生成的yarn.lock变更一起提交后,团队才能真正得到 1.12.0 的锁定效果。请运行yarn install --check-files yarn why underscore确认输出只剩 1.12.0,再把
yarn.lock的变更一并提交。
|
删掉 resolutions 如何? |
|
删除resolutions???我没有明白,是要换解决方案来升级underscore吗?比如换用依赖了低版本underscore的库? 我单独写了一个简单的测试 "dependencies": {
"pngjs-image": "^0.11.7",
"underscore": "1.13.0"
}不写resolutions时输出: geodaoyu@anonymous resolutions % yarn list underscore
yarn list v1.22.22
warning Filtering by arguments is deprecated. Please use the pattern option instead.
├─ pngjs-image@0.11.7
│ └─ underscore@1.7.0
└─ underscore@1.13.0
✨ Done in 0.04s.resolutions不写嵌套时即: "resolutions": {
"underscore": "1.12.0"
},输出: geodaoyu@anonymous resolutions % yarn list underscore
yarn list v1.22.22
warning Resolution field "underscore@1.12.0" is incompatible with requested version "underscore@1.7.0"
warning Filtering by arguments is deprecated. Please use the pattern option instead.
├─ pngjs-image@0.11.7
│ └─ underscore@1.12.0
└─ underscore@1.13.0
✨ Done in 0.04s.resolutions写嵌套时即: "resolutions": {
"**/underscore": "1.12.0"
},输出: geodaoyu@anonymous resolutions % yarn list underscore
yarn list v1.22.22
warning Resolution field "underscore@1.12.0" is incompatible with requested version "underscore@1.7.0"
warning Filtering by arguments is deprecated. Please use the pattern option instead.
├─ pngjs-image@0.11.7
│ └─ underscore@1.12.0
└─ underscore@1.13.0
✨ Done in 0.06s.结论resolutions中需要加**处理嵌套依赖。可以解决问题。 |
你想用pnpm.overrides? |
|
@afc163 还有一种办法,就是重写 screenshot 模块,把 blink-diff 和 pngjs-image 这两个9年前就停止更新的库取消了。那么整个项目都没有依赖underscore了。 |
Fix #132
我在package.json中看到是锁定了underscore的版本,已经升级到1.12.0了
但是我安装之后发现版本还是1.7.0
应该是yarn 深层嵌套依赖之后的范围问题。我把resolutions写成**了。但是没有test指令,我不能确定功能是否正常。
Summary by CodeRabbit