From 56aaea6fb872232bad2133b6d75bbde25441d1b1 Mon Sep 17 00:00:00 2001 From: Richard Zampieri Date: Thu, 21 Mar 2024 18:59:15 -0700 Subject: [PATCH] feat: adjust templates and module creation --- src/generate/form.ts | 3 ++- src/generate/templates/module-default.tpl | 3 ++- src/generate/templates/module.tpl | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/generate/form.ts b/src/generate/form.ts index 8c1d17e..3ede542 100644 --- a/src/generate/form.ts +++ b/src/generate/form.ts @@ -328,7 +328,6 @@ const splitTarget = async ({ target.includes("\\") || target.includes("//") ) { - //pathContent = target.split("/").filter((item) => item !== ""); if (schematic === "service") schematic = "controller"; if ( schematic === "service" || @@ -450,6 +449,8 @@ const schematicFolder = (schematic: string): string | undefined => { return "entities"; case "middleware": return "providers/middlewares"; + case "module": + return "useCases"; } return undefined; diff --git a/src/generate/templates/module-default.tpl b/src/generate/templates/module-default.tpl index e512824..45df72d 100644 --- a/src/generate/templates/module-default.tpl +++ b/src/generate/templates/module-default.tpl @@ -1,3 +1,4 @@ +import { ContainerModule } from "inversify"; import { CreateModule } from "@expressots/core"; -export const {{moduleName}}Module = CreateModule([]); +export const {{moduleName}}Module: ContainerModule = CreateModule([]); diff --git a/src/generate/templates/module.tpl b/src/generate/templates/module.tpl index 627650f..9ef58e7 100644 --- a/src/generate/templates/module.tpl +++ b/src/generate/templates/module.tpl @@ -1,4 +1,5 @@ +import { ContainerModule } from "inversify"; import { CreateModule } from "@expressots/core"; import { {{className}}Controller } from "{{{path}}}"; -export const {{moduleName}}Module = CreateModule([{{className}}Controller]); +export const {{moduleName}}Module: ContainerModule = CreateModule([{{className}}Controller]);