feat: add TypeDoc API reference deployed to GitHub Pages #4
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Bundle-size check for pull requests. | |
| # | |
| # Runs size-limit from local node_modules (avoids npx version mismatch). | |
| # Posts a PR comment with current sizes and fails if any budget is exceeded. | |
| name: Size | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| jobs: | |
| size: | |
| name: Bundle size | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| persist-credentials: false | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: "22" | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build | |
| run: npm run build | |
| - name: Check bundle size | |
| id: size | |
| run: | | |
| ./node_modules/.bin/size-limit --json > size-output.json | |
| cat size-output.json | |
| - name: Post size comment | |
| if: always() && steps.size.conclusion != 'skipped' | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const fs = require('fs'); | |
| if (!fs.existsSync('size-output.json')) return; | |
| let results; | |
| try { results = JSON.parse(fs.readFileSync('size-output.json', 'utf8')); } | |
| catch { return; } | |
| const rows = results.map(r => { | |
| const status = r.exceeded ? '❌' : '✅'; | |
| const size = r.size != null ? `${(r.size / 1024).toFixed(1)} kB` : 'n/a'; | |
| const limit = r.sizeLimit || 'none'; | |
| return `| ${r.name || r.path} | ${size} | ${limit} | ${status} |`; | |
| }).join('\n'); | |
| const body = `## Bundle size\n\n| Entry | Size | Budget | Status |\n|-------|------|--------|--------|\n${rows}`; | |
| await github.rest.issues.createComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.issue.number, | |
| body | |
| }); |