Skip to content

@ekino/logger v3.0#48

Open
tduyng wants to merge 70 commits intoekino:masterfrom
tduyng:3.0
Open

@ekino/logger v3.0#48
tduyng wants to merge 70 commits intoekino:masterfrom
tduyng:3.0

Conversation

@tduyng
Copy link
Contributor

@tduyng tduyng commented Feb 24, 2025

Summary

Rewrite @ekino/logger for v3.0

Motivation

  • It's been so long time the library is not matained
  • Rewrite this library for adapting the modern Node.js (Typescript, ESM)

What has changed?

Here are the key changes made in this PR:

  • Rewritten in ESM
  • Support for dual package (CommonJS and ESM)
  • Rewritten in TypeScript
  • Removed many unnecessary dependencies
  • Replaced yarn with pnpm, which is faster and more convenient with different commands and management
  • Upgraded GitHub Actions, rewrote some deprecated syntax
  • Using git-cliff on GitHub Actions for easily customizable CHANGELOG
  • Replaced ESLint + Prettier with Biome, which is faster, has sufficient rules, and is easier to set up
  • Rewrote all tests from ava + sinon.js + nyc + ts-node to vitest (compatible with ESM)
  • Create a benchmark compare with pino.js and winston
  • Refactored and cleaned up code, focusing on performance, and much more...

Test plan

  • All unit tests have been correctly rewritten with Vitest
  • All functional test behaviors are ensured

Also close issue #25 , close issue #37

tduyng added 30 commits October 21, 2024 16:00
@tduyng
Copy link
Contributor Author

tduyng commented May 23, 2025

TODO: fix github-action for release and changelog.

@tduyng
Copy link
Contributor Author

tduyng commented Dec 3, 2025

Thank @Nico385412 for all the reviews!

"winston": "3.18.3"
},
"optionalDependencies": {
"@tduyng/prettyoutput": "2.x"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why put this dependancy in optionalDependencies ?

Copy link
Contributor Author

@tduyng tduyng Feb 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pretty feature is optional and mainly intended for local development and easier debugging.
In production, logs are emitted in JSON format.

The pretty formatter is therefore declared as an optional dependency. Users are free to use @tduyng/prettyoutput or provide their own implementation, or disable pretty logging entirely. This keeps the setup flexible and avoids imposing a specific formatter.

"examples-esm": "./examples/esm/exec.sh",
"examples-cjs": "./examples/cjs/exec.sh",
"benchmark": "node ./benchmarks/basic.js",
"postinstall": "git config core.hooksPath ./.githooks || true"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this modify the user git config for the repo, maybe we should add this script as a step on the readme instead of running it automatically ?
What do you think ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, added. Thank for your suggestion @atacanjacques

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants