@percy/core 1.19.1-alpha.0 → 1.19.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/README.md +34 -0
- package/dist/config.js +10 -0
- package/dist/discovery.js +9 -2
- package/dist/page.js +4 -2
- package/dist/percy.js +2 -0
- package/dist/snapshot.js +4 -1
- package/package.json +6 -6
- package/types/index.d.ts +1 -0
package/README.md
CHANGED
|
@@ -276,3 +276,37 @@ environment variable.
|
|
|
276
276
|
|
|
277
277
|
> **Warning!** Percy is only tested against the browser it downloads automatically. When providing a
|
|
278
278
|
> custom browser executable, you may experience unexpected issues.
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
### How to update Chromium revision?
|
|
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.
|
|
296
|
+
|
|
297
|
+
### Excerpt
|
|
298
|
+
|
|
299
|
+
check the [release information on Github](https://github.com/GoogleChrome/puppeteer/releases) where the expected Chromium version and revision is specified.
|
|
300
|
+
For example:
|
|
301
|
+
|
|
302
|
+
> [v1.17.0](https://github.com/GoogleChrome/puppeteer/releases/tag/v1.17.0)
|
|
303
|
+
Big Changes
|
|
304
|
+
Chromium 76.0.3803.0 (r662092)
|
|
305
|
+
|
|
306
|
+
1. Go to [Chromium browser snapshots](https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html)
|
|
307
|
+
|
|
308
|
+
2. Choose the directory of your platform (e.g., `Linux_x64`)
|
|
309
|
+
|
|
310
|
+
3. Copy the revision number into the "Filter:" field without the "r" (e.g., `662092`)
|
|
311
|
+
|
|
312
|
+
4. Fetch revision number for rest of the platform (`Win`, `Win_x64`, `Mac`, `Mac_Arm`), it should be nearby (Tip: verify the date of upload).
|
package/dist/config.js
CHANGED
|
@@ -35,6 +35,10 @@ export const configSchema = {
|
|
|
35
35
|
enableJavaScript: {
|
|
36
36
|
type: 'boolean'
|
|
37
37
|
},
|
|
38
|
+
disableShadowDOM: {
|
|
39
|
+
type: 'boolean',
|
|
40
|
+
default: false
|
|
41
|
+
},
|
|
38
42
|
scope: {
|
|
39
43
|
type: 'string'
|
|
40
44
|
}
|
|
@@ -190,6 +194,9 @@ export const snapshotSchema = {
|
|
|
190
194
|
enableJavaScript: {
|
|
191
195
|
$ref: '/config/snapshot#/properties/enableJavaScript'
|
|
192
196
|
},
|
|
197
|
+
disableShadowDOM: {
|
|
198
|
+
$ref: '/config/snapshot#/properties/disableShadowDOM'
|
|
199
|
+
},
|
|
193
200
|
discovery: {
|
|
194
201
|
type: 'object',
|
|
195
202
|
additionalProperties: false,
|
|
@@ -576,6 +583,9 @@ export const comparisonSchema = {
|
|
|
576
583
|
content: {
|
|
577
584
|
type: 'string'
|
|
578
585
|
},
|
|
586
|
+
sha: {
|
|
587
|
+
type: 'string'
|
|
588
|
+
},
|
|
579
589
|
statusBarHeight: {
|
|
580
590
|
type: 'integer',
|
|
581
591
|
minimum: 0
|
package/dist/discovery.js
CHANGED
|
@@ -24,6 +24,7 @@ function debugSnapshotOptions(snapshot) {
|
|
|
24
24
|
debugProp(snapshot, 'widths', v => `${v}px`);
|
|
25
25
|
debugProp(snapshot, 'minHeight', v => `${v}px`);
|
|
26
26
|
debugProp(snapshot, 'enableJavaScript');
|
|
27
|
+
debugProp(snapshot, 'disableShadowDOM');
|
|
27
28
|
debugProp(snapshot, 'deviceScaleFactor');
|
|
28
29
|
debugProp(snapshot, 'waitForTimeout');
|
|
29
30
|
debugProp(snapshot, 'waitForSelector');
|
|
@@ -33,6 +34,7 @@ function debugSnapshotOptions(snapshot) {
|
|
|
33
34
|
debugProp(snapshot, 'execute.beforeSnapshot');
|
|
34
35
|
debugProp(snapshot, 'discovery.allowedHostnames');
|
|
35
36
|
debugProp(snapshot, 'discovery.disallowedHostnames');
|
|
37
|
+
debugProp(snapshot, 'discovery.devicePixelRatio');
|
|
36
38
|
debugProp(snapshot, 'discovery.requestHeaders', JSON.stringify);
|
|
37
39
|
debugProp(snapshot, 'discovery.authorization', JSON.stringify);
|
|
38
40
|
debugProp(snapshot, 'discovery.disableCache');
|
|
@@ -259,7 +261,7 @@ export async function* discoverSnapshotResources(queue, options, callback) {
|
|
|
259
261
|
}
|
|
260
262
|
|
|
261
263
|
// Used to cache resources across core instances
|
|
262
|
-
const RESOURCE_CACHE_KEY = Symbol('resource-cache');
|
|
264
|
+
export const RESOURCE_CACHE_KEY = Symbol('resource-cache');
|
|
263
265
|
|
|
264
266
|
// Creates an asset discovery queue that uses the percy browser instance to create a page for each
|
|
265
267
|
// snapshot which is used to intercept and capture snapshot resource requests.
|
|
@@ -314,7 +316,12 @@ export function createDiscoveryQueue(percy) {
|
|
|
314
316
|
allowedHostnames: snapshot.discovery.allowedHostnames,
|
|
315
317
|
disallowedHostnames: snapshot.discovery.disallowedHostnames,
|
|
316
318
|
getResource: u => snapshot.resources.get(u) || cache.get(u),
|
|
317
|
-
saveResource: r =>
|
|
319
|
+
saveResource: r => {
|
|
320
|
+
snapshot.resources.set(r.url, r);
|
|
321
|
+
if (!r.root) {
|
|
322
|
+
cache.set(r.url, r);
|
|
323
|
+
}
|
|
324
|
+
}
|
|
318
325
|
}
|
|
319
326
|
});
|
|
320
327
|
try {
|
package/dist/page.js
CHANGED
|
@@ -143,7 +143,8 @@ export class Page {
|
|
|
143
143
|
let {
|
|
144
144
|
name,
|
|
145
145
|
width,
|
|
146
|
-
enableJavaScript
|
|
146
|
+
enableJavaScript,
|
|
147
|
+
disableShadowDOM
|
|
147
148
|
} = snapshot;
|
|
148
149
|
this.log.debug(`Taking snapshot: ${name}${width ? ` @${width}px` : ''}`, this.meta);
|
|
149
150
|
|
|
@@ -186,7 +187,8 @@ export class Page {
|
|
|
186
187
|
domSnapshot: PercyDOM.serialize(options),
|
|
187
188
|
url: document.URL
|
|
188
189
|
}), {
|
|
189
|
-
enableJavaScript
|
|
190
|
+
enableJavaScript,
|
|
191
|
+
disableShadowDOM
|
|
190
192
|
});
|
|
191
193
|
return {
|
|
192
194
|
...snapshot,
|
package/dist/percy.js
CHANGED
|
@@ -46,6 +46,7 @@ export class Percy {
|
|
|
46
46
|
// snapshot server options
|
|
47
47
|
server = true,
|
|
48
48
|
port = 5338,
|
|
49
|
+
projectType = null,
|
|
49
50
|
// options such as `snapshot` and `discovery` that are valid Percy config
|
|
50
51
|
// options which will become accessible via the `.config` property
|
|
51
52
|
...options
|
|
@@ -61,6 +62,7 @@ export class Percy {
|
|
|
61
62
|
this.config = config;
|
|
62
63
|
if (testing) loglevel = 'silent';
|
|
63
64
|
if (loglevel) this.loglevel(loglevel);
|
|
65
|
+
this.projectType = projectType;
|
|
64
66
|
this.testing = testing ? {} : null;
|
|
65
67
|
this.dryRun = !!testing || !!dryRun;
|
|
66
68
|
this.skipUploads = this.dryRun || !!skipUploads;
|
package/dist/snapshot.js
CHANGED
|
@@ -121,6 +121,7 @@ function getSnapshotOptions(options, {
|
|
|
121
121
|
allowedHostnames: config.discovery.allowedHostnames,
|
|
122
122
|
disallowedHostnames: config.discovery.disallowedHostnames,
|
|
123
123
|
networkIdleTimeout: config.discovery.networkIdleTimeout,
|
|
124
|
+
devicePixelRatio: config.discovery.devicePixelRatio,
|
|
124
125
|
requestHeaders: config.discovery.requestHeaders,
|
|
125
126
|
authorization: config.discovery.authorization,
|
|
126
127
|
disableCache: config.discovery.disableCache,
|
|
@@ -328,7 +329,9 @@ export function createSnapshotsQueue(percy) {
|
|
|
328
329
|
build = percy.build = {};
|
|
329
330
|
let {
|
|
330
331
|
data
|
|
331
|
-
} = await percy.client.createBuild(
|
|
332
|
+
} = await percy.client.createBuild({
|
|
333
|
+
projectType: percy.projectType
|
|
334
|
+
});
|
|
332
335
|
let url = data.attributes['web-url'];
|
|
333
336
|
let number = data.attributes['build-number'];
|
|
334
337
|
Object.assign(build, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@percy/core",
|
|
3
|
-
"version": "1.19.
|
|
3
|
+
"version": "1.19.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -39,10 +39,10 @@
|
|
|
39
39
|
"test:types": "tsd"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@percy/client": "1.19.
|
|
43
|
-
"@percy/config": "1.19.
|
|
44
|
-
"@percy/dom": "1.19.
|
|
45
|
-
"@percy/logger": "1.19.
|
|
42
|
+
"@percy/client": "1.19.2",
|
|
43
|
+
"@percy/config": "1.19.2",
|
|
44
|
+
"@percy/dom": "1.19.2",
|
|
45
|
+
"@percy/logger": "1.19.2",
|
|
46
46
|
"content-disposition": "^0.5.4",
|
|
47
47
|
"cross-spawn": "^7.0.3",
|
|
48
48
|
"extract-zip": "^2.0.1",
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"rimraf": "^3.0.2",
|
|
54
54
|
"ws": "^8.0.0"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "609ae53aa84ab2f7054a21214b36dccd71025780"
|
|
57
57
|
}
|