Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
b5c47f8
chore: add typescript
KyleRoss Nov 17, 2021
39abf26
chore: rename .releaserc to release.config.js
KyleRoss Nov 17, 2021
2800655
feat: rewrite into typescript
KyleRoss Nov 17, 2021
0e8f0ac
feat: support esm and cjs
KyleRoss Nov 17, 2021
726a209
feat: change minimum support to node v12+
KyleRoss Nov 17, 2021
9ffcf9a
chore: update jest to add esm support and watch command
KyleRoss Nov 17, 2021
1fb42dd
chore: update jest config to support typescript
KyleRoss Nov 17, 2021
f518ec1
chore: add support for pre-release branches in module workflow
KyleRoss Nov 17, 2021
00afd02
chore: update tests to run on node 12, 14, and 16
KyleRoss Nov 17, 2021
ead5507
chore: only run code coverage on master branch
KyleRoss Nov 17, 2021
9110c86
chore: update eslint glob in workflow
KyleRoss Nov 17, 2021
8c16c07
chore: build the package prior to release in workflow
KyleRoss Nov 17, 2021
4ce3053
chore: add additional files/folders to npmignore
KyleRoss Nov 17, 2021
df7b271
chore: update dependencies
KyleRoss Nov 17, 2021
764cd62
docs: update readme for prerelease
KyleRoss Nov 17, 2021
23e3efd
chore(release): 3.2.0 [skip ci]
semantic-release-bot Nov 17, 2021
fe34fe6
feat: 4.0.0-beta
KyleRoss Nov 17, 2021
461ca47
chore(release): 4.0.0-beta.1 [skip ci]
semantic-release-bot Nov 17, 2021
da55f8d
chore: do not run workflow when there are only changes to site
KyleRoss Nov 17, 2021
1575161
chore: simplify code coverage workflow
KyleRoss Nov 17, 2021
48602b9
chore: only trigger workflow when a file in `gh_pages` is changed
KyleRoss Nov 17, 2021
77e8000
chore: update jest settings
KyleRoss Nov 17, 2021
e58a168
chore: add ignore patterns to eslint config
KyleRoss Nov 17, 2021
9e15c02
Merge branch 'beta' of https://github.com/KyleRoss/node-lambda-log in…
KyleRoss Nov 17, 2021
1d91fe6
chore: update codeclimate settings
KyleRoss Nov 17, 2021
db5a2d7
chore: remove coverage job from `needs`
KyleRoss Nov 17, 2021
551e43d
chore: disable declaration in tsconfig
KyleRoss Nov 18, 2021
2fcf770
fix: add `.js` file extensions on imports to support node ESM
KyleRoss Nov 18, 2021
62da1ec
fix: add root index file to alleviate the need to call `.default` in cjs
KyleRoss Nov 18, 2021
8b18e19
chore: update to the latest typescript version
KyleRoss Nov 18, 2021
54cfce0
chore: add jest-ts-webcompat-resolver to fix issues resolving `.js` f…
KyleRoss Nov 18, 2021
d268e91
fix: add `src` as a module directory to jest
KyleRoss Nov 18, 2021
1c6376c
fix: ignore jest.config.ts when publishing to npm
KyleRoss Nov 18, 2021
39a9f43
fix: update `main` to point to root index.js file for cjs usage
KyleRoss Nov 18, 2021
1323bf4
fix: add `module` field to point to esm
KyleRoss Nov 18, 2021
2345392
chore: remove extra "exports" from package.json that aren't needed
KyleRoss Nov 18, 2021
c65fd52
fix: point `types` to separate declaration file
KyleRoss Nov 18, 2021
0d48d63
chore: cleanup build scripts
KyleRoss Nov 18, 2021
c43deef
fix: add build:declaration script and run it during build
KyleRoss Nov 18, 2021
433cb70
fix: add `ts-node` as a dev dependency for jest
KyleRoss Nov 18, 2021
6495084
chore: upgrade deps
KyleRoss Nov 18, 2021
4f15d05
chore(release): 4.0.0-beta.2 [skip ci]
semantic-release-bot Nov 18, 2021
bb7bd7e
chore: add types for node
KyleRoss Nov 19, 2021
467c9e4
fix: rename index to `lambda-log` to ensure the types are generated p…
KyleRoss Nov 19, 2021
d7861de
fix: add entrypoint file for advanced usage
KyleRoss Nov 19, 2021
d3408a5
chore: add separate tsconfig for tests
KyleRoss Nov 19, 2021
7a949dd
chore: rename tests from .test.ts to .spec.ts
KyleRoss Nov 19, 2021
50dd03d
feat: add support for direct entrypoint
KyleRoss Nov 19, 2021
6c77c79
fix: add package.json to esm and cjs directories after build
KyleRoss Nov 19, 2021
3becce8
chore: add `expect-more-jest` as a dev dependency
KyleRoss Nov 19, 2021
89db707
fix: change legacy cjs file to require `lambda-log.js` instead
KyleRoss Nov 19, 2021
1e4442c
Merge branch 'beta' of https://github.com/KyleRoss/node-lambda-log in…
KyleRoss Nov 19, 2021
5592cda
chore: add missing properties to tsconfig.spec.json
KyleRoss Nov 19, 2021
42bffa2
test: add missing tests
KyleRoss Nov 19, 2021
be4002f
chore: ignore branch that does not need to be tested
KyleRoss Nov 19, 2021
cc42f22
chore: cleanup npmignore
KyleRoss Nov 19, 2021
8103016
chore(release): 4.0.0-beta.3 [skip ci]
semantic-release-bot Nov 19, 2021
1b7fcf9
chore: add *.spec.ts files to exclude patterns for codeclimate
KyleRoss Nov 25, 2021
4cb3e6d
Merge branch 'beta' of https://github.com/KyleRoss/node-lambda-log in…
KyleRoss Nov 25, 2021
9fc1857
fix: destructure import of EventEmitter to support TS projects
KyleRoss Nov 25, 2021
35cd48b
chore(release): 4.0.0-beta.4 [skip ci]
semantic-release-bot Nov 25, 2021
4491110
chore: specify key of `reduce` as string
KyleRoss Dec 10, 2021
cc10311
fix: remove generic from Message type
KyleRoss Dec 10, 2021
9bafeb0
chore: add new Metadata type to use for incoming metadata
KyleRoss Dec 10, 2021
cd1c746
fix: add generic to LogObject type to specify type of Message
KyleRoss Dec 10, 2021
8c6b3ca
chore: separate Formatter type into individual "plugin" types
KyleRoss Dec 10, 2021
fddc993
chore: update options to use new "plugin" types
KyleRoss Dec 10, 2021
f8ecac7
feat: separate built-in formatters into separate files
KyleRoss Dec 10, 2021
223785f
chore: provide multiple methods of accessing built-in formatters
KyleRoss Dec 10, 2021
31281df
chore: default to the built-in json formatter
KyleRoss Dec 10, 2021
cde1d2d
chore: provide additional access to `defaultOptions` object as a stat…
KyleRoss Dec 10, 2021
7317bf5
fix: rename the `log` method to `_log`
KyleRoss Dec 10, 2021
a3c1f16
feat: add `log` shortcut method as an alias for `info` to match the `…
KyleRoss Dec 10, 2021
6e13564
fix: still generate the log message just don't log it when verbosity …
KyleRoss Dec 10, 2021
7e48904
fix: ts generics and typings on shortcut methods
KyleRoss Dec 10, 2021
3562d25
chore: misc cleanup and type updates
KyleRoss Dec 10, 2021
b483dbb
test: update tests for LambdaLog class to reflect recent changes
KyleRoss Dec 10, 2021
df6ac1a
chore: update LogMessage to use new formatters
KyleRoss Dec 10, 2021
36fbdaa
fix: remove toJSON() method from LogMessage since it's been moved to …
KyleRoss Dec 10, 2021
b1a280e
chore: remove toJSON() method from interface
KyleRoss Dec 10, 2021
fd873e3
fix: explicitly set type to `string[]` for compiled tags returned fro…
KyleRoss Dec 10, 2021
6e6775a
fix: add generic support to LogMessage class for specifying the messa…
KyleRoss Dec 10, 2021
274d5d1
chore: misc cleanup and typing updates
KyleRoss Dec 10, 2021
eac9df6
test: update LogMessage tests to reflect recent changes
KyleRoss Dec 10, 2021
0c3c016
chore: update dependencies to the latest versions
KyleRoss Dec 10, 2021
1e5076c
Merge branch 'beta' of https://github.com/KyleRoss/node-lambda-log in…
KyleRoss Dec 10, 2021
65d98c7
chore(release): 4.0.0-beta.5 [skip ci]
semantic-release-bot Dec 10, 2021
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
5 changes: 4 additions & 1 deletion .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ checks:
file-lines:
enabled: true
config:
threshold: 350
threshold: 500
method-complexity:
enabled: true
config:
Expand Down Expand Up @@ -50,4 +50,7 @@ exclude_patterns:
- "**/node_modules/"
- "site/"
- "**/*.d.ts"
- "**/*.test.ts"
- "**/*.test.js"
- "**/*.spec.ts"
- "**/*.spec.js"
25 changes: 19 additions & 6 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
---
root: true

parserOptions:
ecmaVersion: 2019
ignorePatterns:
- 'node_modules/**/*'
- 'dist'
- 'site'

env:
node: true
Expand All @@ -11,12 +13,11 @@ env:

plugins:
- 'jsdoc'
- 'node'
- '@typescript-eslint/eslint-plugin'

extends:
- 'xo-space'
- 'plugin:jsdoc/recommended'
- 'plugin:node/recommended'

rules:
array-element-newline: off
Expand All @@ -29,5 +30,17 @@ rules:
no-negated-condition: off
keyword-spacing: ['error', { overrides: { if: { after: false }, for: { after: false }, while: { after: false }, catch: { after: false } } }]
jsdoc/newline-after-description: off
node/no-unsupported-features/es-syntax: ['error', { version: '>=10.0.0' }]
node/no-missing-require: off

overrides:
- files: ['*.ts']
parserOptions:
project:
- './tsconfig.eslint.json'
- './tsconfig.spec.json'
extends:
- 'xo-typescript/space'
rules:
'@typescript-eslint/keyword-spacing': ['error', { overrides: { if: { after: false }, for: { after: false }, while: { after: false }, catch: { after: false } } }]
'@typescript-eslint/object-curly-spacing': ['error', 'always']
'@typescript-eslint/comma-dangle': ['error', 'never']
'@typescript-eslint/naming-convention': off
46 changes: 16 additions & 30 deletions .github/workflows/module.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,22 @@ on:
push:
branches:
- master
- next
- beta
- alpha
paths-ignore:
- 'site/**'
pull_request:
branches:
- master
paths-ignore:
- 'site/**'

jobs:
test:
strategy:
matrix:
node: [ '10', '12', '14', '16' ]
node: [ '12', '14', '16' ]
name: test/node v${{ matrix.node }}
runs-on: ubuntu-latest
steps:
Expand All @@ -25,32 +32,9 @@ jobs:
run: npm i
- name: Run Tests
run: npm test

coverage:
name: Code Coverage
needs: [ test ]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- name: Setup Node
uses: actions/setup-node@master
with:
node-version: 14
- name: Install Dependencies
run: npm i
- name: Run Tests
if: ${{ github.event_name == 'pull_request' }}
run: npm test
- name: Comment Coverage on PR
if: ${{ github.event_name == 'pull_request' }}
uses: artiomtr/jest-coverage-report-action@fdabb5bd42fa8a55bcfdfb55d855122cabfb7911
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
threshold: 100
- name: Upload Coverage to Code Climate
uses: paambaati/codeclimate-action@v2.7.2
if: ${{ github.event_name == 'push' }}
uses: paambaati/codeclimate-action@v3.0.0
if: ${{ matrix.node == '16' }}
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
Expand All @@ -68,7 +52,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@master
with:
node-version: 14
node-version: 16
- name: Install Dependencies
run: npm i
- name: Delete expired artifacts
Expand All @@ -79,22 +63,24 @@ jobs:
dry_run: "false"
- uses: bradennapier/eslint-plus-action@v3.4.2
with:
includeGlob: 'index.js,index.test.js,lib/*.js'
includeGlob: 'src/*.ts'

release:
name: Release
if: ${{ github.event_name == 'push' }}
needs: [ test, coverage ]
needs: [ test ]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- name: Setup Node
uses: actions/setup-node@master
with:
node-version: 14
node-version: 16
- name: Install Dependencies
run: npm i
- name: Build Package
run: npm run build
- name: Publish to NPM
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
- master
tags:
- '!*'
paths:
- 'gh-pages/**'

jobs:
build:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ package-lock.json
# DS_Store file
.DS_Store

dist
res
11 changes: 8 additions & 3 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,17 @@
gh-pages
site
.eslintrc.yml
.releaserc
release.config.js
commitlint.config.js
*.test.js
jest.config.js
tsconfig.json
tsconfig.eslint.json
tsconfig.spec.json
*.test.ts
*.spec.ts
jest.config.ts
.all-contributorsrc
.codeclimate.yml
babel.config.js
CHANGELOG.md
README.md
src
13 changes: 0 additions & 13 deletions .releaserc

This file was deleted.

9 changes: 8 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,14 @@
"changeProcessCWD": true
}
],
"eslint.validate": [
"mdx",
"javascript",
"javascriptreact",
"typescript"
],
"[mdx]": {
"editor.wordWrap": "on"
}
},
"typescript.tsdk": "node_modules/typescript/lib"
}
69 changes: 69 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,72 @@
# [4.0.0-beta.5](https://github.com/KyleRoss/node-lambda-log/compare/v4.0.0-beta.4...v4.0.0-beta.5) (2021-12-10)


### Bug Fixes

* add generic support to LogMessage class for specifying the message type ([6e6775a](https://github.com/KyleRoss/node-lambda-log/commit/6e6775a44bf881d3d7d64d9ce2f40ff2bce858da))
* add generic to LogObject type to specify type of Message ([cd1c746](https://github.com/KyleRoss/node-lambda-log/commit/cd1c74697a99840a48f29d49509ad3409e145de5))
* explicitly set type to `string[]` for compiled tags returned from LogMessage ([fd873e3](https://github.com/KyleRoss/node-lambda-log/commit/fd873e3a2da24f3b90985708771adeb2901ce39c))
* remove generic from Message type ([cc10311](https://github.com/KyleRoss/node-lambda-log/commit/cc10311b3e0580e840792e452d11dcc43e911544))
* remove toJSON() method from LogMessage since it's been moved to a formatter ([36fbdaa](https://github.com/KyleRoss/node-lambda-log/commit/36fbdaa738fb1fa0daf046dc71eb84adc18ae55c))
* rename the `log` method to `_log` ([7317bf5](https://github.com/KyleRoss/node-lambda-log/commit/7317bf52418af6fed65db8066b94d8c2dbe21023))
* still generate the log message just don't log it when verbosity is set ([6e13564](https://github.com/KyleRoss/node-lambda-log/commit/6e13564da87fe5b189a2b9262d8e3613a3f138e5))
* ts generics and typings on shortcut methods ([7e48904](https://github.com/KyleRoss/node-lambda-log/commit/7e48904076802adf571385f73ac83294c0d4f875))


### Features

* add `log` shortcut method as an alias for `info` to match the `console` pattern ([a3c1f16](https://github.com/KyleRoss/node-lambda-log/commit/a3c1f163976de3f68c49e05f3a84ab7c1791c0e5))
* separate built-in formatters into separate files ([f8ecac7](https://github.com/KyleRoss/node-lambda-log/commit/f8ecac7ed12b25495c634a904f489857a7413f80))

# [4.0.0-beta.4](https://github.com/KyleRoss/node-lambda-log/compare/v4.0.0-beta.3...v4.0.0-beta.4) (2021-11-25)


### Bug Fixes

* destructure import of EventEmitter to support TS projects ([9fc1857](https://github.com/KyleRoss/node-lambda-log/commit/9fc18573373e62a09c46f71a3517f862b74aac77))

# [4.0.0-beta.3](https://github.com/KyleRoss/node-lambda-log/compare/v4.0.0-beta.2...v4.0.0-beta.3) (2021-11-19)


### Bug Fixes

* add entrypoint file for advanced usage ([d7861de](https://github.com/KyleRoss/node-lambda-log/commit/d7861de9269532ab31631e559ec8da7a77c2870a))
* add package.json to esm and cjs directories after build ([6c77c79](https://github.com/KyleRoss/node-lambda-log/commit/6c77c7971def43eb8b3f5e66a071f8b87d8b6bb8))
* change legacy cjs file to require `lambda-log.js` instead ([89db707](https://github.com/KyleRoss/node-lambda-log/commit/89db70742c011405534c6ce1a3c8916190d85a66))
* rename index to `lambda-log` to ensure the types are generated properly ([467c9e4](https://github.com/KyleRoss/node-lambda-log/commit/467c9e42628ed05a6ba28bb2cea79f4129d6a2f5))


### Features

* add support for direct entrypoint ([50dd03d](https://github.com/KyleRoss/node-lambda-log/commit/50dd03d8651799ea4f865fcadae5b3d5abcfe121))

# [4.0.0-beta.2](https://github.com/KyleRoss/node-lambda-log/compare/v4.0.0-beta.1...v4.0.0-beta.2) (2021-11-18)


### Bug Fixes

* add `.js` file extensions on imports to support node ESM ([2fcf770](https://github.com/KyleRoss/node-lambda-log/commit/2fcf7707528c7a07c7d0e02ab4e1ecf1b699363d))
* add `module` field to point to esm ([1323bf4](https://github.com/KyleRoss/node-lambda-log/commit/1323bf4866ba14fb1c86b6daae4e0daad2bcfcba))
* add `src` as a module directory to jest ([d268e91](https://github.com/KyleRoss/node-lambda-log/commit/d268e91f8d2f4e26e1ddf0d798635a87c13c6a7d))
* add `ts-node` as a dev dependency for jest ([433cb70](https://github.com/KyleRoss/node-lambda-log/commit/433cb70287352dd9e16b9b51f3ce5b31c4f8f098))
* add build:declaration script and run it during build ([c43deef](https://github.com/KyleRoss/node-lambda-log/commit/c43deef9aa2080637055e48a93851f5fc537bc20))
* add root index file to alleviate the need to call `.default` in cjs ([62da1ec](https://github.com/KyleRoss/node-lambda-log/commit/62da1ec8d119bbcdee783db75545252e90755310))
* ignore jest.config.ts when publishing to npm ([1c6376c](https://github.com/KyleRoss/node-lambda-log/commit/1c6376c027014473e31123cdd39d61c260e36bad))
* point `types` to separate declaration file ([c65fd52](https://github.com/KyleRoss/node-lambda-log/commit/c65fd52cbcf6cf5d08dc6cde4f221f70dd4e92a3))
* update `main` to point to root index.js file for cjs usage ([39a9f43](https://github.com/KyleRoss/node-lambda-log/commit/39a9f437637a3ec3443fef79e79cd93d641d876f))

# [4.0.0-beta.1](https://github.com/KyleRoss/node-lambda-log/compare/v3.2.0...v4.0.0-beta.1) (2021-11-17)


### Features

* 4.0.0-beta ([fe34fe6](https://github.com/KyleRoss/node-lambda-log/commit/fe34fe6cb26f05c966d5879c6a87baa1681d0c57))


### BREAKING CHANGES

* This is the beta version for the next major release of LambdaLog. Do not use in production yet! Please report any issues you may find!

# [3.1.0](https://github.com/KyleRoss/node-lambda-log/compare/v3.0.2...v3.1.0) (2021-10-14)


Expand Down
Loading