@percy/client 1.0.0-beta.69 → 1.0.0-beta.72
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 +6 -4
- package/dist/index.js +10 -2
- package/dist/request.js +6 -3
- package/dist/utils.js +2 -6
- package/package.json +13 -13
package/dist/client.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default = void 0;
|
|
6
|
+
exports.default = exports.PercyClient = void 0;
|
|
7
7
|
|
|
8
8
|
var _env = _interopRequireDefault(require("@percy/env"));
|
|
9
9
|
|
|
@@ -39,7 +39,7 @@ function validateProjectPath(path) {
|
|
|
39
39
|
if (!path) throw new Error('Missing project path');
|
|
40
40
|
|
|
41
41
|
if (!/^[^/]+?\/.+/.test(path)) {
|
|
42
|
-
throw new Error(`Invalid project path. Expected "org/project" but
|
|
42
|
+
throw new Error(`Invalid project path. Expected "org/project" but received "${path}"`);
|
|
43
43
|
}
|
|
44
44
|
} // PercyClient is used to communicate with the Percy API to create and finalize
|
|
45
45
|
// builds and snapshot. Uses @percy/env to collect environment information used
|
|
@@ -228,7 +228,7 @@ class PercyClient {
|
|
|
228
228
|
let data = await fetchData();
|
|
229
229
|
let state = data === null || data === void 0 ? void 0 : data.attributes.state;
|
|
230
230
|
let pending = !state || state === 'pending' || state === 'processing';
|
|
231
|
-
let updated = JSON.stringify(data) !== JSON.stringify(last); // new data
|
|
231
|
+
let updated = JSON.stringify(data) !== JSON.stringify(last); // new data received
|
|
232
232
|
|
|
233
233
|
if (updated) {
|
|
234
234
|
t = Date.now(); // no new data within the timeout
|
|
@@ -366,4 +366,6 @@ class PercyClient {
|
|
|
366
366
|
|
|
367
367
|
}
|
|
368
368
|
|
|
369
|
-
exports.
|
|
369
|
+
exports.PercyClient = PercyClient;
|
|
370
|
+
var _default = PercyClient;
|
|
371
|
+
exports.default = _default;
|
package/dist/index.js
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
Object.defineProperty(exports, "PercyClient", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _client.PercyClient;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
6
12
|
Object.defineProperty(exports, "default", {
|
|
7
13
|
enumerable: true,
|
|
8
14
|
get: function () {
|
|
@@ -10,6 +16,8 @@ Object.defineProperty(exports, "default", {
|
|
|
10
16
|
}
|
|
11
17
|
});
|
|
12
18
|
|
|
13
|
-
var _client =
|
|
19
|
+
var _client = _interopRequireWildcard(require("./client"));
|
|
20
|
+
|
|
21
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
14
22
|
|
|
15
|
-
function
|
|
23
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
package/dist/request.js
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.ProxyHttpsAgent = exports.ProxyHttpAgent = void 0;
|
|
7
|
-
exports.default = request;
|
|
6
|
+
exports.default = exports.ProxyHttpsAgent = exports.ProxyHttpAgent = void 0;
|
|
8
7
|
exports.getProxy = getProxy;
|
|
9
8
|
exports.href = href;
|
|
10
9
|
exports.port = port;
|
|
11
10
|
exports.proxyAgentFor = proxyAgentFor;
|
|
11
|
+
exports.request = request;
|
|
12
12
|
|
|
13
13
|
var _net = _interopRequireDefault(require("net"));
|
|
14
14
|
|
|
@@ -297,4 +297,7 @@ function request(url, options = {}, callback) {
|
|
|
297
297
|
retries,
|
|
298
298
|
interval
|
|
299
299
|
});
|
|
300
|
-
}
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
var _default = request;
|
|
303
|
+
exports.default = _default;
|
package/dist/utils.js
CHANGED
|
@@ -74,15 +74,11 @@ function retry(fn, {
|
|
|
74
74
|
interval = 50
|
|
75
75
|
}) {
|
|
76
76
|
return new Promise((resolve, reject) => {
|
|
77
|
-
|
|
78
|
-
let run = () => {
|
|
79
|
-
fn(resolve, reject, retry);
|
|
80
|
-
retries--;
|
|
81
|
-
}; // wait an interval to try again or reject with the error
|
|
77
|
+
let run = () => fn(resolve, reject, retry); // wait an interval to try again or reject with the error
|
|
82
78
|
|
|
83
79
|
|
|
84
80
|
let retry = err => {
|
|
85
|
-
if (retries) {
|
|
81
|
+
if (retries-- > 0) {
|
|
86
82
|
setTimeout(run, interval);
|
|
87
83
|
} else {
|
|
88
84
|
reject(err);
|
package/package.json
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@percy/client",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.72",
|
|
4
4
|
"license": "MIT",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/percy/cli",
|
|
8
|
+
"directory": "packages/client"
|
|
9
|
+
},
|
|
10
|
+
"publishConfig": {
|
|
11
|
+
"access": "public"
|
|
12
|
+
},
|
|
5
13
|
"main": "dist/index.js",
|
|
6
14
|
"files": [
|
|
7
15
|
"dist",
|
|
@@ -16,20 +24,12 @@
|
|
|
16
24
|
"test": "node ../../scripts/test",
|
|
17
25
|
"test:coverage": "yarn test --coverage"
|
|
18
26
|
},
|
|
19
|
-
"
|
|
20
|
-
"
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"@percy/env": "1.0.0-beta.72",
|
|
29
|
+
"@percy/logger": "1.0.0-beta.72"
|
|
21
30
|
},
|
|
22
31
|
"devDependencies": {
|
|
23
32
|
"mock-require": "^3.0.3"
|
|
24
33
|
},
|
|
25
|
-
"
|
|
26
|
-
"@percy/env": "1.0.0-beta.69",
|
|
27
|
-
"@percy/logger": "1.0.0-beta.69"
|
|
28
|
-
},
|
|
29
|
-
"repository": {
|
|
30
|
-
"type": "git",
|
|
31
|
-
"url": "https://github.com/percy/cli",
|
|
32
|
-
"directory": "packages/client"
|
|
33
|
-
},
|
|
34
|
-
"gitHead": "99b0617016a07c9d7d4ca37c1442011c904cf860"
|
|
34
|
+
"gitHead": "6219287e18a0cacb609d0c2696a5785abc9009b9"
|
|
35
35
|
}
|