ee-core 2.8.1 → 2.9.0-beta.1

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.
@@ -27,7 +27,13 @@ class SpawnProcess {
27
27
  _init(options = {}) {
28
28
  const { targetConf, port } = options;
29
29
  this.config = targetConf;
30
+
30
31
  this.port = port;
32
+ // 某些程序给它传入不存在的参数时会报错
33
+ if (isNaN(port) && targetConf.port > 0) {
34
+ this.port = targetConf.port;
35
+ }
36
+
31
37
  // 该名称如果在childrenMap重复,会被重写
32
38
  this.name = targetConf.name;
33
39
 
@@ -39,6 +45,9 @@ class SpawnProcess {
39
45
  if (Ps.isPackaged()) {
40
46
  standardOutput = ['ignore', 'ignore', 'ignore', 'ipc'];
41
47
  }
48
+ if (targetConf.stdio) {
49
+ standardOutput = targetConf.stdio;
50
+ }
42
51
 
43
52
  const { cmd, directory } = targetConf;
44
53
  // use cmd first
package/ee/eeApp.js CHANGED
@@ -190,6 +190,9 @@ class EeApp extends BaseApp {
190
190
  }
191
191
 
192
192
  // 主进程
193
+ if (mainServer.protocol == "") {
194
+ return
195
+ }
193
196
  if (Conf.isFileProtocol(mainServer)) {
194
197
  url = path.join(this.config.homeDir, mainServer.indexPath);
195
198
  this.loadMainUrl('spa', url, 'file');
@@ -220,7 +223,8 @@ class EeApp extends BaseApp {
220
223
  throw new Error(`[ee-core] Please Check the value of cross.${service} enable is true !`);
221
224
  }
222
225
 
223
- const url = Cross.getUrl(service);
226
+ const entityName = crossConfig[service].name;
227
+ const url = Cross.getUrl(entityName);
224
228
 
225
229
  let count = 0;
226
230
  let serviceReady = false;
@@ -324,7 +328,7 @@ class EeApp extends BaseApp {
324
328
  * loading page
325
329
  */
326
330
  _loadingPage(name) {
327
- if (!fs.existsSync(name)) {
331
+ if (!UtilsHelper.fileIsExist(name)) {
328
332
  return
329
333
  }
330
334
 
package/html/index.js ADDED
@@ -0,0 +1,14 @@
1
+ const path = require('path');
2
+
3
+ /**
4
+ * Html
5
+ */
6
+ const Html = {
7
+ getFilepath(name){
8
+ const pagePath = path.join(__dirname, name);
9
+ return pagePath;
10
+ },
11
+
12
+ }
13
+
14
+ module.exports = Html;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ee-core",
3
- "version": "2.8.1",
3
+ "version": "2.9.0-beta.1",
4
4
  "description": "ee core",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/utils/helper.js CHANGED
@@ -211,4 +211,11 @@ exports.getValueFromArgv = function(argv, key) {
211
211
  }
212
212
 
213
213
  return value;
214
+ };
215
+
216
+ exports.fileIsExist = function(filepath) {
217
+ if (fs.existsSync(filepath) && fs.statSync(filepath).isFile()) {
218
+ return true;
219
+ }
220
+ return false;
214
221
  };