profoundjs 6.0.0-beta.7 → 6.0.0-beta.9

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.
@@ -21,7 +21,10 @@ const path = require("path");
21
21
  const readline = require("readline");
22
22
  const iutils = require("./install_utils.js");
23
23
 
24
- const IBMi = os.type() === "OS400";
24
+ const IBMi = iutils.isIBMi();
25
+
26
+ const RED = "\x1b[31m";
27
+ const RESET = "\x1b[0m";
25
28
 
26
29
  (async () => {
27
30
  try {
@@ -71,15 +74,26 @@ If config.js is already present, installation proceeds silently by default.
71
74
  console.error("Can't find deployment directory.");
72
75
  process.exit(1);
73
76
  }
77
+
78
+ const nodeMajorVersion = Number(process.versions.node.split(".")[0]);
79
+ const gitSupported = ["win32", "darwin", "linux"].includes(os.platform());
80
+
74
81
  const configPath = iutils.getConfigPath();
75
82
  let config = fileExists(configPath) ? require(configPath) : {};
76
83
 
77
84
  let downloadStaticFiles;
78
85
  let svrname, autostart, ccsid, nodePath;
79
86
 
87
+
80
88
  // If config.js doesn't exist, or if --configure is passed, prompt and create/update config.js.
81
89
  if (!fileExists(configPath) || args["configure"] === true) {
82
90
 
91
+ if (gitSupported && nodeMajorVersion >= 18) {
92
+ console.log("");
93
+ console.log(`${RED}WARNING: Git integration not supported on Node.js ${nodeMajorVersion}${RESET}`);
94
+ console.log("");
95
+ }
96
+
83
97
  let staticFilesDirectory, port, gitSupport;
84
98
  let profounduiLibrary, connectorLibrary, connectorIASP;
85
99
 
@@ -109,7 +123,7 @@ If config.js is already present, installation proceeds silently by default.
109
123
  port = Number(await ask("Specify port number for Profound.js server", config.port || 8081, validatePort));
110
124
 
111
125
 
112
- if (["win32", "darwin", "linux"].includes(os.platform())) {
126
+ if (gitSupported && nodeMajorVersion < 18) {
113
127
  let answer = (await ask("Install with Git integration?", config.gitSupport === false ? "n" : "y" , validateYesNo)).toUpperCase();
114
128
  gitSupport = (answer === "Y");
115
129
  }
@@ -266,7 +280,7 @@ If config.js is already present, installation proceeds silently by default.
266
280
  if (downloadStaticFiles) {
267
281
  setupArgs.push("--static-files");
268
282
  }
269
- if (["win32", "darwin", "linux"].includes(os.platform()) && config.gitSupport !== false) {
283
+ if (gitSupported && config.gitSupport !== false && nodeMajorVersion < 18) {
270
284
  setupArgs.push("--nodegit");
271
285
  }
272
286
  if (setupArgs.length === 0) {
package/setup/config.js CHANGED
@@ -15,7 +15,10 @@ module.exports = {
15
15
  {
16
16
  "name": "default",
17
17
  "default": true,
18
- "driver": "IBMi"
18
+ "driver": "IBMi",
19
+ "driverOptions": {
20
+ "SQL_ATTR_COMMIT": "SQL_TXN_NO_COMMIT"
21
+ }
19
22
  }
20
23
  ],
21
24
  "timeout": 3600,
@@ -6,6 +6,7 @@
6
6
  */
7
7
 
8
8
  const fs = require("fs");
9
+ const os = require("os");
9
10
  const path = require("path");
10
11
 
11
12
  exports.getConfigPath = function() {
@@ -121,3 +122,8 @@ exports.validateIBMiName = function(name) {
121
122
  }
122
123
 
123
124
  }
125
+
126
+ exports.isIBMi = function() {
127
+ // Node.js versions < 18 report os.platform() === "aix" on IBM i.
128
+ return (os.platform() === "os400" || (os.platform() === "aix" && os.type() === "OS400"));
129
+ }
@@ -12,10 +12,10 @@
12
12
  "profoundui"
13
13
  ],
14
14
  "engines": {
15
- "node": "^14 || ^16"
15
+ "node": "^14 || ^16 || ^18"
16
16
  },
17
17
  "dependencies": {
18
- "profoundjs": "^6.0.0-beta.7"
18
+ "profoundjs": "^6.0.0-beta.9"
19
19
  },
20
20
  "scripts": {
21
21
  "start": "node start.js"
Binary file
package/setup/setup.js CHANGED
@@ -29,7 +29,7 @@ const path = require("path");
29
29
  const util = require("util");
30
30
  const uuidv4 = require("uuid").v4;
31
31
 
32
- const IBMi = os.type() === "OS400";
32
+ const IBMi = iutils.isIBMi();
33
33
 
34
34
  const RED = "\x1b[31m";
35
35
  const CYAN = "\x1b[36m";
package/setup/start.js CHANGED
@@ -14,11 +14,9 @@ async function startPJS() {
14
14
  process.exit(1);
15
15
  }
16
16
  profoundjs.applyConfig(config);
17
- var isWorker = await profoundjs.server.listen();
18
- if (isWorker) {
19
- var express = profoundjs.server.express;
20
- var app = profoundjs.server.app;
21
- app.use(express.json());
22
- }
17
+ await profoundjs.server.listen();
18
+ var express = profoundjs.server.express;
19
+ var app = profoundjs.server.app;
20
+ app.use(express.json());
23
21
  }
24
22
  startPJS();