@nsshunt/stsrunnerframework 2.0.4 → 2.0.5
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.
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
(function(global, factory) {
|
|
2
|
-
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("@nsshunt/stsutils"), require("@nsshunt/stsobservability")) : typeof define === "function" && define.amd ? define([
|
|
2
|
+
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("detect-node"), require("@nsshunt/stsutils"), require("@nsshunt/stsobservability")) : typeof define === "function" && define.amd ? define([
|
|
3
3
|
"exports",
|
|
4
|
+
"detect-node",
|
|
4
5
|
"@nsshunt/stsutils",
|
|
5
6
|
"@nsshunt/stsobservability"
|
|
6
|
-
], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global["@nsshunt/stsrunnerframework"] = {}, global._nsshunt_stsutils, global._nsshunt_stsobservability));
|
|
7
|
-
})(this, function(exports, _nsshunt_stsutils, _nsshunt_stsobservability) {
|
|
7
|
+
], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global["@nsshunt/stsrunnerframework"] = {}, global.detect_node, global._nsshunt_stsutils, global._nsshunt_stsobservability));
|
|
8
|
+
})(this, function(exports, detect_node, _nsshunt_stsutils, _nsshunt_stsobservability) {
|
|
8
9
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
9
10
|
//#region \0rolldown/runtime.js
|
|
10
11
|
var __create = Object.create;
|
|
@@ -29,6 +30,7 @@
|
|
|
29
30
|
enumerable: true
|
|
30
31
|
}) : target, mod));
|
|
31
32
|
//#endregion
|
|
33
|
+
detect_node = __toESM(detect_node);
|
|
32
34
|
//#region src/commonTypes.ts
|
|
33
35
|
/**
|
|
34
36
|
* Inter-Worker (IW) message commands.
|
|
@@ -95,11 +97,6 @@
|
|
|
95
97
|
ExecuteRefreshTokenResponse: "__ExecuteRefreshTokenResponse"
|
|
96
98
|
};
|
|
97
99
|
//#endregion
|
|
98
|
-
//#region node_modules/detect-node/browser.js
|
|
99
|
-
var require_browser$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
100
|
-
module.exports = false;
|
|
101
|
-
}));
|
|
102
|
-
//#endregion
|
|
103
100
|
//#region node_modules/color-name/index.js
|
|
104
101
|
var require_color_name = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
105
102
|
module.exports = {
|
|
@@ -2003,8 +2000,8 @@
|
|
|
2003
2000
|
};
|
|
2004
2001
|
}));
|
|
2005
2002
|
//#endregion
|
|
2006
|
-
//#region
|
|
2007
|
-
var
|
|
2003
|
+
//#region src/abstractRunnerExecutionWorker.ts
|
|
2004
|
+
var import_source = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2008
2005
|
var ansiStyles = require_ansi_styles();
|
|
2009
2006
|
var { stdout: stdoutColor, stderr: stderrColor } = require_browser();
|
|
2010
2007
|
var { stringReplaceAll, stringEncaseCRLFWithFirstIndex } = require_util();
|
|
@@ -2148,11 +2145,7 @@
|
|
|
2148
2145
|
chalk.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
2149
2146
|
chalk.stderr.supportsColor = stderrColor;
|
|
2150
2147
|
module.exports = chalk;
|
|
2151
|
-
}));
|
|
2152
|
-
//#endregion
|
|
2153
|
-
//#region src/abstractRunnerExecutionWorker.ts
|
|
2154
|
-
var import_browser = /* @__PURE__ */ __toESM(require_browser$1());
|
|
2155
|
-
var import_source = /* @__PURE__ */ __toESM(require_source());
|
|
2148
|
+
})))());
|
|
2156
2149
|
import_source.default.level = 3;
|
|
2157
2150
|
/**
|
|
2158
2151
|
* Abstract worker-runtime base class.
|
|
@@ -2299,7 +2292,7 @@
|
|
|
2299
2292
|
this.#debug(import_source.default.grey(`WorkerInstance:#processLoopExecutor(): Removing runners from collection: [${removeList}]`));
|
|
2300
2293
|
for (let i = 0; i < removeList.length; i++) {
|
|
2301
2294
|
this.#runners[removeList[i]].archived = true;
|
|
2302
|
-
if (this.#archiveDeleteTimeout !== 0) if (
|
|
2295
|
+
if (this.#archiveDeleteTimeout !== 0) if (detect_node.default) setTimeout(() => delete this.#runners[removeList[i]], this.#archiveDeleteTimeout * 1e3).unref();
|
|
2303
2296
|
else setTimeout(() => delete this.#runners[removeList[i]], this.#archiveDeleteTimeout * 1e3);
|
|
2304
2297
|
}
|
|
2305
2298
|
const message = `WorkerInstance:#processLoopExecutor(): Remaining Runner Count: [${Object.keys(this.#runners).length}]`;
|
|
@@ -2372,7 +2365,7 @@
|
|
|
2372
2365
|
#SetMessagePort = (workerMessagePort) => {
|
|
2373
2366
|
try {
|
|
2374
2367
|
this.#collectorCollectorPort = workerMessagePort.port;
|
|
2375
|
-
if (
|
|
2368
|
+
if (detect_node.default) this.#collectorCollectorPort.on("message", (data) => {
|
|
2376
2369
|
this.#silly(`collectorCollectorPort on('message'): ${JSON.stringify(data)}`);
|
|
2377
2370
|
});
|
|
2378
2371
|
else this.#collectorCollectorPort.addEventListener("message", (data) => {
|
|
@@ -4890,7 +4883,7 @@
|
|
|
4890
4883
|
* @param cb Callback used to handle unsolicited inbound messages.
|
|
4891
4884
|
*/
|
|
4892
4885
|
SetupMessagePortListener = (stsWorkerEx, cb) => {
|
|
4893
|
-
if (
|
|
4886
|
+
if (detect_node.default) stsWorkerEx.messagePort.on("message", (data) => {
|
|
4894
4887
|
this._processInboundMessage(data, cb);
|
|
4895
4888
|
});
|
|
4896
4889
|
else stsWorkerEx.messagePort.addEventListener("message", (data) => {
|
|
@@ -5121,7 +5114,7 @@
|
|
|
5121
5114
|
*/
|
|
5122
5115
|
GetPorts = () => {
|
|
5123
5116
|
const { port1, port2 } = new MessageChannel();
|
|
5124
|
-
if (!
|
|
5117
|
+
if (!detect_node.default) port1.start();
|
|
5125
5118
|
return {
|
|
5126
5119
|
port1,
|
|
5127
5120
|
port2
|
|
@@ -5746,7 +5739,7 @@ ${runnerId}`,
|
|
|
5746
5739
|
/**
|
|
5747
5740
|
* In Node.js, unref the timer so it does not keep the process alive.
|
|
5748
5741
|
*/
|
|
5749
|
-
this.archiveDelTimeout.unref();
|
|
5742
|
+
if (detect_node.default) this.archiveDelTimeout.unref();
|
|
5750
5743
|
}
|
|
5751
5744
|
}
|
|
5752
5745
|
}
|
|
@@ -5762,15 +5755,15 @@ ${runnerId}`,
|
|
|
5762
5755
|
* Schedule the next archive scan.
|
|
5763
5756
|
*/
|
|
5764
5757
|
this.timeout = setTimeout(() => this.ProcessLoopExecutor(), 1e3);
|
|
5765
|
-
if (
|
|
5758
|
+
if (detect_node.default) this.timeout.unref();
|
|
5766
5759
|
}, 100);
|
|
5767
|
-
if (
|
|
5760
|
+
if (detect_node.default) startTimeout.unref();
|
|
5768
5761
|
} else {
|
|
5769
5762
|
/**
|
|
5770
5763
|
* No archive candidates found; just schedule the next scan.
|
|
5771
5764
|
*/
|
|
5772
5765
|
this.timeout = setTimeout(() => this.ProcessLoopExecutor(), 1e3);
|
|
5773
|
-
if (
|
|
5766
|
+
if (detect_node.default) this.timeout.unref();
|
|
5774
5767
|
}
|
|
5775
5768
|
} catch (error) {
|
|
5776
5769
|
this.options.logger.error(`_processLoopExecutor(): Error: [${error}]`);
|
|
@@ -6400,7 +6393,7 @@ ${runnerId}`,
|
|
|
6400
6393
|
* @param stsWorkerEx Manager-side worker instance whose underlying actual worker should be monitored.
|
|
6401
6394
|
*/
|
|
6402
6395
|
SetupWorkerSystemEvents = (stsWorkerEx) => {
|
|
6403
|
-
if (
|
|
6396
|
+
if (detect_node.default) {
|
|
6404
6397
|
/**
|
|
6405
6398
|
* Node.js worker thread exit event.
|
|
6406
6399
|
*
|