From 693089fffa8ace08242d1f342ca11c27f3591404 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Lenon?= Date: Mon, 11 Apr 2022 01:09:28 -0300 Subject: [PATCH] feat: update dependencies and remove facade --- index.ts | 1 - package.json | 8 ++++---- src/Application.ts | 4 +++- src/Facade.ts | 38 -------------------------------------- src/Ignite.ts | 4 +++- 5 files changed, 10 insertions(+), 45 deletions(-) delete mode 100644 src/Facade.ts diff --git a/index.ts b/index.ts index cf628e1..6db3b27 100644 --- a/index.ts +++ b/index.ts @@ -7,6 +7,5 @@ * file that was distributed with this source code. */ -export * from 'src/Facade' export * from 'src/Ignite' export * from 'src/Application' diff --git a/package.json b/package.json index 7a839df..264d63e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@athenna/core", - "version": "1.2.6", + "version": "1.2.7", "description": "", "license": "MIT", "author": "João Lenon ", @@ -159,9 +159,9 @@ }, "dependencies": { "@athenna/config": "1.0.8", - "@athenna/ioc": "1.1.2", - "@athenna/logger": "1.1.6", - "@athenna/http": "1.2.3", + "@athenna/ioc": "1.1.3", + "@athenna/logger": "1.1.7", + "@athenna/http": "1.2.4", "@secjs/utils": "1.8.3", "reflect-metadata": "0.1.13", "tscpaths": "0.0.9" diff --git a/src/Application.ts b/src/Application.ts index c5d5cfd..676932a 100644 --- a/src/Application.ts +++ b/src/Application.ts @@ -18,7 +18,9 @@ import { AlreadyShutdownException } from 'src/Exceptions/AlreadyShutdownExceptio export class Application { /** - * Simple logger for Application class. + * Simple logger for Application class. Application creates + * a new instance of Logger because providers are not + * registered yet. * * @private */ diff --git a/src/Facade.ts b/src/Facade.ts deleted file mode 100644 index 34413ed..0000000 --- a/src/Facade.ts +++ /dev/null @@ -1,38 +0,0 @@ -/** - * @athenna/core - * - * (c) João Lenon - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -export class ProxyHandler { - private readonly alias: any - - public constructor(alias: any) { - this.alias = alias - } - - get(_object: any, key: string) { - const provider = ioc.use(this.alias) - - if (!provider) { - return () => {} - } - - return provider[key] - } -} - -export class Facade { - /** - * Creates a new facade for alias. - * - * @param alias - * @return any - */ - static createFor(alias: string): Provider { - return new Proxy(this, new ProxyHandler(alias)) - } -} diff --git a/src/Ignite.ts b/src/Ignite.ts index 2f5b699..a314758 100644 --- a/src/Ignite.ts +++ b/src/Ignite.ts @@ -22,7 +22,9 @@ import { DuplicatedApplicationException } from 'src/Exceptions/DuplicatedApplica export class Ignite { /** - * Simple logger for Ignite class. + * Simple logger for Ignite class. Ignite creates a new + * instance of Logger because providers are not registered + * yet. * * @private */