File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -91,8 +91,13 @@ export function main() {
91
91
<thead><tr><th>File</th><th>Diff (B)</th><th>Diff (%)</th></tr></thead>
92
92
<tbody>` ;
93
93
for ( const [ file , details ] of files . entries ( ) ) {
94
+ const isBridge = file . includes ( 'src/Bridge' ) ;
95
+ const packageName = file . split ( '/' ) [ 1 ] ;
96
+ const bridgeName = isBridge ? file . split ( '/' ) [ 4 ] : '' ;
97
+ const fileShort = file . replace ( isBridge ? `src/${ packageName } /src/Bridge/${ bridgeName } /assets/dist/` : `src/${ packageName } /assets/dist/` , '' ) ;
98
+ output += `<tr><td colspan="3"><b>${ packageName } </b></td></tr>` ;
94
99
output += `<tr>
95
- <td><code>${ file } </code> ${ details . state === 'added' ? '(new)' : ( details . state === 'removed' ? '(deleted)' : '' ) } </td>
100
+ <td><code>${ fileShort } </code> ${ details . state === 'added' ? '(new)' : ( details . state === 'removed' ? '(deleted)' : '' ) } </td>
96
101
<td>
97
102
Size: <code>${ formatBytes ( base [ file ] ?. size || 0 ) } </code> → <code>${ formatBytes ( pr [ file ] ?. size || 0 ) } </code><br>
98
103
Gzip: <code>${ formatBytes ( base [ file ] ?. size_gz || 0 ) } </code> → <code>${ formatBytes ( pr [ file ] ?. size_gz || 0 ) } </code><br>
Original file line number Diff line number Diff line change @@ -3,9 +3,8 @@ name: Dist Files Size Diff
3
3
on :
4
4
pull_request :
5
5
paths :
6
- - ' src/*/**'
7
- - ' !src/*/doc/**'
8
- - ' .github/**'
6
+ - ' src/*/assets/dist/**'
7
+ - ' src/*/src/Bridge/*/assets/dist/**'
9
8
10
9
jobs :
11
10
dist-files-size-diff :
60
59
with :
61
60
result-encoding : string
62
61
script : |
62
+ console.log(context);
63
63
const { main } = await import('${{ github.workspace }}/.github/generate-dist-files-size-diff.mjs')
64
64
65
65
return await main()
You can’t perform that action at this time.
0 commit comments