Add a consistency check for registry.json, game folders and trophies
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 55/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript, vite
Hướng nghiên cứu
Start by reading games/registry.json, vite.config.ts, shared/achievements.ts, and scripts/new-game.mjs to trace how game folders, registry entries, and trophies are connected. Add the consistency checks in games/registry.test.ts, then make the scaffold function testable with a temporary directory. Done means the listed validation and scaffold cases pass in CI; the issue says there is no test suite yet, so first identify the project’s test setup.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
The list of games has three independent sources of truth and nothing ties them together: Vite builds pages from a folder scan, the hub lists games from registry.json, and the "play every game" trophy derives the game set from the trophy list. They agree today; this is a drift risk.
Where
vite.config.ts:10-19(discoverGames)games/registry.json,src/hub/main.ts:46(unchecked cast)shared/achievements.ts:143-144scripts/new-game.mjs:7-44(runs at module top level, so it cannot be pointed at a fixture directory)
Impact
A registry slug with no folder is a dead hub card. A folder with no registry entry is built and precached but unreachable. A game with no trophy is silently not required for the "play every game" trophy.
Suggested fix
Add games/registry.test.ts (and optionally the same check at build time in vite.config.ts):
- Slugs are unique and match
/^[a-z0-9]+(-[a-z0-9]+)*$/ - The slug set equals the set of
games/*folders that do not start with_and containindex.html - Every entry has a non-empty title, description, controls and tags, and a six-digit hex accent
- Every
thumbnailresolves to a file underpublic/ - Every non-arcade trophy's game is a registry slug, and every slug has at least one trophy
- Trophy ids are unique;
counterandtargetare both set or both absent
Then export scaffold({ root, slug, title }) from new-game.mjs with a thin CLI wrapper and test it against a temp directory:
- Invalid and existing slugs are rejected with no writes
-
space-dodgewith no title becomes "Space Dodge" - No placeholder remains in the copied files; the registry gains exactly one entry and stays valid JSON
Acceptance criteria
- The cases above pass in CI
Getting started
- Relevant files:
games/registry.json,vite.config.ts,shared/achievements.ts,scripts/new-game.mjs - Run locally:
npm install, thennpm run dev - Checks:
npm run typecheckandnpm run build(there is no test suite yet) - Related docs:
README.md
Filed by repo-audit/full-audit at b001f5d. Severity: medium. Effort: M. audit-key: testing|games/registry.json|registry-consistency
- Ngôn ngữ chính
- TypeScript
- Star
- 3
- Fork
- 3
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của TMHSDigital/GH-Arcade
-
enhancement good first issue severity: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
TMHSDigital/GH-Arcade#50 ·
-
enhancement good first issue severity: medium
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
TMHSDigital/GH-Arcade#47 ·
-
documentation good first issue severity: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
TMHSDigital/GH-Arcade#34 ·
-
documentation good first issue severity: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
TMHSDigital/GH-Arcade#33 ·
-
dependencies good first issue severity: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
TMHSDigital/GH-Arcade#27 ·
Tất cả issue của TMHSDigital/GH-Arcade
Issue tương tự
-
automated-triage type/bug type/ci
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
📦 expo-router Android contributor: external needs review sdk-58 severity: medium
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
expo/expo#53436 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Translate the READMEĐang mởdocumentation good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
asasemahmed/openboard#68 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Document PowerShell shell semantics and read-only Bash deduplication in Built-in Tools referenceĐang mởdocumentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100