@percy/core 1.27.3-beta.0 → 1.27.4-beta.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
@@ -280,19 +280,9 @@ environment variable.
280
280
 
281
281
  ### How to update Chromium revision?
282
282
 
283
- `src/install.js`
284
-
285
- ```js
286
- chromium.revisions = {
287
- linux: '.*',
288
- win64: '.*',
289
- win32: '.*',
290
- darwin: '.*',
291
- darwinArm: '.*'
292
- };
293
- ```
294
-
295
- Nicely summarised in this [stackoverflow](https://stackoverflow.com/a/56366776) answer.
283
+ - Vist https://chromiumdash.appspot.com/releases?platform=Mac and check for current version in use.
284
+ - Get Branch Base Position for that release.
285
+ - Visit https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html?prefix=Mac/ and search for exact/neareast Branch Base Position.
296
286
 
297
287
  ### Excerpt
298
288
 
package/dist/config.js CHANGED
@@ -6,6 +6,9 @@ export const configSchema = {
6
6
  properties: {
7
7
  deferUploads: {
8
8
  type: 'boolean'
9
+ },
10
+ token: {
11
+ type: 'string'
9
12
  }
10
13
  }
11
14
  },
package/dist/network.js CHANGED
@@ -1,7 +1,7 @@
1
- import mime from 'mime-types';
2
- import logger from '@percy/logger';
3
1
  import { request as makeRequest } from '@percy/client/utils';
4
- import { normalizeURL, hostnameMatches, createResource, waitFor } from './utils.js';
2
+ import logger from '@percy/logger';
3
+ import mime from 'mime-types';
4
+ import { createResource, hostnameMatches, normalizeURL, waitFor } from './utils.js';
5
5
  const MAX_RESOURCE_SIZE = 25 * 1024 ** 2; // 25MB
6
6
  const ALLOWED_STATUSES = [200, 201, 301, 302, 304, 307, 308];
7
7
  const ALLOWED_RESOURCES = ['Document', 'Stylesheet', 'Image', 'Media', 'Font', 'Other'];
@@ -431,7 +431,11 @@ async function saveResponseResource(network, request) {
431
431
  } else if (!enableJavaScript && !ALLOWED_RESOURCES.includes(request.type)) {
432
432
  return log.debug(`- Skipping disallowed resource type [${request.type}]`, meta);
433
433
  }
434
- let detectedMime = mime.lookup(response.url);
434
+
435
+ // mime package does not handle query params
436
+ let urlObj = new URL(url);
437
+ let urlWithoutSearchParams = urlObj.origin + urlObj.pathname;
438
+ let detectedMime = mime.lookup(urlWithoutSearchParams);
435
439
  let mimeType =
436
440
  // ensure the mimetype is correct for text/plain responses
437
441
  response.mimeType === 'text/plain' && detectedMime || response.mimeType;
package/dist/percy.js CHANGED
@@ -51,14 +51,12 @@ export class Percy {
51
51
  // options which will become accessible via the `.config` property
52
52
  ...options
53
53
  } = {}) {
54
- let {
55
- percy,
56
- ...config
57
- } = PercyConfig.load({
54
+ var _config$percy;
55
+ let config = PercyConfig.load({
58
56
  overrides: options,
59
57
  path: configFile
60
58
  });
61
- deferUploads ?? (deferUploads = percy === null || percy === void 0 ? void 0 : percy.deferUploads);
59
+ deferUploads ?? (deferUploads = (_config$percy = config.percy) === null || _config$percy === void 0 ? void 0 : _config$percy.deferUploads);
62
60
  this.config = config;
63
61
  if (testing) loglevel = 'silent';
64
62
  if (loglevel) this.loglevel(loglevel);
@@ -72,7 +70,8 @@ export class Percy {
72
70
  this.client = new PercyClient({
73
71
  token,
74
72
  clientInfo,
75
- environmentInfo
73
+ environmentInfo,
74
+ config
76
75
  });
77
76
  if (server) this.server = createPercyServer(this, port);
78
77
  this.browser = new Browser(this);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@percy/core",
3
- "version": "1.27.3-beta.0",
3
+ "version": "1.27.4-beta.0",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -43,11 +43,11 @@
43
43
  "test:types": "tsd"
44
44
  },
45
45
  "dependencies": {
46
- "@percy/client": "1.27.3-beta.0",
47
- "@percy/config": "1.27.3-beta.0",
48
- "@percy/dom": "1.27.3-beta.0",
49
- "@percy/logger": "1.27.3-beta.0",
50
- "@percy/webdriver-utils": "1.27.3-beta.0",
46
+ "@percy/client": "1.27.4-beta.0",
47
+ "@percy/config": "1.27.4-beta.0",
48
+ "@percy/dom": "1.27.4-beta.0",
49
+ "@percy/logger": "1.27.4-beta.0",
50
+ "@percy/webdriver-utils": "1.27.4-beta.0",
51
51
  "content-disposition": "^0.5.4",
52
52
  "cross-spawn": "^7.0.3",
53
53
  "extract-zip": "^2.0.1",
@@ -58,5 +58,5 @@
58
58
  "rimraf": "^3.0.2",
59
59
  "ws": "^8.0.0"
60
60
  },
61
- "gitHead": "a9b7ebc7005ee50761373f49ce3454449f38f227"
61
+ "gitHead": "d83228ad59736923285426854572f9e1f80ad48f"
62
62
  }
@@ -22,7 +22,7 @@ export function createTestServer({ default: defaultReply, ...replies }, port = 8
22
22
  let pathname = req.url.pathname;
23
23
  if (req.url.search) pathname += req.url.search;
24
24
  server.requests.push(req.body ? [pathname, req.body] : [pathname]);
25
- let reply = replies[req.url.pathname] || defaultReply;
25
+ let reply = replies[pathname] || defaultReply;
26
26
  return reply ? await reply(req, res) : next();
27
27
  });
28
28