browserstack-cypress-cli 1.31.6 → 1.31.7
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/bin/helpers/archiver.js
CHANGED
|
@@ -72,9 +72,30 @@ const archiveSpecs = (runSettings, filePath, excludeFiles, md5data) => {
|
|
|
72
72
|
});
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
+
// Split mac and win configs
|
|
76
|
+
let macPackageJSON = {};
|
|
77
|
+
let winPackageJSON = {};
|
|
78
|
+
Object.assign(macPackageJSON, packageJSON);
|
|
79
|
+
Object.assign(winPackageJSON, packageJSON);
|
|
80
|
+
|
|
81
|
+
if (typeof runSettings.npm_dependencies === 'object') {
|
|
82
|
+
let macNpmDependencies = Object.assign({}, runSettings.npm_dependencies, runSettings.mac_npm_dependencies || {});
|
|
83
|
+
let winNpmDependencies = Object.assign({}, runSettings.npm_dependencies, runSettings.win_npm_dependencies || {});
|
|
84
|
+
|
|
85
|
+
Object.assign(macPackageJSON, {
|
|
86
|
+
devDependencies: macNpmDependencies,
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
Object.assign(winPackageJSON, {
|
|
90
|
+
devDependencies: winNpmDependencies,
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
|
|
75
94
|
if (Object.keys(packageJSON).length > 0) {
|
|
76
|
-
|
|
77
|
-
|
|
95
|
+
const macPackageJSONString = JSON.stringify(macPackageJSON, null, 4);
|
|
96
|
+
const winPackageJSONString = JSON.stringify(winPackageJSON, null, 4);
|
|
97
|
+
archive.append(macPackageJSONString, {name: `${cypressAppendFilesZipLocation}browserstack-mac-package.json`});
|
|
98
|
+
archive.append(winPackageJSONString, {name: `${cypressAppendFilesZipLocation}browserstack-win-package.json`});
|
|
78
99
|
}
|
|
79
100
|
|
|
80
101
|
//Create copy of package.json
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
const request = require('request');
|
|
3
|
+
const { combineMacWinNpmDependencies } = require('./helper');
|
|
3
4
|
|
|
4
5
|
const crypto = require('crypto'),
|
|
5
6
|
Constants = require('./constants'),
|
|
@@ -59,7 +60,7 @@ const checkPackageMd5 = (runSettings) => {
|
|
|
59
60
|
|
|
60
61
|
if (typeof runSettings.npm_dependencies === 'object') {
|
|
61
62
|
Object.assign(packageJSON, {
|
|
62
|
-
devDependencies: utils.sortJsonKeys(runSettings
|
|
63
|
+
devDependencies: utils.sortJsonKeys(combineMacWinNpmDependencies(runSettings)),
|
|
63
64
|
});
|
|
64
65
|
}
|
|
65
66
|
|
package/bin/helpers/constants.js
CHANGED
|
@@ -343,7 +343,11 @@ const filesToIgnoreWhileUploading = [
|
|
|
343
343
|
"package.json",
|
|
344
344
|
"**/package.json",
|
|
345
345
|
"browserstack-package.json",
|
|
346
|
+
"browserstack-mac-package.json",
|
|
347
|
+
"browserstack-win-package.json",
|
|
346
348
|
"**/browserstack-package.json",
|
|
349
|
+
"**/browserstack-mac-package.json",
|
|
350
|
+
"**/browserstack-win-package.json",
|
|
347
351
|
"tests.zip",
|
|
348
352
|
"**/tests.zip",
|
|
349
353
|
"cypress.json",
|
package/bin/helpers/helper.js
CHANGED
|
@@ -441,3 +441,7 @@ exports.truncateString = (field, truncateSizeInBytes) => {
|
|
|
441
441
|
|
|
442
442
|
return field;
|
|
443
443
|
};
|
|
444
|
+
|
|
445
|
+
exports.combineMacWinNpmDependencies = (runSettings) => {
|
|
446
|
+
return Object.assign({}, runSettings.npm_dependencies, runSettings.win_npm_dependencies || {}, runSettings.mac_npm_dependencies || {})
|
|
447
|
+
};
|
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
cliUtils = require("./utils"),
|
|
13
13
|
util = require('util');
|
|
14
14
|
|
|
15
|
+
const { combineMacWinNpmDependencies } = require("./helper");
|
|
16
|
+
|
|
15
17
|
let nodeProcess;
|
|
16
18
|
|
|
17
19
|
const setupPackageFolder = (runSettings, directoryPath) => {
|
|
@@ -29,9 +31,10 @@ const setupPackageFolder = (runSettings, directoryPath) => {
|
|
|
29
31
|
Object.assign(packageJSON, runSettings.package_config_options);
|
|
30
32
|
}
|
|
31
33
|
|
|
34
|
+
// Combine win and mac specific dependencies if present
|
|
32
35
|
if (typeof runSettings.npm_dependencies === 'object') {
|
|
33
36
|
Object.assign(packageJSON, {
|
|
34
|
-
devDependencies: runSettings
|
|
37
|
+
devDependencies: combineMacWinNpmDependencies(runSettings),
|
|
35
38
|
});
|
|
36
39
|
}
|
|
37
40
|
|
package/bin/helpers/utils.js
CHANGED
|
@@ -222,6 +222,16 @@ exports.setDefaults = (bsConfig, args) => {
|
|
|
222
222
|
bsConfig.run_settings.npm_dependencies = {}
|
|
223
223
|
}
|
|
224
224
|
|
|
225
|
+
// setting win_npm_dependencies to {} if not present
|
|
226
|
+
if (bsConfig.run_settings && this.isUndefined(bsConfig.run_settings.win_npm_dependencies)) {
|
|
227
|
+
bsConfig.run_settings.win_npm_dependencies = {}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
// setting mac_npm_dependencies to {} if not present
|
|
231
|
+
if (bsConfig.run_settings && this.isUndefined(bsConfig.run_settings.mac_npm_dependencies)) {
|
|
232
|
+
bsConfig.run_settings.mac_npm_dependencies = {}
|
|
233
|
+
}
|
|
234
|
+
|
|
225
235
|
// setting connection_settings to {} if not present
|
|
226
236
|
if (this.isUndefined(bsConfig.connection_settings)) {
|
|
227
237
|
bsConfig.connection_settings = {};
|