Skip to content

docs: blogpost for 1.12.0 #578

docs: blogpost for 1.12.0

docs: blogpost for 1.12.0 #578

Workflow file for this run

name: 🧪 Size diff
on:
pull_request:
paths-ignore:
- "example/**"
- "FabricExample/**"
- "docs/**"
jobs:
check-diff:
name: 🔬 Find npm package size diff
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Checkout to target branch
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.base.ref }}
- uses: actions/setup-node@v4
with:
node-version: 18.19.0
cache: yarn
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Calculate size of package (target)
id: old-size
run: echo "OLD_SIZE=$(node scripts/size.js)" >> "$GITHUB_OUTPUT"
- uses: actions/checkout@v4
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Pack
run: npm pack --json
- name: Calculate size of package (current)
id: new-size
run: echo "NEW_SIZE=$(node scripts/size.js)" >> "$GITHUB_OUTPUT"
- name: Calculate difference
id: diff
env:
NEW_SIZE: ${{ steps.new-size.outputs.NEW_SIZE }}
OLD_SIZE: ${{ steps.old-size.outputs.OLD_SIZE }}
run: |
echo "DIFF=$((NEW_SIZE - OLD_SIZE))" >> "$GITHUB_OUTPUT"
echo "SIGN=$([ $((NEW_SIZE - OLD_SIZE)) -gt 0 ] && echo "📈" || echo "📉")" >> "$GITHUB_OUTPUT"
- uses: marocchino/sticky-pull-request-comment@v2
env:
NEW_SIZE: ${{ steps.new-size.outputs.NEW_SIZE }}
OLD_SIZE: ${{ steps.old-size.outputs.OLD_SIZE }}
DIFF: ${{ steps.diff.outputs.DIFF }}
SIGN: ${{ steps.diff.outputs.SIGN }}
with:
message: |
### 📊 Package size report
| Current size | Target Size | Difference |
| ------------- | ------------- | ------------------------ |
| ${{ env.NEW_SIZE }} bytes | ${{ env.OLD_SIZE }} bytes | ${{ env.DIFF }} bytes ${{ env.SIGN }} |