feat(yarn): support berry portal and exec protocols#729
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Greptile SummaryThis PR adds first-class support for Yarn Berry's
Confidence Score: 5/5The change is well-bounded — new protocol variants are wired consistently across parse, rebase, resolve, fetch, delta, linker, deploy, and lockfile-write paths. The path-boundary check for exec scripts prevents execution outside the project root. Both variants are handled in every consumer that previously matched on LocalSource; tests cover round-trip, fresh-resolve, ignore-scripts, path-boundary, and fingerprint-change scenarios. No silent data-loss or correctness gaps were found in the changed paths. crates/aube-resolver/src/lib.rs (YARN_EXEC_WRAPPER CommonJS limitation) and crates/aube-resolver/src/local_source.rs (double generator execution during fresh resolve) Important Files Changed
Reviews (12): Last reviewed commit: "fix(yarn): bound exec generator paths" | Re-trigger Greptile |
b582cd0 to
862ff35
Compare
862ff35 to
e35c378
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 2fb797b. Configure here.

Summary
LocalSource::PortalandLocalSource::Execso Yarn Berryportal:andexec:lockfile entries are parsed instead of skippedportal:emitted aslinkType: softandexec:emitted as a generated hard-link packageportal:targets as local packages so graph-visible dependencies are linked, and runexec:generators into a temp build directory before importing the generated packageexec:generators during fresh resolution so generated versions and dependencies are locked, while normalizing root/transitive script paths to a single dep path--ignore-scripts, and rejectexec:scripts that resolve outside the project rootNotes
Yarn documents
portal:as a local package whose dependencies are followed, unlikelink:. It documentsexec:as a generator script that populatesexecEnv.buildDir; this PR implements that shape for both fresh resolution and lockfile-backed installs.exec:generators require Node.js onPATHand are treated as script execution. Fresh resolution fails before running them when--ignore-scriptsis set, and both resolve-time and fetch-time execution canonicalize the generator path and require it to stay inside the project root.Validation
cargo test -p aube-lockfile test_parse_berry_portal_and_exec_protocolscargo test -p aube-lockfile test_write_berry_roundtrips_portal_and_exec_protocolscargo test -p aube-resolver --no-fail-fastcargo test -p aube-scripts --libcargo buildmise run test:bats test/import.batscargo fmt --checkcargo clippy --all-targets -- -D warnings