From 0140e5669eca140a2071d94b25786122a8dea5b8 Mon Sep 17 00:00:00 2001 From: Jakob Scheid Date: Sun, 25 Oct 2026 02:24:14 +0100 Subject: [PATCH] chore: migrate main module to TypeScript Migrated main module (src/main.js) to TypeScript. Fonts configuration has been moved from JSON to TypeScript module to make fonts type annotations easier. --- src/{main.js => main.ts} | 2 +- src/styles/fonts.json | 32 -------------------- src/styles/fonts.ts | 65 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 66 insertions(+), 33 deletions(-) rename src/{main.js => main.ts} (98%) delete mode 100644 src/styles/fonts.json create mode 100644 src/styles/fonts.ts diff --git a/src/main.js b/src/main.ts similarity index 98% rename from src/main.js rename to src/main.ts index 9b3d634..fee340f 100644 --- a/src/main.js +++ b/src/main.ts @@ -23,7 +23,7 @@ import { createApp } from 'vue'; import App from './App.vue'; import './styles/common.css'; -import rawFonts from './styles/fonts.json'; +import rawFonts from './styles/fonts'; import './styles/variables/colors.css'; import './styles/variables/dimensions.css'; diff --git a/src/styles/fonts.json b/src/styles/fonts.json deleted file mode 100644 index ec03111..0000000 --- a/src/styles/fonts.json +++ /dev/null @@ -1,32 +0,0 @@ -[ - { - "family": "Inter", - "weight": "100 900", - "style": "normal", - "source": [ - { - "url": "fonts/Inter/Inter-Variable.woff2", - "format": "woff2" - }, - { - "url": "fonts/Inter/Inter-Variable.ttf", - "format": "truetype" - } - ] - }, - { - "family": "Inter", - "weight": "100 900", - "style": "italic", - "source": [ - { - "url": "fonts/Inter/Inter-Italic-Variable.woff2", - "format": "woff2" - }, - { - "url": "fonts/Inter/Inter-Italic-Variable.ttf", - "format": "truetype" - } - ] - } -] diff --git a/src/styles/fonts.ts b/src/styles/fonts.ts new file mode 100644 index 0000000..d2eb9db --- /dev/null +++ b/src/styles/fonts.ts @@ -0,0 +1,65 @@ +/* +Copyright 2026 Seekra + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +type FontFormat = + 'woff2' | 'woff' | 'truetype' | 'opentype' | 'embedded-opentype' | 'svg'; + +interface FontSource { + url: string; + format: FontFormat; +} + +interface RawFont { + family: string; + weight: string; + style: string; + source: FontSource[]; +} + +const fonts: RawFont[] = [ + { + family: 'Inter', + weight: '100 900', + style: 'normal', + source: [ + { + url: 'fonts/Inter/Inter-Variable.woff2', + format: 'woff2', + }, + { + url: 'fonts/Inter/Inter-Variable.ttf', + format: 'truetype', + }, + ], + }, + { + family: 'Inter', + weight: '100 900', + style: 'italic', + source: [ + { + url: 'fonts/Inter/Inter-Italic-Variable.woff2', + format: 'woff2', + }, + { + url: 'fonts/Inter/Inter-Italic-Variable.ttf', + format: 'truetype', + }, + ], + }, +]; + +export default fonts;