@percy/sdk-utils 1.0.0-beta.76 → 1.0.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/README.md +6 -6
- package/package.json +19 -12
- package/dist/bundle.js +0 -694
- package/dist/index.js +0 -66
- package/dist/percy-dom.js +0 -26
- package/dist/percy-enabled.js +0 -74
- package/dist/percy-info.js +0 -67
- package/dist/post-snapshot.js +0 -29
- package/dist/request.js +0 -76
- package/test/client.js +0 -314
- package/test/helpers.js +0 -77
- package/test/server.js +0 -208
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ This object contains information about the local Percy environment and is update
|
|
|
21
21
|
[`isPercyEnabled`](#ispercyenabled) is called for the first time.
|
|
22
22
|
|
|
23
23
|
``` js
|
|
24
|
-
|
|
24
|
+
import { percy } from '@percy/sdk-utils'
|
|
25
25
|
|
|
26
26
|
// reflects/updates process.env.PERCY_SERVER_ADDRESS
|
|
27
27
|
percy.address === 'http://localhost:5338'
|
|
@@ -47,7 +47,7 @@ log a message unless the CLI loglevel is `quiet` or `silent`. Upon a successful
|
|
|
47
47
|
remote logging connection is also established.
|
|
48
48
|
|
|
49
49
|
``` js
|
|
50
|
-
|
|
50
|
+
import { isPercyEnabled } from '@percy/sdk-utils'
|
|
51
51
|
|
|
52
52
|
// CLI API not running
|
|
53
53
|
await isPercyEnabled() === false
|
|
@@ -64,7 +64,7 @@ resulting string can be evaulated within a browser context to add the `PercyDOM.
|
|
|
64
64
|
to the global scope. Subsequent calls return the first cached result.
|
|
65
65
|
|
|
66
66
|
``` js
|
|
67
|
-
|
|
67
|
+
import { fetchPercyDOM } from '@percy/sdk-utils'
|
|
68
68
|
|
|
69
69
|
let script = await fetchPercyDOM()
|
|
70
70
|
|
|
@@ -84,7 +84,7 @@ browser.executeScript(script)
|
|
|
84
84
|
Posts snapshot options to the local Percy API server.
|
|
85
85
|
|
|
86
86
|
``` js
|
|
87
|
-
|
|
87
|
+
import { postSnapshot } from '@percy/sdk-utils'
|
|
88
88
|
|
|
89
89
|
await postSnapshot({
|
|
90
90
|
// required
|
|
@@ -106,7 +106,7 @@ await postSnapshot({
|
|
|
106
106
|
Sends a request to the local Percy API server. Used internally by the other SDK utils.
|
|
107
107
|
|
|
108
108
|
``` js
|
|
109
|
-
|
|
109
|
+
import { request } from '@percy/sdk-utils'
|
|
110
110
|
|
|
111
111
|
await request('/percy/idle')
|
|
112
112
|
await request('/percy/stop')
|
|
@@ -122,7 +122,7 @@ The returned object must contain the following normalized properties from the re
|
|
|
122
122
|
`status`, `statusText`, `headers`, `body`
|
|
123
123
|
|
|
124
124
|
``` js
|
|
125
|
-
|
|
125
|
+
import { request } from '@percy/sdk-utils'
|
|
126
126
|
|
|
127
127
|
// Cypress SDK example
|
|
128
128
|
request.fetch = async function fetch(url, options) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@percy/sdk-utils",
|
|
3
|
-
"version": "1.0.0
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -10,16 +10,23 @@
|
|
|
10
10
|
"publishConfig": {
|
|
11
11
|
"access": "public"
|
|
12
12
|
},
|
|
13
|
-
"
|
|
14
|
-
|
|
13
|
+
"engines": {
|
|
14
|
+
"node": ">=14"
|
|
15
|
+
},
|
|
15
16
|
"files": [
|
|
16
|
-
"dist",
|
|
17
|
-
"test/
|
|
18
|
-
"test/
|
|
19
|
-
"test/
|
|
17
|
+
"./dist",
|
|
18
|
+
"./test/server.js",
|
|
19
|
+
"./test/client.js",
|
|
20
|
+
"./test/helpers.js"
|
|
20
21
|
],
|
|
21
|
-
"
|
|
22
|
-
|
|
22
|
+
"main": "./dist/index.js",
|
|
23
|
+
"browser": "./dist/bundle.js",
|
|
24
|
+
"type": "module",
|
|
25
|
+
"exports": {
|
|
26
|
+
".": "./dist/index.js",
|
|
27
|
+
"./test/server": "./test/server.js",
|
|
28
|
+
"./test/client": "./test/client.js",
|
|
29
|
+
"./test/helpers": "./test/helpers.js"
|
|
23
30
|
},
|
|
24
31
|
"scripts": {
|
|
25
32
|
"build": "node ../../scripts/build",
|
|
@@ -28,7 +35,7 @@
|
|
|
28
35
|
"test:coverage": "yarn test --coverage"
|
|
29
36
|
},
|
|
30
37
|
"karma": {
|
|
31
|
-
"run_start": "node test/server start
|
|
38
|
+
"run_start": "node test/server start",
|
|
32
39
|
"run_complete": "node test/server stop"
|
|
33
40
|
},
|
|
34
41
|
"rollup": {
|
|
@@ -51,7 +58,7 @@
|
|
|
51
58
|
}
|
|
52
59
|
},
|
|
53
60
|
"dependencies": {
|
|
54
|
-
"@percy/logger": "1.0.0
|
|
61
|
+
"@percy/logger": "1.0.0"
|
|
55
62
|
},
|
|
56
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "6df509421a60144e4f9f5d59dc57a5675372a0b2"
|
|
57
64
|
}
|