@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
- reportLighthouseImpact,
145
+ reportLighthouseImpactInGithubPullRequest,
146
146
  readGitHubWorkflowEnv,
147
147
  } from "@jsenv/lighthouse-impact"
148
148
 
149
- await reportLighthouseImpact({
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 { reportLighthouseImpact, readGitHubWorkflowEnv } from "@jsenv/lighthouse-impact"
187
- + import { reportLighthouseImpact } from "@jsenv/lighthouse-impact"
186
+ - import { reportLighthouseImpactInGithubPullRequest, readGitHubWorkflowEnv } from "@jsenv/lighthouse-impact"
187
+ + import { reportLighthouseImpactInGithubPullRequest } from "@jsenv/lighthouse-impact"
188
188
 
189
- reportLighthouseImpact({
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/lighthouse-impact",
3
- "version": "4.0.0-alpha.2",
3
+ "version": "4.0.0",
4
4
  "description": "Package description",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -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 contentBefore = viewportWidthNow.content
35
- viewportWidthNow.setAttribute(
36
- "content",
37
- `width=${viewportWidthNow + 1}`,
38
- )
34
+ const content = viewportMeta.content
35
+ viewportMeta.setAttribute("content", `width=${viewportWidthNow + 1}`)
39
36
  return () => {
40
- viewportWidthNow.setAttribute("content", contentBefore)
37
+ viewportMeta.setAttribute("content", content)
41
38
  }
42
39
  }
43
40
  } else {