mirror of
https://github.com/Warky-Devs/artemis-kit.git
synced 2026-11-10 06:18:47 +00:00
Add collection and sorting utilities with Gitea release workflows
CI / test-and-build (push) Successful in 30s
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:
1 parent
34be59ba01
commit
538ec38632
17 files changed
+545
-12
No files matched your search
@@ -0,0 +1,54 @@
|
||||
{
|
||||
"base64.js": {
|
||||
"bytes": 2200,
|
||||
"gzip": 800
|
||||
},
|
||||
"collections.js": {
|
||||
"bytes": 850,
|
||||
"gzip": 425
|
||||
},
|
||||
"dataqueue.js": {
|
||||
"bytes": 12000,
|
||||
"gzip": 3500
|
||||
},
|
||||
"dom.js": {
|
||||
"bytes": 500,
|
||||
"gzip": 350
|
||||
},
|
||||
"i18n.js": {
|
||||
"bytes": 7000,
|
||||
"gzip": 2400
|
||||
},
|
||||
"index.js": {
|
||||
"bytes": 3800,
|
||||
"gzip": 1400
|
||||
},
|
||||
"llm.js": {
|
||||
"bytes": 3000,
|
||||
"gzip": 1200
|
||||
},
|
||||
"logger.js": {
|
||||
"bytes": 1800,
|
||||
"gzip": 850
|
||||
},
|
||||
"mime.js": {
|
||||
"bytes": 205000,
|
||||
"gzip": 26000
|
||||
},
|
||||
"object.js": {
|
||||
"bytes": 4500,
|
||||
"gzip": 1800
|
||||
},
|
||||
"promise.js": {
|
||||
"bytes": 1000,
|
||||
"gzip": 550
|
||||
},
|
||||
"sorting.js": {
|
||||
"bytes": 1400,
|
||||
"gzip": 700
|
||||
},
|
||||
"strings.js": {
|
||||
"bytes": 14500,
|
||||
"gzip": 4900
|
||||
}
|
||||
}
|
||||
@@ -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.');
|
||||
Reference in new issue
Block a user