mirror of
https://github.com/oven-sh/bun
synced 2026-02-10 02:48:50 +00:00
### What does this PR do? Allows optional peers to resolve to package if possible. Optional peers aren't auto-installed, but they should still be given a chance to resolve. If they're always left unresolved it's possible for multiple dependencies on the same package to result in different peer resolutions when they should be the same. For example, this bug this could cause monorepos using elysia to have corrupt node_modules because there might be more than one copy of elysia in `node_modules/.bun` (or more than the expected number of copies). fixes #23725 most likely fixes #23895 fixes ENG-21411 ### How did you verify your code works? Added a test for optional peers and non-optional peers that would previously trigger this bug. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Improved resolution of optional peer dependencies during isolated installations, with better propagation across package hierarchies. * **Tests** * Added comprehensive test suite covering optional peer dependency scenarios in isolated workspaces. * Added test fixtures for packages with peer and optional peer dependencies. * Enhanced lockfile migration test verification using snapshot-based assertions. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
73 lines
2.3 KiB
JSON
73 lines
2.3 KiB
JSON
{
|
|
"name": "one-optional-peer-dep",
|
|
"versions": {
|
|
"1.0.1": {
|
|
"name": "one-optional-peer-dep",
|
|
"version": "1.0.1",
|
|
"peerDependencies": {
|
|
"no-deps": "^1.0.0"
|
|
},
|
|
"_id": "one-optional-peer-dep@1.0.1",
|
|
"_integrity": "sha512-tqKLkZX69BL7dsv8ldPBeNqypOS2QxPEyqdB48kbcf0oyPGzLK+tOuDFEK7U63H+PoGErF+ro7reQUztRyL/pA==",
|
|
"_nodeVersion": "24.3.0",
|
|
"_npmVersion": "10.8.3",
|
|
"integrity": "sha512-tqKLkZX69BL7dsv8ldPBeNqypOS2QxPEyqdB48kbcf0oyPGzLK+tOuDFEK7U63H+PoGErF+ro7reQUztRyL/pA==",
|
|
"shasum": "70ab2e73a16d86c1ed2547889025df30b8534c71",
|
|
"dist": {
|
|
"integrity": "sha512-tqKLkZX69BL7dsv8ldPBeNqypOS2QxPEyqdB48kbcf0oyPGzLK+tOuDFEK7U63H+PoGErF+ro7reQUztRyL/pA==",
|
|
"shasum": "70ab2e73a16d86c1ed2547889025df30b8534c71",
|
|
"tarball": "http://http://localhost:4873/one-optional-peer-dep/-/one-optional-peer-dep-1.0.1.tgz"
|
|
},
|
|
"contributors": []
|
|
},
|
|
"1.0.2": {
|
|
"name": "one-optional-peer-dep",
|
|
"version": "1.0.2",
|
|
"peerDependencies": {
|
|
"no-deps": "^1.0.0"
|
|
},
|
|
"peerDependenciesMeta": {
|
|
"no-deps": {
|
|
"optional": true
|
|
}
|
|
},
|
|
"_id": "one-optional-peer-dep@1.0.2",
|
|
"_integrity": "sha512-S25U8/QXGIKfn/AWtsce1aVMnDjDL+ykFtAufpsuKGad32NlsCpi9TDuXvzoTQ+MdaZpGV3c4xghUZUsNeMp4A==",
|
|
"_nodeVersion": "24.3.0",
|
|
"_npmVersion": "10.8.3",
|
|
"integrity": "sha512-S25U8/QXGIKfn/AWtsce1aVMnDjDL+ykFtAufpsuKGad32NlsCpi9TDuXvzoTQ+MdaZpGV3c4xghUZUsNeMp4A==",
|
|
"shasum": "0fbf084260c3decd365aaaf2d72526ec2d01fe1d",
|
|
"dist": {
|
|
"integrity": "sha512-S25U8/QXGIKfn/AWtsce1aVMnDjDL+ykFtAufpsuKGad32NlsCpi9TDuXvzoTQ+MdaZpGV3c4xghUZUsNeMp4A==",
|
|
"shasum": "0fbf084260c3decd365aaaf2d72526ec2d01fe1d",
|
|
"tarball": "http://http://localhost:4873/one-optional-peer-dep/-/one-optional-peer-dep-1.0.2.tgz"
|
|
},
|
|
"contributors": []
|
|
}
|
|
},
|
|
"time": {
|
|
"modified": "2025-10-31T21:56:37.922Z",
|
|
"created": "2025-10-31T21:48:54.585Z",
|
|
"1.0.1": "2025-10-31T21:48:54.585Z",
|
|
"1.0.2": "2025-10-31T21:56:37.922Z"
|
|
},
|
|
"users": {},
|
|
"dist-tags": {
|
|
"latest": "1.0.2"
|
|
},
|
|
"_uplinks": {},
|
|
"_distfiles": {},
|
|
"_attachments": {
|
|
"one-optional-peer-dep-1.0.1.tgz": {
|
|
"shasum": "70ab2e73a16d86c1ed2547889025df30b8534c71",
|
|
"version": "1.0.1"
|
|
},
|
|
"one-optional-peer-dep-1.0.2.tgz": {
|
|
"shasum": "0fbf084260c3decd365aaaf2d72526ec2d01fe1d",
|
|
"version": "1.0.2"
|
|
}
|
|
},
|
|
"_rev": "",
|
|
"_id": "one-optional-peer-dep",
|
|
"readme": ""
|
|
} |