-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
38 changed files
with
1,630 additions
and
1,869 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"reporter" : ["lcov", "cobertura", "text-summary"], | ||
"extension": [".js", ".ts"], | ||
"include": ["src/**/*.ts"], | ||
"exclude": ["src/@types/**"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,20 @@ | ||
root: true | ||
parser: '@typescript-eslint/parser' | ||
plugins: | ||
- '@typescript-eslint' | ||
parserOptions: | ||
ecmaVersion: 11 | ||
sourceType: script | ||
env: | ||
node: true | ||
es6: true | ||
extends: eslint:recommended | ||
rules: | ||
no-unused-vars: off | ||
project: './tsconfig.json' | ||
sourceType: 'module' | ||
ignorePatterns: | ||
- 'scripts/*' | ||
- '*.config.js' | ||
- 'lib/*' | ||
- 'examples/*' | ||
- 'coverage/*' | ||
- 'node_modules/*' | ||
- '.yarn/*' | ||
- '.nyc_output/*' | ||
extends: | ||
- 'eslint:recommended' | ||
- 'plugin:@typescript-eslint/eslint-recommended' | ||
- 'plugin:@typescript-eslint/recommended' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,18 +14,18 @@ jobs: | |
strategy: | ||
matrix: | ||
node-version: [18.x] | ||
|
||
if: ${{ github.actor == 'pebie' || github.actor == 'Crow-EH' || github.actor == 'fthouraud' || github.actor == 'leguellec' || github.actor == 'rande' }} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
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)" | ||
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT | ||
|
||
- uses: actions/cache@v3 | ||
id: yarn-cache | ||
|
@@ -44,7 +44,7 @@ jobs: | |
- name: Bump the version using input strategy | ||
run: yarn version --new-version ${{ github.event.inputs.strategy }} --no-git-tag-version | ||
|
||
- name: Update changelog | ||
- name: Update changelog | ||
id: changelog | ||
run: | | ||
CHANGELOG=$(yarn conventional-changelog -p conventionalcommits -r -u 0) | ||
|
@@ -53,12 +53,12 @@ jobs: | |
BODY="${BODY//'%'/'%25'}" | ||
BODY="${BODY//$'\n'/'%0A'}" | ||
BODY="${BODY//$'\r'/'%0D'}" | ||
echo "::set-output name=body::${BODY}" | ||
echo "{body}=${BODY}" >> $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] | ||
|
@@ -85,7 +85,7 @@ jobs: | |
with: | ||
node-version: '18.x' | ||
registry-url: 'https://registry.npmjs.org' | ||
|
||
- name: Publish to NPM | ||
run: npm publish --access public | ||
env: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
yarn check-fmt | ||
yarn lint && yarn check-fmt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
18.14.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
export default { | ||
require: ['ts-node/register'], | ||
extensions: ['js', 'ts'], | ||
files: ['test/**/*.test.{js,ts}'], | ||
nodeArguments: ['--experimental-specifier-resolution=node', '--loader=ts-node/esm', '--no-warnings'], | ||
environmentVariables: { | ||
TS_NODE_FILES: 'true', | ||
TS_NODE_TRANSPILE_ONLY: 'true', | ||
TS_NODE_COMPILER_OPTIONS: '{"module":"ESNext"}', | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
const logger = require('../lib/index') | ||
const logger = require('../../lib/cjs/index.js') | ||
|
||
logger.setNamespaces('root:*') | ||
logger.setLevel('debug') | ||
|
||
const log = logger.createLogger('root:testing') | ||
log.debug('ctxId', 'log with predefined context ID', { | ||
log.debug('example1', { | ||
foo: 'bar', | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
const logger = require('../../lib/cjs/index.js') | ||
|
||
logger.setNamespaces('root:*') | ||
logger.setLevel('debug') | ||
|
||
const log = logger.createLogger('root:testing') | ||
log.debug('example2', 'log with predefined context ID', { | ||
foo: 'bar', | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
const logger = require('../../lib/cjs/index.js') | ||
|
||
logger.setNamespaces('namespace:*') | ||
logger.setLevel('debug') | ||
//logger.setOutput(logger.outputs.json) | ||
|
||
const log = logger.createLogger('namespace:subNamespace') | ||
log.debug('example3', 'Will be logged', { someData: 'someValue', someData2: 'someValue' }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
const logger = require('../../lib/cjs/index.js') | ||
|
||
logger.setOutput(logger.outputs.pretty) | ||
logger.setNamespaces('*') | ||
logger.setLevel('info') | ||
logger.setGlobalContext({ version: '2.0.0', env: 'dev' }) | ||
|
||
const log = logger.createLogger('namespace') | ||
|
||
log.warn('example4', { someData: 'someValue' }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
const logger = require('../../lib/cjs/index.js') | ||
|
||
logger.setOutput(logger.outputs.pretty) | ||
logger.setNamespaces('namespace:*') | ||
logger.setLevel('info') | ||
|
||
const log = logger.createLogger('namespace:subNamespace') | ||
|
||
log.warn('example5', { someData: 'someValue' }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
const logger = require('../../lib/cjs/index.js') | ||
|
||
logger.setOutput(logger.outputs.pretty) | ||
logger.setNamespaces('*') | ||
logger.setLevel('info') | ||
|
||
const log = logger.createLogger('namespace', true) | ||
const num = 1 | ||
log.debug('example6', { someData: 'someValue' }, num > 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
const logger = require('../../lib/cjs/index.js') | ||
|
||
logger.setNamespaces('namespace:*') | ||
logger.setLevel('debug') | ||
logger.setOutput(logger.outputs.pretty) | ||
|
||
const log = logger.createLogger('namespace:subNamespace') | ||
log.debug('example7', 'Will be logged', { someData: 'someValue', someData2: 'someValue' }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"type": "commonjs"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
const logger = require('../lib/index') | ||
import logger from '../../lib/esm/index.js' | ||
|
||
logger.setNamespaces('root:*') | ||
logger.setLevel('debug') | ||
|
||
const log = logger.createLogger('root:testing') | ||
log.debug('sample message', { | ||
log.debug('example1', { | ||
foo: 'bar', | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import logger from '../../lib/esm/index.js' | ||
|
||
logger.setNamespaces('root:*') | ||
logger.setLevel('debug') | ||
|
||
const log = logger.createLogger('root:testing') | ||
log.debug('example2', 'log with predefined context ID', { | ||
foo: 'bar', | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
const logger = require('../lib/index') | ||
import logger from '../../lib/esm/index.js' | ||
|
||
logger.setNamespaces('namespace:*') | ||
logger.setLevel('debug') | ||
//logger.setOutput(logger.outputs.json) | ||
|
||
const log = logger.createLogger('namespace:subNamespace') | ||
log.debug('ctxId', 'Will be logged', { someData: 'someValue', someData2: 'someValue' }) | ||
log.debug('example3', 'Will be logged', { someData: 'someValue', someData2: 'someValue' }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
const logger = require('../lib/index') | ||
import logger from '../../lib/esm/index.js' | ||
|
||
logger.setOutput(logger.outputs.pretty) | ||
logger.setNamespaces('namespace:*') | ||
logger.setLevel('info') | ||
|
||
const log = logger.createLogger('namespace:subNamespace') | ||
|
||
log.warn('message', { someData: 'someValue' }) | ||
log.warn('example5', { someData: 'someValue' }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
const logger = require('../lib/index') | ||
import logger from '../../lib/esm/index.js' | ||
|
||
logger.setOutput(logger.outputs.pretty) | ||
logger.setNamespaces('*') | ||
logger.setLevel('info') | ||
|
||
const log = logger.createLogger('namespace', true) | ||
const num = 1 | ||
log.debug('Will be logged', { someData: 'someValue' }, num > 0) | ||
log.debug('example6', { someData: 'someValue' }, num > 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
const logger = require('../lib/index') | ||
import logger from '../../lib/esm/index.js' | ||
|
||
logger.setNamespaces('namespace:*') | ||
logger.setLevel('debug') | ||
logger.setOutput(logger.outputs.pretty) | ||
|
||
const log = logger.createLogger('namespace:subNamespace') | ||
log.debug('ctxId', 'Will be logged', { someData: 'someValue', someData2: 'someValue' }) | ||
log.debug('example7', 'Will be logged', { someData: 'someValue', someData2: 'someValue' }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"type": "module"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env zx | ||
import { $, chalk } from 'zx' | ||
|
||
console.log(chalk.green('RUN ESM EXAMPLES:')) | ||
await $`for file in examples/esm/*.js; do node "$file"; done` | ||
|
||
console.log(chalk.green('RUN CJS EXAMPLES:')) | ||
await $`for file in examples/cjs/*.js; do node "$file"; done` |
Oops, something went wrong.