From c9f2cf8a12f6211adba8b0a1c2951f99c1e429dd Mon Sep 17 00:00:00 2001 From: zhom <2717306+zhom@users.noreply.github.com> Date: Mon, 12 Oct 2026 14:27:25 +0400 Subject: [PATCH] fix: bundle fonts --- package.json | 1 + pnpm-lock.yaml | 12 ++++++++++++ scripts/generate-licenses.mjs | 2 ++ scripts/generate-licenses.test.mjs | 1 + src/app/layout.tsx | 16 ++++------------ src/generated/licenses.json | 4 ++++ 6 files changed, 24 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index 6cc00d30..830603d4 100644 --- a/package.json +++ b/package.json @@ -95,6 +95,7 @@ "cmdk": "^1.1.1", "color": "^5.0.3", "flag-icons": "^7.5.0", + "geist": "1.7.2", "i18next": "^26.4.2", "lucide-react": "^1.52.0", "motion": "^14.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6cfc8ffc..5b3ed338 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -267,6 +267,9 @@ importers: flag-icons: specifier: ^7.5.0 version: 7.5.0 + geist: + specifier: 1.7.2 + version: 1.7.2(next@16.4.0(@babel/core@8.0.1)(@types/node@26.6.4)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)) i18next: specifier: ^26.4.2 version: 26.4.2(typescript@7.0.2) @@ -3631,6 +3634,11 @@ packages: function-bind@1.1.2: resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} + geist@1.7.2: + resolution: {integrity: sha512-Gu5lDFa3pLRyoBlBPf0QIFHVdWAnpco7fS1bJm41jyLPFoguBgiubseUN2oLXMgqZ7uxAxDoXcHMhCY/fOTTgg==} + peerDependencies: + next: '>=13.2.0' + gensync@1.0.0-beta.2: resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} engines: {node: '>=6.9.0'} @@ -8523,6 +8531,10 @@ snapshots: function-bind@1.1.2: {} + geist@1.7.2(next@16.4.0(@babel/core@8.0.1)(@types/node@26.6.4)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)): + dependencies: + next: 16.4.0(@babel/core@8.0.1)(@types/node@26.6.4)(react-dom@19.3.0(react@19.3.0))(react@19.3.0) + gensync@1.0.0-beta.2: {} get-caller-file@2.0.5: {} diff --git a/scripts/generate-licenses.mjs b/scripts/generate-licenses.mjs index 649e86e1..f84b5151 100644 --- a/scripts/generate-licenses.mjs +++ b/scripts/generate-licenses.mjs @@ -40,6 +40,8 @@ const LEGACY_LICENSE_EXPRESSIONS = new Map([ ["MIT/Apache-2.0", "Apache-2.0 OR MIT"], ["MIT OR Apache-2.0", "Apache-2.0 OR MIT"], ["Unlicense/MIT", "MIT OR Unlicense"], + // The bundled Geist fonts name their license in words. + ["SIL OPEN FONT LICENSE", "OFL-1.1"], ]); const HOST_ONLY_PNPM_NATIVE_PREFIXES = [ diff --git a/scripts/generate-licenses.test.mjs b/scripts/generate-licenses.test.mjs index 34bcf0db..4464fb0c 100644 --- a/scripts/generate-licenses.test.mjs +++ b/scripts/generate-licenses.test.mjs @@ -14,6 +14,7 @@ test("normalizes legacy dual-license metadata into SPDX expressions", () => { normalizeLicenseExpression("MIT/Apache-2.0"), "Apache-2.0 OR MIT", ); + assert.equal(normalizeLicenseExpression("SIL OPEN FONT LICENSE"), "OFL-1.1"); assert.equal( normalizeLicenseExpression("Apache-2.0 OR MIT"), "Apache-2.0 OR MIT", diff --git a/src/app/layout.tsx b/src/app/layout.tsx index de69bf23..6a612e3a 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,18 +1,10 @@ -import { Geist, Geist_Mono } from "next/font/google"; +// Bundled with the app: the build and the app never fetch fonts from a CDN. +import { GeistMono } from "geist/font/mono"; +import { GeistSans } from "geist/font/sans"; import "@/styles/globals.css"; import "flag-icons/css/flag-icons.min.css"; import { ClientProviders } from "@/components/client-providers"; -const geistSans = Geist({ - variable: "--font-geist-sans", - subsets: ["latin"], -}); - -const geistMono = Geist_Mono({ - variable: "--font-geist-mono", - subsets: ["latin"], -}); - export default function RootLayout({ children, }: Readonly<{ @@ -21,7 +13,7 @@ export default function RootLayout({ return ( {children} diff --git a/src/generated/licenses.json b/src/generated/licenses.json index ad4ef8e2..4f9b4a4d 100644 --- a/src/generated/licenses.json +++ b/src/generated/licenses.json @@ -1323,6 +1323,10 @@ "name": "gdkx11-sys", "license": "MIT" }, + { + "name": "geist", + "license": "OFL-1.1" + }, { "name": "generic-array", "license": "MIT"