diff --git a/.gitignore b/.gitignore index dc534ea..3dfd7d2 100644 --- a/.gitignore +++ b/.gitignore @@ -60,3 +60,4 @@ type_definitions/**/*.js type_definitions/*.js .typingsrc +package-lock.json diff --git a/.npmignore b/.npmignore index b0eede3..1a75997 100644 --- a/.npmignore +++ b/.npmignore @@ -19,4 +19,5 @@ wallaby.js .travis.yml .gitignore .vscode -type_definitions \ No newline at end of file +type_definitions +package-lock.json \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 5d9fad1..aefbefc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,12 +1,8 @@ language: node_js node_js: - stable -- 5.4.1 -- 5.4.0 -- 5.3.0 -- 5.2.0 -- 5.1.1 -- 4.4.6 +- 8.8.1 +- 7.10.1 before_install: - npm install -g codeclimate-test-reporter after_success: diff --git a/PULL_REQUEST_TEMPLATE.md b/PULL_REQUEST_TEMPLATE.md index 7f0a9b7..c44826d 100644 --- a/PULL_REQUEST_TEMPLATE.md +++ b/PULL_REQUEST_TEMPLATE.md @@ -1,36 +1,45 @@ +# PR Details + ## Description + ## Related Issue + ## Motivation and Context + -## How Has This Been Tested? +## How Has This Been Tested + ## Types of changes + + +- [ ] Docs change / refactoring / dependency upgrade - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) -## Checklist: +## Checklist + + - [ ] My code follows the code style of this project. - [ ] My change requires a change to the documentation. - [ ] I have updated the documentation accordingly. -- [ ] My change requires a change to the type definitions. -- [ ] I have updated the type definitions accordingly. - [ ] I have read the **CONTRIBUTING** document. - [ ] I have added tests to cover my changes. -- [ ] All new and existing tests passed. \ No newline at end of file +- [ ] All new and existing tests passed. diff --git a/package.json b/package.json index 8ef48b8..d6cf2dc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "inversify-logger-middleware", - "version": "3.0.0", + "version": "3.1.0", "description": "A basic logger middleware for InversifyJS", "main": "lib/index.js", "typings": "./dts/index.d.ts", @@ -29,27 +29,27 @@ }, "homepage": "https://github.com/inversify/inversify-logger-middleware#readme", "dependencies": { - "chalk": "^2.0.0" + "chalk": "2.3.0" }, "devDependencies": { - "@types/chai": "^4.0.0", - "@types/chalk": "^0.4.28", - "@types/mocha": "^2.2.35", - "@types/sinon": "^2.1.0", - "chai": "^4.0.0", - "gulp": "^3.9.1", - "gulp-istanbul": "^1.0.0", - "gulp-mocha": "^4.0.1", - "gulp-tslint": "^7.1.0", - "gulp-typescript": "^3.1.4", - "harmonize": "^2.0.0", - "inversify": "^4.0.0", - "mocha": "^4.0.0", - "publish-please": "^2.1.4", - "reflect-metadata": "^0.1.9", - "run-sequence": "^1.2.0", - "sinon": "^3.0.0", - "tslint": "^5.0.0", - "typescript": "^2.2.0" + "@types/chai": "4.0.4", + "@types/chalk": "2.2.0", + "@types/mocha": "2.2.44", + "@types/sinon": "2.3.7", + "chai": "4.1.2", + "gulp": "3.9.1", + "gulp-istanbul": "1.1.2", + "gulp-mocha": "3.0.1", + "gulp-tslint": "8.1.2", + "gulp-typescript": "3.2.3", + "harmonize": "2.0.0", + "inversify": "4.5.1", + "mocha": "4.0.1", + "publish-please": "2.3.1", + "reflect-metadata": "0.1.10", + "run-sequence": "2.2.0", + "sinon": "4.1.1", + "tslint": "5.8.0", + "typescript": "2.6.1" } } diff --git a/src/index.ts b/src/index.ts index 7f76a81..e892fe9 100644 --- a/src/index.ts +++ b/src/index.ts @@ -16,8 +16,8 @@ function makeLoggerMiddleware( next: inversify.interfaces.Next ): inversify.interfaces.Next { - if (settings === undefined || settings === null) { settings = deatultOptions; }; - if (renderer === undefined || renderer === null) { renderer = consoleRenderer; }; + if (settings === undefined || settings === null) { settings = deatultOptions; } + if (renderer === undefined || renderer === null) { renderer = consoleRenderer; } return (args: inversify.interfaces.NextArgs) => { diff --git a/src/serializers/text/colors.ts b/src/serializers/text/colors.ts new file mode 100644 index 0000000..c9c272f --- /dev/null +++ b/src/serializers/text/colors.ts @@ -0,0 +1,7 @@ +import * as Chalk from "chalk"; + +const yellow = Chalk.default.yellow; +const green = Chalk.default.green; +const red = Chalk.default.red; + +export { yellow, green, red, Chalk }; diff --git a/src/serializers/text/text_serializer.ts b/src/serializers/text/text_serializer.ts index f8d06ae..e83a979 100644 --- a/src/serializers/text/text_serializer.ts +++ b/src/serializers/text/text_serializer.ts @@ -1,5 +1,5 @@ import serializeRequest from "./request_serializer"; -import { green, red } from "./text_serializer_utils"; +import { green, red } from "./colors"; import interfaces from "../../interfaces/interfaces"; function textSerializer(entry: interfaces.LogEntry) { diff --git a/src/serializers/text/text_serializer_utils.ts b/src/serializers/text/text_serializer_utils.ts index b3b7fb2..b53cc94 100644 --- a/src/serializers/text/text_serializer_utils.ts +++ b/src/serializers/text/text_serializer_utils.ts @@ -1,4 +1,4 @@ -import { yellow, green, red } from "chalk"; +import { yellow } from "./colors"; let tree = { item: "└──" @@ -38,4 +38,4 @@ function makePropertyLogger(indentationForDepth: string) { }; } -export { getIndentationForDepth, makePropertyLogger, yellow, green, red }; +export { getIndentationForDepth, makePropertyLogger }; diff --git a/tslint.json b/tslint.json index b949f42..b5f6b8a 100644 --- a/tslint.json +++ b/tslint.json @@ -35,7 +35,6 @@ "no-switch-case-fall-through": false, "no-trailing-whitespace": true, "no-unused-expression": true, - "no-use-before-declare": true, "no-var-keyword": true, "object-literal-sort-keys": true, "one-line": [true,