Conversation
Extends compress_pkg_log to cover yarn and bun alongside npm and pip. yarn is handled in both dialects. Classic v1 is matched on its line prefixes: the banner, [n/m] step lines, dead info lines, and the echo of a package's deprecated field, which is the direct analogue of npm's "npm warn deprecated". Peer dependency warnings survive, because they open with a quote where those advisories do not, which is a sturdier test than matching on the message text. Berry is matched on the YNnnnn codes it emits from v2 onwards, dropping structural framing, version notices and the per-package cache chatter that makes up most of a yarn 2 or 3 log. YN0000 lines carrying a box-drawing prefix are deliberately left alone, since that is where berry reports build script stdout and stderr. bun loses its banner, its dotenv notice and the static progress lines it prints in place of a spinner when stderr is not a terminal. The install summary is hoisted the way npm's already is. The per-package "+ pkg@ver" rows collapse to a count above five, where bun is listing the project rather than reporting a change and package.json already has the list, and stay verbatim below it where they are a useful diff. Node's own DEP0169 notice shows up in every yarn v1 run on current Node and mentions "security implications", so it is matched ahead of the security check. It is the only rule placed before it. Fixtures are real captures from yarn 1.22.22, yarn 4.18.0 and bun 1.4.2 with both streams piped. Savings on those are 65% for yarn v1, 73% for berry and 81% for bun. Failure paths are asserted to survive intact, including the berry build failure case, which is the one place a filter like this can lose something that matters. Closes jee599#3 Signed-off-by: Osazeme Usen <osazemeu@yahoo.com>
This was referenced Sep 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
compress_pkg_logto handle yarn and bun install output, alongside the existing npm and pip support (Add yarn/bun package install log compression #3).YNnnnncodes berry emits from v2 onwards.+ pkg@versionrows collapse to a count above five.How noise is told apart from signal
The interesting part of yarn is that the split is structural rather than semantic.
warning <path>@<version>: <message>with an unquoted dependency path is the registry'sdeprecatedfield echoed back, which is exactly what npm'snpm warn deprecatedalready is, so it is dropped under the same rule.warning "<path>" has (unmet|incorrect) peer dependency "<spec>".always opens with a quote and is kept. Matching on the quote is sturdier than matching on the message text, which varies per package.Berry is a denylist over message codes with default-keep, never an allowlist. Two cases forced that:
YN0000lines carrying a│prefix are where berry reports build script stdout and stderr. DroppingYN0000by code would have silently eaten the stderr of a failed postinstall and left the model a truncated log under a cheerful summary. There is a test for this.➤ Errors happened when preparing the environment required to run this command., which carries no code at all. An allowlist would have dropped it.One rule is placed ahead of the security check: Node's own
(node:NNNN) [DEP0169] DeprecationWarningnotice, which appears in every yarn v1 run on current Node and mentions "security implications". It is tightly anchored and commented in place. Nothing else precedes that check.Step lines are matched as
^\[\d+/\d+\]rather than/4, sinceyarn removeprints/2andyarn install --auditprints/5. bun patterns tolerate the one-space indent that 1.0.x used.Test plan
cargo fmt --all --check && cargo clippy --all-targets && cargo test(1132 + 7 tests pass; the one clippy warning is pre-existing inwget_cmd.rsand untouched here)Token savings against those fixtures:
yarn install(classic 1.22.22)yarn install(berry 4.18.0)bun install(1.4.2)The berry figure is the pessimistic case. Yarn 2 and 3 re-emit
YN0013cache lines in a sliding window, roughly 250 lines for 54 unique packages, where yarn 4 collapses that to a single aggregate line. The same rule is worth considerably more on 2 and 3.Failure paths are asserted to survive rather than to compress.
test_yarn_berry_keeps_build_script_output,test_yarn_berry_failure_survives_intact,test_yarn_v1_keeps_errors_and_stackandtest_bun_keeps_errors_and_warningsall check that error text, stack frames andBlocked N postinstallscome through intact.Docs
Updated the
Package install noiserow inREADME.mdand the 12 translated READMEs.CHANGELOG.mdis left alone since release-please generates it.Notes for the reviewer
Two small deviations from CONTRIBUTING.md, both because the documented instruction does not apply here:
feat(scope): descriptionis not a legal git ref, since colons are disallowed. Usedfeat/pkg-yarn-bun-install-log-compression.develop; this repository only hasmain.Scope is filter only, per the issue. There is no
contextzip yarn/contextzip buncommand today, so this is reachable through the sharedcompress_pkg_logpath rather than a route of its own. Background on the scope call and on what the real output looks like is in #3.Two pre-existing problems turned up while working on this. Neither is caused or fixed by this PR, both filed separately: #12 (unanchored drop rules plus no error guard can lose lines from failing build scripts) and #13 (OSC-8 hyperlinks survive the CSI-only ANSI strippers).