huge refactor done

This commit is contained in:
Boki 2025-06-24 11:59:35 -04:00
parent 843a7b9b9b
commit 60d7de1da8
16 changed files with 472 additions and 443 deletions

View file

@ -3,7 +3,7 @@
* Discovers and registers handlers with the DI container
*/
import { asClass, type AwilixContainer } from 'awilix';
import { asClass, asFunction, type AwilixContainer } from 'awilix';
import { glob } from 'glob';
import type {
HandlerConfiguration,
@ -157,7 +157,9 @@ export class HandlerScanner {
// Register with DI container if auto-register is enabled
if (this.options.autoRegister !== false) {
this.container.register({
[handlerName]: asClass(HandlerClass).singleton(),
[handlerName]: asFunction(({ serviceContainer }) => {
return new HandlerClass(serviceContainer);
}).singleton(),
});
}