Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
4566757
chore(yarn): use yarn v2
tduyng Oct 21, 2024
0152daa
chore(hooks): remove husky, use native githooks
tduyng Oct 21, 2024
999ed77
chore(deps): use exact version of dev dependencies for better local dev
tduyng Oct 21, 2024
e7db6b8
chore(lint): implement biome and remove eslint,prettier
tduyng Oct 21, 2024
011198e
fix(lint): fix all linter issues
tduyng Oct 21, 2024
bc3100c
refactor(outils): remove unused function
tduyng Oct 21, 2024
94c17cb
refactor: write native colors outils
tduyng Oct 21, 2024
f1fd5e1
refactor(examples): give meaningfull messages
tduyng Oct 22, 2024
f9a94a0
chore(deps): remove unused eslint and prettier
tduyng Oct 22, 2024
8b83f9f
refactor(adapters): create wrapper writable stream for process.stdout…
tduyng Oct 22, 2024
10d473a
feat(perf): implement fast-json-stringify for better performance json…
tduyng Oct 22, 2024
245729d
refactor: implement pur functional, avoid mutable internal object
tduyng Oct 22, 2024
eac80d7
refactor: separate default config and mutual config
tduyng Oct 22, 2024
4d6b3d1
fix: handle correctly dual signature for logMethod
tduyng Oct 22, 2024
8d64d9f
feat(perf): implement memorization for caching expensive operations
tduyng Oct 22, 2024
afd4099
refactor: separate json schema for fast-json-stringify
tduyng Oct 22, 2024
ccbb2c6
fix: fast-json-stringify do not support replacer
tduyng Oct 22, 2024
eb0efdc
feat(3.0): convert src code to ESM
tduyng Oct 26, 2024
dfe49fb
feat(3.0): remove ts-node, use tsx, convert examples to typescript
tduyng Oct 26, 2024
109b4e1
chore(3.0): ignore format package.json by biome
tduyng Oct 26, 2024
efb6522
feat(3.0): support more colors
tduyng Oct 26, 2024
70735b5
chore(3.0): support dual npm package in ESM and CJS
tduyng Oct 26, 2024
3a0f647
chore(3.0): set Node.js 18 as the minimum supported version
tduyng Oct 26, 2024
53d8730
chore(3.0): remove unused Makefile
tduyng Oct 26, 2024
47c134a
ci(3.0): fix, update action versions, run test on Nodejs18,20,22
tduyng Oct 26, 2024
2afacab
ci(3.0): simplify release step and build Typescript files
tduyng Oct 26, 2024
5ac9e32
chore(3.0): run examples/*.ts with deno for faster execution
tduyng Oct 26, 2024
8d79fb5
chore(3.0): remove unused dependencies
tduyng Oct 26, 2024
2a886fc
chore(3.0): add more tags
tduyng Oct 26, 2024
9effe33
ci(3.0): add issue templates: bug, feature_request
tduyng Oct 26, 2024
37a4acb
docs(3.0): update image examples
tduyng Oct 26, 2024
2ccdde4
test(3.0): rewrite tests with vitest for ESM
tduyng Oct 26, 2024
291740b
test(3.0): reimplement coverage with vitest + c8
tduyng Oct 26, 2024
28261c4
feat(3.0): use native crypto.randomUUID to replace uuidV4
tduyng Oct 26, 2024
06de2a3
test(3.0): rewrite all test files in Typescript with vitest
tduyng Oct 27, 2024
252493e
chore(3.0): cleanup package.json
tduyng Oct 28, 2024
92fdfd5
docs(3.0): update documentations
tduyng Oct 28, 2024
0af815e
chore(3.0): add CONTRIBUTION rules
tduyng Oct 28, 2024
cfd1858
docs(3.0): add breaking change docs
tduyng Oct 28, 2024
708b16f
ci(3.0): add type checking step
tduyng Oct 28, 2024
cbee334
docs(3.0): create benchmark with v2, winston and pino
tduyng Oct 28, 2024
61decaf
perf(3.0): early return log when not forcing and not active level
tduyng Oct 28, 2024
783a6a8
perf(3.0): avoid using Object.assign
tduyng Oct 28, 2024
2087ee3
docs(3.0): add benchmarks results
tduyng Oct 28, 2024
1c68174
chore(3.0): add benchmark for complex objects
tduyng Oct 29, 2024
7686758
chore(3.0): simplify and split and create helpers functions for bench…
tduyng Oct 29, 2024
7632fbb
chore(3.0): remove tsx, write build script directly in js
tduyng Oct 30, 2024
42164ed
chore(3.0): off useImportType lint rule
tduyng Nov 20, 2024
bbef8d2
test(3.0): use correct type MockInstance for vi.spyOn
tduyng Nov 20, 2024
92c563e
ci(3.0): implement git cliff for highly customizable changelog
tduyng Nov 27, 2024
434899d
chore(3.0): update the dev dependencies
tduyng Nov 27, 2024
7ecafb4
chore(3.0): replace yarn by pnpm
tduyng Feb 6, 2025
2f12694
chore(3.0): upgrade dev dependencies
tduyng Feb 6, 2025
92d8ad5
feat(3.0): remove fast-json-stringify
tduyng Feb 6, 2025
06627ef
chore(3.0): simplify build scripts
tduyng Feb 6, 2025
778db14
chore(deps): update latest dependencies
tduyng Feb 17, 2025
d0f73e6
ci: setup bot user for creating release commit
tduyng Feb 17, 2025
8392aa3
ci: simplify bump version and tag with npm
tduyng Feb 17, 2025
90d1bd9
feat: use @tduyng/prettyouput to replace deprecated prettyoutput library
tduyng Feb 17, 2025
6780446
docs: update README.md
tduyng Feb 17, 2025
a933b2f
chore(deps): use major version for dependencies field
tduyng Feb 18, 2025
ef6856e
ci: check typings for all files
tduyng Feb 18, 2025
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
9 changes: 0 additions & 9 deletions .eslintrc.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env sh
pnpm run check

2 changes: 2 additions & 0 deletions .githooks/prepare-commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
npx --no -- commitlint --edit ${1}
55 changes: 55 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Bug Report
description: Report an issue with @ekino/logger
title: "[Bug]: "
labels: ["bug", "needs-triage"]
body:
- type: markdown
attributes:
value: |
🐛 **Bug Report** - Please use this form for bugs only!

- type: input
validations:
required: true
attributes:
label: 🔎 Search Terms
description: |
List any terms you searched for in open/closed issues before reporting this bug.

- type: textarea
validations:
required: true
attributes:
label: Problem Description
description: |
Describe the issue in detail. Include expected vs. actual behavior.

- type: input
validations:
required: true
attributes:
label: Version of @ekino/logger
placeholder: e.g., v3.0.0
description: |
You can find this by running `npm list @ekino/logger` or similar.

- type: input
validations:
required: true
attributes:
label: Node Version
placeholder: e.g., v22.8.0
description: |
Run `node -v` to find the version.

- type: textarea
attributes:
label: Steps to Reproduce
description: |
Describe how to reproduce the issue. If possible, provide a minimum working example.

- type: textarea
attributes:
label: Additional Info
description: |
Any additional context, error logs, or related info.
37 changes: 37 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Feature Request
description: Suggest a new feature to enhance @ekino/logger
title: "[Feature Request]: "
labels: ["enhancement", "feature-request"]
body:
- type: markdown
attributes:
value: |
Thanks for wanting to make `@ekino/logger` better! 🎉 Please use this form to share a feature you'd love to see.

- type: input
validations:
required: true
attributes:
label: 🔎 Search Terms
description: |
To help us understand if this request already exists, list any terms you searched for in open/closed issues.

- type: textarea
validations:
required: true
attributes:
label: Feature Description
description: |
Provide a clear description of the feature. What would this feature do, and how would it enhance the library?

- type: textarea
attributes:
label: Use Cases
description: |
Describe a few use cases where this feature would make a difference.

- type: textarea
attributes:
label: Additional Info
description: |
Share any additional context or examples to help us understand your request.
58 changes: 22 additions & 36 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,61 +1,47 @@
name: Continuous integration
name: CI

on: [push, pull_request]

jobs:
tests:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04

strategy:
matrix:
node-version: [14.x, 16.x, 18.x]
node-version: [18.x, 20.x, 22.x]

steps:
- uses: actions/checkout@v3
- name: Checkout repository
uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
node-version: ${{ matrix.node-version }}

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
version: 10
run_install: false

- uses: actions/cache@v3
id: yarn-cache
- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

- name: Install dependencies
if: steps.yarn-cache-dir-path.outputs.cache-hit != 'true'
run: yarn install
run: pnpm install --frozen-lockfile

- name: Eslint
run: yarn lint
- name: Check linter
run: pnpm run check

- name: Prettier
run: yarn check-fmt
- name: Check typing
run: pnpm tsc -p tsconfig.json --noEmit

- run: yarn test-cover
- name: Run tests with coverage
run: pnpm coverage
env:
CI: true

- name: Coveralls Parallel
uses: coverallsapp/github-action@v1.1.2
- name: Upload coverage to Coveralls
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: node-${{ matrix.node-version }}
parallel: true

coverall:
needs: tests
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/[email protected]
with:
github-token: ${{ secrets.github_token }}
parallel-finished: true
111 changes: 53 additions & 58 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,93 +1,88 @@
name: Release

on:
workflow_dispatch:
inputs:
strategy:
description: Valid semver number <x.x.x> or strategy <patch, minor, major>
default: "patch"
description: 'Valid semver (x.x.x) or strategy (patch, minor, major)'
default: 'patch'
required: false

permissions:
contents: write

jobs:
release:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x]

if: ${{ github.actor == 'pebie' || github.actor == 'Crow-EH' || github.actor == 'fthouraud' || github.actor == 'leguellec' || github.actor == 'rande' }}
runs-on: ubuntu-24.04
if: ${{ github.actor == 'pebie' || github.actor == 'leguellec' }}

steps:
- name: Checkout
uses: actions/checkout@v3
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"

- uses: actions/cache@v3
id: yarn-cache
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-
version: 10
run_install: false

- name: Setup Node.js 22.x
uses: actions/setup-node@v4
with:
node-version: '22.x'
cache: 'pnpm'
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
if: steps.yarn-cache-dir-path.outputs.cache-hit != 'true'
run: yarn install
run: pnpm install --frozen-lockfile

- name: Build
run: yarn build
- name: Build the project
run: pnpm run build

- name: Bump the version using input strategy
run: yarn version --new-version ${{ github.event.inputs.strategy }} --no-git-tag-version
- name: Set up Git user
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"

- name: Bump version
id: versioning
run: |
npm version ${{ github.event.inputs.strategy }} -m "chore(release): v%s"
VERSION=$(node -p "require('./package.json').version")
echo "current-version=$VERSION" >> $GITHUB_OUTPUT

- name: Update changelog
- name: Set up git-cliff
uses: kenji-miyake/setup-git-cliff@v2

- name: Run git-cliff to generate changelog
id: changelog
run: |
CHANGELOG=$(yarn conventional-changelog -p conventionalcommits -r -u 0)
echo -e "${CHANGELOG}\n\n\n\n$(cat CHANGELOG.md)" > CHANGELOG.md
BODY=$(echo -e "${CHANGELOG}" | sed -e "1,2d")
BODY="${BODY//'%'/'%25'}"
BODY="${BODY//$'\n'/'%0A'}"
BODY="${BODY//$'\r'/'%0D'}"
echo "::set-output name=body::${BODY}"
git-cliff --latest > temp_changelog
cat temp_changelog CHANGELOG.md > temp && mv temp CHANGELOG.md
echo "changelog-body<<EOF" >> $GITHUB_OUTPUT
cat temp_changelog >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT

- name: Log changes
run: |
echo "The changelog will be : ${{ steps.changelog.outputs.body }}"

- name: Get version
id: package-version
uses: martinbeentjes/[email protected]
echo "The changelog will be: $(git cliff --latest)"

- name: Create tag
- name: Commit changelog
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
git add .
git commit -m "chore(bump): release v${{ steps.package-version.outputs.current-version }}"
git add CHANGELOG.md
git commit -m "docs: update changelog for v${{ steps.versioning.outputs.current-version }}"
git push
git tag -a v${{ steps.package-version.outputs.current-version }} -m "chore(tag): release v${{ steps.package-version.outputs.current-version }}"
git push origin v${{ steps.package-version.outputs.current-version }}

- name: Create release
uses: softprops/action-gh-release@v1
- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
body: ${{ steps.changelog.outputs.body }}
tag_name: v${{ steps.package-version.outputs.current-version }}
name: v${{ steps.package-version.outputs.current-version }}
body: ${{ steps.changelog.outputs.changelog-body}}
tag_name: v${{ steps.versioning.outputs.current-version }}
name: v${{ steps.versioning.outputs.current-version }}

- name: Setup npmrc
uses: actions/setup-node@v3
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'

- name: Publish to NPM
run: npm publish --access public
env:
VERSION: ${{ steps.package-version.outputs.current-version }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
4 changes: 0 additions & 4 deletions .husky/commit-msg

This file was deleted.

4 changes: 0 additions & 4 deletions .husky/pre-commit

This file was deleted.

Empty file removed .npmignore
Empty file.
5 changes: 0 additions & 5 deletions .prettierrc

This file was deleted.

Loading
Loading