Compare commits

...

4 Commits

Author SHA1 Message Date
Ryan Walters
7eb4705b7c fix(ci): use railway redeploy instead of railway up
Changed deployment command from `railway up` to `railway redeploy` because
the Railway service is configured to use an external Docker image from GHCR,
not source code deployment. The `railway up` command was attempting to build
from source with Railpack, which failed since no source code was provided.

The `railway redeploy` command triggers Railway to pull the latest image
from ghcr.io/xevion/pac-man:latest and redeploy the service.
2025-11-22 22:15:50 -06:00
Ryan Walters
a98ad23348 chore(deps): reconfigure Dependabot with granular update groups
Replaced monolithic dependency grouping with 13 separate update groups
across Cargo (game/server), npm (frontend), and GitHub Actions ecosystems.

Key improvements:
- Separate patch/minor/major updates to prevent breaking changes from
  blocking safe updates
- Group by crate (game vs server) for easier review
- Enable auto-merge for patch updates via labels
- Weekly checks with 5 PR limit to avoid spam
- Ignore bevy_ecs 0.17+ and jsonwebtoken 10+ until manual migration

Closed PR #10 (22 jumbled updates causing build failures).
2025-11-22 21:58:27 -06:00
Ryan Walters
3e08720b43 fix(ci): correct Railway CLI invocation in GitHub Actions
The deployment was failing because the workflow used incorrect syntax
with `uses: docker://` which caused Docker to misinterpret `up` as an
executable rather than an argument to the Railway CLI.

Split deployment into a separate job using `container:` at the job level,
allowing the Railway CLI to execute properly. This follows Railway's
official documentation for GitHub Actions integration.
2025-11-22 21:43:04 -06:00
Ryan Walters
c306e992c4 fix(game): resolve race condition in render dirty flag using bitwise OR
The render dirty flag was being reset instead of accumulated, causing
the game to become stuck and unplayable in web builds. Changed from
assignment to bitwise OR to preserve all dirty state updates.

Also adds game layout component and updates Justfile to build frontend.
2025-11-22 21:14:24 -06:00
6 changed files with 237 additions and 21 deletions

219
.github/dependabot.yml vendored
View File

@@ -1,20 +1,227 @@
# Dependabot Configuration
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
#
# Strategy:
# - Weekly checks for faster vulnerability detection
# - Separate patch/minor/major updates to prevent blocking
# - Group by crate (game vs server) for easier review
# - Auto-merge patches via GitHub branch protection rules
# - Limit concurrent PRs to avoid spam
version: 2
updates:
# Game: Patch updates (auto-mergeable)
- package-ecosystem: "cargo"
directory: "/"
directory: "/pacman"
schedule:
interval: "monthly"
interval: "weekly"
day: "monday"
open-pull-requests-limit: 5
groups:
dependencies:
game-patches:
applies-to: "version-updates"
update-types:
- "patch"
ignore:
# Bevy ECS 0.17+ requires API migration - ignore until manual update
- dependency-name: "bevy_ecs"
versions: ["0.17.x", "0.18.x", "0.19.x"]
labels:
- "dependencies"
- "dependencies:patch"
- "game"
# Game: Minor updates (grouped, manual review)
- package-ecosystem: "cargo"
directory: "/pacman"
schedule:
interval: "weekly"
day: "monday"
open-pull-requests-limit: 5
groups:
game-minor:
applies-to: "version-updates"
update-types:
- "minor"
ignore:
- dependency-name: "bevy_ecs"
versions: ["0.17.x", "0.18.x", "0.19.x"]
labels:
- "dependencies"
- "dependencies:minor"
- "game"
# Game: Major updates (separate PRs, manual review)
- package-ecosystem: "cargo"
directory: "/pacman"
schedule:
interval: "weekly"
day: "monday"
open-pull-requests-limit: 5
groups:
game-major:
applies-to: "version-updates"
update-types:
- "major"
ignore:
- dependency-name: "bevy_ecs"
versions: ["0.17.x", "0.18.x", "0.19.x"]
labels:
- "dependencies"
- "dependencies:major"
- "game"
# Server: Patch updates (auto-mergeable)
- package-ecosystem: "cargo"
directory: "/pacman-server"
schedule:
interval: "weekly"
day: "monday"
open-pull-requests-limit: 5
groups:
server-patches:
applies-to: "version-updates"
update-types:
- "patch"
ignore:
# jsonwebtoken 10+ requires crypto backend feature flag - ignore until manual migration
- dependency-name: "jsonwebtoken"
versions: ["10.x", "11.x"]
labels:
- "dependencies"
- "dependencies:patch"
- "server"
# Server: Minor updates (grouped, manual review)
- package-ecosystem: "cargo"
directory: "/pacman-server"
schedule:
interval: "weekly"
day: "monday"
open-pull-requests-limit: 5
groups:
server-minor:
applies-to: "version-updates"
update-types:
- "minor"
ignore:
- dependency-name: "jsonwebtoken"
versions: ["10.x", "11.x"]
labels:
- "dependencies"
- "dependencies:minor"
- "server"
# Server: Major updates (separate PRs, manual review)
- package-ecosystem: "cargo"
directory: "/pacman-server"
schedule:
interval: "weekly"
day: "monday"
open-pull-requests-limit: 5
groups:
server-major:
applies-to: "version-updates"
update-types:
- "major"
ignore:
- dependency-name: "jsonwebtoken"
versions: ["10.x", "11.x"]
labels:
- "dependencies"
- "dependencies:major"
- "server"
# Frontend: Patch updates (auto-mergeable)
- package-ecosystem: "npm"
directory: "/web"
schedule:
interval: "weekly"
day: "monday"
open-pull-requests-limit: 5
groups:
frontend-patches:
applies-to: "version-updates"
update-types:
- "patch"
labels:
- "dependencies"
- "dependencies:patch"
- "frontend"
# Frontend: Minor updates (grouped, manual review)
- package-ecosystem: "npm"
directory: "/web"
schedule:
interval: "weekly"
day: "monday"
open-pull-requests-limit: 5
groups:
frontend-minor:
applies-to: "version-updates"
update-types:
- "minor"
labels:
- "dependencies"
- "dependencies:minor"
- "frontend"
# Frontend: Major updates (separate PRs for critical deps)
- package-ecosystem: "npm"
directory: "/web"
schedule:
interval: "weekly"
day: "monday"
open-pull-requests-limit: 5
groups:
frontend-major-framework:
applies-to: "version-updates"
update-types:
- "major"
patterns:
- "*"
- "react"
- "react-dom"
- "vike"
- "vite"
labels:
- "dependencies"
- "dependencies:major"
- "frontend"
- "framework"
# Frontend: Other major updates (grouped)
- package-ecosystem: "npm"
directory: "/web"
schedule:
interval: "weekly"
day: "monday"
open-pull-requests-limit: 5
groups:
frontend-major-other:
applies-to: "version-updates"
update-types:
- "major"
exclude-patterns:
- "react"
- "react-dom"
- "vike"
- "vite"
labels:
- "dependencies"
- "dependencies:major"
- "frontend"
# GitHub Actions: All updates grouped (low risk)
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
interval: "weekly"
day: "monday"
open-pull-requests-limit: 5
groups:
dependencies:
github-actions:
patterns:
- "*"
labels:
- "dependencies"
- "github-actions"

View File

@@ -120,10 +120,14 @@ jobs:
- name: Wait for registry propagation
run: sleep 5
# Deploy to Railway
# Deploy to Railway - separate job to use container properly
deploy:
name: Deploy to Railway
runs-on: ubuntu-latest
needs: build-and-deploy
container: ghcr.io/railwayapp/cli:latest
env:
RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }}
steps:
- name: Deploy to Railway
uses: docker://ghcr.io/railwayapp/cli:latest
env:
RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }}
with:
args: up --service pac-man
run: railway redeploy --service pac-man -y

View File

@@ -36,7 +36,8 @@ samply:
# Build the project for Emscripten
web *args:
bun run pacman/web.build.ts {{args}};
bun run pacman/web.build.ts {{args}}
bun run --cwd web build
caddy file-server --root web/dist/client
# Fix linting errors & formatting

View File

@@ -521,7 +521,7 @@ impl Game {
stage_system.in_set(GameplaySet::Respond),
(
(|mut dirty: ResMut<RenderDirty>, score: Res<ScoreResource>, stage: Res<GameStage>| {
dirty.0 = score.is_changed() || stage.is_changed();
dirty.0 |= score.is_changed() || stage.is_changed();
}),
dirty_render_system.run_if(|dirty: Res<RenderDirty>| dirty.0.not()),
combined_render_system,

View File

@@ -0,0 +1,9 @@
import "../../layouts/tailwind.css";
export default function GameLayout({ children }: { children: React.ReactNode }) {
return (
<div className="bg-black text-yellow-400 min-h-screen flex flex-col">
<main className="flex-1">{children}</main>
</div>
);
}

View File

@@ -2,32 +2,27 @@ import { useEffect } from "react";
export default function Page() {
useEffect(() => {
// Only setup Module if not already configured (prevents double-initialization on hot reload)
if (!(window as any).Module) {
const canvas = document.getElementById("canvas");
// Simple Module configuration matching the original working approach
(window as any).Module = {
canvas: canvas,
locateFile: (path: string) => {
// Return absolute paths for all resources
return path.startsWith("/") ? path : `/${path}`;
},
preRun: [],
};
// Load the Emscripten script
const script = document.createElement("script");
script.src = "/pacman.js";
script.async = false; // Load synchronously to ensure Module is configured first
script.async = false;
document.body.appendChild(script);
// Cleanup function (runs when component unmounts)
return () => {
script.remove();
};
}
}, []); // Empty dependency array = run once on mount
}, []);
return (
<div className="mt-4 flex justify-center h-[calc(100vh-120px)]">