@jsenv/lighthouse-impact 4.1.4 → 4.2.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
@@ -1,4 +1,6 @@
1
- # Lighthouse impact [![npm package](https://img.shields.io/npm/v/@jsenv/lighthouse-impact.svg?logo=npm&label=package)](https://www.npmjs.com/package/@jsenv/lighthouse-impact)
1
+ # Lighthouse impact
2
+
3
+ [![npm package](https://img.shields.io/npm/v/@jsenv/lighthouse-impact.svg?logo=npm&label=package)](https://www.npmjs.com/package/@jsenv/lighthouse-impact)
2
4
 
3
5
  `@jsenv/lighthouse-impact` analyses a pull request impact on lighthouse score. This analysis is posted in a comment of the pull request on GitHub.
4
6
 
package/package.json CHANGED
@@ -1,20 +1,15 @@
1
1
  {
2
2
  "name": "@jsenv/lighthouse-impact",
3
- "version": "4.1.4",
3
+ "version": "4.2.0",
4
4
  "description": "Package description",
5
5
  "license": "MIT",
6
- "author": {
7
- "name": "dmail",
8
- "email": "dmaillard06@gmail.com",
9
- "url": "https://twitter.com/damienmaillard"
10
- },
11
6
  "repository": {
12
7
  "type": "git",
13
- "url": "https://github.com/jsenv/workflow",
14
- "directory": "packages/lighthouse-impact"
8
+ "url": "https://github.com/jsenv/core",
9
+ "directory": "packages/independent/workflow/lighthouse-impact"
15
10
  },
16
11
  "engines": {
17
- "node": ">=16.13.0"
12
+ "node": ">=20.0.0"
18
13
  },
19
14
  "publishConfig": {
20
15
  "access": "public"
@@ -37,9 +32,9 @@
37
32
  "dependencies": {
38
33
  "@jsenv/abort": "4.3.0",
39
34
  "@jsenv/dynamic-import-worker": "1.2.1",
40
- "@jsenv/filesystem": "4.9.8",
41
- "@jsenv/github-pull-request-impact": "1.7.6",
42
- "@jsenv/log": "3.5.2",
43
- "lighthouse": "12.1.0"
35
+ "@jsenv/filesystem": "4.10.2",
36
+ "@jsenv/github-pull-request-impact": "1.8.0",
37
+ "@jsenv/humanize": "1.2.8",
38
+ "lighthouse": "12.2.0"
44
39
  }
45
40
  }
@@ -1,15 +1,14 @@
1
1
  // https://github.com/GoogleChrome/lighthouse/blob/5a14deb5c4e0ec4e8e58f50ff72b53851b021bcf/docs/readme.md#using-programmatically
2
2
 
3
- import { assertAndNormalizeFileUrl, writeFileSync } from "@jsenv/filesystem";
4
- import { createLogger } from "@jsenv/log";
5
3
  import { Abort, raceProcessTeardownEvents } from "@jsenv/abort";
6
-
4
+ import { assertAndNormalizeFileUrl, writeFileSync } from "@jsenv/filesystem";
5
+ import { createLogger } from "@jsenv/humanize";
7
6
  import {
8
- runLighthouse,
9
- reduceToMedianReport,
10
- formatReportAsSummaryText,
11
- formatReportAsJson,
12
7
  formatReportAsHtml,
8
+ formatReportAsJson,
9
+ formatReportAsSummaryText,
10
+ reduceToMedianReport,
11
+ runLighthouse,
13
12
  } from "./lighthouse_api.js";
14
13
 
15
14
  export const generateLighthouseReport = async (
package/src/main.js CHANGED
@@ -1,4 +1,3 @@
1
1
  export { readGitHubWorkflowEnv } from "@jsenv/github-pull-request-impact";
2
-
3
- export { runLighthouseOnPlaywrightPage } from "./run_lighthouse_on_playwright_page.js";
4
2
  export { reportLighthouseImpactInGithubPullRequest } from "./report_lighthouse_impact_in_github_pr.js";
3
+ export { runLighthouseOnPlaywrightPage } from "./run_lighthouse_on_playwright_page.js";
@@ -1,4 +1,4 @@
1
- import { formatNumericDiff } from "./formatNumericDiff.js";
1
+ import { formatNumericDiff } from "./format_numeric_diff.js";
2
2
 
3
3
  export const createLighthouseImpactComment = ({
4
4
  pullRequestBase,
@@ -1,5 +1,5 @@
1
1
  import * as githubRESTAPI from "@jsenv/github-pull-request-impact/src/internal/github_rest_api.js";
2
- import { createDetailedMessage } from "@jsenv/log";
2
+ import { createDetailedMessage } from "@jsenv/humanize";
3
3
 
4
4
  // https://developer.github.com/v3/gists/#create-a-gist
5
5
 
@@ -126,12 +126,8 @@ const createGistBody = (
126
126
  };
127
127
  };
128
128
 
129
- const beforeMergeGistIdRegex = new RegExp(
130
- "<!-- before_merge_gist_id=([a-zA-Z0-9_]+) -->",
131
- );
132
- const afterMergeGistIdRegex = new RegExp(
133
- "<!-- after_merge_gist_id=([a-zA-Z0-9_]+) -->",
134
- );
129
+ const beforeMergeGistIdRegex = /<!-- before_merge_gist_id=([a-zA-Z0-9_]+) -->/;
130
+ const afterMergeGistIdRegex = /<!-- after_merge_gist_id=([a-zA-Z0-9_]+) -->/;
135
131
 
136
132
  const gistIdsFromComment = (comment) => {
137
133
  const beforeMergeGistIdMatch = comment.body.match(beforeMergeGistIdRegex);
@@ -1,9 +1,8 @@
1
+ import { importOneExportFromFile } from "@jsenv/dynamic-import-worker";
1
2
  import { assertAndNormalizeDirectoryUrl } from "@jsenv/filesystem";
2
3
  import { commentGitHubPullRequestImpact } from "@jsenv/github-pull-request-impact";
3
- import { importOneExportFromFile } from "@jsenv/dynamic-import-worker";
4
-
5
- import { patchOrPostGists } from "./pr_impact/patchOrPostGists.js";
6
- import { createLighthouseImpactComment } from "./pr_impact/createLighthouseImpactComment.js";
4
+ import { createLighthouseImpactComment } from "./pr_impact/create_lighthouse_impact_comment.js";
5
+ import { patchOrPostGists } from "./pr_impact/patch_or_post_gists.js";
7
6
 
8
7
  export const reportLighthouseImpactInGithubPullRequest = async ({
9
8
  logLevel,
@@ -108,7 +107,7 @@ export const reportLighthouseImpactInGithubPullRequest = async ({
108
107
  };
109
108
  },
110
109
  generatedByLink: {
111
- url: "https://github.com/jsenv/workflow/tree/main/packages/lighthouse-impact",
110
+ url: "https://github.com/jsenv/core/tree/main/packages/independent/workflow/lighthouse-impact",
112
111
  text: "@jsenv/lighthouse-impact",
113
112
  },
114
113
  runLink,