@gatling.io/cli 3.11.4-M1 → 3.11.4

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gatling.io/cli",
3
- "version": "3.11.4-M1",
3
+ "version": "3.11.4",
4
4
  "license": "Apache-2.0",
5
5
  "bin": {
6
6
  "gatling": "target/index.js"
@@ -8,7 +8,7 @@ exports.versions = {
8
8
  },
9
9
  coursier: "2.1.10",
10
10
  gatling: {
11
- core: "3.11.3",
12
- jsAdapter: "3.11.4-M1"
11
+ core: "3.11.4",
12
+ jsAdapter: "3.11.4"
13
13
  }
14
14
  };
package/target/index.js CHANGED
@@ -35,8 +35,20 @@ const simulationWithDefaults = (options, simulationsFound) => {
35
35
  }
36
36
  };
37
37
  const simulationRequiredOption = new commander_1.Option("--simulation <value>", "The simulation entry point function name").makeOptionMandatory(true);
38
- const bundleFileOption = new commander_1.Option("--bundle-file <value>", "The target bundle file path when building simulations").default("target/bundle.js");
39
- const enterprisePackageFileOption = new commander_1.Option("--enterprise-package-file <value>", "The target package file path when packaging simulations for Gatling Enterprise").default("target/package.jar");
38
+ const bundleFileOption = new commander_1.Option("--bundle-file <value>", "The target bundle file path when building simulations (must have a .js extension)").default("target/bundle.js");
39
+ const validateBundleFile = (options) => {
40
+ if (!options.bundleFile.endsWith(".js")) {
41
+ throw Error(`'${options.bundleFile}' is not a valid bundle file path: should have a .js extension`);
42
+ }
43
+ return options.bundleFile;
44
+ };
45
+ const enterprisePackageFileOption = new commander_1.Option("--enterprise-package-file <value>", "The target package file path when packaging simulations for Gatling Enterprise (must have a .zip extension)").default("target/package.zip");
46
+ const validateEnterprisePackageFile = (options) => {
47
+ if (!options.enterprisePackageFile.endsWith(".zip")) {
48
+ throw Error(`'${options.enterprisePackageFile}' is not a valid package file path: should have a .zip extension`);
49
+ }
50
+ return options.enterprisePackageFile;
51
+ };
40
52
  const resourcesFolderOption = new commander_1.Option("--resources-folder <value>", "The resources folder path").default("resources");
41
53
  const resultsFolderOption = new commander_1.Option("--results-folder <value>", "The results folder path").default("target/gatling");
42
54
  const typescriptOption = new commander_1.Option("--typescript", "Use the typescript compiler to compile your code (default: true if the sourcesFolder contains any *.gatling.ts file, false otherwise)");
@@ -64,7 +76,7 @@ program
64
76
  .addOption(typescriptOption)
65
77
  .action(async (options) => {
66
78
  const sourcesFolder = options.sourcesFolder;
67
- const bundleFile = options.bundleFile;
79
+ const bundleFile = validateBundleFile(options);
68
80
  const simulations = await (0, simulations_1.findSimulations)(sourcesFolder);
69
81
  const typescript = typescriptWithDefaults(options, simulations);
70
82
  await (0, bundle_1.bundle)({ sourcesFolder, bundleFile, typescript, simulations });
@@ -82,7 +94,7 @@ program
82
94
  const graalvmHome = options.graalvmHome;
83
95
  const jvmClasspath = options.jvmClasspath;
84
96
  const simulation = options.simulation;
85
- const bundleFile = options.bundleFile;
97
+ const bundleFile = validateBundleFile(options);
86
98
  const resourcesFolder = options.resourcesFolder;
87
99
  const resultsFolder = options.resultsFolder;
88
100
  await (0, run_1.runSimulation)({
@@ -107,7 +119,7 @@ program
107
119
  .action(async (options) => {
108
120
  const gatlingHome = gatlingHomeDirWithDefaults(options);
109
121
  const sourcesFolder = options.sourcesFolder;
110
- const bundleFile = options.bundleFile;
122
+ const bundleFile = validateBundleFile(options);
111
123
  const resourcesFolder = options.resourcesFolder;
112
124
  const resultsFolder = options.resultsFolder;
113
125
  const simulations = await (0, simulations_1.findSimulations)(sourcesFolder);
@@ -150,8 +162,8 @@ program
150
162
  .action(async (options) => {
151
163
  const sourcesFolder = options.sourcesFolder;
152
164
  const resourcesFolder = options.resourcesFolder;
153
- const bundleFile = options.bundleFile;
154
- const enterprisePackageFile = options.enterprisePackageFile;
165
+ const bundleFile = validateBundleFile(options);
166
+ const enterprisePackageFile = validateEnterprisePackageFile(options);
155
167
  const simulations = await (0, simulations_1.findSimulations)(sourcesFolder);
156
168
  const typescript = typescriptWithDefaults(options, simulations);
157
169
  await (0, bundle_1.bundle)({ sourcesFolder, bundleFile, typescript, simulations });