@mui/internal-bundle-size-checker 1.0.9-canary.42 → 1.0.9-canary.44
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/package.json +3 -3
- package/src/cli.js +21 -4
- package/src/constants.js +1 -0
- package/src/renderMarkdownReport.js +2 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/internal-bundle-size-checker",
|
|
3
|
-
"version": "1.0.9-canary.
|
|
3
|
+
"version": "1.0.9-canary.44",
|
|
4
4
|
"description": "Bundle size checker for MUI packages.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"micromatch": "^4.0.8",
|
|
30
30
|
"piscina": "^5.1.3",
|
|
31
31
|
"rollup-plugin-visualizer": "^6.0.3",
|
|
32
|
-
"vite": "^7.1.
|
|
32
|
+
"vite": "^7.1.6",
|
|
33
33
|
"yargs": "^18.0.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@types/micromatch": "^4.0.9",
|
|
38
38
|
"@types/yargs": "^17.0.33"
|
|
39
39
|
},
|
|
40
|
-
"gitSha": "
|
|
40
|
+
"gitSha": "1585df080a8b1e0f911796ffea739b7a8e1bda6f",
|
|
41
41
|
"scripts": {
|
|
42
42
|
"typescript": "tsc -p tsconfig.json",
|
|
43
43
|
"test": "pnpm -w test --project @mui/internal-bundle-size-checker"
|
package/src/cli.js
CHANGED
|
@@ -13,6 +13,21 @@ import { renderMarkdownReport } from './renderMarkdownReport.js';
|
|
|
13
13
|
import { octokit } from './github.js';
|
|
14
14
|
import { getCurrentRepoInfo } from './git.js';
|
|
15
15
|
import { notifyPr } from './notifyPr.js';
|
|
16
|
+
import { DASHBOARD_ORIGIN } from './constants.js';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @param {string} repo
|
|
20
|
+
* @param {number} prNumber
|
|
21
|
+
* @param {string} bundleSizeInfo
|
|
22
|
+
*/
|
|
23
|
+
function formatComment(repo, prNumber, bundleSizeInfo) {
|
|
24
|
+
return [
|
|
25
|
+
'## Bundle size report',
|
|
26
|
+
bundleSizeInfo,
|
|
27
|
+
'<hr>',
|
|
28
|
+
`Check out the [code infra dashboard](${DASHBOARD_ORIGIN}/repository/${repo}/prs/${prNumber}) for more information about this PR.`,
|
|
29
|
+
].join('\n\n');
|
|
30
|
+
}
|
|
16
31
|
|
|
17
32
|
/**
|
|
18
33
|
*/
|
|
@@ -123,9 +138,11 @@ async function postInitialPrComment() {
|
|
|
123
138
|
// eslint-disable-next-line no-console
|
|
124
139
|
console.log('Posting initial PR comment...');
|
|
125
140
|
|
|
126
|
-
const initialComment =
|
|
127
|
-
|
|
128
|
-
|
|
141
|
+
const initialComment = formatComment(
|
|
142
|
+
ciInfo.slug,
|
|
143
|
+
prNumber,
|
|
144
|
+
`Bundle size will be reported once [CircleCI build #${circleBuildNum}](${circleBuildUrl}) finishes.\n\nStatus: 🟠 Processing...`,
|
|
145
|
+
);
|
|
129
146
|
|
|
130
147
|
await notifyPr(ciInfo.slug, prNumber, 'bundle-size-report', initialComment);
|
|
131
148
|
|
|
@@ -273,7 +290,7 @@ async function run(argv) {
|
|
|
273
290
|
ciInfo.slug,
|
|
274
291
|
prNumber,
|
|
275
292
|
'bundle-size-report',
|
|
276
|
-
|
|
293
|
+
formatComment(ciInfo.slug, prNumber, report),
|
|
277
294
|
);
|
|
278
295
|
|
|
279
296
|
// eslint-disable-next-line no-console
|
package/src/constants.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const DASHBOARD_ORIGIN = 'https://frontend-public.mui.com';
|
|
@@ -9,6 +9,7 @@ import { fetchSnapshot } from './fetchSnapshot.js';
|
|
|
9
9
|
import { displayPercentFormatter, byteSizeChangeFormatter } from './formatUtils.js';
|
|
10
10
|
import { getMergeBase } from './git.js';
|
|
11
11
|
import { fetchSnapshotWithFallback } from './fetchSnapshotWithFallback.js';
|
|
12
|
+
import { DASHBOARD_ORIGIN } from './constants.js';
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
* Generates a symbol based on the relative change value.
|
|
@@ -202,7 +203,7 @@ export function renderMarkdownReportContent(
|
|
|
202
203
|
function getDetailsUrl(prInfo, options = {}) {
|
|
203
204
|
const { actualBaseCommit } = options;
|
|
204
205
|
const detailedComparisonUrl = new URL(
|
|
205
|
-
|
|
206
|
+
`${DASHBOARD_ORIGIN}/size-comparison/${prInfo.base.repo.full_name}/diff`,
|
|
206
207
|
);
|
|
207
208
|
detailedComparisonUrl.searchParams.set('prNumber', String(prInfo.number));
|
|
208
209
|
detailedComparisonUrl.searchParams.set('baseRef', prInfo.base.ref);
|