refactor(just): reorganize Justfiles to match project architecture and format code

This commit is contained in:
2025-12-30 04:20:19 -06:00
parent 884f42a855
commit eedf22f86d
10 changed files with 161 additions and 83 deletions
+19
View File
@@ -0,0 +1,19 @@
# Build output
dist/
build/
.svelte-kit/
# Dependencies
node_modules/
# Generated files
.vercel/
.netlify/
static/pacman.data
static/pacman.js
static/pacman.wasm
static/pacman.wasm.map
# Package manager
pnpm-lock.yaml
bun.lockb
+13
View File
@@ -21,3 +21,16 @@ serve *args:
bun run pacman/web.build.ts {{args}}
bun run --cwd web build
caddy file-server --root web/dist/client --listen :8547
# Run checks (type-checking and linting)
check:
bun run check
bun run lint
# Format code
format:
bun run format
# Run tests
test:
bun run test
+50 -48
View File
@@ -1,50 +1,52 @@
{
"name": "pacman-web",
"description": "A web frontend for the Pac-Man game, including leaderboards and OAuth.",
"private": true,
"version": "0.0.1",
"type": "module",
"packageManager": "bun@^1.3.5",
"engines": {
"bun": ">=1.3.5"
},
"scripts": {
"preinstall": "npx only-allow bun",
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview",
"prepare": "svelte-kit sync || echo ''",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "eslint ."
},
"dependencies": {
"@tabler/icons-svelte": "^3.35.0",
"overlayscrollbars": "^2.13.0",
"overlayscrollbars-svelte": "^0.5.5"
},
"devDependencies": {
"@fontsource/outfit": "^5.2.8",
"@fontsource/russo-one": "^5.2.7",
"@sveltejs/adapter-static": "^3.0.0",
"@sveltejs/kit": "^2.49.1",
"@sveltejs/vite-plugin-svelte": "^6.2.1",
"@tailwindcss/vite": "^4.1.13",
"@types/fontkit": "^2.0.8",
"@types/node": "^22.0.0",
"eslint": "^9.35.0",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-svelte": "^3.9.0",
"fontkit": "^2.0.4",
"globals": "^16.3.0",
"prettier": "^3.6.2",
"prettier-plugin-svelte": "^3.4.0",
"subset-font": "^2.4.0",
"svelte": "^5.45.6",
"svelte-check": "^4.3.4",
"tailwindcss": "^4.1.13",
"typescript": "^5.9.3",
"typescript-eslint": "^8.42.0",
"vite": "^7.2.6"
}
"name": "pacman-web",
"description": "A web frontend for the Pac-Man game, including leaderboards and OAuth.",
"private": true,
"version": "0.0.1",
"type": "module",
"packageManager": "bun@^1.3.5",
"engines": {
"bun": ">=1.3.5"
},
"scripts": {
"preinstall": "npx only-allow bun",
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview",
"prepare": "svelte-kit sync || echo ''",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "eslint .",
"format": "prettier --write .",
"test": "vitest run"
},
"dependencies": {
"@tabler/icons-svelte": "^3.35.0",
"overlayscrollbars": "^2.13.0",
"overlayscrollbars-svelte": "^0.5.5"
},
"devDependencies": {
"@fontsource/outfit": "^5.2.8",
"@fontsource/russo-one": "^5.2.7",
"@sveltejs/adapter-static": "^3.0.0",
"@sveltejs/kit": "^2.49.1",
"@sveltejs/vite-plugin-svelte": "^6.2.1",
"@tailwindcss/vite": "^4.1.13",
"@types/fontkit": "^2.0.8",
"@types/node": "^22.0.0",
"eslint": "^9.35.0",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-svelte": "^3.9.0",
"fontkit": "^2.0.4",
"globals": "^16.3.0",
"prettier": "^3.6.2",
"prettier-plugin-svelte": "^3.4.0",
"subset-font": "^2.4.0",
"svelte": "^5.45.6",
"svelte-check": "^4.3.4",
"tailwindcss": "^4.1.13",
"typescript": "^5.9.3",
"typescript-eslint": "^8.42.0",
"vite": "^7.2.6"
}
}
+19 -3
View File
@@ -167,7 +167,12 @@
</button>
<div class="flex items-center gap-8">
<NavLink href="/leaderboard" icon={IconTrophy} label="Leaderboard" active={isActive('/leaderboard')} />
<NavLink
href="/leaderboard"
icon={IconTrophy}
label="Leaderboard"
active={isActive('/leaderboard')}
/>
<a
href="/"
@@ -188,7 +193,12 @@
</h1>
</a>
<NavLink href="/download" icon={IconDownload} label="Download" active={isActive('/download')} />
<NavLink
href="/download"
icon={IconDownload}
label="Download"
active={isActive('/download')}
/>
</div>
<div class="absolute right-4 hidden sm:flex gap-4 items-center">
@@ -257,7 +267,13 @@
</div>
<div class="flex flex-col gap-3">
{#each links as link}
<NavLink href={link.href} icon={link.icon} label={link.label} active={isActive(link.href)} size={28} />
<NavLink
href={link.href}
icon={link.icon}
label={link.label}
active={isActive(link.href)}
size={28}
/>
{/each}
</div>
</div>
+3 -1
View File
@@ -2,7 +2,9 @@
<div class="space-y-6">
<div class="card">
<h2 class="text-2xl font-bold mb-4">Download Pac-Man</h2>
<p class="text-gray-300 mb-4">Download instructions and releases will be available here soon.</p>
<p class="text-gray-300 mb-4">
Download instructions and releases will be available here soon.
</p>
</div>
</div>
</div>
+5 -7
View File
@@ -20,12 +20,7 @@
<tr class="bg-black">
<td class="py-2">
<div class="flex items-center gap-2">
<img
src={entry.avatar}
alt={entry.name}
class="w-9 h-9 rounded-sm"
loading="lazy"
/>
<img src={entry.avatar} alt={entry.name} class="w-9 h-9 rounded-sm" loading="lazy" />
<div class="flex flex-col">
<span class="text-yellow-400 font-semibold text-lg">{entry.name}</span>
<span class="text-xs text-gray-400">{entry.submittedAt}</span>
@@ -49,7 +44,10 @@
<div class="space-y-6">
<div class="card">
<div class="flex gap-2 border-b border-yellow-400/20 pb-2 mb-4">
<button onclick={() => (activeTab = 'global')} class={tabButtonClass(activeTab === 'global')}>
<button
onclick={() => (activeTab = 'global')}
class={tabButtonClass(activeTab === 'global')}
>
<IconTrophy size={16} />
Global
</button>
+2 -7
View File
@@ -266,9 +266,7 @@ async function extractFontMetadata(
}
// Log extracted family name for debugging
logInfo(
` Font family: "${family}" (from ${familySource})`
);
logInfo(` Font family: "${family}" (from ${familySource})`);
return {
family,
@@ -432,10 +430,7 @@ function generateUnicodeRange(whitelist: string): UnicodeRange {
// CSS Generation
// ============================================================================
async function generateCssFile(
fonts: FontFaceDescriptor[],
cssOutputPath: string
): Promise<void> {
async function generateCssFile(fonts: FontFaceDescriptor[], cssOutputPath: string): Promise<void> {
const lines = [
'/* Auto-generated by vite-plugin-font-subset */',
'/* Do not edit manually - changes will be overwritten */',