Files
metabuilder/.github/workflows/size-limits.yml
JohnDoe6345789 3537211368 feat(todos): Add comprehensive TODO lists for various project areas
- Created TODO files for Testing, DBAL, Frontend, Packages, Database, and Lua Scripting.
- Updated README with a quick reference table for all TODO files and their priorities.
- Added specific tasks for improving testing coverage, implementing DBAL features, enhancing frontend components, and refining package management.
- Included documentation tasks to ensure thorough coverage and clarity across all areas.
- Implemented initial unit tests for the useAuth hook and improved password generation logic.
- Enhanced package loader functionality to support modular package seed data retrieval.
- Updated page renderer to include public role in permission checks.
- Added comments for future unit tests in workflow engine and other critical areas.
2025-12-25 15:47:15 +00:00

86 lines
2.7 KiB
YAML

name: Code Size Limits
on:
pull_request:
paths:
- 'frontends/nextjs/src/**/*.{ts,tsx,js,jsx}'
- 'scripts/enforce-size-limits.ts'
- '.github/workflows/size-limits.yml'
push:
branches:
- main
paths:
- 'frontends/nextjs/src/**/*.{ts,tsx,js,jsx}'
jobs:
size-limits:
runs-on: ubuntu-latest
defaults:
run:
working-directory: frontends/nextjs
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: frontends/nextjs/package-lock.json
- name: Install dependencies
run: npm ci
- name: Check code size limits
run: npx tsx ../../scripts/enforce-size-limits.ts
- name: Upload report
if: always()
uses: actions/upload-artifact@v4
with:
name: size-limits-report
path: frontends/nextjs/size-limits-report.json
retention-days: 7
- name: Comment on PR
if: failure() && github.event_name == 'pull_request'
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const report = JSON.parse(fs.readFileSync('frontends/nextjs/size-limits-report.json', 'utf8'));
let comment = '## 📏 Code Size Limits\n\n';
if (report.errors === 0 && report.warnings === 0) {
comment += '✅ All files pass size limits!';
} else {
if (report.errors > 0) {
comment += `### ❌ Errors (${report.errors})\n`;
report.violations
.filter(v => v.severity === 'error')
.forEach(v => {
comment += `- **${v.file}**: ${v.metric} (${v.current} / ${v.limit})\n`;
});
}
if (report.warnings > 0) {
comment += `\n### ⚠️ Warnings (${report.warnings})\n`;
report.violations
.filter(v => v.severity === 'warning')
.forEach(v => {
comment += `- **${v.file}**: ${v.metric} (${v.current} / ${v.limit})\n`;
});
}
comment += '\n[See refactoring guide →](../blob/main/docs/REFACTORING_ENFORCEMENT_GUIDE.md)';
}
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: comment
});