From 4993b75608bef122073943dc06ab662002a82565 Mon Sep 17 00:00:00 2001 From: openhands Date: Sun, 9 Aug 2026 12:12:02 +0200 Subject: [PATCH] perf: self-host fonts, drop unused generated code and add swf tests - Self-host Nunito and Pixelify Sans via next/font instead of Google Fonts CDN (removes render-blocking external stylesheets and preconnects) - Remove stale mariadb entry from serverExternalPackages (app uses mysql2) - Exclude unused src/generated Prisma client from typecheck and remove it - Add unit tests for swf-parser, effectmap and figuremap (0% coverage -> 90%+) --- next.config.ts | 2 +- src/app/globals.css | 6 - src/app/layout.tsx | 35 +++--- src/lib/services/effectmap.test.ts | 85 +++++++++++++ src/lib/services/figuremap.test.ts | 62 +++++++++ src/lib/services/swf/swf-parser.test.ts | 161 ++++++++++++++++++++++++ tsconfig.json | 2 +- 7 files changed, 330 insertions(+), 23 deletions(-) create mode 100644 src/lib/services/effectmap.test.ts create mode 100644 src/lib/services/figuremap.test.ts create mode 100644 src/lib/services/swf/swf-parser.test.ts diff --git a/next.config.ts b/next.config.ts index d7d859b5..85a3ed6d 100644 --- a/next.config.ts +++ b/next.config.ts @@ -36,7 +36,7 @@ const securityHeaders = [ const nextConfig: NextConfig = { cacheComponents: true, // <-- Dit activeert Cache Components en lost de 'instant' build-fout op! deploymentId: resolveDeploymentId(), - serverExternalPackages: ["mariadb", "lzma", "sharp", "pino", "pino-pretty"], + serverExternalPackages: ["lzma", "sharp", "pino", "pino-pretty"], // Onderdruk de specifieke Turbopack waarschuwingen voor brede bestandspatronen in de lib-map turbopack: { diff --git a/src/app/globals.css b/src/app/globals.css index 957a69b6..c8d036c1 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -4,12 +4,6 @@ @plugin "tailwindcss-animate"; @custom-variant dark (&:where(.dark, .dark *)); -:root { - --font-nunito: - "Nunito", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; - --font-pixel: "Pixelify Sans", monospace; -} - @theme { --font-sans: var(--font-nunito), "Nunito", ui-sans-serif, system-ui, -apple-system, diff --git a/src/app/layout.tsx b/src/app/layout.tsx index f43481f6..b0781673 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,4 +1,5 @@ import type { Metadata } from "next"; +import { Nunito, Pixelify_Sans } from "next/font/google"; import { headers } from "next/headers"; import Script from "next/script"; import { NextIntlClientProvider } from "next-intl"; @@ -14,6 +15,20 @@ import { resolveHotelName } from "@/lib/hotel-name"; import { siteSettings } from "@/lib/services/site-settings"; import "./globals.css"; +const nunito = Nunito({ + subsets: ["latin"], + weight: ["400", "600", "700", "800"], + variable: "--font-nunito", + display: "swap", +}); + +const pixelify = Pixelify_Sans({ + subsets: ["latin"], + weight: ["400", "700"], + variable: "--font-pixel", + display: "swap", +}); + // The root layout reads runtime data (locale cookie, request headers via // enforceSiteAccess, DB-backed site settings) to render the element, // which cannot be wrapped in . Child pages inherit this opt-out, @@ -58,23 +73,13 @@ export default async function RootLayout({ const nonce = (await headers()).get("x-nonce") ?? undefined; return ( - + - - - -