mirror of
https://github.com/pnpm/pnpm.git
synced 2026-04-12 02:57:44 -04:00
fix: don't prefix output for dlx
This commit is contained in:
6
.changeset/spotty-planets-pretend.md
Normal file
6
.changeset/spotty-planets-pretend.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@pnpm/default-reporter": patch
|
||||
"pnpm": patch
|
||||
---
|
||||
|
||||
Don't prefix install output for the dlx command.
|
||||
@@ -247,11 +247,12 @@ export function toOutput$ (
|
||||
summary: Rx.from(summaryPushStream),
|
||||
updateCheck: Rx.from(updateCheckPushStream),
|
||||
}
|
||||
const cmd = opts.context.argv[0]
|
||||
const outputs: Array<Rx.Observable<Rx.Observable<{ msg: string }>>> = reporterForClient(
|
||||
log$,
|
||||
{
|
||||
appendOnly: opts.reportingOptions?.appendOnly,
|
||||
cmd: opts.context.argv[0],
|
||||
cmd,
|
||||
config: opts.context.config,
|
||||
env: opts.context.env ?? process.env,
|
||||
filterPkgsDiff: opts.filterPkgsDiff,
|
||||
@@ -264,7 +265,7 @@ export function toOutput$ (
|
||||
throttleProgress: opts.reportingOptions?.throttleProgress,
|
||||
width: opts.reportingOptions?.outputMaxWidth,
|
||||
hideAddedPkgsProgress: opts.reportingOptions?.hideAddedPkgsProgress,
|
||||
hideProgressPrefix: opts.reportingOptions?.hideProgressPrefix,
|
||||
hideProgressPrefix: opts.reportingOptions?.hideProgressPrefix ?? (cmd === 'dlx'),
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -132,6 +132,7 @@ export function reporterForClient (
|
||||
cwd,
|
||||
isRecursive: opts.isRecursive,
|
||||
width,
|
||||
hideProgressPrefix: opts.hideProgressPrefix,
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
@@ -20,8 +20,15 @@ export function reportStats (
|
||||
cwd: string
|
||||
isRecursive: boolean
|
||||
width: number
|
||||
hideProgressPrefix?: boolean
|
||||
}
|
||||
) {
|
||||
if (opts.hideProgressPrefix) {
|
||||
return [statsForCurrentPackage(log$.stats, {
|
||||
cmd: opts.cmd,
|
||||
width: opts.width,
|
||||
})]
|
||||
}
|
||||
const stats$ = opts.isRecursive
|
||||
? log$.stats
|
||||
: log$.stats.pipe(filter((log) => log.prefix !== opts.cwd))
|
||||
@@ -35,9 +42,10 @@ export function reportStats (
|
||||
]
|
||||
|
||||
if (!opts.isRecursive) {
|
||||
outputs.push(statsForCurrentPackage(log$.stats, {
|
||||
outputs.push(statsForCurrentPackage(log$.stats.pipe(
|
||||
filter((log) => log.prefix === opts.cwd)
|
||||
), {
|
||||
cmd: opts.cmd,
|
||||
currentPrefix: opts.cwd,
|
||||
width: opts.width,
|
||||
}))
|
||||
}
|
||||
@@ -49,13 +57,11 @@ function statsForCurrentPackage (
|
||||
stats$: Rx.Observable<StatsLog>,
|
||||
opts: {
|
||||
cmd: string
|
||||
currentPrefix: string
|
||||
width: number
|
||||
}
|
||||
) {
|
||||
return stats$.pipe(
|
||||
filter((log) => log.prefix === opts.currentPrefix),
|
||||
take((opts.cmd === 'install' || opts.cmd === 'install-test' || opts.cmd === 'add' || opts.cmd === 'update') ? 2 : 1),
|
||||
take((opts.cmd === 'install' || opts.cmd === 'install-test' || opts.cmd === 'add' || opts.cmd === 'update' || opts.cmd === 'dlx') ? 2 : 1),
|
||||
reduce((acc, log) => {
|
||||
if (typeof log['added'] === 'number') {
|
||||
acc['added'] = log['added']
|
||||
|
||||
Reference in New Issue
Block a user