{"id":48448665,"url":"https://github.com/jverneaut/gutenberg-chess","last_synced_at":"2026-04-06T19:03:11.181Z","repository":{"id":349063424,"uuid":"1200410821","full_name":"jverneaut/gutenberg-chess","owner":"jverneaut","description":"A chess game built on top of WordPress's upcoming real-time collaboration features.","archived":false,"fork":false,"pushed_at":"2026-04-04T01:53:11.000Z","size":1631,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-04T03:31:50.904Z","etag":null,"topics":["chess","gutenberg","gutenberg-blocks","wordpress"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jverneaut.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-03T11:33:09.000Z","updated_at":"2026-04-04T01:51:26.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/jverneaut/gutenberg-chess","commit_stats":null,"previous_names":["jverneaut/gutenberg-chess"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/jverneaut/gutenberg-chess","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jverneaut%2Fgutenberg-chess","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jverneaut%2Fgutenberg-chess/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jverneaut%2Fgutenberg-chess/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jverneaut%2Fgutenberg-chess/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jverneaut","download_url":"https://codeload.github.com/jverneaut/gutenberg-chess/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jverneaut%2Fgutenberg-chess/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31485517,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-06T17:22:55.647Z","status":"ssl_error","status_checked_at":"2026-04-06T17:22:54.741Z","response_time":112,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chess","gutenberg","gutenberg-blocks","wordpress"],"created_at":"2026-04-06T19:02:52.711Z","updated_at":"2026-04-06T19:03:11.154Z","avatar_url":"https://github.com/jverneaut.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gutenberg Chess\n\nReal-time collaborative chess blocks for WordPress.\n\nThis project is built for the WordPress 7.0 era, where collaboration is a first-class editing experience.\nYou can drop a chess game into the block editor, assign players, and let the board + move list stay in sync through block attributes and Gutenberg context.\n\nIt is a fun project hacked together as an experiment that became surprisingly usable.\n\n![Gutenberg Chess screenshot](./screenshot.png)\n\n## Why It Exists\n\nWordPress collaboration features open the door to shared editing flows.\nChess is a perfect stress test:\n\n- two users\n- strict turn order\n- stateful UI\n- clean block composition\n\nSo this plugin turns that into a reusable block system instead of a one-off widget.\n\nThis plugin is intentionally composable.\nThe board, players, status labels, and move list are separate blocks, so admins can rearrange the layout directly in the editor.\n\n## Architecture (Quick Tour)\n\nAt a high level:\n\n- `chess-game` is the state owner (moves + selected players).\n- state is propagated through Gutenberg block context.\n- specialized child blocks render board, players, status, and move history.\n- React (`chess.js` + `react-chessboard`) handles game rules and board UI.\n- PHP dynamic rendering wires frontend mounts and context output.\n\nMain folders:\n\n- `src/blocks/*`: block definitions, editor behavior, view scripts, dynamic render templates.\n- `src/contexts/*`: shared React context (`ChessGameContext`) and board/game state helpers.\n- `src/components/*`: shared UI behavior (board rendering, move rows, perspective logic).\n- `build/*`: compiled assets + block manifest.\n\n## Block Overview\n\n### `gutenberg-chess/chess-game`\n\n- top-level wrapper and source of truth.\n- stores:\n  - `moves`\n  - `whitePlayerId`\n  - `blackPlayerId`\n- provides block context to descendants.\n\n### `gutenberg-chess/chess-board`\n\n- renders the interactive board in editor.\n- renders display-only board on frontend.\n- supports:\n  - restart toolbar action\n  - board orientation by player perspective\n  - last-move square highlight\n  - turn-based interaction gating in editor\n\n### `gutenberg-chess/chess-player`\n\n- contextual player container for either white or black side.\n- syncs nested player-related blocks with assigned user.\n\n### `gutenberg-chess/chess-player-name`\n\n- displays selected player name (styleable text block).\n\n### `gutenberg-chess/chess-player-status`\n\n- displays simple status text like whose turn it is, win state, or draw.\n- hidden when no status should be shown.\n\n### `gutenberg-chess/chess-moves`\n\n- container block for the move list area.\n\n### `gutenberg-chess/chess-moves-template`\n\n- row template for moves.\n- first row is editable; following rows are generated previews from context.\n\n### `gutenberg-chess/chess-move-index`\n\n- displays move number (`1.`, `2.`, ...).\n\n### `gutenberg-chess/chess-move`\n\n- displays SAN move text for white or black.\n- highlights latest move entry.\n\n## Collaboration Behavior\n\n- moves are persisted in block attributes.\n- in editor, only the player whose turn it is can move.\n- if current user is the black player, editor board/player perspective flips.\n- if white and black are the same user, no flip is applied.\n- frontend board is intentionally read-only.\n\n## Try It From a Release\n\n1. Go to the repository **Releases** page.\n2. Download the latest `gutenberg-chess.zip` asset.\n3. In WordPress admin: **Plugins -\u003e Add New -\u003e Upload Plugin**.\n4. Upload the zip and activate.\n5. Create or edit a post/page and insert **Chess Game**.\n6. Pick white/black players in inspector.\n7. Open the same post in two editor sessions with different users and play.\n\n## Release Automation\n\nThis repo includes a GitHub Action that:\n\n- watches `gutenberg-chess.php`\n- detects version header changes\n- runs Composer + npm build\n- creates a GitHub release tagged with the plugin version\n- uploads the built plugin zip\n\nSo bumping `Version:` in `gutenberg-chess.php` is the release trigger.\n\n## Local Dev\n\n```bash\ncomposer install\nnpm ci --legacy-peer-deps\nnpm run build\n```\n\n`--legacy-peer-deps` is required because `react-chessboard` currently targets React 19, while Gutenberg still runs on React 18.\n\nFor watch mode:\n\n```bash\nnpm run start\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjverneaut%2Fgutenberg-chess","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjverneaut%2Fgutenberg-chess","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjverneaut%2Fgutenberg-chess/lists"}