Files
Pac-Man/pacman/Justfile
Xevion 884f42a855 feat(server): make database and OAuth providers optional configuration
All external services (database, Discord/GitHub OAuth, S3) can now be individually disabled by omitting their environment variables. The server gracefully degrades functionality when services are unavailable. Partial configuration of any service group triggers a clear error at startup.

- Database: Falls back to dummy pool when DATABASE_URL is unset
- OAuth: Providers only registered when credentials are complete
- S3: Image storage disabled when credentials are missing
- Health checks reflect actual configuration state
2025-12-30 04:03:48 -06:00

64 lines
1.7 KiB
Makefile

set shell := ["bash", "-c"]
binary_extension := if os() == "windows" { ".exe" } else { "" }
# Run cargo-vcpkg build for SDL2 dependencies
vcpkg:
cargo vcpkg build
# Run the game, pass args (e.g., `just pacman::run -r` for release)
run *args:
cargo run -p pacman {{args}}
# Run all checks (clippy for desktop + wasm, warns on format)
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 --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
test:
cargo nextest run --no-fail-fast
# Auto-format code
format:
cargo fmt --all
# Fix linting errors & formatting
fix:
cargo fix --workspace --lib --allow-dirty
cargo fmt --all
# Profile using samply
samply:
cargo build --profile profile
samply record ./target/profile/pacman{{binary_extension}}
# Generate baseline LCOV report
coverage:
cargo +nightly llvm-cov \
--lcov \
--remap-path-prefix \
--workspace \
--output-path lcov.info \
--profile coverage \
--no-fail-fast nextest
# Display coverage report
report-coverage: coverage
cargo llvm-cov report --remap-path-prefix
# Open HTML coverage report
html: coverage
cargo llvm-cov report \
--remap-path-prefix \
--html \
--open