ee-core 2.2.0-beta.3 → 2.2.0-beta.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.
package/core/lib/ee.js CHANGED
@@ -21,8 +21,8 @@ class EeCore extends KoaApplication {
21
21
  options.type = options.type || 'application';
22
22
 
23
23
  assert(typeof options.baseDir === 'string', 'options.baseDir required, and must be a string');
24
- assert(fs.existsSync(options.baseDir), `Directory ${options.baseDir} not exists`);
25
- assert(fs.statSync(options.baseDir).isDirectory(), `Directory ${options.baseDir} is not a directory`);
24
+ // assert(fs.existsSync(options.baseDir), `Directory ${options.baseDir} not exists`);
25
+ // assert(fs.statSync(options.baseDir).isDirectory(), `Directory ${options.baseDir} is not a directory`);
26
26
 
27
27
  super();
28
28
 
@@ -25,7 +25,7 @@ class EeLoader {
25
25
  */
26
26
  constructor(options) {
27
27
  this.options = options;
28
- assert(fs.existsSync(this.options.baseDir), `${this.options.baseDir} not exists`);
28
+ // assert(fs.existsSync(this.options.baseDir), `${this.options.baseDir} not exists`);
29
29
  assert(this.options.app, 'options.app is required');
30
30
  assert(this.options.logger, 'options.logger is required');
31
31
 
@@ -47,7 +47,7 @@ module.exports = {
47
47
  const controllerBase = opt.directory;
48
48
 
49
49
  this.loadToApp(controllerBase, 'controller', opt);
50
- this.options.logger.info('[ee-core] [core/.../controller] loaded: %s', controllerBase);
50
+ //this.options.logger.info('[ee-core] [core/.../controller] loaded: %s', controllerBase);
51
51
  this.timing.end('Load Controller');
52
52
  },
53
53
 
package/ee/application.js CHANGED
@@ -11,6 +11,10 @@ class Appliaction extends EeApp {
11
11
  constructor() {
12
12
  Exception.start();
13
13
  const { env } = process;
14
+
15
+ // initialize mode
16
+ Ps.initMode();
17
+
14
18
  let options = {
15
19
  env: 'prod',
16
20
  serverScope: '',
package/main/index.js CHANGED
@@ -21,7 +21,7 @@ class ElectronEgg {
21
21
  if (!Ps.verifyMode(this.mode)) {
22
22
  throw new Error(`The mode supports only (framework | module) !`);
23
23
  }
24
- process.env.EE_MODE = this.mode;
24
+ Ps.initMode(this.mode);
25
25
 
26
26
  // module mode
27
27
  if (Ps.isModuleMode()) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ee-core",
3
- "version": "2.2.0-beta.3",
3
+ "version": "2.2.0-beta.5",
4
4
  "description": "ee core",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/ps/index.js CHANGED
@@ -1,6 +1,14 @@
1
1
  const path = require('path');
2
2
  const eis = require('../utils/is');
3
3
 
4
+ /**
5
+ * 初始化模式
6
+ */
7
+ exports.initMode = function(mode) {
8
+ // process.env.EE_MODE === undefined
9
+ return process.env.EE_MODE = mode ? mode : 'framework';
10
+ }
11
+
4
12
  /**
5
13
  * 当前模式 - framework | module
6
14
  */