From 6bfbc1def5c56009fe58f87a6016f499c1aa4818 Mon Sep 17 00:00:00 2001 From: Juliano Leonardo Soares Date: Wed, 4 Oct 2023 03:17:18 -0300 Subject: [PATCH] feat: remove the automatic module generation --- src/generate/form.ts | 51 +++++++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 24 deletions(-) diff --git a/src/generate/form.ts b/src/generate/form.ts index 099f99a..3cf7e43 100644 --- a/src/generate/form.ts +++ b/src/generate/form.ts @@ -254,33 +254,36 @@ export const createTemplate = async ({ } } } else { - writeTemplate({ - outputPath: moduleOutPath, - template: { - path: `./templates/module.tpl`, - data: { - moduleName: - moduleName[0].toUpperCase() + moduleName.slice(1), - className, - path: controllerPath, + if (opinionated || (!opinionated && schematic == "service")) { + writeTemplate({ + outputPath: moduleOutPath, + template: { + path: `./templates/module.tpl`, + data: { + moduleName: + moduleName[0].toUpperCase() + + moduleName.slice(1), + className, + path: controllerPath, + }, }, - }, - }); + }); - console.log( - " ", - chalk.greenBright(`[module]`.padEnd(14)), - chalk.bold.white(`${moduleName}.module created! ✔️`), - ); + console.log( + " ", + chalk.greenBright(`[module]`.padEnd(14)), + chalk.bold.white(`${moduleName}.module created! ✔️`), + ); - if ( - target.includes("/") || - target.includes("\\") || - target.includes("//") - ) { - await addModuleToContainer(moduleName, modulePath, path); - } else { - await addModuleToContainer(moduleName, moduleName, path); + if ( + target.includes("/") || + target.includes("\\") || + target.includes("//") + ) { + await addModuleToContainer(moduleName, modulePath, path); + } else { + await addModuleToContainer(moduleName, moduleName, path); + } } } }