@percy/client 1.28.3-beta.1 → 1.28.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/client.js +7 -1
- package/package.json +6 -5
package/dist/client.js
CHANGED
|
@@ -2,6 +2,7 @@ import fs from 'fs';
|
|
|
2
2
|
import PercyEnv from '@percy/env';
|
|
3
3
|
import { git } from '@percy/env/utils';
|
|
4
4
|
import logger from '@percy/logger';
|
|
5
|
+
import Pako from 'pako';
|
|
5
6
|
import { pool, request, formatBytes, sha256hash, base64encode, getPackageJSON, waitForTimeout, validateTiles } from './utils.js';
|
|
6
7
|
|
|
7
8
|
// Default client API URL can be set with an env var for API development
|
|
@@ -315,7 +316,12 @@ export class PercyClient {
|
|
|
315
316
|
content
|
|
316
317
|
} = {}) {
|
|
317
318
|
validateId('build', buildId);
|
|
318
|
-
if (filepath)
|
|
319
|
+
if (filepath) {
|
|
320
|
+
content = await fs.promises.readFile(filepath);
|
|
321
|
+
if (process.env.PERCY_GZIP) {
|
|
322
|
+
content = Pako.gzip(content);
|
|
323
|
+
}
|
|
324
|
+
}
|
|
319
325
|
let encodedContent = base64encode(content);
|
|
320
326
|
this.log.debug(`Uploading ${formatBytes(encodedContent.length)} resource: ${url}...`);
|
|
321
327
|
this.mayBeLogUploadSize(encodedContent.length);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@percy/client",
|
|
3
|
-
"version": "1.28.3
|
|
3
|
+
"version": "1.28.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": "
|
|
12
|
+
"tag": "latest"
|
|
13
13
|
},
|
|
14
14
|
"engines": {
|
|
15
15
|
"node": ">=14"
|
|
@@ -32,8 +32,9 @@
|
|
|
32
32
|
"test:coverage": "yarn test --coverage"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@percy/env": "1.28.3
|
|
36
|
-
"@percy/logger": "1.28.3
|
|
35
|
+
"@percy/env": "1.28.3",
|
|
36
|
+
"@percy/logger": "1.28.3",
|
|
37
|
+
"pako": "^2.1.0"
|
|
37
38
|
},
|
|
38
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "5d41045921c7ac06329c4b72caaf291d34e3f699"
|
|
39
40
|
}
|