mirror of
https://github.com/pnpm/pnpm.git
synced 2026-05-19 14:20:36 -04:00
fix(reporter): don't print installation context for the dlx command (#5559)
This commit is contained in:
6
.changeset/tough-cars-kneel.md
Normal file
6
.changeset/tough-cars-kneel.md
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
"@pnpm/default-reporter": patch
|
||||||
|
"pnpm": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Don't print context information when running install for the `pnpm dlx` command.
|
||||||
@@ -93,10 +93,13 @@ export function reporterForClient (
|
|||||||
reportScope(log$.scope, { isRecursive: opts.isRecursive, cmd: opts.cmd }),
|
reportScope(log$.scope, { isRecursive: opts.isRecursive, cmd: opts.cmd }),
|
||||||
reportSkippedOptionalDependencies(log$.skippedOptionalDependency, { cwd }),
|
reportSkippedOptionalDependencies(log$.skippedOptionalDependency, { cwd }),
|
||||||
reportHooks(log$.hook, { cwd, isRecursive: opts.isRecursive }),
|
reportHooks(log$.hook, { cwd, isRecursive: opts.isRecursive }),
|
||||||
reportContext(log$, { cwd }),
|
|
||||||
reportUpdateCheck(log$.updateCheck, opts),
|
reportUpdateCheck(log$.updateCheck, opts),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if (opts.cmd !== 'dlx') {
|
||||||
|
outputs.push(reportContext(log$, { cwd }))
|
||||||
|
}
|
||||||
|
|
||||||
if (PRINT_EXECUTION_TIME_IN_COMMANDS[opts.cmd]) {
|
if (PRINT_EXECUTION_TIME_IN_COMMANDS[opts.cmd]) {
|
||||||
outputs.push(reportExecutionTime(log$.executionTime))
|
outputs.push(reportExecutionTime(log$.executionTime))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,3 +66,34 @@ test('do not print info if not fresh install', (done) => {
|
|||||||
subscription.unsubscribe()
|
subscription.unsubscribe()
|
||||||
}, 10)
|
}, 10)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
test('do not print info if dlx is the executed command', (done) => {
|
||||||
|
const output$ = toOutput$({
|
||||||
|
context: {
|
||||||
|
argv: ['dlx'],
|
||||||
|
},
|
||||||
|
streamParser: createStreamParser(),
|
||||||
|
})
|
||||||
|
|
||||||
|
contextLogger.debug({
|
||||||
|
currentLockfileExists: false,
|
||||||
|
storeDir: '~/.pnpm-store/v3',
|
||||||
|
virtualStoreDir: 'node_modules/.pnpm',
|
||||||
|
})
|
||||||
|
packageImportMethodLogger.debug({
|
||||||
|
method: 'hardlink',
|
||||||
|
})
|
||||||
|
|
||||||
|
const subscription = output$.subscribe({
|
||||||
|
complete: () => done(),
|
||||||
|
error: done,
|
||||||
|
next: (msg) => {
|
||||||
|
expect(msg).toBeFalsy()
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
done()
|
||||||
|
subscription.unsubscribe()
|
||||||
|
}, 10)
|
||||||
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user