@percy/client 1.22.0-alpha.0 → 1.23.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) {
@@ -357,7 +363,8 @@ export class PercyClient {
357
363
  async createComparison(snapshotId, {
358
364
  tag,
359
365
  tiles = [],
360
- externalDebugUrl
366
+ externalDebugUrl,
367
+ ignoredElementsData
361
368
  } = {}) {
362
369
  validateId('snapshot', snapshotId);
363
370
  this.log.debug(`Creating comparision: ${tag.name}...`);
@@ -374,7 +381,8 @@ export class PercyClient {
374
381
  data: {
375
382
  type: 'comparisons',
376
383
  attributes: {
377
- 'external-debug-url': externalDebugUrl || null
384
+ 'external-debug-url': externalDebugUrl || null,
385
+ 'ignore-elements-data': ignoredElementsData || null
378
386
  },
379
387
  relationships: {
380
388
  tag: {
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.23.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.23.0",
35
+ "@percy/logger": "1.23.0"
36
36
  },
37
- "gitHead": "5928e586c401ac10840d1ec6219875526e45d100"
37
+ "gitHead": "cd9a0de3f51233e414cd2657997ce02e8faa19e2"
38
38
  }