Stabilize Frost and prepare npm package

This commit is contained in:
2026-10-29 21:57:42 +01:00
parent f5cd37254c
commit 94ec8bb573
9 changed files with 167 additions and 3 deletions
+15
View File
@@ -0,0 +1,15 @@
import { gzipSync } from "node:zlib";
import { readFile } from "node:fs/promises";
import { resolve } from "node:path";
import { fileURLToPath } from "node:url";
const root = fileURLToPath(new URL("..", import.meta.url));
const files = ["tokens.css", "base.css", "accessibility.css", "layout.css", "controls.css", "components.css"];
const source = (await Promise.all(files.map((file) => readFile(resolve(root, file), "utf8")))).join("\n");
const rawBytes = Buffer.byteLength(source);
const gzipBytes = gzipSync(source).byteLength;
console.log(`Combined CSS: ${rawBytes} bytes raw, ${gzipBytes} bytes gzip`);
if (gzipBytes > 10 * 1024) {
console.error("Warning: Frost exceeds the 10 KB gzip budget.");
process.exitCode = 1;
}