mythix 2.7.4 → 2.8.0

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.7.4",
3
+ "version": "2.8.0",
4
4
  "description": "Mythix is a NodeJS web-app framework",
5
5
  "main": "src/index",
6
6
  "scripts": {
@@ -177,7 +177,7 @@ class Application extends EventEmitter {
177
177
 
178
178
  for (let i = 0, il = modules.length; i < il; i++) {
179
179
  let ModuleClass = modules[i];
180
- if (typeof ModuleClass.shouldUse === 'function' && ModuleClass.shouldUse.call(this, options) === false)
180
+ if (typeof ModuleClass.shouldUse === 'function' && ModuleClass.shouldUse.call(ModuleClass, this, options) === false)
181
181
  continue;
182
182
 
183
183
  let moduleInstance = new ModuleClass(this);
@@ -11,7 +11,7 @@ const {
11
11
  class ControllerModule extends BaseModule {
12
12
  static fileWatcherQueueName = 'controllers';
13
13
 
14
- static shouldUse(options) {
14
+ static shouldUse(application, options) {
15
15
  if (options.httpServer === false)
16
16
  return false;
17
17
 
@@ -5,7 +5,7 @@ const { BaseModule } = require('../modules/base-module');
5
5
  const { HTTPServer } = require('./http-server');
6
6
 
7
7
  class HTTPServerModule extends BaseModule {
8
- static shouldUse(options) {
8
+ static shouldUse(application, options) {
9
9
  if (options.httpServer === false)
10
10
  return false;
11
11
 
@@ -16,7 +16,7 @@ class ModelModule extends BaseModule {
16
16
  return 'ModelModule';
17
17
  }
18
18
 
19
- static shouldUse(options) {
19
+ static shouldUse(application, options) {
20
20
  if (options.database === false)
21
21
  return false;
22
22
 
@@ -11,7 +11,7 @@ export declare class BaseModule {
11
11
  public declare static fileWatcherQueueName: string;
12
12
 
13
13
  public static getModuleName(): string;
14
- public static shouldUse(options?: GenericObject): boolean;
14
+ public static shouldUse(application: Application, options: GenericObject): boolean;
15
15
 
16
16
  public fileWatcherGetMonitorPaths(options?: GenericObject): Array<string>;
17
17
  public fileWatcherHandler(options?: GenericObject): Promise<void>;
@@ -9,7 +9,7 @@ class DatabaseModule extends BaseModule {
9
9
  return 'DatabaseModule';
10
10
  }
11
11
 
12
- static shouldUse(options) {
12
+ static shouldUse(application, options) {
13
13
  if (options.database === false)
14
14
  return false;
15
15
 
@@ -9,7 +9,7 @@ class FileWatcherModule extends BaseModule {
9
9
  return 'FileWatcherModule';
10
10
  }
11
11
 
12
- static shouldUse(options) {
12
+ static shouldUse(application, options) {
13
13
  if (options.autoReload === false)
14
14
  return false;
15
15
 
@@ -23,7 +23,7 @@ class TaskModule extends BaseModule {
23
23
 
24
24
  static fileWatcherQueueName = 'tasks';
25
25
 
26
- static shouldUse(options) {
26
+ static shouldUse(application, options) {
27
27
  if (options.runTasks === false)
28
28
  return false;
29
29