@coherentglobal/wasm-runner 0.1.19 → 0.3.2
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/README.md +16 -0
- package/dist/CancellationToken.js +2 -0
- package/dist/CancellationToken.js.map +1 -1
- package/dist/browser/logger.js +6 -2
- package/dist/browser/logger.js.map +1 -1
- package/dist/browser/template/worker.template.js +113 -105
- package/dist/browser/template/worker.template.js.map +1 -1
- package/dist/browser/template.js +1 -1
- package/dist/browser.d.ts +10 -3
- package/dist/browser.js +255 -257
- package/dist/browser.js.map +1 -1
- package/dist/constants.d.ts +1 -0
- package/dist/constants.js +2 -0
- package/dist/constants.js.map +1 -1
- package/dist/defaultExternalResolver.js +6 -15
- package/dist/defaultExternalResolver.js.map +1 -1
- package/dist/error.js +10 -2
- package/dist/error.js.map +1 -1
- package/dist/node/logger.d.ts +2 -1
- package/dist/node/logger.js +1 -1
- package/dist/node/logger.js.map +1 -1
- package/dist/node/logger.ts +1 -1
- package/dist/node/mockLogger.d.ts +2 -1
- package/dist/node/template/main.template.ejs +60 -29
- package/dist/node/threads/mockWorkerThread.d.ts +1 -0
- package/dist/node/threads/mockWorkerThread.js +10 -3
- package/dist/node/threads/mockWorkerThread.js.map +1 -1
- package/dist/node/threads/workerPool.d.ts +2 -1
- package/dist/node/threads/workerPool.js +7 -6
- package/dist/node/threads/workerPool.js.map +1 -1
- package/dist/node/threads/workerPool.ts +10 -7
- package/dist/node/threads/workerThread.d.ts +1 -2
- package/dist/node/threads/workerThread.js +35 -42
- package/dist/node/threads/workerThread.js.map +1 -1
- package/dist/node/threads/workerThread.ts +8 -12
- package/dist/node.d.ts +26 -8
- package/dist/node.js +596 -437
- package/dist/node.js.map +1 -1
- package/dist/responseTimeMetric.d.ts +7 -3
- package/dist/responseTimeMetric.js +131 -28
- package/dist/responseTimeMetric.js.map +1 -1
- package/dist/serializer/columnarSerializer.d.ts +11 -3
- package/dist/serializer/columnarSerializer.js +49 -29
- package/dist/serializer/columnarSerializer.js.map +1 -1
- package/dist/types.d.ts +4 -1
- package/dist/types.js.map +1 -1
- package/dist/utils.d.ts +3 -2
- package/dist/utils.js +38 -48
- package/dist/utils.js.map +1 -1
- package/package.json +70 -59
package/dist/utils.js
CHANGED
|
@@ -1,18 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
4
|
};
|
|
14
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.isEmpty = exports.ENVIRONMENT_IS_NODE = exports.ENVIRONMENT_IS_WEB = void 0;
|
|
6
|
+
exports.formatMemory = exports.isEmpty = exports.ENVIRONMENT_IS_NODE = exports.ENVIRONMENT_IS_WEB = void 0;
|
|
16
7
|
exports.isPath = isPath;
|
|
17
8
|
exports.isHttpURL = isHttpURL;
|
|
18
9
|
exports.isFilePath = isFilePath;
|
|
@@ -27,40 +18,42 @@ exports.last = last;
|
|
|
27
18
|
exports.isV3Input = isV3Input;
|
|
28
19
|
exports.getSafeJSONObject = getSafeJSONObject;
|
|
29
20
|
exports.getSafeJSONString = getSafeJSONString;
|
|
30
|
-
exports.
|
|
31
|
-
const fs_1 = __importDefault(require("fs"));
|
|
32
|
-
const url_1 = __importDefault(require("url"));
|
|
21
|
+
exports.isNumber = isNumber;
|
|
33
22
|
const error_1 = __importDefault(require("./error"));
|
|
34
23
|
exports.ENVIRONMENT_IS_WEB = typeof window === "object";
|
|
35
24
|
exports.ENVIRONMENT_IS_NODE = typeof process === "object" &&
|
|
36
25
|
typeof process.versions === "object" &&
|
|
37
26
|
typeof process.versions.node === "string";
|
|
38
|
-
function isPath(str) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
27
|
+
async function isPath(str) {
|
|
28
|
+
// In browser environment, this always returns false
|
|
29
|
+
if (exports.ENVIRONMENT_IS_WEB) {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
// For Node.js environment only
|
|
33
|
+
// This check prevents webpack from trying to bundle fs in browser builds
|
|
34
|
+
if (typeof require === "undefined") {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
try {
|
|
38
|
+
// Use eval to prevent webpack from statically analyzing this require
|
|
39
|
+
const fs = eval("require")("fs");
|
|
40
|
+
const stats = await fs.promises.stat(str);
|
|
41
|
+
return stats.isFile();
|
|
42
|
+
}
|
|
43
|
+
catch (_err) {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
48
46
|
}
|
|
49
47
|
/* istanbul ignore next */
|
|
50
48
|
function isHttpURL(str) {
|
|
51
|
-
let urlInstance;
|
|
52
49
|
try {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
if (exports.ENVIRONMENT_IS_WEB) {
|
|
57
|
-
urlInstance = new URL(str);
|
|
58
|
-
}
|
|
50
|
+
// Both Node.js and browser support URL constructor
|
|
51
|
+
const urlInstance = new URL(str);
|
|
52
|
+
return (urlInstance.protocol === "http:" || urlInstance.protocol === "https:");
|
|
59
53
|
}
|
|
60
|
-
catch (
|
|
54
|
+
catch (_err) {
|
|
61
55
|
return false;
|
|
62
56
|
}
|
|
63
|
-
return urlInstance.protocol === "http:" || urlInstance.protocol === "https:";
|
|
64
57
|
}
|
|
65
58
|
/* istanbul ignore next */
|
|
66
59
|
function isFilePath(str, ext) {
|
|
@@ -70,10 +63,9 @@ function isFilePath(str, ext) {
|
|
|
70
63
|
/* istanbul ignore next */
|
|
71
64
|
function isBrowser() {
|
|
72
65
|
try {
|
|
73
|
-
// eslint-disable-next-line no-undef
|
|
74
66
|
return window;
|
|
75
67
|
}
|
|
76
|
-
catch (
|
|
68
|
+
catch (_e) {
|
|
77
69
|
return false;
|
|
78
70
|
}
|
|
79
71
|
}
|
|
@@ -81,23 +73,18 @@ function isBrowser() {
|
|
|
81
73
|
function isWasmSupported() {
|
|
82
74
|
try {
|
|
83
75
|
if (typeof WebAssembly === "object" &&
|
|
84
|
-
// eslint-disable-next-line no-undef
|
|
85
76
|
typeof WebAssembly.instantiate === "function") {
|
|
86
|
-
// eslint-disable-next-line no-undef
|
|
87
77
|
const module = new WebAssembly.Module(Uint8Array.of(0x0, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00));
|
|
88
|
-
// eslint-disable-next-line no-undef
|
|
89
78
|
if (module instanceof WebAssembly.Module)
|
|
90
|
-
// eslint-disable-next-line no-undef
|
|
91
79
|
return new WebAssembly.Instance(module) instanceof WebAssembly.Instance;
|
|
92
80
|
}
|
|
93
81
|
// eslint-disable-next-line no-empty
|
|
94
82
|
}
|
|
95
|
-
catch (
|
|
83
|
+
catch (_e) { }
|
|
96
84
|
return false;
|
|
97
85
|
}
|
|
98
86
|
/* istanbul ignore next */
|
|
99
87
|
function isWorkerSupported() {
|
|
100
|
-
// eslint-disable-next-line no-undef
|
|
101
88
|
return window.Worker;
|
|
102
89
|
}
|
|
103
90
|
/* istanbul ignore next */
|
|
@@ -114,12 +101,10 @@ function isCompatible() {
|
|
|
114
101
|
}
|
|
115
102
|
/* istanbul ignore next */
|
|
116
103
|
function jsString2workerURL(str) {
|
|
117
|
-
// eslint-disable-next-line no-undef
|
|
118
104
|
const blob = new Blob([str], { type: "text/javascript" });
|
|
119
105
|
return URL.createObjectURL(blob);
|
|
120
106
|
}
|
|
121
107
|
function fn2workerURL(fn) {
|
|
122
|
-
// eslint-disable-next-line no-undef
|
|
123
108
|
const blob = new Blob([`(${fn.toString()})()`], {
|
|
124
109
|
type: "text/javascript",
|
|
125
110
|
});
|
|
@@ -131,11 +116,9 @@ const isEmpty = (obj) => [Object, Array].includes((obj || {}).constructor) &&
|
|
|
131
116
|
exports.isEmpty = isEmpty;
|
|
132
117
|
/* istanbul ignore next */
|
|
133
118
|
function addScript(src) {
|
|
134
|
-
// eslint-disable-next-line no-undef
|
|
135
119
|
const s = document.createElement("script");
|
|
136
120
|
s.setAttribute("src", src);
|
|
137
121
|
s.setAttribute("async", "true");
|
|
138
|
-
// eslint-disable-next-line no-undef
|
|
139
122
|
document.body.appendChild(s);
|
|
140
123
|
}
|
|
141
124
|
/* istanbul ignore next */
|
|
@@ -143,7 +126,7 @@ function last(arr) {
|
|
|
143
126
|
if (!Array.isArray(arr)) {
|
|
144
127
|
throw new Error("Argument is not array");
|
|
145
128
|
}
|
|
146
|
-
const length = arr
|
|
129
|
+
const { length } = arr;
|
|
147
130
|
if (length === 0) {
|
|
148
131
|
return undefined;
|
|
149
132
|
}
|
|
@@ -152,7 +135,7 @@ function last(arr) {
|
|
|
152
135
|
/* istanbul ignore next */
|
|
153
136
|
function isV3Input(input) {
|
|
154
137
|
let isV3 = false;
|
|
155
|
-
if (
|
|
138
|
+
if (Object.prototype.hasOwnProperty.call(input, "request_data") &&
|
|
156
139
|
!Array.isArray(input.request_data.inputs)) {
|
|
157
140
|
isV3 = true;
|
|
158
141
|
}
|
|
@@ -188,7 +171,14 @@ function getSafeJSONObject(data) {
|
|
|
188
171
|
function getSafeJSONString(data) {
|
|
189
172
|
return typeof data === "object" ? JSON.stringify(data) : data;
|
|
190
173
|
}
|
|
191
|
-
|
|
192
|
-
|
|
174
|
+
const MB = 1024 * 1024;
|
|
175
|
+
const formatMemory = (usage) => {
|
|
176
|
+
// # bytes / KB / MB
|
|
177
|
+
const exactUsage = usage / MB;
|
|
178
|
+
return Math.round(exactUsage * 100) / 100;
|
|
179
|
+
};
|
|
180
|
+
exports.formatMemory = formatMemory;
|
|
181
|
+
function isNumber(value) {
|
|
182
|
+
return typeof value === "number" && !Number.isNaN(value);
|
|
193
183
|
}
|
|
194
184
|
//# sourceMappingURL=utils.js.map
|
package/dist/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;;;;;AAQA,wBAoBC;AAGD,8BAUC;AAGD,gCAGC;AAGD,8BAMC;AAGD,0CAgBC;AAGD,8CAEC;AAGD,oCAcC;AAGD,gDAGC;AAED,oCAKC;AAQD,8BAMC;AAGD,oBAYC;AAGD,8BASC;AAcD,8CAEC;AAcD,8CAEC;AAUD,4BAEC;AAnMD,oDAAuC;AAE1B,QAAA,kBAAkB,GAAG,OAAO,MAAM,KAAK,QAAQ,CAAC;AAChD,QAAA,mBAAmB,GAC9B,OAAO,OAAO,KAAK,QAAQ;IAC3B,OAAO,OAAO,CAAC,QAAQ,KAAK,QAAQ;IACpC,OAAO,OAAO,CAAC,QAAQ,CAAC,IAAI,KAAK,QAAQ,CAAC;AAErC,KAAK,UAAU,MAAM,CAAC,GAAW;IACtC,oDAAoD;IACpD,IAAI,0BAAkB,EAAE,CAAC;QACvB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,+BAA+B;IAC/B,yEAAyE;IACzE,IAAI,OAAO,OAAO,KAAK,WAAW,EAAE,CAAC;QACnC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,CAAC;QACH,qEAAqE;QACrE,MAAM,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,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AAC,EACzC,CAAC;QACD,IAAI,GAAG,IAAI,CAAC;IACd,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;;;;;;;GAWG;AACH,SAAgB,iBAAiB,CAAC,IAAS;IACzC,OAAO,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAC5D,CAAC;AAED;;;;;;;;;;;GAWG;AACH,SAAgB,iBAAiB,CAAC,IAAS;IACzC,OAAO,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAChE,CAAC;AAED,MAAM,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AAEhB,MAAM,YAAY,GAAG,CAAC,KAAK,EAAE,EAAE;IACpC,qCAAqC;IACrC,MAAM,UAAU,GAAG,KAAK,GAAG,EAAE,CAAC;IAC9B,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC;AAC5C,CAAC,CAAC;AAJW,QAAA,YAAY,gBAIvB;AAEF,SAAgB,QAAQ,CAAC,KAAK;IAC5B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAC3D,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coherentglobal/wasm-runner",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "Coherent WASM runner for Javascript and Node.js",
|
|
5
5
|
"main": "dist/node.js",
|
|
6
6
|
"browser": "dist/browser.js",
|
|
@@ -15,17 +15,17 @@
|
|
|
15
15
|
"format": "prettier --write .",
|
|
16
16
|
"build:ts": "tsc --declaration && cp -R ./src/node ./dist",
|
|
17
17
|
"build:template": "node tools/create-template.js",
|
|
18
|
-
"build": "
|
|
19
|
-
"bundle": "
|
|
18
|
+
"build": "npm run compress && npm run build:template && npm run build:ts",
|
|
19
|
+
"bundle": "npm run compress && npm run build:template && npm run bundle:full && npm run bundle:min",
|
|
20
20
|
"compress:runtime": "terser --compress --mangle --comments false src/browser/template/runtime.template.js > src/browser/template/runtime.template.min.js",
|
|
21
21
|
"compress:worker": "terser --compress --mangle --comments false src/browser/template/worker.template.js > src/browser/template/worker.template.min.js",
|
|
22
|
-
"compress": "
|
|
22
|
+
"compress": "npm run compress:runtime && npm run compress:worker",
|
|
23
23
|
"bundle:full": "browserify src/browser.ts --standalone CoherentGlobal -p [ tsify ] > lib/wasmrunner.js",
|
|
24
24
|
"bundle:min": "browserify src/browser.ts --standalone CoherentGlobal -p [ tsify ] | terser --compress --mangle --comments false > lib/wasmrunner.min.js",
|
|
25
|
-
"prep:samples:simple-html": "
|
|
26
|
-
"test:lcov": "
|
|
25
|
+
"prep:samples:simple-html": "npm run bundle && cp ./lib/wasmrunner.js example/simple-html/ && cp ./lib/wasmrunner.min.js example/simple-html/",
|
|
26
|
+
"test:lcov": "c8 --check-coverage --lines 30 --reporter=lcov npm run test",
|
|
27
27
|
"test:reporter": "NODE_ENV=test mocha -r ts-node/register tests/**/*.test.ts --bail --exit --recursive --timeout 100000 --reporter mocha-sonarqube-reporter tests --reporter-options output=./reports/test-reporter.xml",
|
|
28
|
-
"cover": "
|
|
28
|
+
"cover": "npm run test:lcov && npm run test:reporter",
|
|
29
29
|
"test": "cross-env NODE_ENV=test mocha -r ts-node/register tests/**/*.test.ts --bail --exit --recursive --timeout 100000 ",
|
|
30
30
|
"test:chrome": "cross-env BROWSER=chrome MODE=headless NODE_ENV=test mocha -r ts-node/register selenium/headless.test.js --bail --exit --recursive --timeout 100000",
|
|
31
31
|
"test:firefox": "cross-env BROWSER=firefox MODE=headless NODE_ENV=test mocha -r ts-node/register selenium/headless.test.js --bail --exit --recursive --timeout 100000",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"clean-up": "node scripts/cleanup.js",
|
|
36
36
|
"start:node": "cross-env NODE_ENV=test DEV_DEBUG_TMP_PATH=/tempZip ts-node ./example/nodejs-typescript/index.ts"
|
|
37
37
|
},
|
|
38
|
-
"
|
|
38
|
+
"c8": {
|
|
39
39
|
"exclude": [
|
|
40
40
|
"dist/",
|
|
41
41
|
"src/browser/logger.js",
|
|
@@ -43,73 +43,78 @@
|
|
|
43
43
|
"src/error.ts"
|
|
44
44
|
]
|
|
45
45
|
},
|
|
46
|
+
"resolutions": {
|
|
47
|
+
"brace-expansion": "2.0.2",
|
|
48
|
+
"form-data": "4.0.4",
|
|
49
|
+
"js-yaml": "4.1.1",
|
|
50
|
+
"glob": "11.1.0"
|
|
51
|
+
},
|
|
46
52
|
"devDependencies": {
|
|
47
|
-
"@babel/cli": "^7.
|
|
48
|
-
"@babel/core": "^7.
|
|
49
|
-
"@babel/eslint-parser": "^7.
|
|
50
|
-
"@babel/plugin-transform-runtime": "^7.
|
|
51
|
-
"@babel/preset-env": "^7.
|
|
52
|
-
"@
|
|
53
|
-
"@
|
|
54
|
-
"@types/
|
|
55
|
-
"@types/
|
|
56
|
-
"@types/
|
|
57
|
-
"@types/
|
|
58
|
-
"@types/
|
|
53
|
+
"@babel/cli": "^7.28.3",
|
|
54
|
+
"@babel/core": "^7.28.5",
|
|
55
|
+
"@babel/eslint-parser": "^7.28.5",
|
|
56
|
+
"@babel/plugin-transform-runtime": "^7.28.5",
|
|
57
|
+
"@babel/preset-env": "^7.28.5",
|
|
58
|
+
"@eslint/eslintrc": "^3.2.0",
|
|
59
|
+
"@eslint/js": "^9.39.1",
|
|
60
|
+
"@types/isomorphic-fetch": "^0.0.39",
|
|
61
|
+
"@types/jest": "^30.0.0",
|
|
62
|
+
"@types/jsdom": "^27.0.0",
|
|
63
|
+
"@types/mocha": "^10.0.10",
|
|
64
|
+
"@types/sinon": "^21.0.0",
|
|
65
|
+
"@types/supertest": "^6.0.3",
|
|
66
|
+
"@typescript-eslint/eslint-plugin": "^8.47.0",
|
|
67
|
+
"@typescript-eslint/parser": "^8.47.0",
|
|
59
68
|
"babelify": "^10.0.0",
|
|
60
|
-
"browserify": "^17.0.
|
|
61
|
-
"
|
|
62
|
-
"
|
|
69
|
+
"browserify": "^17.0.1",
|
|
70
|
+
"c8": "^10.1.3",
|
|
71
|
+
"chai": "^6.2.1",
|
|
72
|
+
"chromedriver": "^142.0.2",
|
|
63
73
|
"cross-blob": "^3.0.2",
|
|
64
|
-
"cross-env": "^
|
|
65
|
-
"edgedriver": "^
|
|
66
|
-
"eslint": "^
|
|
67
|
-
"eslint-config-
|
|
68
|
-
"eslint-
|
|
69
|
-
"eslint-plugin-import": "^2.
|
|
70
|
-
"eslint-plugin-jsx-a11y": "^6.7.1",
|
|
74
|
+
"cross-env": "^10.1.0",
|
|
75
|
+
"edgedriver": "^6.1.2",
|
|
76
|
+
"eslint": "^9.39.1",
|
|
77
|
+
"eslint-config-prettier": "^10.1.8",
|
|
78
|
+
"eslint-import-resolver-typescript": "^4.4.4",
|
|
79
|
+
"eslint-plugin-import": "^2.32.0",
|
|
71
80
|
"eslint-plugin-node": "^11.1.0",
|
|
72
|
-
"eslint-plugin-prettier": "^
|
|
73
|
-
"
|
|
74
|
-
"eslint-plugin-react-hooks": "^4.6.0",
|
|
75
|
-
"geckodriver": "^4.0.1",
|
|
81
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
82
|
+
"geckodriver": "^6.0.2",
|
|
76
83
|
"isomorphic-blob": "^1.0.1",
|
|
77
84
|
"isomorphic-fetch": "^3.0.0",
|
|
78
|
-
"jest": "^
|
|
79
|
-
"jsdom": "^
|
|
80
|
-
"mocha": "^
|
|
85
|
+
"jest": "^30.2.0",
|
|
86
|
+
"jsdom": "^27.2.0",
|
|
87
|
+
"mocha": "^11.7.5",
|
|
81
88
|
"mocha-sonarqube-reporter": "^1.0.2",
|
|
82
|
-
"node-fetch": "^3.3.
|
|
83
|
-
"
|
|
84
|
-
"prettier": "^2.8.3",
|
|
89
|
+
"node-fetch": "^3.3.2",
|
|
90
|
+
"prettier": "^3.6.2",
|
|
85
91
|
"replace": "^1.2.2",
|
|
86
|
-
"selenium-webdriver": "^4.
|
|
92
|
+
"selenium-webdriver": "^4.38.0",
|
|
87
93
|
"should": "^13.2.3",
|
|
88
|
-
"
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
"typescript": "^5.0.4"
|
|
94
|
+
"terser": "^5.44.1",
|
|
95
|
+
"ts-node": "^10.9.2",
|
|
96
|
+
"typescript": "^5.9.3"
|
|
92
97
|
},
|
|
93
98
|
"dependencies": {
|
|
94
|
-
"@babel/runtime": "^7.
|
|
95
|
-
"@paralleldrive/cuid2": "^2.2.
|
|
96
|
-
"@types/ejs": "^3.1.
|
|
99
|
+
"@babel/runtime": "^7.28.4",
|
|
100
|
+
"@paralleldrive/cuid2": "^2.2.2",
|
|
101
|
+
"@types/ejs": "^3.1.5",
|
|
97
102
|
"@types/got": "^9.6.12",
|
|
98
|
-
"@types/node": "^
|
|
99
|
-
"@types/tmp": "^0.2.
|
|
100
|
-
"@types/unzipper": "^0.10.
|
|
101
|
-
"@types/worker-threads-pool": "^2.0.
|
|
102
|
-
"ejs": "^3.1.
|
|
103
|
+
"@types/node": "^24.10.1",
|
|
104
|
+
"@types/tmp": "^0.2.6",
|
|
105
|
+
"@types/unzipper": "^0.10.11",
|
|
106
|
+
"@types/worker-threads-pool": "^2.0.4",
|
|
107
|
+
"ejs": "^3.1.10",
|
|
103
108
|
"got": "11.8.6",
|
|
104
109
|
"is-buffer": "^2.0.5",
|
|
105
110
|
"memoizerific": "^1.11.3",
|
|
106
|
-
"pino": "^
|
|
107
|
-
"poolifier": "^
|
|
108
|
-
"semver": "^7.
|
|
109
|
-
"tmp": "^0.2.
|
|
111
|
+
"pino": "^10.1.0",
|
|
112
|
+
"poolifier": "^5.1.7",
|
|
113
|
+
"semver": "^7.7.3",
|
|
114
|
+
"tmp": "^0.2.5",
|
|
110
115
|
"tsify": "^5.0.4",
|
|
111
|
-
"unzipit": "^1.4.
|
|
112
|
-
"unzipper": "^0.
|
|
116
|
+
"unzipit": "^1.4.3",
|
|
117
|
+
"unzipper": "^0.12.3"
|
|
113
118
|
},
|
|
114
119
|
"browserify": {
|
|
115
120
|
"transform": [
|
|
@@ -130,5 +135,11 @@
|
|
|
130
135
|
}
|
|
131
136
|
]
|
|
132
137
|
]
|
|
138
|
+
},
|
|
139
|
+
"overrides": {
|
|
140
|
+
"brace-expansion": "2.0.2",
|
|
141
|
+
"form-data": "4.0.4",
|
|
142
|
+
"glob": "11.1.0",
|
|
143
|
+
"js-yaml": "4.1.1"
|
|
133
144
|
}
|
|
134
145
|
}
|