@percy/core 1.30.3-beta.0 → 1.30.3

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/api.js CHANGED
@@ -180,7 +180,7 @@ export function createPercyServer(percy, port) {
180
180
  data: data
181
181
  });
182
182
  })
183
- // Recieves events from sdk's.
183
+ // Receives events from sdk's.
184
184
  .route('post', '/percy/events', async (req, res) => {
185
185
  var _percy$build2;
186
186
  const body = percyBuildEventHandler(req, pkg.version);
package/dist/network.js CHANGED
@@ -2,7 +2,7 @@ import { request as makeRequest } from '@percy/client/utils';
2
2
  import logger from '@percy/logger';
3
3
  import mime from 'mime-types';
4
4
  import { DefaultMap, createResource, hostnameMatches, normalizeURL, waitFor, decodeAndEncodeURLWithLogging } from './utils.js';
5
- const MAX_RESOURCE_SIZE = 25 * 1024 ** 2; // 25MB
5
+ const MAX_RESOURCE_SIZE = 25 * 1024 ** 2 * 0.63; // 25MB, 0.63 factor for accounting for base64 encoding
6
6
  const ALLOWED_STATUSES = [200, 201, 301, 302, 304, 307, 308];
7
7
  const ALLOWED_RESOURCES = ['Document', 'Stylesheet', 'Image', 'Media', 'Font', 'Other'];
8
8
  const ABORTED_MESSAGE = 'Request was aborted by browser';
package/dist/snapshot.js CHANGED
@@ -3,7 +3,7 @@ import PercyConfig from '@percy/config';
3
3
  import micromatch from 'micromatch';
4
4
  import { configSchema } from './config.js';
5
5
  import Queue from './queue.js';
6
- import { request, hostnameMatches, yieldTo, snapshotLogName, decodeAndEncodeURLWithLogging } from './utils.js';
6
+ import { request, hostnameMatches, yieldTo, snapshotLogName, decodeAndEncodeURLWithLogging, compareObjectTypes } from './utils.js';
7
7
  import { JobData } from './wait-for-job.js';
8
8
 
9
9
  // Throw a better error message for missing or invalid urls
@@ -420,8 +420,11 @@ export function createSnapshotsQueue(percy) {
420
420
  // snapshots are unique by name and testCase both
421
421
  .handle('find', ({
422
422
  name,
423
- testCase
424
- }, snapshot) => snapshot.testCase === testCase && snapshot.name === name)
423
+ testCase,
424
+ tag
425
+ }, snapshot) => {
426
+ return snapshot.testCase === testCase && snapshot.name === name && compareObjectTypes(tag, snapshot.tag);
427
+ })
425
428
  // when pushed, maybe flush old snapshots or possibly merge with existing snapshots
426
429
  .handle('push', (snapshot, existing) => {
427
430
  let {
package/dist/utils.js CHANGED
@@ -515,4 +515,15 @@ export class DefaultMap extends Map {
515
515
  return super.get(key);
516
516
  };
517
517
  }
518
- ;
518
+ ;
519
+ export function compareObjectTypes(obj1, obj2) {
520
+ if (obj1 === obj2) return true; // Handles primitives
521
+ if (typeof obj1 !== 'object' || typeof obj2 !== 'object' || obj1 === null || obj2 === null) return false;
522
+ const keys1 = Object.keys(obj1);
523
+ const keys2 = Object.keys(obj2);
524
+ if (keys1.length !== keys2.length) return false;
525
+ for (const key of keys1) {
526
+ if (!keys2.includes(key) || !compareObjectTypes(obj1[key], obj2[key])) return false;
527
+ }
528
+ return true;
529
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@percy/core",
3
- "version": "1.30.3-beta.0",
3
+ "version": "1.30.3",
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": "beta"
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.3-beta.0",
47
- "@percy/config": "1.30.3-beta.0",
48
- "@percy/dom": "1.30.3-beta.0",
49
- "@percy/logger": "1.30.3-beta.0",
50
- "@percy/webdriver-utils": "1.30.3-beta.0",
46
+ "@percy/client": "1.30.3",
47
+ "@percy/config": "1.30.3",
48
+ "@percy/dom": "1.30.3",
49
+ "@percy/logger": "1.30.3",
50
+ "@percy/webdriver-utils": "1.30.3",
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": "8f5a9cb4b287900c4b053302452ea6f84d20c2f1"
63
+ "gitHead": "3daa6549ac7bd9873fb8b81b5534bac5669cef6f"
64
64
  }
package/types/index.d.ts CHANGED
@@ -20,6 +20,7 @@ interface DiscoveryOptions {
20
20
  disableCache?: boolean;
21
21
  captureMockedServiceWorker?: boolean;
22
22
  captureSrcset?: boolean;
23
+ devicePixelRatio?: number;
23
24
  }
24
25
 
25
26
  interface ScopeOptions {
@@ -41,15 +42,20 @@ interface AllDiscoveryOptions extends DiscoveryOptions {
41
42
 
42
43
  interface CommonSnapshotOptions {
43
44
  widths?: number[];
45
+ scope?: string;
44
46
  minHeight?: number;
45
47
  percyCSS?: string;
46
48
  enableJavaScript?: boolean;
49
+ cliEnableJavascript?: boolean;
47
50
  disableShadowDOM?: boolean;
48
- enableLayout?: boolean;
49
51
  domTransformation?: string;
52
+ enableLayout?: boolean;
53
+ sync?: boolean;
54
+ responsiveSnapshotCapture?: boolean;
55
+ testCase?: string;
56
+ labels?: string;
50
57
  reshuffleInvalidTags?: boolean;
51
58
  devicePixelRatio?: number;
52
- scope?: string;
53
59
  scopeOptions?: ScopeOptions;
54
60
  }
55
61