From 4c32ba384ff4f091ba50d443ae6d57a834afad6b Mon Sep 17 00:00:00 2001 From: Divinewill Date: Sun, 7 Apr 2024 12:18:31 +0100 Subject: [PATCH] patch: modified how modules are exported --- package.json | 2 +- src/http/index.ts | 4 ++++ src/log/index.ts | 2 ++ src/log/provider.ts | 20 -------------------- src/main.ts | 10 ++++------ src/validator/index.ts | 1 + 6 files changed, 12 insertions(+), 27 deletions(-) create mode 100644 src/http/index.ts create mode 100644 src/log/index.ts delete mode 100644 src/log/provider.ts create mode 100644 src/validator/index.ts diff --git a/package.json b/package.json index 5c3daca..9b30a85 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@blinkclaud/octobus", - "version": "0.3.0", + "version": "0.3.1", "description": "A toolkit for Blink HQ's microservices", "author": "Blink HQ", "private": false, diff --git a/src/http/index.ts b/src/http/index.ts new file mode 100644 index 0000000..ef429fa --- /dev/null +++ b/src/http/index.ts @@ -0,0 +1,4 @@ +export * from './agent'; +export * from './errors'; +export * from './jwt'; +export * from './wrapper'; diff --git a/src/log/index.ts b/src/log/index.ts new file mode 100644 index 0000000..91b4e62 --- /dev/null +++ b/src/log/index.ts @@ -0,0 +1,2 @@ +export * from './logger'; +export * from './serializers'; diff --git a/src/log/provider.ts b/src/log/provider.ts deleted file mode 100644 index 4ffc082..0000000 --- a/src/log/provider.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { Logger, LoggerConfig } from './logger'; - -import { Provider } from '@nestjs/common'; -import { defaultSerializers } from './serializers'; - -export const BunyanLogger: ( - name: string, - serializers?: string -) => Provider = (name: string, serializers: string = '') => ({ - provide: Logger, - useFactory: () => { - // You can provide a default configuration here or load it from a configuration file - const config: LoggerConfig = { - name, - serializers: defaultSerializers(serializers), - }; - - return new Logger(config); - }, -}); diff --git a/src/main.ts b/src/main.ts index f07ce0a..1cb462b 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,7 +1,5 @@ -export * from './log/logger'; -export * from './http/agent'; -export * from './http/errors'; -export * as jwt from './http/jwt'; -export * from './http/wrapper'; -export * from './mq/worker'; +export * from './http'; export * from './mq'; +export * from './log'; +export * from './validator'; +export * from './retry'; diff --git a/src/validator/index.ts b/src/validator/index.ts new file mode 100644 index 0000000..087b687 --- /dev/null +++ b/src/validator/index.ts @@ -0,0 +1 @@ +export * from './yup.validation';