Add collection and sorting utilities with Gitea release workflows
CI / test-and-build (push) Successful in 30s

Replace retrocycle eval calls with property traversal and regression coverage. Add bundle budgets, eval guards, package publishing, and contributor documentation.
This commit is contained in:
warkanum committed 2026-09-23 19:22:12 +02:00
1 parent 34be59ba01
commit 538ec38632
17 files changed
+545 -12

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
import { readFile, readdir } from 'node:fs/promises';
import { gzipSync } from 'node:zlib';
const dist = new URL('../dist/', import.meta.url);
const budgets = JSON.parse(await readFile(new URL('./bundle-budgets.json', import.meta.url), 'utf8'));
const files = (await readdir(dist)).filter(file => file.endsWith('.js'));
let failed = false;
for (const file of new Set([...files, ...Object.keys(budgets)])) {
const budget = budgets[file];
if (!budget || !files.includes(file)) {
console.error(`${file}: missing ${budget ? 'build output' : 'bundle budget'}`);
failed = true;
continue;
}
const source = await readFile(new URL(file, dist));
const bytes = source.byteLength;
const gzip = gzipSync(source).byteLength;
console.log(`${file}: ${bytes}/${budget.bytes} bytes; gzip ${gzip}/${budget.gzip} bytes`);
if (bytes > budget.bytes || gzip > budget.gzip) failed = true;
}
if (failed) throw new Error('Bundle budget check failed. Review size changes before updating budgets.');