diff --git a/index.js b/index.js index a7f4d62d..083320b1 100644 --- a/index.js +++ b/index.js @@ -5,7 +5,6 @@ var fs = require('fs'); var bodyParser = require('body-parser'); var PercyClient = require('percy-client'); -var Environment = require('percy-client/dist/environment'); var PromisePool = require('es6-promise-pool'); // Some build assets we never want to upload. @@ -56,6 +55,7 @@ module.exports = { _clientInfo: function() { if(!this._clientInfoCache) { + // eslint-disable-next-line node/no-missing-require var version = require('./package.json').version; this._clientInfoCache = `${this.name}/${version}`; } @@ -149,15 +149,14 @@ module.exports = { var token = process.env.PERCY_TOKEN; var apiUrl = process.env.PERCY_API; // Optional. - var environment = new Environment(process.env); - var repo = environment.repo; // Disable if Percy is explicitly disabled or if this is not an 'ember test' run. if (process.env.PERCY_ENABLE == '0' || process.env.EMBER_ENV !== 'test') { isPercyEnabled = false; } - if (token && repo && isPercyEnabled) { + if (token && isPercyEnabled) { + console.warn('[percy] Percy is running.'); percyClient = new PercyClient({ token: token, apiUrl: apiUrl, @@ -166,15 +165,10 @@ module.exports = { }); } else { isPercyEnabled = false; - - if (environment.ci && !token) { + if (!token) { console.warn( '[percy][WARNING] Percy is disabled, no PERCY_TOKEN environment variable found.') } - if (environment.ci && !repo) { - console.warn( - '[percy][WARNING] Percy is disabled, no PERCY_PROJECT environment variable found.') - } } if (!isPercyEnabled) { return; } @@ -185,7 +179,7 @@ module.exports = { }); // Initialize the percy client and a new build. - percyBuildPromise = percyClient.createBuild(repo, {resources: resources}); + percyBuildPromise = percyClient.createBuild({resources: resources}); // Return a promise and only resolve when all build resources are uploaded, which // ensures that the output build dir is still available to be read from before deleted. diff --git a/package.json b/package.json index 86855efc..de5890c5 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ "body-parser": "^1.15.0", "ember-cli-babel": "^6.10.0", "es6-promise-pool": "^2.4.1", - "percy-client": "^2.10.0", + "percy-client": "^3.0.0", "walk": "^2.3.9" }, "ember-addon": { diff --git a/yarn.lock b/yarn.lock index 78c1ac7b..97e73a20 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5433,9 +5433,9 @@ path-type@^1.0.0: pify "^2.0.0" pinkie-promise "^2.0.0" -percy-client@^2.10.0: - version "2.10.0" - resolved "https://registry.yarnpkg.com/percy-client/-/percy-client-2.10.0.tgz#9e70e5c51dc32721ea72fd35efe4b18657e897a6" +percy-client@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/percy-client/-/percy-client-3.0.0.tgz#86289f8224817cf550c9b21aaf994b7fa16f291d" dependencies: base64-js "^1.2.3" bluebird "^3.5.1"