mythix 2.7.2 → 2.7.4
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 +2 -2
- package/src/application.d.ts +3 -2
- package/src/application.js +2 -1
- package/src/cli/cli-utils.js +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mythix",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.4",
|
|
4
4
|
"description": "Mythix is a NodeJS web-app framework",
|
|
5
5
|
"main": "src/index",
|
|
6
6
|
"scripts": {
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"form-data": "^4.0.0",
|
|
36
36
|
"luxon": "^3.0.4",
|
|
37
37
|
"micromatch": "^4.0.5",
|
|
38
|
-
"mythix-orm": "^1.8.
|
|
38
|
+
"mythix-orm": "^1.8.2",
|
|
39
39
|
"nife": "^1.12.1",
|
|
40
40
|
"prompts": "^2.4.2"
|
|
41
41
|
}
|
package/src/application.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { Modules, ModuleClasses, BaseModuleClass } from './modules/base-module';
|
|
|
8
8
|
export declare type ApplicationClass = typeof Application;
|
|
9
9
|
|
|
10
10
|
export declare interface ApplicationOptions {
|
|
11
|
+
cli: boolean;
|
|
11
12
|
environment: string;
|
|
12
13
|
appName: string;
|
|
13
14
|
rootPath: string;
|
|
@@ -29,7 +30,7 @@ export declare interface ApplicationOptions {
|
|
|
29
30
|
database: boolean | GenericObject;
|
|
30
31
|
httpServer: boolean | GenericObject;
|
|
31
32
|
tempPath: string;
|
|
32
|
-
routeParserTypes: { [
|
|
33
|
+
routeParserTypes: { [key: string]: (value: string, param: GenericObject, index?: number) => any };
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
export declare class Application {
|
|
@@ -54,7 +55,7 @@ export declare class Application {
|
|
|
54
55
|
public setConfig(options: GenericObject): Application;
|
|
55
56
|
public getApplicationName(): string;
|
|
56
57
|
public getRoutes(): GenericObject;
|
|
57
|
-
public getCustomRouteParserTypes(): { [
|
|
58
|
+
public getCustomRouteParserTypes(): { [key: string]: (value: string, param: GenericObject, index?: number) => any };
|
|
58
59
|
public createLogger(loggerOptions: LoggerOptions, LoggerClass: LoggerClass): Logger;
|
|
59
60
|
public getLogger(): Logger;
|
|
60
61
|
public start(): Promise<void>;
|
package/src/application.js
CHANGED
|
@@ -81,7 +81,6 @@ class Application extends EventEmitter {
|
|
|
81
81
|
templatesPath: Path.resolve(ROOT_PATH, 'templates'),
|
|
82
82
|
commandsPath: Path.resolve(ROOT_PATH, 'commands'),
|
|
83
83
|
tasksPath: Path.resolve(ROOT_PATH, 'tasks'),
|
|
84
|
-
modules: this.constructor.getDefaultModules(),
|
|
85
84
|
autoReload: ((_opts && _opts.environment) || process.env.NODE_ENV || 'development') === 'development',
|
|
86
85
|
exitOnShutdown: null,
|
|
87
86
|
runTasks: true,
|
|
@@ -149,6 +148,8 @@ class Application extends EventEmitter {
|
|
|
149
148
|
|
|
150
149
|
if (Nife.isEmpty(opts.tempPath))
|
|
151
150
|
opts.tempPath = Path.resolve(OS.tmpdir(), this.getApplicationName().replace(/[^\w-]/g, ''), ('' + process.pid));
|
|
151
|
+
|
|
152
|
+
opts.modules = this.constructor.getDefaultModules(this, opts);
|
|
152
153
|
}
|
|
153
154
|
|
|
154
155
|
getApplicationName() {
|
package/src/cli/cli-utils.js
CHANGED
|
@@ -250,10 +250,10 @@ function defineCommand(_commandName, definer, _parent) {
|
|
|
250
250
|
if (typeof applicationConfig === 'function')
|
|
251
251
|
applicationConfig = applicationConfig(config, Application);
|
|
252
252
|
else if (applicationConfig)
|
|
253
|
-
applicationConfig = Nife.extend(true, { httpServer: false, autoReload: false, logger: { level: Logger.LEVEL_WARN }, runTasks: false }, applicationConfig);
|
|
253
|
+
applicationConfig = Nife.extend(true, { cli: true, httpServer: false, autoReload: false, logger: { level: Logger.LEVEL_WARN }, runTasks: false }, applicationConfig);
|
|
254
254
|
|
|
255
255
|
if (!applicationConfig)
|
|
256
|
-
applicationConfig = {
|
|
256
|
+
applicationConfig = { cli: true, ttpServer: false, autoReload: false, logger: { level: Logger.LEVEL_WARN }, runTasks: false };
|
|
257
257
|
|
|
258
258
|
let doStartApplication = (applicationConfig.autoStart !== false);
|
|
259
259
|
|