Skip to content

Fix TS export condition #2223

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"test-ci": "npm run lint && npm run transpile && tap --ts --no-check-coverage --coverage-report=lcovonly && npm run test-types",
"test-ci-pnpm": "pnpm run lint && npm run transpile && tap --ts --no-coverage --no-check-coverage && pnpm run test-types",
"test-ci-yarn-pnp": "yarn run lint && npm run transpile && tap --ts --no-check-coverage --coverage-report=lcovonly",
"test-types": "tsc && tsd && ts-node test/types/pino.ts",
"test-types": "tsc && tsd && ts-node test/types/pino.ts && attw --pack .",
"test:smoke": "smoker smoke:pino && smoker smoke:browser && smoker smoke:file",
"smoke:pino": "node ./pino.js",
"smoke:browser": "node ./browser.js",
Expand Down Expand Up @@ -60,6 +60,7 @@
},
"homepage": "https://getpino.io",
"devDependencies": {
"@arethetypeswrong/cli": "^0.18.1",
"@types/flush-write-stream": "^1.0.0",
"@types/node": "^22.0.0",
"@types/tap": "^15.0.6",
Expand Down
3 changes: 2 additions & 1 deletion pino.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,17 +221,17 @@
silent: pino.LogFn;
}

type Bindings = Record<string, any>;

Check failure on line 224 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 22 macOS-latest

Duplicate identifier 'Bindings'.

Check failure on line 224 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 22 ubuntu-latest

Duplicate identifier 'Bindings'.

Check failure on line 224 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 18 macOS-latest

Duplicate identifier 'Bindings'.

Check failure on line 224 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 20 ubuntu-latest

Duplicate identifier 'Bindings'.

Check failure on line 224 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 18 ubuntu-latest

Duplicate identifier 'Bindings'.

Check failure on line 224 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 20 macOS-latest

Duplicate identifier 'Bindings'.

Check failure on line 224 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 20 windows-latest

Duplicate identifier 'Bindings'.

Check failure on line 224 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 18 windows-latest

Duplicate identifier 'Bindings'.

type Level = "fatal" | "error" | "warn" | "info" | "debug" | "trace";

Check failure on line 226 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 22 macOS-latest

Duplicate identifier 'Level'.

Check failure on line 226 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 22 ubuntu-latest

Duplicate identifier 'Level'.

Check failure on line 226 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 18 macOS-latest

Duplicate identifier 'Level'.

Check failure on line 226 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 20 ubuntu-latest

Duplicate identifier 'Level'.

Check failure on line 226 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 18 ubuntu-latest

Duplicate identifier 'Level'.

Check failure on line 226 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 20 macOS-latest

Duplicate identifier 'Level'.

Check failure on line 226 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 20 windows-latest

Duplicate identifier 'Level'.

Check failure on line 226 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 18 windows-latest

Duplicate identifier 'Level'.
type LevelOrString = Level | (string & {});

Check failure on line 227 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 22 macOS-latest

Duplicate identifier 'LevelOrString'.

Check failure on line 227 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 22 ubuntu-latest

Duplicate identifier 'LevelOrString'.

Check failure on line 227 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 18 macOS-latest

Duplicate identifier 'LevelOrString'.

Check failure on line 227 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 20 ubuntu-latest

Duplicate identifier 'LevelOrString'.

Check failure on line 227 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 18 ubuntu-latest

Duplicate identifier 'LevelOrString'.

Check failure on line 227 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 20 macOS-latest

Duplicate identifier 'LevelOrString'.

Check failure on line 227 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 20 windows-latest

Duplicate identifier 'LevelOrString'.

Check failure on line 227 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 18 windows-latest

Duplicate identifier 'LevelOrString'.
type LevelWithSilent = pino.Level | "silent";

Check failure on line 228 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 22 macOS-latest

Duplicate identifier 'LevelWithSilent'.

Check failure on line 228 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 22 ubuntu-latest

Duplicate identifier 'LevelWithSilent'.

Check failure on line 228 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 18 macOS-latest

Duplicate identifier 'LevelWithSilent'.

Check failure on line 228 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 20 ubuntu-latest

Duplicate identifier 'LevelWithSilent'.

Check failure on line 228 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 18 ubuntu-latest

Duplicate identifier 'LevelWithSilent'.

Check failure on line 228 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 20 macOS-latest

Duplicate identifier 'LevelWithSilent'.

Check failure on line 228 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 20 windows-latest

Duplicate identifier 'LevelWithSilent'.

Check failure on line 228 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 18 windows-latest

Duplicate identifier 'LevelWithSilent'.
type LevelWithSilentOrString = LevelWithSilent | (string & {});

Check failure on line 229 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 22 macOS-latest

Duplicate identifier 'LevelWithSilentOrString'.

Check failure on line 229 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 22 ubuntu-latest

Duplicate identifier 'LevelWithSilentOrString'.

Check failure on line 229 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 18 macOS-latest

Duplicate identifier 'LevelWithSilentOrString'.

Check failure on line 229 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 20 ubuntu-latest

Duplicate identifier 'LevelWithSilentOrString'.

Check failure on line 229 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 18 ubuntu-latest

Duplicate identifier 'LevelWithSilentOrString'.

Check failure on line 229 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 20 macOS-latest

Duplicate identifier 'LevelWithSilentOrString'.

Check failure on line 229 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 20 windows-latest

Duplicate identifier 'LevelWithSilentOrString'.

Check failure on line 229 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 18 windows-latest

Duplicate identifier 'LevelWithSilentOrString'.

type SerializerFn = (value: any) => any;

Check failure on line 231 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 22 macOS-latest

Duplicate identifier 'SerializerFn'.

Check failure on line 231 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 22 ubuntu-latest

Duplicate identifier 'SerializerFn'.

Check failure on line 231 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 18 macOS-latest

Duplicate identifier 'SerializerFn'.

Check failure on line 231 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 20 ubuntu-latest

Duplicate identifier 'SerializerFn'.

Check failure on line 231 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 18 ubuntu-latest

Duplicate identifier 'SerializerFn'.

Check failure on line 231 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 20 macOS-latest

Duplicate identifier 'SerializerFn'.

Check failure on line 231 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 20 windows-latest

Duplicate identifier 'SerializerFn'.

Check failure on line 231 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 18 windows-latest

Duplicate identifier 'SerializerFn'.
type WriteFn = (o: object) => void;

Check failure on line 232 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 22 macOS-latest

Duplicate identifier 'WriteFn'.

Check failure on line 232 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 22 ubuntu-latest

Duplicate identifier 'WriteFn'.

Check failure on line 232 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 18 macOS-latest

Duplicate identifier 'WriteFn'.

Check failure on line 232 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 20 ubuntu-latest

Duplicate identifier 'WriteFn'.

Check failure on line 232 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 18 ubuntu-latest

Duplicate identifier 'WriteFn'.

Check failure on line 232 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 20 macOS-latest

Duplicate identifier 'WriteFn'.

Check failure on line 232 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 20 windows-latest

Duplicate identifier 'WriteFn'.

Check failure on line 232 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 18 windows-latest

Duplicate identifier 'WriteFn'.

type LevelChangeEventListener<CustomLevels extends string = never, UseOnlyCustomLevels extends boolean = boolean> = (

Check failure on line 234 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 22 macOS-latest

Duplicate identifier 'LevelChangeEventListener'.

Check failure on line 234 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 22 ubuntu-latest

Duplicate identifier 'LevelChangeEventListener'.

Check failure on line 234 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 18 macOS-latest

Duplicate identifier 'LevelChangeEventListener'.

Check failure on line 234 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 20 ubuntu-latest

Duplicate identifier 'LevelChangeEventListener'.

Check failure on line 234 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 18 ubuntu-latest

Duplicate identifier 'LevelChangeEventListener'.

Check failure on line 234 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 20 macOS-latest

Duplicate identifier 'LevelChangeEventListener'.

Check failure on line 234 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 20 windows-latest

Duplicate identifier 'LevelChangeEventListener'.

Check failure on line 234 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 18 windows-latest

Duplicate identifier 'LevelChangeEventListener'.
lvl: LevelWithSilentOrString,
val: number,
prevLvl: LevelWithSilentOrString,
Expand All @@ -239,9 +239,9 @@
logger: Logger<CustomLevels, UseOnlyCustomLevels>
) => void;

type LogDescriptor = Record<string, any>;

Check failure on line 242 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 22 macOS-latest

Duplicate identifier 'LogDescriptor'.

Check failure on line 242 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 22 ubuntu-latest

Duplicate identifier 'LogDescriptor'.

Check failure on line 242 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 18 macOS-latest

Duplicate identifier 'LogDescriptor'.

Check failure on line 242 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 20 ubuntu-latest

Duplicate identifier 'LogDescriptor'.

Check failure on line 242 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 18 ubuntu-latest

Duplicate identifier 'LogDescriptor'.

Check failure on line 242 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 20 macOS-latest

Duplicate identifier 'LogDescriptor'.

Check failure on line 242 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 20 windows-latest

Duplicate identifier 'LogDescriptor'.

Check failure on line 242 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 18 windows-latest

Duplicate identifier 'LogDescriptor'.

type Logger<CustomLevels extends string = never, UseOnlyCustomLevels extends boolean = boolean> = BaseLogger & LoggerExtras<CustomLevels> & CustomLevelLogger<CustomLevels, UseOnlyCustomLevels>;

Check failure on line 244 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 22 macOS-latest

Duplicate identifier 'Logger'.

Check failure on line 244 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 22 ubuntu-latest

Duplicate identifier 'Logger'.

Check failure on line 244 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 18 macOS-latest

Duplicate identifier 'Logger'.

Check failure on line 244 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 20 ubuntu-latest

Duplicate identifier 'Logger'.

Check failure on line 244 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 18 ubuntu-latest

Duplicate identifier 'Logger'.

Check failure on line 244 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 20 macOS-latest

Duplicate identifier 'Logger'.

Check failure on line 244 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 20 windows-latest

Duplicate identifier 'Logger'.

Check failure on line 244 in pino.d.ts

View workflow job for this annotation

GitHub Actions / 18 windows-latest

Duplicate identifier 'Logger'.

type SerializedError = pinoStdSerializers.SerializedError;
type SerializedResponse = pinoStdSerializers.SerializedResponse;
Expand Down Expand Up @@ -885,5 +885,6 @@
// Export just the type side of the namespace as "P", allows
// `import {P} from "pino"; const log: P.Logger;`.
// (Legacy support for early 7.x releases, remove in 8.x.)
export type { pino as P };
export type { pino as P };

export = pino;