From 09f058f29a42ba553d908fd83e0652675a1782f9 Mon Sep 17 00:00:00 2001 From: syuilo <4439005+syuilo@users.noreply.github.com> Date: Sat, 20 Jun 2026 15:27:43 +0900 Subject: [PATCH] Update frontend-js-size.yml --- .github/workflows/frontend-js-size.yml | 39 +++++++++++++------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/.github/workflows/frontend-js-size.yml b/.github/workflows/frontend-js-size.yml index 90b212738e..630b659be9 100644 --- a/.github/workflows/frontend-js-size.yml +++ b/.github/workflows/frontend-js-size.yml @@ -92,7 +92,6 @@ jobs: const marker = ''; const locale = process.env.FRONTEND_JS_SIZE_LOCALE || 'ja-JP'; - const topLimit = 10; function normalizePath(filePath) { return filePath.split(path.sep).join('/'); @@ -155,7 +154,7 @@ jobs: if (diff === 0) return '0 B'; const sign = diff > 0 ? '+' : '-'; const text = `${sign}${formatBytes(Math.abs(diff))}`; - const color = diff > 0 ? 'orange' : 'cyan'; + const color = diff > 0 ? 'orange' : 'green'; return `$\\color{${color}}{\\text{${formatMathText(text)}}}$`; } @@ -163,9 +162,8 @@ jobs: if (diff == null) return '-'; const percent = formatPercent(diff, beforeSize); if (diff === 0) return `${percent}`; - const sign = diff > 0 ? '+' : '-'; - const text = `${sign}${percent}`; - const color = diff > 0 ? 'orange' : 'cyan'; + const text = `${percent}`; + const color = diff > 0 ? 'orange' : 'green'; return `$\\color{${color}}{\\text{${formatMathText(text)}}}$`; } @@ -354,7 +352,7 @@ jobs: function topKeys(keys, before, after) { return compareRows(keys, before, after) .sort((a, b) => b.sortSize - a.sortSize || a.name.localeCompare(b.name)) - .slice(0, topLimit) + .slice(0, 30) .map((row) => row.key); } @@ -365,11 +363,11 @@ jobs: || a.name.localeCompare(b.name); } - function topDiffKeys(keys, before, after) { + function diffKeys(keys, before, after) { return compareRows(keys, before, after) .filter((row) => row.diff !== 0 && row.diff != null) .sort(compareDiffRows) - .slice(0, topLimit) + .slice(0, 30) .map((row) => row.key); } @@ -386,7 +384,7 @@ jobs: const topRows = compareRows(topKeys(commonChunkKeys, before, after), before, after) .sort((a, b) => b.sortSize - a.sortSize || a.name.localeCompare(b.name)); - const diffRows = compareRows(topDiffKeys(commonChunkKeys, before, after), before, after) + const diffRows = compareRows(diffKeys(commonChunkKeys, before, after), before, after) .sort(compareDiffRows); const addedRows = chunkRows(addedKeys(before, after), after) @@ -404,35 +402,31 @@ jobs: const body = [ marker, - `## Frontend size report (${locale})`, + `## Frontend chunk size report (${locale})`, '', - '### Top 10 largest chunk diffs', + '
', + `Diffs`, '', markdownTable(diffRows, '_No chunk size changes found._'), '', - '### Top 10 largest chunks', - '
', - '', - markdownTable(topRows), - '', '
', '', - `### Added chunks (${addedRows.length})`, '
', + `Added (${addedRows.length})`, '', markdownChunkTable(addedRows, '_No chunks added._'), '', '
', '', - `### Removed chunks (${removedRows.length})`, '
', + `Removed (${removedRows.length})`, '', markdownChunkTable(removedRows, '_No chunks removed._'), '', '
', '', - '### Startup chunks', '
', + `Startup`, '', markdownTable(startupRows), '', @@ -440,6 +434,13 @@ jobs: '', '
', '', + '
', + `Largest`, + '', + markdownTable(topRows), + '', + '
', + '', ].join('\n'); await fs.writeFile(outFile, body);