Skip to content

Latest commit

 

History

History
122 lines (83 loc) · 4.41 KB

File metadata and controls

122 lines (83 loc) · 4.41 KB

pixi-minesweeper

Classic Minesweeper created with PixiJS. Play the game here!

Now with PixiV8 and WebGPU support.

Getting Started

Prerequisites

  • Node.js 20 (see .nvmrc) — use nvm to install the correct version:
    nvm install
    nvm use

Installation

npm install

Build Commands

Development

  • npm start - Start the development server with modern settings (alias for npm run serve-modern)
  • npm run serve - Start webpack development server
  • npm run serve-modern - Start development server with modern browser optimizations
  • npm run serve-prod - Start development server in production mode

Production Build

  • npm run build - Build the project for production (optimized bundle)
  • npm run build-dev - Build the project in development mode (unoptimized)

Testing

  • npm test - Run the test suite (6 suites covering game state logic, color utilities, math helpers, event system, and utility functions)
  • npm run test-watch - Run tests in watch mode (automatically re-runs on file changes)

Code Quality

  • npm run lint - Check code for linting errors using ESLint
  • npm run lint:fix - Automatically fix linting errors where possible
  • npm run prettier - Check TypeScript source files formatting
  • npm run prettier:fix - Format TypeScript source files

Development Server

When running the development server, the application will be available at:

  • URL: http://localhost:3000
  • The server runs on all network interfaces (0.0.0.0), making it accessible from other devices on your local network

Build Output

Production builds are output to the build/ directory and include:

  • Optimized JavaScript bundle
  • Source maps for debugging
  • All static assets from the static/ folder
  • Generated index.html

Branching Strategy

This project follows a trunk-based development model with short-lived feature branches:

  • master is the main branch — it should always be deployable and receives all merges
  • Feature/fix branches are created from master for all changes
  • Pull requests target master and are rebased onto master when merging to keep a linear commit history
  • Release PRs are automatically generated by release-please on master
  • No long-lived branches exist besides master

CI/CD

The project uses GitHub Actions for continuous integration and deployment to Firebase Hosting.

Workflows

Workflow Trigger Purpose
Lint & Test PRs to master Runs npm run lint and npm test
Release Push to master / manual On push to master: creates tags, GitHub releases, and triggers deploy (PRs are skipped). On manual dispatch: creates release PRs via release-please
Deploy Manual / called by Release Builds and deploys to Firebase Hosting

Release Process

  1. Merge feature PRs to master using Conventional Commits (feat:, fix:, chore:, etc.)
  2. Go to Actions > Release > Run workflow to create a release PR
  3. Review and merge the release PR (requires --admin to bypass checks)
  4. The Release workflow runs on the push, creates a v* tag and GitHub release, then automatically triggers the Deploy job

Version Bumps

Version is determined from commit prefixes:

Prefix Bump Example
fix: Patch 0.0.1 → 0.0.2
feat: Minor (patch while pre-1.0) 0.0.1 → 0.0.2
feat!: / BREAKING CHANGE: Major (minor while pre-1.0) 0.0.2 → 0.1.0

To override the version, include a Release-As: x.y.z footer in a commit message (e.g., chore: prepare release\n\nRelease-As: 1.0.0) before running the Release workflow.

Required Secrets

Secret Description
FIREBASE_SERVICE_ACCOUNT Firebase service account JSON key (from Firebase Console > Project Settings > Service accounts)

Technology Stack

  • PixiJS - WebGL rendering engine
  • TypeScript - Type-safe JavaScript
  • Webpack - Module bundler and development server
  • Jest - Testing framework
  • Spine - 2D skeletal animation
  • Tone.js - Web Audio framework for interactive music and sound
  • tweenjs - Animation tweening
  • @tonejs/midi - MIDI file parsing and playback
  • ESLint + Prettier - Code linting and formatting