@percy/core 1.17.0 → 1.18.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/dist/config.js +3 -0
- package/dist/discovery.js +8 -2
- package/dist/percy.js +2 -0
- package/dist/snapshot.js +4 -1
- package/package.json +6 -6
package/dist/config.js
CHANGED
package/dist/discovery.js
CHANGED
|
@@ -33,6 +33,7 @@ function debugSnapshotOptions(snapshot) {
|
|
|
33
33
|
debugProp(snapshot, 'execute.beforeSnapshot');
|
|
34
34
|
debugProp(snapshot, 'discovery.allowedHostnames');
|
|
35
35
|
debugProp(snapshot, 'discovery.disallowedHostnames');
|
|
36
|
+
debugProp(snapshot, 'discovery.devicePixelRatio');
|
|
36
37
|
debugProp(snapshot, 'discovery.requestHeaders', JSON.stringify);
|
|
37
38
|
debugProp(snapshot, 'discovery.authorization', JSON.stringify);
|
|
38
39
|
debugProp(snapshot, 'discovery.disableCache');
|
|
@@ -259,7 +260,7 @@ export async function* discoverSnapshotResources(queue, options, callback) {
|
|
|
259
260
|
}
|
|
260
261
|
|
|
261
262
|
// Used to cache resources across core instances
|
|
262
|
-
const RESOURCE_CACHE_KEY = Symbol('resource-cache');
|
|
263
|
+
export const RESOURCE_CACHE_KEY = Symbol('resource-cache');
|
|
263
264
|
|
|
264
265
|
// Creates an asset discovery queue that uses the percy browser instance to create a page for each
|
|
265
266
|
// snapshot which is used to intercept and capture snapshot resource requests.
|
|
@@ -314,7 +315,12 @@ export function createDiscoveryQueue(percy) {
|
|
|
314
315
|
allowedHostnames: snapshot.discovery.allowedHostnames,
|
|
315
316
|
disallowedHostnames: snapshot.discovery.disallowedHostnames,
|
|
316
317
|
getResource: u => snapshot.resources.get(u) || cache.get(u),
|
|
317
|
-
saveResource: r =>
|
|
318
|
+
saveResource: r => {
|
|
319
|
+
snapshot.resources.set(r.url, r);
|
|
320
|
+
if (!r.root) {
|
|
321
|
+
cache.set(r.url, r);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
318
324
|
}
|
|
319
325
|
});
|
|
320
326
|
try {
|
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.
|
|
3
|
+
"version": "1.18.0",
|
|
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.
|
|
43
|
-
"@percy/config": "1.
|
|
44
|
-
"@percy/dom": "1.
|
|
45
|
-
"@percy/logger": "1.
|
|
42
|
+
"@percy/client": "1.18.0",
|
|
43
|
+
"@percy/config": "1.18.0",
|
|
44
|
+
"@percy/dom": "1.18.0",
|
|
45
|
+
"@percy/logger": "1.18.0",
|
|
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": "8aeb759653765fea11e8ebeb96c53a4c4ea616b2"
|
|
57
57
|
}
|