From e3bcae219b901a8825efca964d85652eb9c25490 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Lenon?= Date: Mon, 6 Dec 2021 22:54:01 -0300 Subject: [PATCH] feat: update packages and tests --- package-lock.json | 107 +++++++------------------------------------ package.json | 6 +-- src/utils/global.ts | 3 -- tests/config.spec.ts | 9 ---- 4 files changed, 19 insertions(+), 106 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7bc4f8c..ceda37d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,19 +1,18 @@ { "name": "@secjs/config", - "version": "1.0.7", + "version": "1.1.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@secjs/config", - "version": "1.0.7", + "version": "1.1.3", "license": "MIT", "devDependencies": { "@secjs/contracts": "1.1.7", - "@secjs/env": "1.2.5", + "@secjs/env": "1.2.8", "@secjs/exceptions": "1.0.4", - "@secjs/logger": "1.2.2", - "@secjs/utils": "1.4.3", + "@secjs/utils": "1.5.8", "@types/debug": "4.1.5", "@types/jest": "27.0.1", "@types/node": "14.17.0", @@ -1365,9 +1364,9 @@ "dev": true }, "node_modules/@secjs/env": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/@secjs/env/-/env-1.2.5.tgz", - "integrity": "sha512-1XHJYppTu5qOTf9Wjr/GLhHUDddDfV24Qwt1Bqco2BplupnGXulLXg0Ph9/uC4oZ8sfTkK6d9JRpH7eyINpu7A==", + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@secjs/env/-/env-1.2.8.tgz", + "integrity": "sha512-J5BZe2NwlP02NvlzLMWjRnXKqVL7jwceDahZcPTQCwFcVGVQaVSZoci+wJ6+/kj66++2XIdExS3xhIkHimiYYQ==", "dev": true, "dependencies": { "dotenv": "10.0.0" @@ -1379,53 +1378,10 @@ "integrity": "sha512-prj8eNUOqJtrEdUFX58gqvo1RsuKZJI6pJnUr/molkDEerhWEF4lAuR8gliQo+cA+LASAvCeJXDkTWR/xbodMQ==", "dev": true }, - "node_modules/@secjs/logger": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@secjs/logger/-/logger-1.2.2.tgz", - "integrity": "sha512-bDmMttraaKLmxEAPHoDs+kTZKrJUGf4BCNEqtQ0Yr9aL6O82PfdwahgZn6esxpPWrZW42Fi1Xo8UuNBTjFGjpg==", - "dev": true, - "dependencies": { - "chalk": "4.1.1", - "debug": "4.3.1" - } - }, - "node_modules/@secjs/logger/node_modules/chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", - "dev": true, - "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/@secjs/logger/node_modules/debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, "node_modules/@secjs/utils": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/@secjs/utils/-/utils-1.4.3.tgz", - "integrity": "sha512-rZMLhn1RSrnSboOSPD76cgPgeBGotfXOlTQxKQq1Di2UWFXQeOU5aKmbiHO98JQHWWiVuveeArKrcYpDeDvScQ==", + "version": "1.5.8", + "resolved": "https://registry.npmjs.org/@secjs/utils/-/utils-1.5.8.tgz", + "integrity": "sha512-PZ9xHS8M1390XP4HKXw0mVOcc/UzYX5By28XppnBJglMbWAZ9zwhB9Ftf+w33nqRoxDmjaOYFa9cMIVF8TWnbA==", "dev": true, "dependencies": { "mime-types": "2.1.34" @@ -10809,9 +10765,9 @@ "dev": true }, "@secjs/env": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/@secjs/env/-/env-1.2.5.tgz", - "integrity": "sha512-1XHJYppTu5qOTf9Wjr/GLhHUDddDfV24Qwt1Bqco2BplupnGXulLXg0Ph9/uC4oZ8sfTkK6d9JRpH7eyINpu7A==", + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@secjs/env/-/env-1.2.8.tgz", + "integrity": "sha512-J5BZe2NwlP02NvlzLMWjRnXKqVL7jwceDahZcPTQCwFcVGVQaVSZoci+wJ6+/kj66++2XIdExS3xhIkHimiYYQ==", "dev": true, "requires": { "dotenv": "10.0.0" @@ -10823,41 +10779,10 @@ "integrity": "sha512-prj8eNUOqJtrEdUFX58gqvo1RsuKZJI6pJnUr/molkDEerhWEF4lAuR8gliQo+cA+LASAvCeJXDkTWR/xbodMQ==", "dev": true }, - "@secjs/logger": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@secjs/logger/-/logger-1.2.2.tgz", - "integrity": "sha512-bDmMttraaKLmxEAPHoDs+kTZKrJUGf4BCNEqtQ0Yr9aL6O82PfdwahgZn6esxpPWrZW42Fi1Xo8UuNBTjFGjpg==", - "dev": true, - "requires": { - "chalk": "4.1.1", - "debug": "4.3.1" - }, - "dependencies": { - "chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - } - } - }, "@secjs/utils": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/@secjs/utils/-/utils-1.4.3.tgz", - "integrity": "sha512-rZMLhn1RSrnSboOSPD76cgPgeBGotfXOlTQxKQq1Di2UWFXQeOU5aKmbiHO98JQHWWiVuveeArKrcYpDeDvScQ==", + "version": "1.5.8", + "resolved": "https://registry.npmjs.org/@secjs/utils/-/utils-1.5.8.tgz", + "integrity": "sha512-PZ9xHS8M1390XP4HKXw0mVOcc/UzYX5By28XppnBJglMbWAZ9zwhB9Ftf+w33nqRoxDmjaOYFa9cMIVF8TWnbA==", "dev": true, "requires": { "mime-types": "2.1.34" diff --git a/package.json b/package.json index d593ec9..97cffa5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@secjs/config", - "version": "1.1.2", + "version": "1.1.3", "description": "", "license": "MIT", "author": "João Lenon", @@ -20,9 +20,9 @@ ], "devDependencies": { "@secjs/contracts": "1.1.7", - "@secjs/env": "1.2.5", + "@secjs/env": "1.2.8", "@secjs/exceptions": "1.0.4", - "@secjs/utils": "1.4.3", + "@secjs/utils": "1.5.8", "@types/debug": "4.1.5", "@types/jest": "27.0.1", "@types/node": "14.17.0", diff --git a/src/utils/global.ts b/src/utils/global.ts index 730f235..69e8bf3 100644 --- a/src/utils/global.ts +++ b/src/utils/global.ts @@ -1,4 +1,3 @@ -import { Path } from '@secjs/utils' import { Config as ConfigInstance } from '../Config' export {} @@ -15,8 +14,6 @@ declare global { const _global = global as any -Path.switchEnvVerify() - new ConfigInstance().loadIfUnloaded() _global.Config = ConfigInstance diff --git a/tests/config.spec.ts b/tests/config.spec.ts index f6913ab..11f4976 100644 --- a/tests/config.spec.ts +++ b/tests/config.spec.ts @@ -80,13 +80,4 @@ describe('\n Config', () => { expect(Config.get('DB_NAME')).toBe('testing') expect(Config.get('database.dbName')).toBe('testing') }) - - it('should be able to use loadIfUnloaded method to load configs if they are not loaded', async () => { - expect(Config.get('app')).toBe(undefined) - - new Config().loadIfUnloaded() - - expect(Config.get('DB_NAME')).toBe('testing') - expect(Config.get('database.dbName')).toBe('testing') - }) })