You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The issue asks to extend pkg_cmd.rs, so that is all the PR does. Worth being explicit that there is currently no route feeding yarn or bun output into compress_pkg_log: main.rs has Commands::Npm and Commands::Pnpm but no Yarn or Bun, and discover/rules.rs has no rewrite prefix for either, so contextzip rewrite "yarn install" exits 1 today. Filed that separately as #14 rather than growing this PR, since it means new Clap variants, two new modules, discover rules and hook docs.
What the output actually looks like
Fixtures are real captures rather than synthetic, generated locally from yarn 1.22.22, yarn 4.18.0 and bun 1.4.2 with both streams piped, plus failing installs. A few things that shaped the implementation and are easy to get wrong from memory:
yarn splits noise from signal structurally, not semantically.warning <path>@<version>: <message> with an unquoted path is the registry's deprecated field echoed back, the direct analogue of npm warn deprecated. warning "<path>" has (unmet|incorrect) peer dependency "<spec>". always opens with a quote. Matching on the quote is far sturdier than matching message text.
Berry needs a denylist over message codes, never an allowlist. Two cases force it. YN0000 lines carrying a │ are where berry reports build script stdout and stderr, so dropping YN0000 by code eats the stderr of a failed postinstall. And a resolution failure ends with ➤ Errors happened when preparing the environment required to run this command., which has no code at all.
Step lines are not always /4.yarn remove prints /2, yarn install --audit prints /5, and the source builds that array conditionally so /6 and /7 are reachable.
Yarn 2 and 3 are where the savings are. They re-emit YN0013 cache lines in a sliding window, around 250 lines for 54 unique packages. Yarn 4 collapses that to one aggregate line, so the 73% measured against a 4.18.0 capture is the floor, not the ceiling.
bun's Resolving dependencies and Resolved, downloaded and extracted [N] lines are piped-only. They are the non-TTY replacement for the spinner, so piping makes them appear rather than disappear. bun 1.0.x also indents its summary rows by one space and does not singularize the count.
Measured savings: 65% on yarn classic, 73% on yarn berry, 81% on bun.
Two things found on the way
Neither is caused by this change and neither is fixed by it, but both are real:
Activity
osazemeu commentedon Sep 5, 2026
Opened #11 for this.
Scope
The issue asks to extend
pkg_cmd.rs, so that is all the PR does. Worth being explicit that there is currently no route feeding yarn or bun output intocompress_pkg_log:main.rshasCommands::NpmandCommands::Pnpmbut noYarnorBun, anddiscover/rules.rshas no rewrite prefix for either, socontextzip rewrite "yarn install"exits 1 today. Filed that separately as #14 rather than growing this PR, since it means new Clap variants, two new modules, discover rules and hook docs.What the output actually looks like
Fixtures are real captures rather than synthetic, generated locally from yarn 1.22.22, yarn 4.18.0 and bun 1.4.2 with both streams piped, plus failing installs. A few things that shaped the implementation and are easy to get wrong from memory:
yarn splits noise from signal structurally, not semantically.
warning <path>@<version>: <message>with an unquoted path is the registry'sdeprecatedfield echoed back, the direct analogue ofnpm warn deprecated.warning "<path>" has (unmet|incorrect) peer dependency "<spec>".always opens with a quote. Matching on the quote is far sturdier than matching message text.Berry needs a denylist over message codes, never an allowlist. Two cases force it.
YN0000lines carrying a│are where berry reports build script stdout and stderr, so droppingYN0000by code eats the stderr of a failed postinstall. And a resolution failure ends with➤ Errors happened when preparing the environment required to run this command., which has no code at all.Step lines are not always
/4.yarn removeprints/2,yarn install --auditprints/5, and the source builds that array conditionally so/6and/7are reachable.Yarn 2 and 3 are where the savings are. They re-emit
YN0013cache lines in a sliding window, around 250 lines for 54 unique packages. Yarn 4 collapses that to one aggregate line, so the 73% measured against a 4.18.0 capture is the floor, not the ceiling.bun's
Resolving dependenciesandResolved, downloaded and extracted [N]lines are piped-only. They are the non-TTY replacement for the spinner, so piping makes them appear rather than disappear. bun 1.0.x also indents its summary rows by one space and does not singularize the count.Measured savings: 65% on yarn classic, 73% on yarn berry, 81% on bun.
Two things found on the way
Neither is caused by this change and neither is fixed by it, but both are real:
deprecat,already satisfied,using cached) and nothing in the chain keeps error output unconditionally, so a failing build script's free-form stderr can lose lines. Every rule added in feat(pkg): compress yarn and bun install logs #11 is anchored, so it does not add to this.strip_ansiandansi_filteronly strip CSI sequences, so OSC-8 hyperlinks survive as inline text. Berry wraps every non-YN0000code in one when it has a terminal.