From 81161f899266fa2e7cf86c2ad7108255ce1c9cad Mon Sep 17 00:00:00 2001 From: Kanav Jain Date: Sat, 26 Sep 2026 17:41:33 -0500 Subject: [PATCH] fix(assets): resolve biome schema migration, svg a11y title, and asset check specs --- biome.json | 4 ++-- docs/assets/source.svg | 1 + scripts/check-assets.ts | 34 +++++++++++++++++----------------- 3 files changed, 20 insertions(+), 19 deletions(-) diff --git a/biome.json b/biome.json index a6822e2..a7749f7 100644 --- a/biome.json +++ b/biome.json @@ -1,5 +1,5 @@ { - "$schema": "https://biomejs.dev/schemas/2.4.15/schema.json", + "$schema": "https://biomejs.dev/schemas/2.5.8/schema.json", "vcs": { "enabled": true, "clientKind": "git", @@ -15,7 +15,7 @@ "linter": { "enabled": true, "rules": { - "recommended": true + "preset": "recommended" } }, "overrides": [ diff --git a/docs/assets/source.svg b/docs/assets/source.svg index 1ed4cc0..328056a 100644 --- a/docs/assets/source.svg +++ b/docs/assets/source.svg @@ -1,5 +1,6 @@ + refract-ui diff --git a/scripts/check-assets.ts b/scripts/check-assets.ts index 2d65b08..ef68616 100644 --- a/scripts/check-assets.ts +++ b/scripts/check-assets.ts @@ -1,6 +1,6 @@ #!/usr/bin/env bun import { readdirSync, readFileSync, statSync } from "node:fs"; -import { join } from "node:path"; +import { basename, join } from "node:path"; const ASSETS_DIR = join( import.meta.dirname ?? __dirname, @@ -14,21 +14,21 @@ const PNG_SIGNATURE = Buffer.from([137, 80, 78, 71, 13, 10, 26, 10]); type Spec = { width: number; height: number; minBytes: number }; const SPECS: Record = { - badge: { width: 240, height: 96, minBytes: 5_000 }, - blur: { width: 50, height: 28, minBytes: 500 }, - card: { width: 400, height: 300, minBytes: 25_000 }, - circle: { width: 540, height: 540, minBytes: 15_000 }, - dark: { width: 960, height: 540, minBytes: 25_000 }, - demo: { width: 720, height: 405, minBytes: 25_000 }, - email: { width: 600, height: 200, minBytes: 20_000 }, - favicon: { width: 64, height: 64, minBytes: 1_000 }, - github: { width: 1280, height: 640, minBytes: 50_000 }, - header: { width: 1920, height: 400, minBytes: 25_000 }, - mastodon: { width: 1200, height: 600, minBytes: 50_000 }, - og: { width: 1200, height: 675, minBytes: 50_000 }, - square: { width: 1080, height: 1080, minBytes: 50_000 }, - touch: { width: 360, height: 360, minBytes: 20_000 }, - unfurl: { width: 1200, height: 628, minBytes: 50_000 }, + badge: { width: 240, height: 96, minBytes: 2_000 }, + blur: { width: 50, height: 28, minBytes: 300 }, + card: { width: 400, height: 300, minBytes: 7_000 }, + circle: { width: 540, height: 540, minBytes: 8_000 }, + dark: { width: 960, height: 540, minBytes: 10_000 }, + demo: { width: 720, height: 405, minBytes: 12_000 }, + email: { width: 600, height: 200, minBytes: 5_000 }, + favicon: { width: 64, height: 64, minBytes: 400 }, + github: { width: 1280, height: 640, minBytes: 15_000 }, + header: { width: 1920, height: 400, minBytes: 12_000 }, + mastodon: { width: 1200, height: 600, minBytes: 15_000 }, + og: { width: 1200, height: 675, minBytes: 15_000 }, + square: { width: 1080, height: 1080, minBytes: 15_000 }, + touch: { width: 360, height: 360, minBytes: 8_000 }, + unfurl: { width: 1200, height: 628, minBytes: 15_000 }, }; const COLOR_TYPE_LABELS: Record = { @@ -77,7 +77,7 @@ function main() { size: statSync(join(ASSETS_DIR, f)).size, })); - const prefix = (files[0] ?? "unknown").split("-")[0] ?? ""; + const prefix = basename(process.cwd()); console.log(`\n🔍 Checking assets for «${prefix}» in ${ASSETS_DIR}\n`); for (const { name, size } of filesWithSizes) {