@percy/client 1.22.0-alpha.0 → 1.22.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/README.md CHANGED
@@ -164,4 +164,4 @@ await client.waitForBuild({
164
164
  - `commit` — Commit SHA (**required** when missing `build`)
165
165
  - `project` — Project slug (**required** when using `commit`)
166
166
  - `timeout` — Timeout in milliseconds to wait with no updates (**default** `10 * 60 * 1000`)
167
- - `interval` — Interval in miliseconds to check for updates (**default** `1000`)
167
+ - `interval` — Interval in miliseconds to check for updates (**default** `10000`)
package/dist/client.js CHANGED
@@ -9,6 +9,8 @@ const {
9
9
  PERCY_CLIENT_API_URL = 'https://percy.io/api/v1'
10
10
  } = process.env;
11
11
  const pkg = getPackageJSON(import.meta.url);
12
+ // minimum polling interval milliseconds
13
+ const MIN_POLLING_INTERVAL = 1_000;
12
14
 
13
15
  // Validate ID arguments
14
16
  function validateId(type, id) {
@@ -186,8 +188,12 @@ export class PercyClient {
186
188
  project,
187
189
  commit,
188
190
  timeout = 10 * 60 * 1000,
189
- interval = 1000
191
+ interval = 10_000
190
192
  }, onProgress) {
193
+ if (interval < MIN_POLLING_INTERVAL) {
194
+ this.log.warn(`Ignoring interval since it cannot be less than ${MIN_POLLING_INTERVAL}ms.`);
195
+ interval = MIN_POLLING_INTERVAL;
196
+ }
191
197
  if (!project && commit) {
192
198
  throw new Error('Missing project path for commit');
193
199
  } else if (!project && !build) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@percy/client",
3
- "version": "1.22.0-alpha.0",
3
+ "version": "1.22.0",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -31,8 +31,8 @@
31
31
  "test:coverage": "yarn test --coverage"
32
32
  },
33
33
  "dependencies": {
34
- "@percy/env": "1.22.0-alpha.0",
35
- "@percy/logger": "1.22.0-alpha.0"
34
+ "@percy/env": "1.22.0",
35
+ "@percy/logger": "1.22.0"
36
36
  },
37
- "gitHead": "5928e586c401ac10840d1ec6219875526e45d100"
37
+ "gitHead": "473ae8925585bc77f584bbcaa7058fc967bd3c61"
38
38
  }