From b7a13d65588daa31e479625261f09d2bc3942531 Mon Sep 17 00:00:00 2001 From: Jacob Nguyen <76754747+jacoobes@users.noreply.github.com> Date: Wed, 3 May 2023 15:08:07 -0500 Subject: [PATCH] chore: remove redundant directories for single files --- .../{dependencies/provider.ts => dependencies.ts} | 12 ++++++------ src/core/dependencies/index.ts | 1 - src/core/functions.ts | 2 +- src/core/index.ts | 2 ++ 4 files changed, 9 insertions(+), 8 deletions(-) rename src/core/{dependencies/provider.ts => dependencies.ts} (93%) delete mode 100644 src/core/dependencies/index.ts diff --git a/src/core/dependencies/provider.ts b/src/core/dependencies.ts similarity index 93% rename from src/core/dependencies/provider.ts rename to src/core/dependencies.ts index cc956aa..d875d28 100644 --- a/src/core/dependencies/provider.ts +++ b/src/core/dependencies.ts @@ -1,12 +1,12 @@ import type { Container } from 'iti'; -import type { AnyDependencies, DependencyConfiguration, MapDeps, ServerlessDependencies, WebsocketDependencies } from '../../types/handler'; -import SernEmitter from '../sernEmitter'; -import { DefaultErrorHandling, DefaultLogging, DefaultModuleManager } from '../contracts'; +import type { AnyDependencies, DependencyConfiguration, MapDeps, ServerlessDependencies, WebsocketDependencies } from '../types/handler'; +import SernEmitter from './sernEmitter'; +import { DefaultErrorHandling, DefaultLogging, DefaultModuleManager } from './contracts'; import { Result } from 'ts-results-es'; import { BehaviorSubject } from 'rxjs'; import { createContainer } from 'iti'; -import { ModuleStore, SernError } from '../structures'; -import { AnyWrapper, ServerlessWrapper, WebsocketWrapper } from '../structures/wrapper'; +import { ModuleStore } from './structures'; +import { AnyWrapper, ServerlessWrapper, WebsocketWrapper } from './structures/wrapper'; export const containerSubject = new BehaviorSubject(defaultContainer()); @@ -53,7 +53,7 @@ export function composeRoot( const container = conf.build(currentContainer); //Check if the built container contains @sern/client or throw // a runtime exception - Result.wrap(() => container.get('@sern/client')).expect(SernError.MissingRequired); + //Result.wrap(() => container.get('@sern/client')).expect(SernError.MissingRequired); if (!excludeLogger) { container.get('@sern/logger')?.info({ message: 'All dependencies loaded successfully.' }); diff --git a/src/core/dependencies/index.ts b/src/core/dependencies/index.ts deleted file mode 100644 index 01940b5..0000000 --- a/src/core/dependencies/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { useContainerRaw, single, transient } from './provider'; diff --git a/src/core/functions.ts b/src/core/functions.ts index 8ab6745..e725eca 100644 --- a/src/core/functions.ts +++ b/src/core/functions.ts @@ -1,6 +1,6 @@ import { Err, Ok } from 'ts-results-es'; import { ApplicationCommandOptionType, AutocompleteInteraction } from 'discord.js'; -import type { SernAutocompleteData, SernOptionsData } from '../../types/module'; +import type { SernAutocompleteData, SernOptionsData } from '../types/module'; //function wrappers for empty ok / err diff --git a/src/core/index.ts b/src/core/index.ts index f6facb2..8a9c8d3 100644 --- a/src/core/index.ts +++ b/src/core/index.ts @@ -5,3 +5,5 @@ export { SernEmitter }; export * from './contracts'; export * from './platform'; export * from './plugins'; +export * from './structures/'; +export { single, transient, useContainerRaw } from './dependencies'