mirror of
https://github.com/pnpm/pnpm.git
synced 2026-04-12 02:57:44 -04:00
feat(reporting): an option for hiding lifecycle output (#6979)
This commit is contained in:
5
.changeset/flat-elephants-appear.md
Normal file
5
.changeset/flat-elephants-appear.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@pnpm/default-reporter": minor
|
||||
---
|
||||
|
||||
New option added: hideLifecycleOutput.
|
||||
@@ -26,6 +26,7 @@ export function initDefaultReporter (
|
||||
outputMaxWidth?: number
|
||||
hideAddedPkgsProgress?: boolean
|
||||
hideProgressPrefix?: boolean
|
||||
hideLifecycleOutput?: boolean
|
||||
}
|
||||
context: {
|
||||
argv: string[]
|
||||
@@ -107,6 +108,7 @@ export function toOutput$ (
|
||||
throttleProgress?: number
|
||||
hideAddedPkgsProgress?: boolean
|
||||
hideProgressPrefix?: boolean
|
||||
hideLifecycleOutput?: boolean
|
||||
}
|
||||
context: {
|
||||
argv: string[]
|
||||
@@ -266,6 +268,7 @@ export function toOutput$ (
|
||||
width: opts.reportingOptions?.outputMaxWidth,
|
||||
hideAddedPkgsProgress: opts.reportingOptions?.hideAddedPkgsProgress,
|
||||
hideProgressPrefix: opts.reportingOptions?.hideProgressPrefix ?? (cmd === 'dlx'),
|
||||
hideLifecycleOutput: opts.reportingOptions?.hideLifecycleOutput,
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -68,6 +68,7 @@ export function reporterForClient (
|
||||
width?: number
|
||||
hideAddedPkgsProgress?: boolean
|
||||
hideProgressPrefix?: boolean
|
||||
hideLifecycleOutput?: boolean
|
||||
}
|
||||
): Array<Rx.Observable<Rx.Observable<{ msg: string }>>> {
|
||||
const width = opts.width ?? process.stdout.columns ?? 80
|
||||
@@ -78,7 +79,7 @@ export function reporterForClient (
|
||||
|
||||
const outputs: Array<Rx.Observable<Rx.Observable<{ msg: string }>>> = [
|
||||
reportLifecycleScripts(log$, {
|
||||
appendOnly: opts.appendOnly === true || opts.streamLifecycleOutput,
|
||||
appendOnly: (opts.appendOnly === true || opts.streamLifecycleOutput) && !opts.hideLifecycleOutput,
|
||||
aggregateOutput: opts.aggregateOutput,
|
||||
cwd,
|
||||
width,
|
||||
|
||||
Reference in New Issue
Block a user