Skip to content

Commit 33e94d5

Browse files
committed
chore: adjust dist files for the demo
1 parent 0825a0c commit 33e94d5

File tree

7 files changed

+24
-140
lines changed

7 files changed

+24
-140
lines changed

.github/generate-dist-files-size-diff.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ export function main() {
7878
return output;
7979
}
8080

81-
output += 'Thanks for the PR! Here is the difference in size of the dist files between the base and the PR.\n\n';
81+
output += 'Thanks for the PR! Here is the difference in size of the dist files between the base and the PR.\n';
82+
output += 'Please review the changes and make sure they are expected.\n\n';
8283
output += `<table>
8384
<thead><tr><th>File</th><th>Diff (B)</th><th>Diff (%)</th></tr></thead>
8485
<tbody>`;

.github/workflows/dist-files-size-diff.yaml

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,44 +12,42 @@ jobs:
1212
runs-on: ubuntu-latest
1313

1414
steps:
15+
- name: Configure git
16+
run: |
17+
git config --global user.email ""
18+
git config --global user.name "github-action[bot]"
19+
1520
- uses: marocchino/sticky-pull-request-comment@v2
1621
with:
1722
message: |
1823
⏳ The dist files size difference is being calculated...
19-
24+
2025
- uses: actions/checkout@v4
21-
22-
- uses: actions/setup-node@v4
2326
with:
24-
node-version: '22'
25-
26-
- name: Configure git
27-
run: |
28-
git config --global user.email ""
29-
git config --global user.name "github-action[bot]"
27+
ref: ${{ github.base_ref }}
3028

31-
- name: Get dist files size (from pull request)
32-
id: pr-dist-files
29+
- name: Get dist files size (from base branch)
30+
id: base-dist-files
3331
run: |
3432
set -e
35-
33+
3634
FILES=$(find src -mindepth 2 -path '*/assets/dist/*' \( -name "*.js" -o -name "*.css" \) -not \( -path '*/tests/*' -o -path '*/public/*' -o -path '*/vendor/*' \) | sort | while read -r file; do
3735
echo "{\"$file\": {\"size\": $(wc -c < "$file"), \"size_gz\": $(gzip -c "$file" | wc -c), \"size_brotli\": $(brotli -c "$file" | wc -c)}}"
3836
done | jq -s 'add' -c)
39-
37+
4038
echo "files=$FILES" >> $GITHUB_OUTPUT
4139
42-
- name: Get dist files size (from base branch)
43-
id: base-dist-files
40+
- uses: actions/checkout@v4
41+
42+
- name: Get dist files size (from pull request)
43+
id: pr-dist-files
4444
run: |
4545
set -e
46-
47-
git fetch origin ${{ github.base_ref }}:${{ github.base_ref }}
48-
46+
4947
FILES=$(find src -mindepth 2 -path '*/assets/dist/*' \( -name "*.js" -o -name "*.css" \) -not \( -path '*/tests/*' -o -path '*/public/*' -o -path '*/vendor/*' \) | sort | while read -r file; do
5048
echo "{\"$file\": {\"size\": $(wc -c < "$file"), \"size_gz\": $(gzip -c "$file" | wc -c), \"size_brotli\": $(brotli -c "$file" | wc -c)}}"
5149
done | jq -s 'add' -c)
52-
50+
5351
echo "files=$FILES" >> $GITHUB_OUTPUT
5452
5553
- name: Generate the diff
@@ -63,7 +61,7 @@ jobs:
6361
script: |
6462
const { main } = await import('${{ github.workspace }}/.github/generate-dist-files-size-diff.mjs')
6563
66-
return await(main())
64+
return await main()
6765
6866
- name: Comment on the pull request (if any failure)
6967
if: ${{ failure() }}

src/Autocomplete/assets/dist/foo.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Dropzone/assets/dist/controller.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)