not-node 6.3.74 → 6.3.75

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "not-node",
3
- "version": "6.3.74",
3
+ "version": "6.3.75",
4
4
  "description": "node complimentary part for client side notFramework.",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/src/env.js CHANGED
@@ -5,6 +5,7 @@ const ENVS = {
5
5
  };
6
6
 
7
7
  module.exports = class notEnv {
8
+ static LOG_STRING_ASSIGNMENTS = true;
8
9
  /**
9
10
  * Obsolete!
10
11
  * Wrapper for 'get'
@@ -52,6 +53,9 @@ module.exports = class notEnv {
52
53
  * @return {notEnv} chainable
53
54
  */
54
55
  static set(key, val) {
56
+ if (notEnv.LOG_STRING_ASSIGNMENTS && typeof val === "string") {
57
+ console.log("ENV SET ", key, " = ", val);
58
+ }
55
59
  ENVS[key] = val;
56
60
  return notEnv;
57
61
  }
@@ -3,7 +3,7 @@ const ENV = process.env.NODE_ENV || "development";
3
3
  const path = require("path");
4
4
  const logger = require("not-log");
5
5
  const log = logger(module, "not-node//init//app");
6
- const { notErrorReporter } = require("not-error");
6
+ const { notErrorReporter } = require("not-error/src/index.cjs");
7
7
 
8
8
  const CONST_CORE_PATH = path.join(__dirname, "../../core");
9
9
 
@@ -21,23 +21,7 @@ module.exports = class InitApp {
21
21
 
22
22
  static async setAppEnvs({ config, options, master, emit }) {
23
23
  await emit("app.setEnv.pre", { config, options, master });
24
- master.setEnv("validationEnv", options.validationEnv);
25
- master.setEnv("hostname", config.get("hostname"));
26
- master.setEnv("server", `https://` + config.get("host"));
27
- master.setEnv(
28
- "appPath",
29
- master.getAbsolutePath(config.get("path.app"))
30
- );
31
- master.setEnv(
32
- "dbDumpsPath",
33
- master.getAbsolutePath(config.get("path.dbDumps"))
34
- );
35
- master.setEnv(
36
- "tmpPath",
37
- master.getAbsolutePath(config.get("path.tmp"))
38
- );
39
24
  master.setEnv("name", master.getManifest().name);
40
- master.setEnv("fullServerName", config.get("fullServerName"));
41
25
  master.setEnv(
42
26
  "rolesPriority",
43
27
  master.getManifest().targets.server.roles
@@ -97,6 +97,10 @@ module.exports = class InitENV {
97
97
  log?.info("Setting up server environment variables...");
98
98
  await emit("env.pre", { config, options, master });
99
99
 
100
+ master.setEnv("validationEnv", options.validationEnv);
101
+ master.setEnv("hostname", config.get("hostname"));
102
+ master.setEnv("server", `https://` + config.get("host"));
103
+
100
104
  InitENV.initFromTemplate({ config, master });
101
105
 
102
106
  config.set(
package/test/init/env.js CHANGED
@@ -78,6 +78,7 @@ module.exports = ({ expect }) => {
78
78
  getAbsolutePath(str) {
79
79
  return str + "_fake_absolute";
80
80
  },
81
+ setEnv() {},
81
82
  };
82
83
  const options = {
83
84
  pathToApp: "pathToApp__fake",
@@ -108,6 +109,7 @@ module.exports = ({ expect }) => {
108
109
  getAbsolutePath(str) {
109
110
  return str + "_fake_absolute";
110
111
  },
112
+ setEnv() {},
111
113
  };
112
114
  const options = {
113
115
  pathToApp: "pathToApp__fake",