From d030984206ae5b431a88b0af2856d5cf3ae4d5af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Lenon?= Date: Wed, 6 Apr 2022 23:39:27 -0300 Subject: [PATCH] feat: update @secjs/utils to v1.8.2 --- package-lock.json | 140 +++++---------------------------------- package.json | 6 +- src/Logger.ts | 4 +- tests/Unit/LoggerTest.ts | 6 +- 4 files changed, 26 insertions(+), 130 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6b8c78c..88cd625 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,16 +1,16 @@ { "name": "@athenna/logger", - "version": "1.0.8", + "version": "1.1.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@athenna/logger", - "version": "1.0.8", + "version": "1.1.2", "license": "MIT", "dependencies": { - "@athenna/ioc": "1.0.9", - "@secjs/utils": "1.8.0", + "@athenna/ioc": "1.1.1", + "@secjs/utils": "1.8.2", "chalk": "4.1.1", "reflect-metadata": "0.1.13", "tscpaths": "0.0.9" @@ -56,73 +56,16 @@ } }, "node_modules/@athenna/ioc": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/@athenna/ioc/-/ioc-1.0.9.tgz", - "integrity": "sha512-IqU04R7oZFGeHQRjI6d1hK1P0VYF6FYaKLQP0BAQL407q+Wh5AkDEqIxQDyInIOoqIyWjpRet0WpRWjUyrQ1tw==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@athenna/ioc/-/ioc-1.1.1.tgz", + "integrity": "sha512-XtpAH/K73FsuixNSvI8B4+zxI9xfuGJmM2uq1/Px6PimEBNxzL3ScXG+L4JRhbSdWKM+Eq/AlNxu3EU1F1wgAA==", "dependencies": { - "@secjs/utils": "1.7.8", + "@secjs/utils": "1.8.2", "awilix": "7.0.0", "reflect-metadata": "0.1.13", "tscpaths": "0.0.9" } }, - "node_modules/@athenna/ioc/node_modules/@secjs/utils": { - "version": "1.7.8", - "resolved": "https://registry.npmjs.org/@secjs/utils/-/utils-1.7.8.tgz", - "integrity": "sha512-DrcuJhcF2kdUJWoilniCFxbNWVbJJiTI/1NP779kvOSBD8g402tBzqgIjZdrL+tItjcEXMEUFURvmmZeI1l9VQ==", - "dependencies": { - "bytes": "3.1.2", - "chalk": "4.1.2", - "change-case": "4.1.2", - "http-status-codes": "2.2.0", - "kind-of": "6.0.3", - "lodash": "4.17.21", - "mime-types": "2.1.34", - "ms": "2.1.3", - "pluralize": "8.0.0", - "uuid": "8.3.2", - "validator-brazil": "1.2.2" - } - }, - "node_modules/@athenna/ioc/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/@athenna/ioc/node_modules/mime-db": { - "version": "1.51.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.51.0.tgz", - "integrity": "sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/@athenna/ioc/node_modules/mime-types": { - "version": "2.1.34", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.34.tgz", - "integrity": "sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A==", - "dependencies": { - "mime-db": "1.51.0" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/@athenna/ioc/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" - }, "node_modules/@babel/code-frame": { "version": "7.12.11", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", @@ -1463,9 +1406,9 @@ } }, "node_modules/@secjs/utils": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/@secjs/utils/-/utils-1.8.0.tgz", - "integrity": "sha512-HfffBCtuTK6pRxa6SEhGAinZTj+dRySd8DzlGXR5gpB86Ces48wBEV4wpM39H1sGN60Ct7YL3b9335cBRNq0tg==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/@secjs/utils/-/utils-1.8.2.tgz", + "integrity": "sha512-6o1Ws3Sazbn3qsz0sFJzS7WmCOpX7T2RnRJVtTH90Er5XMci5WK9FxcWKsFtklUpVAfh7gieAF0M/y6LKKTP0w==", "dependencies": { "bytes": "3.1.2", "chalk": "4.1.2", @@ -11913,61 +11856,14 @@ } }, "@athenna/ioc": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/@athenna/ioc/-/ioc-1.0.9.tgz", - "integrity": "sha512-IqU04R7oZFGeHQRjI6d1hK1P0VYF6FYaKLQP0BAQL407q+Wh5AkDEqIxQDyInIOoqIyWjpRet0WpRWjUyrQ1tw==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@athenna/ioc/-/ioc-1.1.1.tgz", + "integrity": "sha512-XtpAH/K73FsuixNSvI8B4+zxI9xfuGJmM2uq1/Px6PimEBNxzL3ScXG+L4JRhbSdWKM+Eq/AlNxu3EU1F1wgAA==", "requires": { - "@secjs/utils": "1.7.8", + "@secjs/utils": "1.8.2", "awilix": "7.0.0", "reflect-metadata": "0.1.13", "tscpaths": "0.0.9" - }, - "dependencies": { - "@secjs/utils": { - "version": "1.7.8", - "resolved": "https://registry.npmjs.org/@secjs/utils/-/utils-1.7.8.tgz", - "integrity": "sha512-DrcuJhcF2kdUJWoilniCFxbNWVbJJiTI/1NP779kvOSBD8g402tBzqgIjZdrL+tItjcEXMEUFURvmmZeI1l9VQ==", - "requires": { - "bytes": "3.1.2", - "chalk": "4.1.2", - "change-case": "4.1.2", - "http-status-codes": "2.2.0", - "kind-of": "6.0.3", - "lodash": "4.17.21", - "mime-types": "2.1.34", - "ms": "2.1.3", - "pluralize": "8.0.0", - "uuid": "8.3.2", - "validator-brazil": "1.2.2" - } - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "mime-db": { - "version": "1.51.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.51.0.tgz", - "integrity": "sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g==" - }, - "mime-types": { - "version": "2.1.34", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.34.tgz", - "integrity": "sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A==", - "requires": { - "mime-db": "1.51.0" - } - }, - "ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" - } } }, "@babel/code-frame": { @@ -12995,9 +12891,9 @@ } }, "@secjs/utils": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/@secjs/utils/-/utils-1.8.0.tgz", - "integrity": "sha512-HfffBCtuTK6pRxa6SEhGAinZTj+dRySd8DzlGXR5gpB86Ces48wBEV4wpM39H1sGN60Ct7YL3b9335cBRNq0tg==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/@secjs/utils/-/utils-1.8.2.tgz", + "integrity": "sha512-6o1Ws3Sazbn3qsz0sFJzS7WmCOpX7T2RnRJVtTH90Er5XMci5WK9FxcWKsFtklUpVAfh7gieAF0M/y6LKKTP0w==", "requires": { "bytes": "3.1.2", "chalk": "4.1.2", diff --git a/package.json b/package.json index 8bff81e..d67fad3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@athenna/logger", - "version": "1.1.1", + "version": "1.1.2", "description": "", "license": "MIT", "author": "João Lenon ", @@ -153,8 +153,8 @@ } }, "dependencies": { - "@athenna/ioc": "1.0.9", - "@secjs/utils": "1.8.0", + "@athenna/ioc": "1.1.1", + "@secjs/utils": "1.8.2", "chalk": "4.1.1", "reflect-metadata": "0.1.13", "tscpaths": "0.0.9" diff --git a/src/Logger.ts b/src/Logger.ts index 88ef988..c5f0d9c 100644 --- a/src/Logger.ts +++ b/src/Logger.ts @@ -1,6 +1,6 @@ import Chalk from 'chalk' +import { Is } from '@secjs/utils' import { Color } from './Utils/Color' -import { Config, Is, Path } from '@secjs/utils' import { DriverContract } from './Contracts/DriverContract' import { DriverFactory } from 'src/Factories/DriverFactory' import { FormatterContract } from './Contracts/FormatterContract' @@ -12,8 +12,6 @@ export class Logger { private driver: DriverContract constructor(runtimeConfig: any = {}) { - new Config().safeLoad(Path.config('logging')) - this.runtimeConfig = runtimeConfig this.channelName = 'default' this.driver = DriverFactory.fabricate(this.channelName, this.runtimeConfig) diff --git a/tests/Unit/LoggerTest.ts b/tests/Unit/LoggerTest.ts index 31ee938..1d2539c 100644 --- a/tests/Unit/LoggerTest.ts +++ b/tests/Unit/LoggerTest.ts @@ -8,14 +8,16 @@ */ import { Logger } from '../../src/Logger' -import { Folder, Path } from '@secjs/utils' +import { Config, Folder, Path } from '@secjs/utils' describe('\n LoggerTest', () => { let logger: Logger - beforeAll(() => { + beforeAll(async () => { new Folder(Path.tests('Stubs/config')).loadSync().copySync(Path.pwd('config')) + await new Config().safeLoad(Path.config('logging')) + logger = new Logger({ formatterConfig: { context: 'Context' } }) })