feat(yarn): support berry patch protocol#728
Conversation
Greptile SummaryThis PR adds end-to-end support for Yarn Berry's
Confidence Score: 5/5Safe to merge; the new patch-loading path goes through the same safety guards as the existing pnpm/bun patch code, and both issues raised in prior rounds are addressed Built-in patch detection and path-traversal guards are correctly wired end-to-end. The No files require special attention; both observations are in the round-trip writer path and do not affect patch application at install time Important Files Changed
Reviews (3): Last reviewed commit: "fix(yarn): handle berry patch edge cases" | Re-trigger Greptile |
b80d3d3 to
35f9255
Compare
Summary
patch:resolution entries into aube's patched dependency map instead of skipping thempatch:specs when writing Berry lockfiles and document the supported protocolValidation
cargo test -p aube-lockfile test_parse_berry_patch_protocolcargo test -p aube-lockfile test_write_berry_roundtrips_patch_protocolcargo test -p aube load_reads_lockfile_patched_dependenciescargo build -p aube./test/bats/bin/bats test/import.bats --filter 'aube install applies yarn berry patch protocol'cargo fmt --checkgit diff --checkcargo clippy --all-targets -- -D warningsNote
Medium Risk
Adds support for Yarn Berry
patch:dependencies, affecting lockfile parsing/writing and patch application during install; risk is mainly incorrect patch resolution or caching causing wrong package contents to be linked.Overview
Adds end-to-end support for Yarn Berry
patch:protocol entries: the Berry parser now records patched packages intoLockfileGraph.patched_dependencies(skipping builtin patches), and the Berry writer preservespatch:specs in headers/resolutions and dependency maps for round-trip fidelity.Install/link now passes lockfile-declared patched dependencies into
load_patches_for_linker, which merges lockfile + manifest/workspace patch sources and caches by(cwd, patched_dependencies)so Yarn patch files are applied during materialization. Adds unit/integration coverage plus afixtures/import-yarn-patchfixture, updates docs to listpatch:as supported, and adds a bats regression test verifying the patch is applied at runtime.Reviewed by Cursor Bugbot for commit 35f9255. Bugbot is set up for automated code reviews on this repo. Configure here.