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
{{ message }}
This repository was archived by the owner on May 14, 2026. It is now read-only.
Implement the reporter described in #344: a typed LogEvent enum mirroring @pnpm/core-loggers, a trait Reporter per the #339 capability shape, an NdjsonReporter that writes pnpm's wire format to stderr, a SilentReporter for --reporter=silent, generic threading through the
install entry point, and the spawn-and-pipe wiring that feeds pacquet's
NDJSON into @pnpm/cli.default-reporter for default rendering.
This is the engine only. Backfilling missing log events in existing crates
and documenting the porting convention land in separate issues (linked
below).
Scope
New crate (likely crates/reporter, or extend an existing one if a
clearer home emerges):
LogEvent enum with one variant per pnpm log channel from @pnpm/core-loggers.
Serde attributes produce the bunyan envelope (level, time, name)
plus channel-specific payload, matching what pnpm emits under --reporter=ndjson.
Module-level static OnceLock<Sender<Vec<u8>>> for the writer-task
MPSC sender.
Module-level static throttle map for pnpm:fetching-progress
(200ms per package, matching pnpm's reporter-side throttle).
Thread-local Vec<u8> serialization buffer per emit.
One dedicated writer task draining the channel and write_all-ing to
stderr in batches.
SilentReporter unit struct: no-op emit.
--reporter=default|ndjson|silent CLI flag in pacquet-cli. The entry
point dispatches to install::<NdjsonReporter> or install::<SilentReporter>; default and ndjson share the same sink,
default additionally spawns the JS reporter and pipes stderr into it.
Spawn-and-pipe wiring for --reporter=default: spawn @pnpm/cli.default-reporter (or pnpm --reporter=default in consumer
mode — TBD) as a child process and pipe pacquet's stderr to its stdin.
The PR picks one of the three delivery options from Use pnpm's @pnpm/cli.default-reporter for terminal output (via NDJSON) #344 and documents
the choice.
Identifier interning: Arc<str> (or lasso / ustr) for package
names/versions threaded through events. Hooked at the resolver boundary
so call sites already hold cheap clones.
One real channel wired end-to-end as a smoke test (e.g. pnpm:stage for
"importing"), verified to render identically to pnpm.
Schema pinning: pacquet's Cargo.toml records the pnpm version it
targets; add a CI check that emitted JSON parses against the
corresponding upstream @pnpm/core-loggers shapes (TS-side script or a serde round-trip into our own duplicate of those types).
Out of scope (tracked separately)
Wiring all existing pacquet call sites to emit events.
AGENTS.md / CODE_STYLE_GUIDE.md guidance for porting log emissions from
pnpm.
pacquet install --reporter=ndjson emits NDJSON whose lines parse cleanly
when piped into pnpm --reporter=default (or npx @pnpm/cli.default-reporter), with at least one channel rendering
identically to pnpm.
pacquet install --reporter=silent produces no output beyond what --reporter=silent produces in pnpm.
pacquet install --reporter=default spawns the JS reporter and renders
pnpm-shaped output for the wired channel.
Summary
Implement the reporter described in #344: a typed
LogEventenum mirroring@pnpm/core-loggers, atrait Reporterper the #339 capability shape, anNdjsonReporterthat writes pnpm's wire format to stderr, aSilentReporterfor--reporter=silent, generic threading through theinstall entry point, and the spawn-and-pipe wiring that feeds pacquet's
NDJSON into
@pnpm/cli.default-reporterfor default rendering.This is the engine only. Backfilling missing log events in existing crates
and documenting the porting convention land in separate issues (linked
below).
Scope
crates/reporter, or extend an existing one if aclearer home emerges):
LogEventenum with one variant per pnpm log channel from@pnpm/core-loggers.Serde attributes produce the bunyan envelope (
level,time,name)plus channel-specific payload, matching what pnpm emits under
--reporter=ndjson.trait Reporter { fn emit(event: &LogEvent); }per Refactor and document the dependency injection pattern for tests #339 (associatedfunction, no
&self).NdjsonReporterunit struct:static OnceLock<Sender<Vec<u8>>>for the writer-taskMPSC sender.
staticthrottle map forpnpm:fetching-progress(200ms per package, matching pnpm's reporter-side throttle).
Vec<u8>serialization buffer per emit.write_all-ing tostderr in batches.
SilentReporterunit struct: no-opemit.--reporter=default|ndjson|silentCLI flag inpacquet-cli. The entrypoint dispatches to
install::<NdjsonReporter>orinstall::<SilentReporter>; default and ndjson share the same sink,default additionally spawns the JS reporter and pipes stderr into it.
--reporter=default: spawn@pnpm/cli.default-reporter(orpnpm --reporter=defaultin consumermode — TBD) as a child process and pipe pacquet's stderr to its stdin.
The PR picks one of the three delivery options from Use pnpm's @pnpm/cli.default-reporter for terminal output (via NDJSON) #344 and documents
the choice.
Arc<str>(orlasso/ustr) for packagenames/versions threaded through events. Hooked at the resolver boundary
so call sites already hold cheap clones.
pnpm:stagefor"importing"), verified to render identically to pnpm.
Cargo.tomlrecords the pnpm version ittargets; add a CI check that emitted JSON parses against the
corresponding upstream
@pnpm/core-loggersshapes (TS-side script or aserderound-trip into our own duplicate of those types).Out of scope (tracked separately)
pnpm.
Acceptance criteria
pacquet install --reporter=ndjsonemits NDJSON whose lines parse cleanlywhen piped into
pnpm --reporter=default(ornpx @pnpm/cli.default-reporter), with at least one channel renderingidentically to pnpm.
pacquet install --reporter=silentproduces no output beyond what--reporter=silentproduces in pnpm.pacquet install --reporter=defaultspawns the JS reporter and renderspnpm-shaped output for the wired channel.
just readyis green; the recording-fake pattern from Refactor and document the dependency injection pattern for tests #339 is used atleast once.
Parent
Design: #344. Roadmap line item: pnpm/pnpm#11633.