jcc-express-mvc 1.3.4 → 1.3.5

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 +1 @@
1
- {"version":3,"file":"NodeArtisanCommand.d.ts","sourceRoot":"","sources":["../../../framework/lib/Command-Line/NodeArtisanCommand.ts"],"names":[],"mappings":"AACA;;;;MAIM;AACN,eAAO,MAAM,kBAAkB,gBAAgB,KAAK,CAAC,GAAG,CAAC,KAAQ,GA6FhE,CAAC"}
1
+ {"version":3,"file":"NodeArtisanCommand.d.ts","sourceRoot":"","sources":["../../../framework/lib/Command-Line/NodeArtisanCommand.ts"],"names":[],"mappings":"AACA;;;;MAIM;AACN,eAAO,MAAM,kBAAkB,gBAAgB,KAAK,CAAC,GAAG,CAAC,KAAQ,GA4FhE,CAAC"}
@@ -12,12 +12,12 @@ const command_1 = __importDefault(require("./command"));
12
12
  * */
13
13
  const NodeArtisanCommand = (commandArg = []) => {
14
14
  try {
15
+ if (commandArg.includes("migrate") && !commandArg.includes(":")) {
16
+ return command_1.default.runMigration();
17
+ }
15
18
  let index = commandArg.findIndex((arg, index) => arg.includes(":")); //commandArg[0].split(":")[1] || commandArg[1].split(":")[1]; // Extract the command type from the first argument
16
19
  let command = commandArg[index].split(":")[1];
17
20
  // If the command is for creating an API controller with resources
18
- if (command === "migrate") {
19
- return command_1.default.runMigration();
20
- }
21
21
  if (commandArg.length === index + 4 &&
22
22
  (command === "apiController" || command === "ApiController") &&
23
23
  (commandArg[index + 3] === "--resources" ||
@@ -115,14 +115,14 @@ class Command {
115
115
  const migrationPath = `${rootPath}/database/migrations`;
116
116
  const files = fs_1.default.readdirSync(migrationPath);
117
117
  for (const file of files) {
118
- const migrationFile = require(`${migrationPath}/${file}.ts`);
118
+ const migrationFile = require(`${migrationPath}/${file}`);
119
119
  const sql = migrationFile.up();
120
120
  jcc_eloquent_1.DB.runQuery(sql)
121
121
  .then((res) => {
122
- console.log(res);
123
- process.exit();
122
+ console.log(colors_1.default.green("Migrated Successfully"));
124
123
  })
125
- .catch((err) => console.log(err));
124
+ .catch((err) => console.log(err))
125
+ .finally(() => process.exit(0));
126
126
  }
127
127
  }
128
128
  catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jcc-express-mvc",
3
- "version": "1.3.4",
3
+ "version": "1.3.5",
4
4
  "description": "express mvc structure",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",