ee-core 2.11.0-beta.1 → 2.11.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.
@@ -210,8 +210,11 @@ class FileLoader {
210
210
  for (const addonName of addonpaths) {
211
211
  if (filterAddons.includes(addonName)) continue;
212
212
 
213
- let fullpath = path.join(directory, addonName, 'index');
214
- fullpath = loader.resolveModule(fullpath);
213
+ const filepath = path.join(directory, addonName, 'index');
214
+ const fullpath = loader.resolveModule(filepath);
215
+ if (!fs.existsSync(fullpath)) {
216
+ throw new Error(`The ${filepath} file does not exist`);
217
+ }
215
218
  if (!fs.statSync(fullpath).isFile()) continue;
216
219
 
217
220
  let exports = getExports(fullpath, this.options, addonName);
package/loader/index.js CHANGED
@@ -24,7 +24,6 @@ module.exports = {
24
24
  filepath = filepath && this.resolveModule(filepath);
25
25
  if (!fs.existsSync(filepath)) {
26
26
  let errorMsg = `[ee-core] [loader/index] loadOneFile ${filepath} does not exist`;
27
- Log.coreLogger.error(errorMsg);
28
27
  throw new Error(errorMsg);
29
28
  }
30
29
 
@@ -45,8 +44,7 @@ module.exports = {
45
44
  loadJsFile (filepath) {
46
45
  if (!fs.existsSync(filepath)) {
47
46
  let errMsg = `[ee-core] [loader] loadJobFile ${filepath} does not exist`;
48
- Log.coreLogger.error(errMsg);
49
- return;
47
+ throw new Error(errMsg);
50
48
  }
51
49
 
52
50
  const ret = UtilsCore.loadFile(filepath);
@@ -64,8 +62,7 @@ module.exports = {
64
62
  execJsFile (filepath, ...inject) {
65
63
  if (!fs.existsSync(filepath)) {
66
64
  let errMsg = `[ee-core] [loader] loadJobFile ${filepath} does not exist`;
67
- Log.coreLogger.error(errMsg);
68
- return;
65
+ throw new Error(errMsg);
69
66
  }
70
67
 
71
68
  let ret = UtilsCore.loadFile(filepath);
@@ -97,7 +94,7 @@ module.exports = {
97
94
 
98
95
  if (!fs.existsSync(filepath) && !fs.existsSync(fullpath)) {
99
96
  let files = { filepath, fullpath }
100
- Log.coreLogger.warn(`[ee-core] [loader] resolveModule unknow filepath: ${files}`)
97
+ console.warn(`[ee-core] [loader] resolveModule unknow filepath: ${files}`)
101
98
  return undefined;
102
99
  }
103
100
  }
@@ -122,7 +119,7 @@ module.exports = {
122
119
  fullpath = this.resolveModule(filepath);
123
120
  if (!fs.existsSync(fullpath)) {
124
121
  let errorMsg = `[ee-core] [loader] requireModule filepath: ${filepath} does not exist`;
125
- Log.coreLogger.error(errorMsg);
122
+ throw new Error(errorMsg);
126
123
  }
127
124
  const ret = UtilsCore.loadFile(fullpath);
128
125
 
package/main/index.js CHANGED
@@ -43,13 +43,13 @@ class ElectronEgg {
43
43
  baseDir = Ps.getEncryptDir(app.getAppPath());
44
44
  }
45
45
 
46
- let indexFile = path.join(baseDir, 'index');
47
- indexFile = Loader.resolveModule(indexFile);
48
- if (!fs.existsSync(indexFile)) {
46
+ const indexFile = path.join(baseDir, 'index');
47
+ const indexModulePath = Loader.resolveModule(indexFile);
48
+ if (!fs.existsSync(indexModulePath)) {
49
49
  throw new Error(`The ${indexFile} file does not exist`);
50
50
  }
51
51
 
52
- const EEApp = UtilsCore.loadFile(indexFile);
52
+ const EEApp = UtilsCore.loadFile(indexModulePath);
53
53
  EE.app = new EEApp();
54
54
  }
55
55
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ee-core",
3
- "version": "2.11.0-beta.1",
3
+ "version": "2.11.1",
4
4
  "description": "ee core",
5
5
  "main": "index.js",
6
6
  "scripts": {