Skip to content

Commit 062a333

Browse files
authored
perf: upgrade pino and pino-pretty, reducing the total amount of dependencies (#8776)
BEFORE: 22 dependencies, 2MB total size ![CleanShot 2024-10-18 at 00 11 48@2x](https://github.com/user-attachments/assets/abd20ac1-fc66-4d5b-bbda-bdcf89846a0a) AFTER: 12 dependencies, 1MB total size ![CleanShot 2024-10-18 at 00 12 44@2x](https://github.com/user-attachments/assets/6f22e2e3-0eed-4b48-8e51-1f5156e9efd3)
1 parent fa92912 commit 062a333

File tree

3 files changed

+24
-25
lines changed

3 files changed

+24
-25
lines changed

packages/payload/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@
101101
"json-schema-to-typescript": "15.0.1",
102102
"jsonwebtoken": "9.0.2",
103103
"minimist": "1.2.8",
104-
"pino": "9.3.1",
105-
"pino-pretty": "11.2.1",
104+
"pino": "9.5.0",
105+
"pino-pretty": "11.3.0",
106106
"pluralize": "8.0.0",
107107
"sanitize-filename": "1.6.3",
108108
"scmp": "2.1.0",

packages/payload/src/utilities/logger.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { type Logger, pino } from 'pino'
2-
import { build, type PrettyOptions } from 'pino-pretty'
2+
import { build, type PinoPretty, type PrettyOptions } from 'pino-pretty'
33

44
import type { Config } from '../config/types.js'
55

@@ -15,13 +15,13 @@ const prettyOptions: PrettyOptions = {
1515
translateTime: 'SYS:HH:MM:ss',
1616
}
1717

18-
export const prettySyncLoggerDestination = build({
18+
export const prettySyncLoggerDestination: PinoPretty.PrettyStream = build({
1919
...prettyOptions,
2020
destination: 1, // stdout
2121
sync: true,
2222
})
2323

24-
export const defaultLoggerOptions = build(prettyOptions)
24+
export const defaultLoggerOptions: PinoPretty.PrettyStream = build(prettyOptions)
2525

2626
export const getLogger = (name = 'payload', logger?: Config['logger']): PayloadLogger => {
2727
if (!logger) {

pnpm-lock.yaml

Lines changed: 19 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)