mythix 2.4.10 → 2.4.13

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mythix",
3
- "version": "2.4.10",
3
+ "version": "2.4.13",
4
4
  "description": "Mythix is a NodeJS web-app framework",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -30,7 +30,7 @@
30
30
  "express": "^4.17.3",
31
31
  "express-busboy": "github:th317erd/express-busboy#0754a570d7979097b31e48655b80d3fcd628d4e4",
32
32
  "form-data": "^4.0.0",
33
- "mythix-orm": "^1.5.2",
33
+ "mythix-orm": "^1.5.6",
34
34
  "nife": "^1.11.3",
35
35
  "prompts": "^2.4.2"
36
36
  }
@@ -308,7 +308,7 @@ function loadMythixConfig(_mythixConfigPath, _appRootPath) {
308
308
 
309
309
  let defaultConfig = {
310
310
  runtime: process.env.MYTHIX_RUNTIME || 'node',
311
- runtimeArgs: (process.env.MYTHIX_RUNTIME_ARGS || '').split(/\s+/g),
311
+ runtimeArgs: (process.env.MYTHIX_RUNTIME_ARGS || '').split(/\s+/g).filter(Boolean),
312
312
  applicationPath: (config) => Path.resolve(config.appRootPath, 'application.js'),
313
313
  getApplicationClass: (config) => {
314
314
  let Application = require(config.applicationPath);
@@ -347,7 +347,7 @@ function spawnCommand(args, options, _config) {
347
347
  try {
348
348
  let childProcess = spawn(
349
349
  config.runtime || 'node',
350
- (config.runtimeArgs || []).concat(args),
350
+ (config.runtimeArgs || []).concat(args).filter(Boolean),
351
351
  Object.assign({}, options || {}, {
352
352
  env: Object.assign({}, process.env, (options || {}).env || {}),
353
353
  stdio: 'inherit',
@@ -87,7 +87,7 @@ function nodeRequestHandler(routeName, requestOptions) {
87
87
  headers: Utils.cleanObjectProperties(Object.assign(
88
88
  {},
89
89
  headers,
90
- Utils.keysToLowerCase(extraConfig.headers || {})
90
+ Utils.keysToLowerCase(extraConfig.headers || {}),
91
91
  )),
92
92
  },
93
93
  );
@@ -203,7 +203,7 @@ function browserRequestHandler(routeName, requestOptions) {
203
203
  headers: Utils.cleanObjectProperties(Object.assign(
204
204
  {},
205
205
  headers,
206
- Utils.keysToLowerCase(extraConfig.headers || {})
206
+ Utils.keysToLowerCase(extraConfig.headers || {}),
207
207
  )),
208
208
  },
209
209
  );
@@ -114,7 +114,7 @@ class ModelModule extends BaseModule {
114
114
  let application = this.getApplication();
115
115
  let connection = (typeof application.getDBConnection === 'function') ? application.getDBConnection() : null;
116
116
  if (!connection)
117
- return;
117
+ return {};
118
118
 
119
119
  return connection.getModels();
120
120
  }
@@ -55,17 +55,17 @@ class TaskBase {
55
55
  }
56
56
 
57
57
  getModel(name) {
58
- let application = this.application;
58
+ let application = this.getApplication();
59
59
  return application.getModel(name);
60
60
  }
61
61
 
62
62
  getModels() {
63
- let application = this.application;
63
+ let application = this.getApplication();
64
64
  return application.getModels();
65
65
  }
66
66
 
67
67
  getDBConnection() {
68
- let application = this.application;
68
+ let application = this.getApplication();
69
69
  return application.getDBConnection();
70
70
  }
71
71
 
@@ -84,7 +84,7 @@ class TaskModule extends BaseModule {
84
84
  let connection = (typeof application.getDBConnection === 'function') ? application.getDBConnection() : null;
85
85
  let dbConfig = (typeof application.getDBConfig === 'function') ? application.getDBConfig() : null;
86
86
  let tasks = {};
87
- let args = { application: this, connection, dbConfig };
87
+ let args = { application, connection, dbConfig };
88
88
 
89
89
  for (let i = 0, il = taskFiles.length; i < il; i++) {
90
90
  let taskFile = taskFiles[i];
@@ -160,7 +160,7 @@ class TaskModule extends BaseModule {
160
160
  try {
161
161
  if (!TaskKlass.keepAlive || !taskInstance) {
162
162
  logger = createTaskLogger();
163
- taskInstance = new TaskKlass(this, logger, runID, { lastTime, currentTime, diff });
163
+ taskInstance = new TaskKlass(this.getApplication(), logger, runID, { lastTime, currentTime, diff });
164
164
 
165
165
  taskInfo.taskInstance = taskInstance;
166
166