mirror of
https://github.com/pnpm/pnpm.git
synced 2026-05-19 06:07:59 -04:00
feat: print pnpm version at the end of the console output (#9108)
This commit is contained in:
6
.changeset/many-eyes-laugh.md
Normal file
6
.changeset/many-eyes-laugh.md
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
"@pnpm/default-reporter": patch
|
||||||
|
"pnpm": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Print pnpm's version after the execution time at the end of the console output.
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
import prettyMs from 'pretty-ms'
|
import prettyMs from 'pretty-ms'
|
||||||
|
import { packageManager } from '@pnpm/cli-meta'
|
||||||
import { type ExecutionTimeLog } from '@pnpm/core-loggers'
|
import { type ExecutionTimeLog } from '@pnpm/core-loggers'
|
||||||
import * as Rx from 'rxjs'
|
import * as Rx from 'rxjs'
|
||||||
import { map, take } from 'rxjs/operators'
|
import { map, take } from 'rxjs/operators'
|
||||||
@@ -11,7 +12,7 @@ export function reportExecutionTime (
|
|||||||
map((log) => {
|
map((log) => {
|
||||||
return Rx.of({
|
return Rx.of({
|
||||||
fixed: true, // Without this, for some reason sometimes the progress bar is printed after the execution time
|
fixed: true, // Without this, for some reason sometimes the progress bar is printed after the execution time
|
||||||
msg: `Done in ${prettyMs(log.endedAt - log.startedAt)}`,
|
msg: `Done in ${prettyMs(log.endedAt - log.startedAt)} using ${packageManager.name} v${packageManager.version}`,
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { executionTimeLogger } from '@pnpm/core-loggers'
|
import { executionTimeLogger } from '@pnpm/core-loggers'
|
||||||
|
import { packageManager } from '@pnpm/cli-meta'
|
||||||
import { toOutput$ } from '@pnpm/default-reporter'
|
import { toOutput$ } from '@pnpm/default-reporter'
|
||||||
import { createStreamParser } from '@pnpm/logger'
|
import { createStreamParser } from '@pnpm/logger'
|
||||||
import { take } from 'rxjs/operators'
|
import { take } from 'rxjs/operators'
|
||||||
@@ -49,7 +50,7 @@ test('prints execution time for install command', (done) => {
|
|||||||
complete: () => done(),
|
complete: () => done(),
|
||||||
error: done,
|
error: done,
|
||||||
next: output => {
|
next: output => {
|
||||||
expect(output).toBe('Done in 10.8s')
|
expect(output).toBe(`Done in 10.8s using ${packageManager.name} v${packageManager.version}`)
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user