@jsenv/file-size-impact 14.2.1 → 14.3.1
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/bin/filesize.mjs +1 -1
- package/package.json +6 -8
- package/readme.md +3 -1
- package/src/{generateFileSizeReport.js → generate_file_size_report.js} +6 -7
- package/src/{gzipTransformation.js → gzip_transformation.js} +1 -1
- package/src/internal/{compareTwoFileSizeReports.js → compare_two_file_size_reports.js} +1 -2
- package/src/internal/{formatComment.js → format_comment.js} +5 -5
- package/src/internal/{formatFileSizeReportForLog.js → format_file_size_report_for_log.js} +2 -2
- package/src/internal/{jsenvCommentParameters.js → jsenv_comment_parameters.js} +1 -1
- package/src/main.js +5 -6
- package/src/report_file_size_impact_in_github_pr.js +4 -5
- package/src/{brotliTransformation.js → brotli_transformation.js} +0 -0
- package/src/internal/{applyTrackingConfig.js → apply_tracking_config.js} +1 -1
- /package/src/internal/{formatSize.js → format_size.js} +0 -0
- /package/src/internal/{orderBySizeImpact.js → order_by_size_impact.js} +0 -0
- /package/src/internal/{renderImpactTable.js → render_impact_table.js} +0 -0
- /package/src/{jsenvTrackingConfig.js → jsenv_tracking_config.js} +0 -0
- /package/src/{rawTransformation.js → raw_transformation.js} +0 -0
package/bin/filesize.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { pathToFileURL } from "node:url";
|
|
4
3
|
import { generateFileSizeReport } from "@jsenv/file-size-impact";
|
|
4
|
+
import { pathToFileURL } from "node:url";
|
|
5
5
|
|
|
6
6
|
const cwdUrl = `${pathToFileURL(process.cwd())}/`;
|
|
7
7
|
const argv = process.argv.slice(2);
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsenv/file-size-impact",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.3.1",
|
|
4
4
|
"description": "Add files size impact into pull requests",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
|
-
"url": "https://github.com/jsenv/
|
|
9
|
-
"directory": "packages/file-size-impact"
|
|
8
|
+
"url": "https://github.com/jsenv/core",
|
|
9
|
+
"directory": "packages/independent/workflow/file-size-impact"
|
|
10
10
|
},
|
|
11
11
|
"engines": {
|
|
12
|
-
"node": ">=
|
|
12
|
+
"node": ">=20.0.0"
|
|
13
13
|
},
|
|
14
14
|
"publishConfig": {
|
|
15
15
|
"access": "public"
|
|
@@ -30,14 +30,12 @@
|
|
|
30
30
|
],
|
|
31
31
|
"scripts": {
|
|
32
32
|
"snapshot": "node ./tests/comment/generate_comment_snapshot_file.mjs",
|
|
33
|
-
"test": "node ./scripts/test.mjs",
|
|
34
33
|
"file-size": "node ./scripts/file_size.mjs --log"
|
|
35
34
|
},
|
|
36
35
|
"dependencies": {
|
|
37
36
|
"@jsenv/dynamic-import-worker": "1.2.1",
|
|
38
|
-
"@jsenv/filesystem": "4.10.
|
|
39
|
-
"@jsenv/github-pull-request-impact": "1.
|
|
40
|
-
"@jsenv/log": "3.5.2",
|
|
37
|
+
"@jsenv/filesystem": "4.10.3",
|
|
38
|
+
"@jsenv/github-pull-request-impact": "1.8.1",
|
|
41
39
|
"@jsenv/urls": "2.5.2",
|
|
42
40
|
"@jsenv/humanize": "1.2.8"
|
|
43
41
|
}
|
package/readme.md
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
# File size impact
|
|
1
|
+
# File size impact
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@jsenv/file-size-impact)
|
|
2
4
|
|
|
3
5
|
`@jsenv/file-size-impact` analyses a pull request impact on specific files size. This analysis is posted in a comment of the pull request on GitHub.
|
|
4
6
|
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { fileURLToPath } from "node:url";
|
|
2
1
|
import {
|
|
3
2
|
assertAndNormalizeDirectoryUrl,
|
|
4
3
|
bufferToEtag,
|
|
5
4
|
readFile,
|
|
6
5
|
} from "@jsenv/filesystem";
|
|
7
|
-
import { createDetailedMessage, createLogger } from "@jsenv/
|
|
8
|
-
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
6
|
+
import { createDetailedMessage, createLogger } from "@jsenv/humanize";
|
|
7
|
+
import { fileURLToPath } from "node:url";
|
|
8
|
+
import { applyTrackingConfig } from "./internal/apply_tracking_config.js";
|
|
9
|
+
import { formatFileSizeReportForLog } from "./internal/format_file_size_report_for_log.js";
|
|
10
|
+
import { jsenvTrackingConfig } from "./jsenv_tracking_config.js";
|
|
11
|
+
import { transform as rawTransform } from "./raw_transformation.js";
|
|
13
12
|
|
|
14
13
|
export const generateFileSizeReport = async ({
|
|
15
14
|
cancellationToken,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { comparePathnames } from "@jsenv/filesystem";
|
|
2
|
-
|
|
3
|
-
import { manifestToMappings, manifestKeyFromRelativeUrl } from "./manifest.js";
|
|
2
|
+
import { manifestKeyFromRelativeUrl, manifestToMappings } from "./manifest.js";
|
|
4
3
|
|
|
5
4
|
export const compareTwoFileSizeReports = ({
|
|
6
5
|
afterMergeFileSizeReport,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { compareTwoFileSizeReports } from "./
|
|
2
|
-
import { isAdded,
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { compareTwoFileSizeReports } from "./compare_two_file_size_reports.js";
|
|
2
|
+
import { isAdded, isDeleted, isModified } from "./helper.js";
|
|
3
|
+
import { orderBySizeImpact } from "./order_by_size_impact.js";
|
|
4
|
+
import { renderImpactTable } from "./render_impact_table.js";
|
|
5
|
+
import { getSizeMapsForManyFiles, getSizeMapsOneFile } from "./size_map.js";
|
|
6
6
|
|
|
7
7
|
export const formatComment = ({
|
|
8
8
|
pullRequestBase,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { formatSize } from "./
|
|
2
|
-
import {
|
|
1
|
+
import { formatSize } from "./format_size.js";
|
|
2
|
+
import { manifestKeyFromRelativeUrl, manifestToMappings } from "./manifest.js";
|
|
3
3
|
|
|
4
4
|
export const formatFileSizeReportForLog = (fileSizeReport) => {
|
|
5
5
|
const { groups } = fileSizeReport;
|
package/src/main.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
export { readGitHubWorkflowEnv } from "@jsenv/github-pull-request-impact";
|
|
2
|
-
|
|
3
|
-
export {
|
|
4
|
-
export { transform as
|
|
5
|
-
export {
|
|
6
|
-
export { transform as
|
|
7
|
-
export { generateFileSizeReport } from "./generateFileSizeReport.js";
|
|
2
|
+
export { transform as brotli } from "./brotli_transformation.js";
|
|
3
|
+
export { generateFileSizeReport } from "./generate_file_size_report.js";
|
|
4
|
+
export { transform as gzip } from "./gzip_transformation.js";
|
|
5
|
+
export { jsenvTrackingConfig } from "./jsenv_tracking_config.js";
|
|
6
|
+
export { transform as raw } from "./raw_transformation.js";
|
|
8
7
|
export { reportFileSizeImpactInGitHubPullRequest } from "./report_file_size_impact_in_github_pr.js";
|
|
@@ -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 {
|
|
4
|
-
|
|
5
|
-
import { formatComment } from "./internal/formatComment.js";
|
|
6
|
-
import { jsenvCommentParameters } from "./internal/jsenvCommentParameters.js";
|
|
4
|
+
import { formatComment } from "./internal/format_comment.js";
|
|
5
|
+
import { jsenvCommentParameters } from "./internal/jsenv_comment_parameters.js";
|
|
7
6
|
|
|
8
7
|
export const reportFileSizeImpactInGitHubPullRequest = async ({
|
|
9
8
|
logLevel,
|
|
@@ -106,7 +105,7 @@ export const reportFileSizeImpactInGitHubPullRequest = async ({
|
|
|
106
105
|
});
|
|
107
106
|
},
|
|
108
107
|
generatedByLink: {
|
|
109
|
-
url: "https://github.com/jsenv/
|
|
108
|
+
url: "https://github.com/jsenv/core/tree/main/packages/independent/workflow/file-size-impact",
|
|
110
109
|
text: "@jsenv/file-size-impact",
|
|
111
110
|
},
|
|
112
111
|
runLink,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|