mirror of
https://github.com/Xevion/Pac-Man.git
synced 2026-01-30 20:25:00 -06:00
refactor(just): reorganize Justfiles to match project architecture and format code
This commit is contained in:
@@ -8,27 +8,51 @@ mod web 'web/Justfile'
|
||||
default:
|
||||
@just --list --list-submodules
|
||||
|
||||
alias b := bun
|
||||
alias bu := bun
|
||||
|
||||
# Runs 'bun' from within the 'web/' folder
|
||||
bun *args:
|
||||
cd web/ && bun {{args}}
|
||||
|
||||
alias bx := bunx
|
||||
alias bux := bunx
|
||||
|
||||
# Runs 'bunx' from within the 'web/' folder
|
||||
bunx *args:
|
||||
cd web/ && bunx {{args}}
|
||||
|
||||
# Run the game (pacman::run)
|
||||
run *args:
|
||||
@just pacman::run {{args}}
|
||||
|
||||
# Run all checks (pacman::check)
|
||||
# Run all checks (Rust workspace + web)
|
||||
check:
|
||||
@just pacman::check
|
||||
@echo "Checking format..."
|
||||
@cargo fmt --all -- --check || echo "⚠ Format issues detected (run \`just format\` to fix)"
|
||||
@echo "Running clippy for desktop target..."
|
||||
@cargo clippy --workspace --all-targets --all-features --quiet -- -D warnings || true
|
||||
@echo "Running clippy for wasm target..."
|
||||
@cargo clippy -p pacman --target wasm32-unknown-emscripten --all-targets --all-features --quiet -- -D warnings || true
|
||||
@echo "Running web checks..."
|
||||
@just web::check || true
|
||||
@echo "Check complete!"
|
||||
|
||||
alias lint := check
|
||||
|
||||
# Run tests (pacman::test)
|
||||
# Run tests (Rust workspace + web)
|
||||
test:
|
||||
@just pacman::test
|
||||
cargo nextest run --workspace --no-fail-fast
|
||||
@just web::test || true
|
||||
|
||||
# Format code (pacman::format)
|
||||
# Format code (Rust workspace + web)
|
||||
format:
|
||||
@just pacman::format
|
||||
cargo fmt --all
|
||||
@just web::format
|
||||
|
||||
alias fmt := format
|
||||
|
||||
# Frontend dev server (web::dev)
|
||||
# Dev servers (web + server)
|
||||
dev:
|
||||
@just web::dev
|
||||
|
||||
|
||||
@@ -25,3 +25,15 @@ run: image
|
||||
--env PORT=3000 \
|
||||
--env-file pacman-server/.env \
|
||||
pacman-server
|
||||
|
||||
# Run checks (clippy) for server package
|
||||
check:
|
||||
cargo clippy -p pacman-server --all-targets --all-features --quiet -- -D warnings
|
||||
|
||||
# Format code for server package
|
||||
format:
|
||||
cargo fmt -p pacman-server
|
||||
|
||||
# Run tests for server package
|
||||
test:
|
||||
cargo nextest run -p pacman-server --no-fail-fast
|
||||
|
||||
+7
-10
@@ -10,26 +10,23 @@ vcpkg:
|
||||
run *args:
|
||||
cargo run -p pacman {{args}}
|
||||
|
||||
# Run all checks (clippy for desktop + wasm, warns on format)
|
||||
# Run all checks (clippy for desktop + wasm, warns on format) for pacman package
|
||||
check:
|
||||
@echo "Checking format..."
|
||||
@cargo fmt --all -- --check || echo "⚠ Format issues detected (run \`just format\` to fix)"
|
||||
@cargo fmt -p pacman -- --check || echo "⚠ Format issues detected (run \`just format\` to fix)"
|
||||
@echo "Running clippy for desktop target..."
|
||||
@cargo clippy --all-targets --all-features --quiet -- -D warnings
|
||||
@cargo clippy -p pacman --all-targets --all-features --quiet -- -D warnings
|
||||
@echo "Running clippy for wasm target..."
|
||||
@cargo clippy -p pacman --target wasm32-unknown-emscripten --all-targets --all-features --quiet -- -D warnings
|
||||
@echo "Running frontend checks..."
|
||||
@bun run --cwd web check
|
||||
@bun run --cwd web lint
|
||||
@echo "All checks passed!"
|
||||
|
||||
# Run tests with nextest
|
||||
# Run tests with nextest for pacman package
|
||||
test:
|
||||
cargo nextest run --no-fail-fast
|
||||
cargo nextest run -p pacman --no-fail-fast
|
||||
|
||||
# Auto-format code
|
||||
# Auto-format code for pacman package
|
||||
format:
|
||||
cargo fmt --all
|
||||
cargo fmt -p pacman
|
||||
|
||||
# Fix linting errors & formatting
|
||||
fix:
|
||||
|
||||
@@ -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
|
||||
@@ -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
@@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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 */',
|
||||
|
||||
Reference in New Issue
Block a user