@expressots/cli 1.3.1 → 1.3.3
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.
package/bin/app.container.js
CHANGED
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
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 };*/
|
package/bin/generate/form.js
CHANGED
|
@@ -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
|
|
189
|
+
controllerPath += `${file.slice(0, file.lastIndexOf('.'))}`;
|
|
190
190
|
}
|
|
191
191
|
else if (pathCount === 1) {
|
|
192
|
-
controllerPath
|
|
192
|
+
controllerPath += `${path}/${file.slice(0, file.lastIndexOf('.'))}`;
|
|
193
193
|
}
|
|
194
194
|
else if (pathCount === 2) {
|
|
195
|
-
controllerPath
|
|
195
|
+
controllerPath += `${path.split("/")[1]}/${file.slice(0, file.lastIndexOf('.'))}`;
|
|
196
196
|
}
|
|
197
197
|
else {
|
|
198
|
-
const segments = path.split("/");
|
|
199
|
-
controllerPath
|
|
198
|
+
const segments = path.split("/").filter((segment) => segment !== "");
|
|
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("//")) {
|
|
@@ -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
|
}
|