Skip to content

JustPlayBo/justplay-editor

Repository files navigation

JustPlay Pack Editor

A desktop (Tauri 2) visual editor for JustPlay game packs — the boardgame/1 JSON the player loads. Author a board, a tray of pieces, and a starting layout, with a live preview that is the actual player renderer, then export a pack that drops straight into JustPlay.

The preview reuses the player's own gamedef.js / board.js / state.js (vendored into public/player/), so what you see here is exactly what players see.

What it does (v1)

  • Boards — generated patterns (checker / grid / solid) or an imported image.
  • Pieces — a tray of glyph (emoji / unicode / letter) or image tokens.
  • Sample layout — drag pieces onto the live board to author the preset "Load sample layout" (normalised [0,1] coordinates, identical to the player).
  • Assets — import images; they're managed and bundled on export.
  • Export — a folder pack (pack.json + assets/) and a single file (every image inlined as a data-URI, ready to paste into the player).
  • Open / round-trip — open an existing single-file or folder pack and keep editing. Fields the editor doesn't model (map boards, rules/logic/dice/decks) are preserved.

Not in v1: MapLibre map-board authoring (such packs open read-only and round-trip untouched), and live multiplayer.

Run it

The host toolchain is old, so everything runs in Docker (host Rust/Node untouched).

# from this folder
docker compose up web          # → open http://localhost:1420 in any browser

The editor is web-first, so the browser build is fully functional (open/save use the File System Access API on Chromium, or download/upload elsewhere). To run the native desktop app and build installers:

docker compose run --rm build  # → Linux .deb bundle copied into ./out
docker compose run --rm app    # → native window (needs an X server on the host:
                               #    `xhost +local:` first; honours $DISPLAY)

Without Docker

If you have Node ≥ 18 and a Rust ≥ 1.77 toolchain with the Tauri Linux prerequisites:

npm install
npm run dev        # web dev server at http://localhost:1420
npm run tauri dev  # native window
npm run tauri build

How it fits together

index.html              loads vendored player CSS+JS, then src/main.ts
public/player/          gamedef.js / board.js / state.js / player.css  (synced, do not edit)
scripts/sync-player.mjs refresh the vendored copies from ../justplay-sy
src/
  model/   pack.ts      boardgame/1 types, blankPack, validate
           assets.ts    AssetStore (bytes + blob: URLs for preview)
           io.ts        folder / single-file export + round-trip import
  platform/ index.ts    Platform interface + Tauri-vs-browser detection
            browser.ts  File System Access API / input+download fallback
            tauri.ts    native dialogs + Rust file commands
  ui/      app.ts       toolbar + 3-pane layout
           preview.ts   embeds the player's Board/GameDef/BoardState (the live preview)
           *-panel.ts   meta / board / pieces / setup editors
src-tauri/              Tauri 2 shell (dialog plugin + small fs commands in src/lib.rs)
docker/                 toolchain image; see docker-compose.yml for the three flows

Keeping the preview in sync with the player

The editor vendors the player's renderer modules. After changing the player:

npm run sync:player    # copies gamedef/board/state/identity + styles from ../justplay-sy

(predev/prebuild run this automatically. Set JUSTPLAY_PLAYER_DIR if the player repo lives elsewhere — the Docker services point it at the mounted /player.)

Continuous integration

GitHub Actions does the heavy lifting — no one needs the local toolchain:

Workflow Trigger What it does
.github/workflows/ci.yml push / PR type-check, web build, model self-tests
.github/workflows/pages.yml push to main builds the web app and deploys it to GitHub Pages (try it in a browser)
.github/workflows/release.yml tag v* or manual tauri-action builds desktop installers for Linux / macOS / Windows and attaches them to a draft Release

All three check out the player repo (JustPlayBo/whitechapel) so the vendored renderers are synced fresh in CI.

Cut a desktop release:

git tag v0.1.0 && git push --tags     # → release.yml builds all three platforms

Pack format

See ../justplay-sy/packs/SCHEMA.md.

About

Visual editor for JustPlay game packs (boardgame/1) — Tauri 2 desktop app + web (GitHub Pages). Live preview reuses the player's own renderer.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors