@gatling.io/cli 3.13.500 → 3.14.0
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 +4 -4
- package/polyfills/{global.js → globals.js} +3 -3
- package/target/bundle/index.js +5 -5
- package/target/bundle/polyfills.d.ts +1 -0
- package/target/bundle/polyfills.js +6 -0
- package/target/dependencies/versions.js +5 -5
- package/target/run.js +4 -1
- package/polyfills/crypto.js +0 -87
- package/target/bundle/polyfill.d.ts +0 -2
- package/target/bundle/polyfill.js +0 -83
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gatling.io/cli",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.14.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"homepage": "https://gatling.io",
|
|
6
6
|
"repository": "github:gatling/gatling-js",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"archiver": "7.0.1",
|
|
28
28
|
"node-stream-zip": "1.15.0",
|
|
29
29
|
"commander": "13.1.0",
|
|
30
|
-
"esbuild": "0.25.
|
|
30
|
+
"esbuild": "0.25.4",
|
|
31
31
|
"esbuild-plugin-tsc": "0.5.0",
|
|
32
32
|
"import-meta-resolve": "4.1.0",
|
|
33
33
|
"make-fetch-happen": "14.0.3",
|
|
@@ -36,11 +36,11 @@
|
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@types/archiver": "6.0.3",
|
|
38
38
|
"@types/make-fetch-happen": "10.0.4",
|
|
39
|
-
"@types/node": "18.19.
|
|
39
|
+
"@types/node": "18.19.100",
|
|
40
40
|
"@types/readline-sync": "1.4.8",
|
|
41
41
|
"prettier": "3.5.3",
|
|
42
42
|
"rimraf": "6.0.1",
|
|
43
|
-
"typescript": "5.8.
|
|
43
|
+
"typescript": "5.8.3"
|
|
44
44
|
},
|
|
45
45
|
"scripts": {
|
|
46
46
|
"clean": "rimraf target",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const
|
|
2
|
-
export {
|
|
1
|
+
const globals = globalThis;
|
|
2
|
+
export { globals };
|
|
3
3
|
|
|
4
4
|
export { Buffer } from "buffer";
|
|
5
5
|
|
|
@@ -10,4 +10,4 @@ export const navigator = {
|
|
|
10
10
|
language: "en-US", // Most common default
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
-
export * as crypto from "crypto"
|
|
13
|
+
export * as crypto from "crypto";
|
package/target/bundle/index.js
CHANGED
|
@@ -39,8 +39,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
39
39
|
exports.bundle = void 0;
|
|
40
40
|
const esbuild = __importStar(require("esbuild"));
|
|
41
41
|
const esbuild_plugin_tsc_1 = __importDefault(require("esbuild-plugin-tsc"));
|
|
42
|
-
const
|
|
42
|
+
const path_1 = require("path");
|
|
43
43
|
const log_1 = require("../log");
|
|
44
|
+
const polyfills_1 = require("./polyfills");
|
|
44
45
|
const bundle = async (options) => {
|
|
45
46
|
log_1.logger.info(`Bundling a Gatling simulation with options:
|
|
46
47
|
- sourcesFolder: ${options.sourcesFolder}
|
|
@@ -48,9 +49,6 @@ const bundle = async (options) => {
|
|
|
48
49
|
- typescript: ${options.typescript}`);
|
|
49
50
|
const contents = options.simulations.map((s) => `export { default as "${s.name}" } from "./${s.path}";`).join("\n");
|
|
50
51
|
const plugins = options.typescript ? [(0, esbuild_plugin_tsc_1.default)({ force: true })] : [];
|
|
51
|
-
if (options.postman !== undefined) {
|
|
52
|
-
plugins.push((0, polyfill_1.polyfill)());
|
|
53
|
-
}
|
|
54
52
|
await esbuild.build({
|
|
55
53
|
stdin: {
|
|
56
54
|
contents,
|
|
@@ -61,10 +59,12 @@ const bundle = async (options) => {
|
|
|
61
59
|
mainFields: ["main", "module"],
|
|
62
60
|
bundle: true,
|
|
63
61
|
minify: false,
|
|
62
|
+
inject: [(0, path_1.resolve)(__dirname, "../../polyfills/globals.js")],
|
|
64
63
|
sourcemap: true,
|
|
65
64
|
format: "iife",
|
|
66
65
|
globalName: "gatling",
|
|
67
|
-
plugins
|
|
66
|
+
plugins,
|
|
67
|
+
external: polyfills_1.polyfills
|
|
68
68
|
});
|
|
69
69
|
};
|
|
70
70
|
exports.bundle = bundle;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const polyfills: string[];
|
|
@@ -3,15 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.versions = void 0;
|
|
4
4
|
exports.versions = {
|
|
5
5
|
graalvm: {
|
|
6
|
-
jdk: "
|
|
7
|
-
js: "24.1
|
|
6
|
+
jdk: "24.0.1",
|
|
7
|
+
js: "24.2.1"
|
|
8
8
|
},
|
|
9
9
|
java: {
|
|
10
10
|
compilerRelease: "21"
|
|
11
11
|
},
|
|
12
12
|
gatling: {
|
|
13
|
-
core: "3.
|
|
14
|
-
enterprisePluginCommons: "1.16.
|
|
15
|
-
jsAdapter: "3.
|
|
13
|
+
core: "3.14.0",
|
|
14
|
+
enterprisePluginCommons: "1.16.3",
|
|
15
|
+
jsAdapter: "3.14.0"
|
|
16
16
|
}
|
|
17
17
|
};
|
package/target/run.js
CHANGED
|
@@ -11,13 +11,16 @@ const runSimulation = async (options) => {
|
|
|
11
11
|
- resourcesFolder: ${options.resourcesFolder}
|
|
12
12
|
- resultsFolder: ${options.resultsFolder}`);
|
|
13
13
|
const additionalClasspathElements = [options.resourcesFolder];
|
|
14
|
-
const jitTuningArgs = ["-XX:JVMCINativeLibraryThreadFraction=0.8", "-
|
|
14
|
+
const jitTuningArgs = ["-XX:JVMCINativeLibraryThreadFraction=0.8", "-Djdk.graal.MethodInlineBailoutLimit=500"];
|
|
15
15
|
const memoryArgs = options.memory !== undefined ? [`-Xms${options.memory}M`, `-Xmx${options.memory}M`] : [];
|
|
16
16
|
const javaArgs = [
|
|
17
17
|
...Object.entries(options.runParameters).map(([key, value]) => `-D${key}=${value}`),
|
|
18
18
|
"--add-opens=java.base/java.lang=ALL-UNNAMED",
|
|
19
|
+
"--enable-native-access=ALL-UNNAMED",
|
|
20
|
+
"--sun-misc-unsafe-memory-access=allow",
|
|
19
21
|
`-Dgatling.js.bundle.filePath=${options.bundleFile}`,
|
|
20
22
|
`-Dgatling.js.simulation=${options.simulation}`,
|
|
23
|
+
"-Dpolyglot.engine.WarnVirtualThreadSupport=false",
|
|
21
24
|
...jitTuningArgs,
|
|
22
25
|
...memoryArgs
|
|
23
26
|
];
|
package/polyfills/crypto.js
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { Buffer } from "buffer"
|
|
2
|
-
|
|
3
|
-
// limit of Crypto.getRandomValues()
|
|
4
|
-
// https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues
|
|
5
|
-
const MAX_BYTES = 65536;
|
|
6
|
-
|
|
7
|
-
// Node supports requesting up to this number of bytes
|
|
8
|
-
// https://github.com/nodejs/node/blob/master/lib/internal/crypto/random.js#L48
|
|
9
|
-
const MAX_UINT32 = 4294967295;
|
|
10
|
-
|
|
11
|
-
const JavaCrypto = Java.type("io.gatling.js.polyfills.Crypto");
|
|
12
|
-
|
|
13
|
-
export const randomBytes = (size, cb) => {
|
|
14
|
-
// Node supports requesting up to this number of bytes
|
|
15
|
-
// https://github.com/nodejs/node/blob/master/lib/internal/crypto/random.js#L48
|
|
16
|
-
if (size > MAX_UINT32) {
|
|
17
|
-
throw new RangeError('requested too many random bytes');
|
|
18
|
-
}
|
|
19
|
-
const bytes = Buffer.from(JavaCrypto.randomBytes(size));
|
|
20
|
-
if (typeof cb === 'function') {
|
|
21
|
-
return process.nextTick(function () {
|
|
22
|
-
cb(null, bytes);
|
|
23
|
-
})
|
|
24
|
-
}
|
|
25
|
-
return bytes;
|
|
26
|
-
};
|
|
27
|
-
export const rng = randomBytes;
|
|
28
|
-
export const pseudoRandomBytes = randomBytes;
|
|
29
|
-
export const prng = randomBytes;
|
|
30
|
-
export const getRandomValues = (values) => {
|
|
31
|
-
const byteView = new Uint8Array(values.buffer, values.byteOffset, values.byteLength);
|
|
32
|
-
const bytes = randomBytes(byteView.length);
|
|
33
|
-
for (let i = 0; i < byteView.length; i++) {
|
|
34
|
-
// The range of Math.random() is [0, 1) and the ToUint8 abstract operation rounds down
|
|
35
|
-
byteView[i] = bytes[i];
|
|
36
|
-
}
|
|
37
|
-
return values;
|
|
38
|
-
};
|
|
39
|
-
export const randomUUID = () => JavaCrypto.randomUUID();
|
|
40
|
-
|
|
41
|
-
// export const Cipher = crypto.Cipher;
|
|
42
|
-
// export const Cipheriv = crypto.Cipheriv;
|
|
43
|
-
// export const Decipher = crypto.Decipher;
|
|
44
|
-
// export const Decipheriv = crypto.Decipheriv;
|
|
45
|
-
// export const DiffieHellman = crypto.DiffieHellman;
|
|
46
|
-
// export const DiffieHellmanGroup = crypto.DiffieHellmanGroup;
|
|
47
|
-
// export const Hash = crypto.Hash;
|
|
48
|
-
// export const Hmac = crypto.Hmac;
|
|
49
|
-
// export const Sign = crypto.Sign;
|
|
50
|
-
// export const Verify = crypto.Verify;
|
|
51
|
-
// export const constants = crypto.constants;
|
|
52
|
-
// export const createCipher = crypto.createCipher;
|
|
53
|
-
// export const createCipheriv = crypto.createCipheriv;
|
|
54
|
-
// export const createCredentials = crypto.createCredentials;
|
|
55
|
-
// export const createDecipher = crypto.createDecipher;
|
|
56
|
-
// export const createDecipheriv = crypto.createDecipheriv;
|
|
57
|
-
// export const createDiffieHellman = crypto.createDiffieHellman;
|
|
58
|
-
// export const createDiffieHellmanGroup = crypto.createDiffieHellmanGroup;
|
|
59
|
-
// export const createECDH = crypto.createECDH;
|
|
60
|
-
// export const createHash = crypto.createHash;
|
|
61
|
-
// export const createHmac = crypto.createHmac;
|
|
62
|
-
// export const createSign = crypto.createSign;
|
|
63
|
-
// export const createVerify = crypto.createVerify;
|
|
64
|
-
// export const getCiphers = crypto.getCiphers;
|
|
65
|
-
// export const getDiffieHellman = crypto.getDiffieHellman;
|
|
66
|
-
// export const getHashes = crypto.getHashes;
|
|
67
|
-
// export const listCiphers = crypto.listCiphers;
|
|
68
|
-
// export const pbkdf2 = crypto.pbkdf2;
|
|
69
|
-
// export const pbkdf2Sync = crypto.pbkdf2Sync;
|
|
70
|
-
// export const privateDecrypt = crypto.privateDecrypt;
|
|
71
|
-
// export const privateEncrypt = crypto.privateEncrypt;
|
|
72
|
-
// export const publicDecrypt = crypto.publicDecrypt;
|
|
73
|
-
// export const publicEncrypt = crypto.publicEncrypt;
|
|
74
|
-
// export const randomFill = crypto.randomFill;
|
|
75
|
-
// export const randomFillSync = crypto.randomFillSync;
|
|
76
|
-
|
|
77
|
-
const crypto = {
|
|
78
|
-
randomBytes,
|
|
79
|
-
rng,
|
|
80
|
-
pseudoRandomBytes,
|
|
81
|
-
prng,
|
|
82
|
-
getRandomValues,
|
|
83
|
-
randomUUID,
|
|
84
|
-
};
|
|
85
|
-
crypto.webcrypto = crypto;
|
|
86
|
-
globalThis.crypto = crypto;
|
|
87
|
-
export default crypto;
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.polyfill = void 0;
|
|
4
|
-
const url_1 = require("url");
|
|
5
|
-
const path_1 = require("path");
|
|
6
|
-
// This is largely inspired by https://github.com/cyco130/esbuild-plugin-polyfill-node
|
|
7
|
-
const polyfill = () => ({
|
|
8
|
-
name: "gatling-js-polyfill",
|
|
9
|
-
setup: async (build) => {
|
|
10
|
-
// modules
|
|
11
|
-
const jspmResolved = await resolveImport(`@jspm/core/nodelibs/fs`);
|
|
12
|
-
build.onResolve({ filter: polyfillsFilter }, async ({ path }) => {
|
|
13
|
-
const [, , moduleName] = path.match(polyfillsFilter);
|
|
14
|
-
const resolved = customPolyfills.find((name) => name === moduleName)
|
|
15
|
-
? (0, path_1.resolve)((0, path_1.dirname)(__filename), `../../polyfills/${moduleName}.js`)
|
|
16
|
-
: (0, path_1.resolve)(jspmResolved, `../../browser/${moduleName}.js`);
|
|
17
|
-
return { path: resolved };
|
|
18
|
-
});
|
|
19
|
-
// Globals
|
|
20
|
-
build.initialOptions.inject = build.initialOptions.inject || [];
|
|
21
|
-
const injectGlobal = (name) => build.initialOptions.inject.push((0, path_1.resolve)((0, path_1.dirname)(__filename), `../../polyfills/${name}.js`));
|
|
22
|
-
injectGlobal("global");
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
exports.polyfill = polyfill;
|
|
26
|
-
const customPolyfills = ["crypto"];
|
|
27
|
-
const jspmPolyfills = ["buffer", "path", "string_decoder"];
|
|
28
|
-
// Other available jspm-core modules:
|
|
29
|
-
// "_stream_duplex"
|
|
30
|
-
// "_stream_passthrough"
|
|
31
|
-
// "_stream_readable"
|
|
32
|
-
// "_stream_transform"
|
|
33
|
-
// "_stream_writable"
|
|
34
|
-
// "assert"
|
|
35
|
-
// "assert/strict"
|
|
36
|
-
// "async_hooks"
|
|
37
|
-
// "child_process"
|
|
38
|
-
// "cluster"
|
|
39
|
-
// "console"
|
|
40
|
-
// "constants"
|
|
41
|
-
// "crypto"
|
|
42
|
-
// "dgram"
|
|
43
|
-
// "diagnostics_channel"
|
|
44
|
-
// "dns"
|
|
45
|
-
// "domain"
|
|
46
|
-
// "events"
|
|
47
|
-
// "fs"
|
|
48
|
-
// "fs/promises"
|
|
49
|
-
// "http"
|
|
50
|
-
// "http2"
|
|
51
|
-
// "https"
|
|
52
|
-
// "module"
|
|
53
|
-
// "net"
|
|
54
|
-
// "os"
|
|
55
|
-
// "perf_hooks"
|
|
56
|
-
// "process"
|
|
57
|
-
// "punycode"
|
|
58
|
-
// "querystring"
|
|
59
|
-
// "readline"
|
|
60
|
-
// "repl"
|
|
61
|
-
// "stream"
|
|
62
|
-
// "sys"
|
|
63
|
-
// "timers"
|
|
64
|
-
// "timers/promises"
|
|
65
|
-
// "tls"
|
|
66
|
-
// "tty"
|
|
67
|
-
// "url"
|
|
68
|
-
// "util"
|
|
69
|
-
// "v8"
|
|
70
|
-
// "vm"
|
|
71
|
-
// "wasi"
|
|
72
|
-
// "worker_threads"
|
|
73
|
-
// "zlib"
|
|
74
|
-
const polyfillsFilter = new RegExp(`^(node:)?(${jspmPolyfills.concat(customPolyfills).join("|")})$`);
|
|
75
|
-
let importMetaResolve;
|
|
76
|
-
const importMetaUrl = (0, url_1.pathToFileURL)(__filename).href;
|
|
77
|
-
const resolveImport = async (specifier) => {
|
|
78
|
-
if (!importMetaResolve) {
|
|
79
|
-
importMetaResolve = (await import("import-meta-resolve")).resolve;
|
|
80
|
-
}
|
|
81
|
-
const resolved = importMetaResolve(specifier, importMetaUrl);
|
|
82
|
-
return (0, url_1.fileURLToPath)(resolved);
|
|
83
|
-
};
|