Move trophy definitions next to each game and type trophy ids
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 55/100
- Tipo de issue
- Refactorización
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- typescript, vite
Línea de trabajo
Start with shared/achievements.ts and games/registry.json to understand the trophy list and game registry, then read src/hub/trophies-panel.ts for how games without trophies are displayed. The issue proposes four steps, including adding tests despite noting that no test suite exists; first run npm run typecheck and npm run build to establish the baseline. Done means mistyped trophy IDs fail typechecking and adding a game no longer requires editing shared/achievements.ts.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Summary
All 43 trophies live in one hand-maintained list in a shared module, so every new game edits shared code, and the set of games is stated twice (registry and the trophy list). Trophy ids are bare strings at call sites.
Where
shared/achievements.ts:22-76,shared/achievements.ts:110-111,shared/achievements.ts:143-144src/hub/trophies-panel.ts:26-27(games with no trophies are skipped, hiding their stats)
Impact
- A mistyped id in
unlock('...')compiles and silently never unlocks. - A game added without trophies is excluded from the "play every game" trophy and from the stats panel.
shared/achievements.tschanges in every game-add commit.
Suggested fix
Each step leaves the build working:
- Add tests for
unlock,addCounter,recordPlayand a registry consistency test. - Derive a
TrophyIdunion from the list (as const) and typeunlock(id: TrophyId). No behaviour change. - Move each game's rows to
games/<slug>/trophies.tsand build the list withimport.meta.glob(Phaser-free, so the hub still loads it cheaply). - Derive the "play every game" set from the registry, and render a stats-only section for games with no trophies.
Acceptance criteria
- A mistyped trophy id fails typecheck
- Adding a game does not require editing
shared/achievements.ts
Getting started
- Relevant files:
shared/achievements.ts,games/registry.json,src/hub/trophies-panel.ts - Run locally:
npm install, thennpm run dev - Checks:
npm run typecheckandnpm run build(there is no test suite yet) - Related docs:
README.md
Related: #1
Filed by repo-audit/full-audit at b001f5d. Severity: medium. Effort: M. audit-key: tech-debt|shared/achievements.ts|TROPHIES
- Lenguaje dominante
- TypeScript
- Estrellas
- 3
- Forks
- 3
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de TMHSDigital/GH-Arcade
-
enhancement good first issue severity: low
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
TMHSDigital/GH-Arcade#50 ·
-
enhancement good first issue severity: medium
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
TMHSDigital/GH-Arcade#47 ·
-
documentation good first issue severity: low
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
TMHSDigital/GH-Arcade#34 ·
-
documentation good first issue severity: low
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
TMHSDigital/GH-Arcade#33 ·
-
dependencies good first issue severity: low
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
TMHSDigital/GH-Arcade#27 ·
Todos los issues de TMHSDigital/GH-Arcade
Issues similares
-
automated-triage type/bug type/ci
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
📦 expo-router Android contributor: external needs review sdk-58 severity: medium
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
expo/expo#53436 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Translate the READMEAbiertodocumentation good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
asasemahmed/openboard#68 ·
Los mantenedores suelen responder en 1 día
-
bug good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
-
Document PowerShell shell semantics and read-only Bash deduplication in Built-in Tools referenceAbiertodocumentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100