-
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.
feat(typescript|ci): convert js to ts
- Loading branch information
Showing
28 changed files
with
2,791 additions
and
2,164 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,55 @@ | ||
name: Node.js CI | ||
|
||
on: | ||
push: | ||
branches: [master] | ||
pull_request: | ||
branches: [master] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [12.x, 14.x, 16.x] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v2 | ||
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)" | ||
|
||
- uses: actions/cache@v2 | ||
id: yarn-cache | ||
with: | ||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | ||
key: ${{ runner.os }}-yarn-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: ${{ runner.os }}-yarn- | ||
- name: Install dependencies | ||
if: steps.yarn-cache-dir-path.outputs.cache-hit != 'true' | ||
run: yarn install | ||
- run: yarn lint | ||
- run: yarn check-fmt | ||
- run: yarn tsc | ||
- run: yarn test-cover | ||
env: | ||
CI: true | ||
- name: Coveralls Parallel | ||
uses: coverallsapp/[email protected] | ||
with: | ||
github-token: ${{ secrets.github_token }} | ||
parallel: true | ||
coverall: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Coveralls Finished | ||
uses: coverallsapp/[email protected] | ||
with: | ||
github-token: ${{ secrets.github_token }} | ||
parallel-finished: true |
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 |
---|---|---|
|
@@ -2,4 +2,4 @@ printWidth: 140 | |
semi: false | ||
tabWidth: 4 | ||
singleQuote: true | ||
bracketSpacing: true | ||
bracketSpacing: true |
This file was deleted.
Oops, something went wrong.
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('../index') | ||
const logger = require('../src/index') | ||
|
||
logger.setNamespaces('root:*') | ||
logger.setLevel('debug') | ||
|
||
const log = logger('root:testing') | ||
const log = logger.createLogger('root:testing') | ||
log.debug('sample message', { | ||
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,9 +1,9 @@ | ||
const logger = require('../index') | ||
const logger = require('../src/index') | ||
|
||
logger.setNamespaces('root:*') | ||
logger.setLevel('debug') | ||
|
||
const log = logger('root:testing') | ||
const log = logger.createLogger('root:testing') | ||
log.debug('ctxId', '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('../index') | ||
const logger = require('../src/index') | ||
|
||
logger.setNamespaces('namespace:*') | ||
logger.setLevel('debug') | ||
//logger.setOutput(logger.outputs.json) | ||
|
||
const log = logger('namespace:subNamespace') | ||
log.debug('ctxId', 'Will be logged',{someData: 'someValue', someData2: 'someValue'}) | ||
const log = logger.createLogger('namespace:subNamespace') | ||
log.debug('ctxId', '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 |
---|---|---|
@@ -1,10 +1,10 @@ | ||
const logger = require('../index') | ||
const logger = require('../src/index') | ||
|
||
logger.setOutput(logger.outputs.pretty) | ||
logger.setNamespaces('*') | ||
logger.setLevel('info') | ||
logger.setGlobalContext({ version: '2.0.0', env: 'dev' }) | ||
|
||
const log = logger('namespace') | ||
const log = logger.createLogger('namespace') | ||
|
||
log.warn('message', { someData: 'someValue' }) | ||
log.warn('message', { 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('../index') | ||
const logger = require('../src/index') | ||
|
||
logger.setOutput(logger.outputs.pretty) | ||
logger.setNamespaces('namespace:*') | ||
logger.setLevel('info') | ||
|
||
const log = logger('namespace:subNamespace') | ||
const log = logger.createLogger('namespace:subNamespace') | ||
|
||
log.warn('message', { someData: 'someValue' }) | ||
log.warn('message', { 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,8 +1,8 @@ | ||
const logger = require('../index') | ||
const logger = require('../src/index') | ||
|
||
logger.setNamespaces('namespace:*') | ||
logger.setLevel('debug') | ||
logger.setOutput(logger.outputs.pretty) | ||
|
||
const log = logger('namespace:subNamespace') | ||
log.debug('ctxId', 'Will be logged',{someData: 'someValue', someData2: 'someValue'}) | ||
const log = logger.createLogger('namespace:subNamespace') | ||
log.debug('ctxId', '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 @@ | ||
declare module 'prettyoutput' |
This file was deleted.
Oops, something went wrong.
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,12 @@ | ||
module.exports = { | ||
preset: 'ts-jest', | ||
testEnvironment: 'node', | ||
clearMocks: true, | ||
moduleFileExtensions: ['js', 'ts'], | ||
testRegex: '.*\\.test\\.ts$', | ||
transform: { | ||
'^.+\\.(t|j)s$': 'ts-jest', | ||
}, | ||
collectCoverageFrom: ['src/**/*.(t|j)s'], | ||
coverageDirectory: './coverage', | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.