slnodejs 6.1.1064 → 6.1.1066
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/lib/preload.js +10 -8
- package/package.json +2 -2
package/lib/preload.js
CHANGED
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
const { resolve } = require('node:path');
|
|
2
2
|
const { spawnSync } = require('node:child_process');
|
|
3
|
+
const { LoggerFactory} = require('../tsOutputs/common/logger')
|
|
4
|
+
|
|
5
|
+
const logger = LoggerFactory.getCreateApplicationLogger();
|
|
3
6
|
|
|
4
7
|
function main() {
|
|
5
8
|
if (process.env.PRELOAD_EXECUTED) {
|
|
6
|
-
|
|
9
|
+
logger.info('Skipping preload logic on subsequent entry');
|
|
7
10
|
return;
|
|
8
11
|
}
|
|
9
12
|
|
|
10
13
|
process.env.PRELOAD_EXECUTED = 1;
|
|
11
14
|
|
|
12
15
|
if (require.main === module) {
|
|
13
|
-
|
|
16
|
+
logger.info('preload.js is the main module, exiting.');
|
|
14
17
|
process.exit(0);
|
|
15
18
|
}
|
|
16
19
|
|
|
@@ -41,21 +44,20 @@ function main() {
|
|
|
41
44
|
.filter(x => x); // remove unset arguments
|
|
42
45
|
const processArgs = [pathToSlAgentCli, ...args];
|
|
43
46
|
process.env.NODE_OPTIONS = '';
|
|
44
|
-
process.env.NODE_DEBUG = 'sl';
|
|
45
47
|
|
|
46
48
|
try {
|
|
47
|
-
|
|
49
|
+
logger.info(`Rerun main module with args - ${JSON.stringify(processArgs)}`);
|
|
48
50
|
const result = spawnSync(process.argv[0], processArgs, { stdio: 'inherit', shell: false });
|
|
49
51
|
if (result.error) {
|
|
50
52
|
throw result.error;
|
|
51
53
|
}
|
|
52
54
|
process.exit(result.status);
|
|
53
55
|
} catch (error) {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
+
logger.error('Error occurred while executing the target script:', error);
|
|
57
|
+
logger.info('Run main module with original args - ', originalArgv);
|
|
56
58
|
const result = spawnSync(argv0, originalArgv.split(' '), { stdio: 'inherit', shell: false });
|
|
57
59
|
if (result.error) {
|
|
58
|
-
|
|
60
|
+
logger.error('Error occurred while executing the original script:', result.error);
|
|
59
61
|
process.exit(1);
|
|
60
62
|
}
|
|
61
63
|
process.exit(result.status);
|
|
@@ -63,7 +65,7 @@ function main() {
|
|
|
63
65
|
}
|
|
64
66
|
|
|
65
67
|
process.on('uncaughtException', (error) => {
|
|
66
|
-
|
|
68
|
+
logger.error('Uncaught Exception:', error);
|
|
67
69
|
process.exit(1);
|
|
68
70
|
});
|
|
69
71
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "slnodejs",
|
|
3
|
-
"version": "6.1.
|
|
3
|
+
"version": "6.1.1066",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "tsOutputs/api.js",
|
|
6
6
|
"workspaces": [
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"shell-quote": "1.7.3",
|
|
69
69
|
"sl-convert-source-map": "^1.0.1",
|
|
70
70
|
"sl-esprima-ast-utils": "0.0.7",
|
|
71
|
-
"sl-istanbul-lib-instrument": "6.0.
|
|
71
|
+
"sl-istanbul-lib-instrument": "6.0.7",
|
|
72
72
|
"sl-request": "1.0.5",
|
|
73
73
|
"source-map": "0.6.1",
|
|
74
74
|
"table": "6.7.1",
|