@expressots/cli 1.3.0 → 1.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,14 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- /* import { AppContainer } from "@expressots/core";
4
- import { AppModule } from "./app.module";
5
- import { UserModule } from "@useCases/user/user.module";
6
-
3
+ //import { AppContainer } from "@expressots/core";
4
+ /*
7
5
  const appContainer = new AppContainer();
8
6
 
9
- const container = appContainer.create([// Add your modules here
10
- AppModule, UserModule]);
11
-
12
- export { container };
7
+ const container = appContainer.create([// Add your modules here, UserModule, UserModule, UserModule]);
13
8
 
14
- */
9
+ export { container };*/
@@ -183,20 +183,20 @@ const createTemplate = async ({ schematic, path: target, method, }) => {
183
183
  moduleOutPath = `${usecaseDir}/${moduleName}/${moduleName}.module.ts`;
184
184
  }
185
185
  }
186
- let controllerPath = "";
186
+ let controllerPath = "./";
187
187
  const pathCount = (path.split("/")).length;
188
188
  if (path === "") {
189
- controllerPath = `${file.slice(0, file.lastIndexOf('.'))}`;
189
+ controllerPath += `${file.slice(0, file.lastIndexOf('.'))}`;
190
190
  }
191
191
  else if (pathCount === 1) {
192
- controllerPath = `${path}/${file.slice(0, file.lastIndexOf('.'))}`;
192
+ controllerPath += `${path}/${file.slice(0, file.lastIndexOf('.'))}`;
193
193
  }
194
194
  else if (pathCount === 2) {
195
- controllerPath = `${path.split("/")[1]}/${file.slice(0, file.lastIndexOf('.'))}`;
195
+ controllerPath += `${path.split("/")[1]}/${file.slice(0, file.lastIndexOf('.'))}`;
196
196
  }
197
197
  else {
198
198
  const segments = path.split("/");
199
- controllerPath = `${segments[segments.length - 1]}/${file.slice(0, file.lastIndexOf('.'))}`;
199
+ controllerPath += `${segments[segments.length - 1]}/${file.slice(0, file.lastIndexOf('.'))}`;
200
200
  }
201
201
  if (moduleExist) {
202
202
  if (target.includes("/") || target.includes("\\") || target.includes("//")) {
package/bin/new/form.js CHANGED
@@ -175,7 +175,7 @@ const projectForm = async (projectName, args) => {
175
175
  progressBar.update(100);
176
176
  progressBar.stop();
177
177
  console.log("\n");
178
- console.log("🐎 Project ", chalk_1.default.green(projName), "created successfully!");
178
+ console.log("🐎 Project ", chalk_1.default.green(answer.name), "created successfully!");
179
179
  console.log("🤙 Run the following commands to start the project:\n");
180
180
  console.log(chalk_1.default.bold.gray(`$ cd ${answer.name}`));
181
181
  switch (answer.packageManager) {
@@ -27,7 +27,7 @@ async function addControllerToModule(filePath, controllerName, controllerPath) {
27
27
  if (!moduleDeclarationMatch) {
28
28
  return;
29
29
  }
30
- const controllers = moduleDeclarationMatch[1].trim().split(',').map((c) => c.trim());
30
+ const controllers = moduleDeclarationMatch[1].trim().split(',').map((c) => c.trim()).filter((c) => c);
31
31
  if (controllers.includes(controllerName)) {
32
32
  return;
33
33
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expressots/cli",
3
- "version": "1.3.0",
3
+ "version": "1.3.2",
4
4
  "description": "Expressots CLI - modern, fast, lightweight nodejs web framework (@cli)",
5
5
  "author": "Richard Zampieri",
6
6
  "license": "MIT",