@percy/core 1.30.2-alpha.1 → 1.30.2

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/dist/percy.js CHANGED
@@ -120,6 +120,9 @@ export class Percy {
120
120
  var _this$server;
121
121
  return (_this$server = this.server) === null || _this$server === void 0 ? void 0 : _this$server.address();
122
122
  }
123
+ renderingTypeProject() {
124
+ return this.projectType === 'web' || this.projectType === 'visual_scanner';
125
+ }
123
126
 
124
127
  // Set client & environment info, and override loaded config options
125
128
  set({
@@ -181,13 +184,13 @@ export class Percy {
181
184
  if (!this.skipDiscovery) yield _classPrivateFieldGet(_discovery, this).start();
182
185
  // start a local API server for SDK communication
183
186
  if (this.server) yield this.server.listen();
184
- if (this.projectType === 'web') {
187
+ if (this.renderingTypeProject()) {
185
188
  if (!process.env.PERCY_DO_NOT_CAPTURE_RESPONSIVE_ASSETS || process.env.PERCY_DO_NOT_CAPTURE_RESPONSIVE_ASSETS !== 'true') {
186
189
  var _this$build;
187
190
  this.deviceDetails = yield this.client.getDeviceDetails((_this$build = this.build) === null || _this$build === void 0 ? void 0 : _this$build.id);
188
191
  }
189
192
  }
190
- const snapshotType = this.projectType === 'web' ? 'snapshot' : 'comparison';
193
+ const snapshotType = this.renderingTypeProject() ? 'snapshot' : 'comparison';
191
194
  this.syncQueue = new WaitForJob(snapshotType, this);
192
195
  // log and mark this instance as started
193
196
  this.log.info('Percy has started!');
@@ -407,6 +410,7 @@ export class Percy {
407
410
  let {
408
411
  clientInfo,
409
412
  environmentInfo,
413
+ labels,
410
414
  ...comparison
411
415
  } = options;
412
416
  let errors = PercyConfig.validate(comparison, '/comparison');
@@ -453,7 +457,8 @@ export class Percy {
453
457
  if (this.testing && JSON.stringify(this.testing) === JSON.stringify({})) {
454
458
  return true;
455
459
  }
456
- return tokenType !== 'web';
460
+ const assetDiscoverySupportedTypes = ['web', 'visual_scanner'];
461
+ return !assetDiscoverySupportedTypes.includes(tokenType);
457
462
  }
458
463
  syncMode(options) {
459
464
  var _this$config;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@percy/core",
3
- "version": "1.30.2-alpha.1",
3
+ "version": "1.30.2",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -9,7 +9,7 @@
9
9
  },
10
10
  "publishConfig": {
11
11
  "access": "public",
12
- "tag": "alpha"
12
+ "tag": "latest"
13
13
  },
14
14
  "engines": {
15
15
  "node": ">=14"
@@ -43,11 +43,11 @@
43
43
  "test:types": "tsd"
44
44
  },
45
45
  "dependencies": {
46
- "@percy/client": "1.30.2-alpha.1",
47
- "@percy/config": "1.30.2-alpha.1",
48
- "@percy/dom": "1.30.2-alpha.1",
49
- "@percy/logger": "1.30.2-alpha.1",
50
- "@percy/webdriver-utils": "1.30.2-alpha.1",
46
+ "@percy/client": "1.30.2",
47
+ "@percy/config": "1.30.2",
48
+ "@percy/dom": "1.30.2",
49
+ "@percy/logger": "1.30.2",
50
+ "@percy/webdriver-utils": "1.30.2",
51
51
  "content-disposition": "^0.5.4",
52
52
  "cross-spawn": "^7.0.3",
53
53
  "extract-zip": "^2.0.1",
@@ -60,5 +60,5 @@
60
60
  "ws": "^8.17.1",
61
61
  "yaml": "^2.4.1"
62
62
  },
63
- "gitHead": "49e55e3851ae4b0fd489327cd980e352a440aa19"
63
+ "gitHead": "160670ddfcea48d1bf5ad122bf13fe09b75460e1"
64
64
  }
@@ -1,37 +0,0 @@
1
- #!/bin/bash
2
-
3
- function download_url {
4
- if [[ "$OS" == "Linux" ]]; then
5
- echo "https://www.googleapis.com/download/storage/v1/b/chromium-browser-snapshots/o/Linux_x64%2F${1}%2Fchrome-linux.zip?alt=media"
6
- elif [[ "$OS" == "Mac" ]] || [[ "$OS" == "Mac_Arm" ]]; then
7
- echo "https://www.googleapis.com/download/storage/v1/b/chromium-browser-snapshots/o/$OS%2F${1}%2Fchrome-mac.zip?alt=media"
8
- elif [[ "$OS" == "Win" ]] || [[ "$OS" == "Win_x64" ]]; then
9
- echo "https://www.googleapis.com/download/storage/v1/b/chromium-browser-snapshots/o/$OS%2F${1}%2Fchrome-win.zip?alt=media"
10
- fi
11
- }
12
-
13
- function get_closest_rev {
14
- while true; do
15
- curl -I 2>/dev/null `download_url $REVISION` | head -1 | grep 404 >/dev/null
16
- if (($? == 1)); then
17
- break
18
- fi
19
- REVISION=$(($REVISION-1))
20
- done
21
- echo $REVISION
22
- }
23
-
24
-
25
- if (($# < 1)); then
26
- printf "usage: \n"
27
- printf " ./get_chromuim [-r] rev - will get chromium by revision\n"
28
- exit 1
29
- fi
30
-
31
- export REVISION=$1
32
-
33
- for os in "Linux" "Mac" "Mac_Arm" "Win" "Win_x64";
34
- do
35
- export OS=$os
36
- echo "$OS" `get_closest_rev`
37
- done
package/dist/timing.js DELETED
@@ -1,21 +0,0 @@
1
- import logger from '@percy/logger';
2
- export default class TimeIt {
3
- log = logger('timer');
4
- // returns a singleton instance
5
- constructor() {
6
- let {
7
- instance = this
8
- } = this.constructor;
9
- this.constructor.instance = instance;
10
- return instance;
11
- }
12
- async measure(name, identifier, callback) {
13
- const startTime = Date.now();
14
- try {
15
- return await callback();
16
- } finally {
17
- const duration = Date.now() - startTime;
18
- this.log.debug(`${name} - ${identifier} - ${duration / 1000}s`);
19
- }
20
- }
21
- }