not-node 6.3.76 → 6.3.78
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 +1 -1
- package/src/domain.js +15 -0
- package/src/init/lib/app.js +3 -3
- package/test/init/app.js +13 -0
package/package.json
CHANGED
package/src/domain.js
CHANGED
|
@@ -326,6 +326,21 @@ class notDomain extends EventEmitter {
|
|
|
326
326
|
return this;
|
|
327
327
|
}
|
|
328
328
|
|
|
329
|
+
warn() {
|
|
330
|
+
this.logger.warn(...arguments);
|
|
331
|
+
return this;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
error() {
|
|
335
|
+
this.logger.error(...arguments);
|
|
336
|
+
return this;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
debug() {
|
|
340
|
+
this.logger.debug(...arguments);
|
|
341
|
+
return this;
|
|
342
|
+
}
|
|
343
|
+
|
|
329
344
|
/**
|
|
330
345
|
* reporter - errors
|
|
331
346
|
*/
|
package/src/init/lib/app.js
CHANGED
|
@@ -38,10 +38,10 @@ module.exports = class InitApp {
|
|
|
38
38
|
|
|
39
39
|
static async importModules({ config, options, master, emit }) {
|
|
40
40
|
await emit("app.importModules.pre", { config, options, master });
|
|
41
|
-
master.getApp().importModulesFrom(
|
|
41
|
+
master.getApp().importModulesFrom(master.getEnv("modulesPath"));
|
|
42
42
|
if (Array.isArray(config.get("importModulesFromNPM"))) {
|
|
43
43
|
config.get("importModulesFromNPM").forEach((modName) => {
|
|
44
|
-
const modPath = path.join(
|
|
44
|
+
const modPath = path.join(master.getEnv("npmPath"), modName);
|
|
45
45
|
master.getApp().importModuleFrom(modPath, modName);
|
|
46
46
|
});
|
|
47
47
|
}
|
|
@@ -69,7 +69,7 @@ module.exports = class InitApp {
|
|
|
69
69
|
await InitApp.setAppEnvs({ config, options, master, emit });
|
|
70
70
|
await InitApp.initCore({ config, options, master, emit });
|
|
71
71
|
await InitApp.importModules({ config, options, master, emit });
|
|
72
|
-
await InitApp.createReporter({ config,
|
|
72
|
+
await InitApp.createReporter({ config, master });
|
|
73
73
|
await emit("app.post", { config, options, master });
|
|
74
74
|
} catch (e) {
|
|
75
75
|
master.throwError(e.message, 1);
|
package/test/init/app.js
CHANGED
|
@@ -205,6 +205,9 @@ module.exports = ({ expect }) => {
|
|
|
205
205
|
getManifest() {
|
|
206
206
|
return fakeManifest;
|
|
207
207
|
},
|
|
208
|
+
getEnv(name) {
|
|
209
|
+
return `${name}_fake`;
|
|
210
|
+
},
|
|
208
211
|
};
|
|
209
212
|
|
|
210
213
|
await InitApp.importModules({
|
|
@@ -256,6 +259,9 @@ module.exports = ({ expect }) => {
|
|
|
256
259
|
getManifest() {
|
|
257
260
|
return fakeManifest;
|
|
258
261
|
},
|
|
262
|
+
getEnv(name) {
|
|
263
|
+
return `${name}_fake`;
|
|
264
|
+
},
|
|
259
265
|
};
|
|
260
266
|
await InitApp.importModules({
|
|
261
267
|
master,
|
|
@@ -400,6 +406,13 @@ module.exports = ({ expect }) => {
|
|
|
400
406
|
};
|
|
401
407
|
const master = {
|
|
402
408
|
setEnv() {},
|
|
409
|
+
getEnv: (str) => {
|
|
410
|
+
if (str === "importModulesFromNPM") {
|
|
411
|
+
return ["fakeMod", "fakeMod2"];
|
|
412
|
+
} else {
|
|
413
|
+
return str + "_fake";
|
|
414
|
+
}
|
|
415
|
+
},
|
|
403
416
|
setApp(app) {
|
|
404
417
|
expect(app).to.be.instanceof(FakeApp);
|
|
405
418
|
},
|