diff --git a/README.md b/README.md index cb2c854f..2a034bce 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,7 @@ Here are all the options that you can provide in the `browserstack.json`: ### Authentication You can use the `auth` option to specify your username and access keys. You -can find them in your [Automate dashboard](https://automate.browserstack.com/) +can find them in your [Automate dashboard](https://automate.browserstack.com/) | Option | Description | Possible values | | ------------ | ----------------------------- | --------------- | diff --git a/bin/helpers/archiver.js b/bin/helpers/archiver.js index 630506c0..da6bf816 100644 --- a/bin/helpers/archiver.js +++ b/bin/helpers/archiver.js @@ -8,7 +8,7 @@ const archiveSpecs = (runSettings, filePath) => { return new Promise(function (resolve, reject) { var output = fs.createWriteStream(filePath); - var cypressFolderPath = runSettings.cypress_proj_dir + var cypressFolderPath = runSettings.cypress_proj_dir; var archive = archiver('zip', { zlib: { level: 9 } // Sets the compression level. @@ -36,11 +36,17 @@ const archiveSpecs = (runSettings, filePath) => { archive.pipe(output); + let allowedFileTypes = [ 'js', 'json', 'txt', 'ts' ] allowedFileTypes.forEach(fileType => { - archive.glob(`**/*.${fileType}`, { cwd: cypressFolderPath, matchBase: true, ignore: 'node_modules/**' }); + archive.glob(`**/*.${fileType}`, { cwd: cypressFolderPath, matchBase: true, ignore: ['node_modules/**', 'package-lock.json', 'package.json', 'browserstack-package.json'] }); }); + if (typeof runSettings.npm_dependencies === 'object') { + var packageJSON = JSON.stringify({devDependencies: runSettings.npm_dependencies}, null, 4); + archive.append(packageJSON, { name: 'browserstack-package.json' }); + } + archive.finalize(); }); } diff --git a/bin/templates/configTemplate.js b/bin/templates/configTemplate.js index bf137d65..70acb184 100644 --- a/bin/templates/configTemplate.js +++ b/bin/templates/configTemplate.js @@ -14,7 +14,9 @@ module.exports = function () { "run_settings": { "cypress_proj_dir" : "/path/to/cypress.json", "project_name": "project-name", - "build_name": "build-name" + "build_name": "build-name", + "npm_dependencies": { + } }, "connection_settings": { "local": false,