@percy/core 1.32.8 → 1.32.9-beta.1
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 +16 -0
- package/dist/network.js +23 -3
- package/dist/utils.js +3 -0
- package/package.json +10 -10
package/dist/config.js
CHANGED
|
@@ -261,6 +261,12 @@ export const configSchema = {
|
|
|
261
261
|
type: 'boolean',
|
|
262
262
|
onlyAutomate: true
|
|
263
263
|
},
|
|
264
|
+
// Downscales each tile by 1/dpr so the stitched image fits the 50,000px ceiling;
|
|
265
|
+
// without it the DOM walk is capped at 50000/dpr CSS px. fullPage path only.
|
|
266
|
+
scaleToFit: {
|
|
267
|
+
type: 'boolean',
|
|
268
|
+
onlyAutomate: true
|
|
269
|
+
},
|
|
264
270
|
freezeAnimation: {
|
|
265
271
|
// for backward compatibility
|
|
266
272
|
type: 'boolean',
|
|
@@ -1265,6 +1271,16 @@ export const comparisonSchema = {
|
|
|
1265
1271
|
screenshotType: {
|
|
1266
1272
|
type: 'string',
|
|
1267
1273
|
default: 'singlepage'
|
|
1274
|
+
},
|
|
1275
|
+
// additionalProperties is false here and PercyConfig.validate DELETES unknown keys
|
|
1276
|
+
// from the object it validates, so an undeclared key is silently dropped pre-upload.
|
|
1277
|
+
scaleToFit: {
|
|
1278
|
+
type: 'boolean'
|
|
1279
|
+
},
|
|
1280
|
+
appliedScaleFactor: {
|
|
1281
|
+
type: 'number',
|
|
1282
|
+
exclusiveMinimum: 0,
|
|
1283
|
+
maximum: 1
|
|
1268
1284
|
}
|
|
1269
1285
|
}
|
|
1270
1286
|
},
|
package/dist/network.js
CHANGED
|
@@ -731,9 +731,29 @@ export function logAssetInstrumentation(log, category, reason, details) {
|
|
|
731
731
|
});
|
|
732
732
|
}
|
|
733
733
|
|
|
734
|
-
//
|
|
735
|
-
|
|
736
|
-
|
|
734
|
+
// True when `from` is `to` with an https:// scheme — the abandoned leg of
|
|
735
|
+
// Chrome's HTTPS-upgrade fallback.
|
|
736
|
+
function isHttpsUpgradeFallback(from, to) {
|
|
737
|
+
return from.startsWith('https://') && to.startsWith('http://') && from.slice('https:'.length) === to.slice('http:'.length);
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
// Returns the URL the document referenced — the head of the redirect chain for
|
|
741
|
+
// a real server redirect. Chrome surfaces its HTTPS-upgrade fallback as a
|
|
742
|
+
// redirect hop, so an http:// URL arrives with the abandoned https:// attempt
|
|
743
|
+
// at the head. Keying a resource under that URL hides the snapshot's own root
|
|
744
|
+
// resource and leaks the fetched page to later snapshots through the URL-keyed
|
|
745
|
+
// discovery cache, so skip those hops. A genuine same-path https->http server
|
|
746
|
+
// redirect is indistinguishable from the fallback and is skipped too; that is
|
|
747
|
+
// rare enough (misconfigured proxies) to be the better trade.
|
|
748
|
+
export function originURL(request) {
|
|
749
|
+
let chain = request.redirectChain;
|
|
750
|
+
for (let i = 0; i < chain.length; i++) {
|
|
751
|
+
var _chain;
|
|
752
|
+
let url = normalizeURL(chain[i].url);
|
|
753
|
+
let next = normalizeURL(((_chain = chain[i + 1]) === null || _chain === void 0 ? void 0 : _chain.url) ?? request.url);
|
|
754
|
+
if (!isHttpsUpgradeFallback(url, next)) return url;
|
|
755
|
+
}
|
|
756
|
+
return normalizeURL(request.url);
|
|
737
757
|
}
|
|
738
758
|
|
|
739
759
|
// Convert Fetch event responseHeaders ([{name, value}, …]) to a header object.
|
package/dist/utils.js
CHANGED
|
@@ -388,6 +388,9 @@ export function percyAutomateRequestHandler(req, percy) {
|
|
|
388
388
|
});
|
|
389
389
|
req.body.options = merge([{
|
|
390
390
|
fullPage: percy.config.snapshot.fullPage,
|
|
391
|
+
// Must be listed here or a .percy.yml `snapshot.scaleToFit` validates and is then
|
|
392
|
+
// silently dropped -- the page truncates as before while the build stays green.
|
|
393
|
+
scaleToFit: percy.config.snapshot.scaleToFit,
|
|
391
394
|
percyCSS: percy.config.snapshot.percyCSS,
|
|
392
395
|
freezeAnimatedImage: percy.config.snapshot.freezeAnimatedImage || percy.config.snapshot.freezeAnimation,
|
|
393
396
|
freezeImageBySelectors: (_percy$config$snapsho = percy.config.snapshot.freezeAnimatedImageOptions) === null || _percy$config$snapsho === void 0 ? void 0 : _percy$config$snapsho.freezeImageBySelectors,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@percy/core",
|
|
3
|
-
"version": "1.32.
|
|
3
|
+
"version": "1.32.9-beta.1",
|
|
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": "
|
|
12
|
+
"tag": "beta"
|
|
13
13
|
},
|
|
14
14
|
"engines": {
|
|
15
15
|
"node": ">=14"
|
|
@@ -46,12 +46,12 @@
|
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@grpc/grpc-js": "^1.14.3",
|
|
48
48
|
"@grpc/proto-loader": "^0.8.0",
|
|
49
|
-
"@percy/client": "1.32.
|
|
50
|
-
"@percy/config": "1.32.
|
|
51
|
-
"@percy/dom": "1.32.
|
|
52
|
-
"@percy/logger": "1.32.
|
|
53
|
-
"@percy/monitoring": "1.32.
|
|
54
|
-
"@percy/webdriver-utils": "1.32.
|
|
49
|
+
"@percy/client": "1.32.9-beta.1",
|
|
50
|
+
"@percy/config": "1.32.9-beta.1",
|
|
51
|
+
"@percy/dom": "1.32.9-beta.1",
|
|
52
|
+
"@percy/logger": "1.32.9-beta.1",
|
|
53
|
+
"@percy/monitoring": "1.32.9-beta.1",
|
|
54
|
+
"@percy/webdriver-utils": "1.32.9-beta.1",
|
|
55
55
|
"adm-zip": "^0.6.0",
|
|
56
56
|
"busboy": "^1.6.0",
|
|
57
57
|
"content-disposition": "^0.5.4",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"yaml": "^2.4.1"
|
|
68
68
|
},
|
|
69
69
|
"optionalDependencies": {
|
|
70
|
-
"@percy/cli-doctor": "1.32.
|
|
70
|
+
"@percy/cli-doctor": "1.32.9-beta.1"
|
|
71
71
|
},
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "107da3aefa7aa29c36ee8b6fcf5b888f1a2618dc"
|
|
73
73
|
}
|