@jsenv/lighthouse-impact 4.0.0-alpha.2 → 4.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
CHANGED
|
@@ -142,11 +142,11 @@ _report_lighthouse_impact.mjs_
|
|
|
142
142
|
*/
|
|
143
143
|
|
|
144
144
|
import {
|
|
145
|
-
|
|
145
|
+
reportLighthouseImpactInGithubPullRequest,
|
|
146
146
|
readGitHubWorkflowEnv,
|
|
147
147
|
} from "@jsenv/lighthouse-impact"
|
|
148
148
|
|
|
149
|
-
await
|
|
149
|
+
await reportLighthouseImpactInGithubPullRequest({
|
|
150
150
|
...readGitHubWorkflowEnv(),
|
|
151
151
|
lighthouseReportUrl: new URL(
|
|
152
152
|
"./lighthouse.mjs#lighthouseReport",
|
|
@@ -183,10 +183,10 @@ It means you must pass several parameters to _reportLighthouseImpact_.
|
|
|
183
183
|
The example below assume code is executed by Travis.
|
|
184
184
|
|
|
185
185
|
```diff
|
|
186
|
-
- import {
|
|
187
|
-
+ import {
|
|
186
|
+
- import { reportLighthouseImpactInGithubPullRequest, readGitHubWorkflowEnv } from "@jsenv/lighthouse-impact"
|
|
187
|
+
+ import { reportLighthouseImpactInGithubPullRequest } from "@jsenv/lighthouse-impact"
|
|
188
188
|
|
|
189
|
-
|
|
189
|
+
reportLighthouseImpactInGithubPullRequest({
|
|
190
190
|
- ...readGitHubWorkflowEnv(),
|
|
191
191
|
+ rootDirectoryUrl: process.env.TRAVIS_BUILD_DIR,
|
|
192
192
|
+ repositoryOwner: process.env.TRAVIS_REPO_SLUG.split("/")[0],
|
package/package.json
CHANGED
|
@@ -31,13 +31,10 @@ export const runLighthouseOnPlaywrightPage = async (
|
|
|
31
31
|
const viewportMeta = document.head.querySelector("meta[name=viewport]")
|
|
32
32
|
if (viewportMeta) {
|
|
33
33
|
mutate = () => {
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
"content",
|
|
37
|
-
`width=${viewportWidthNow + 1}`,
|
|
38
|
-
)
|
|
34
|
+
const content = viewportMeta.content
|
|
35
|
+
viewportMeta.setAttribute("content", `width=${viewportWidthNow + 1}`)
|
|
39
36
|
return () => {
|
|
40
|
-
|
|
37
|
+
viewportMeta.setAttribute("content", content)
|
|
41
38
|
}
|
|
42
39
|
}
|
|
43
40
|
} else {
|