Skip to content

fix readme

fix readme #15

Workflow file for this run

name: CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run linting
run: npm run lint
- name: Build library
run: npm run build
- name: Build Storybook
run: npm run build-storybook
- name: Bundle Size Analysis
run: npm run size-report
- name: Upload bundle analysis
uses: actions/upload-artifact@v4
with:
name: bundle-analysis
path: |
dist/bundle-analysis.html
dist/size-report.json
- name: Comment Bundle Size on PR
if: github.event_name == 'pull_request'
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const report = JSON.parse(fs.readFileSync('dist/size-report.json', 'utf8'));
const comment = `## 📦 Bundle Size Analysis
| Format | Size | Gzipped |
|--------|------|---------|
| **Total** | **${report.total.kb} KB** | **${report.total.gzipped.kb} KB** |
### Files:
${report.files.map(file =>
`| ${file.name} | ${file.sizeKb} KB | ${file.gzippedKb} KB |`
).join('\n')}
${report.total.kb > 50 ? '⚠️ Bundle size is getting large' : '✅ Bundle size looks good'}
[View detailed analysis](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})`;
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: comment
});