Generate the shared head of each game's index.html at build time

Abierto
#44 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
72/100
Tipo de issue
Refactorización
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
html, typescript, vite
Área
build-system

Línea de trabajo

Read vite.config.ts and compare games/_template/index.html with games/snake/index.html; check how games/registry.json stores each title. Start by tracing the Vite build entry points, then add the suggested build test for every game's built page. Done means the shared head is defined once and the built pages retain their titles, icon links and font stylesheet.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

severity: low tech-debt

Summary

Each game's index.html repeats the same viewport, theme colour, icon links, font preconnect and stylesheet, back link, loader and script tag. Only the title differs, and the title is also in the registry.

Where

  • games/_template/index.html:1-20, games/snake/index.html:7
  • vite.config.ts:10-19

Details

The template and Snake were compared line by line; the others are the same length and were sampled.

Impact

Any head change (font swap, manifest link, meta description, a CSP tag) is an eleven-file edit that can drift.

Suggested fix

Add a small Vite transformIndexHtml plugin that injects the shared head tags and the title from games/registry.json, and reduce each game's index.html to the body. Cover it with a build test asserting each built page has the title, icon link and font stylesheet.

Acceptance criteria

  • Shared head tags are defined in one place
  • Built pages are unchanged

Getting started

  • Relevant files: games/_template/index.html, vite.config.ts
  • Run locally: npm install, then npm run dev
  • Checks: npm run typecheck and npm run build (there is no test suite yet)
  • Related docs: README.md

Filed by repo-audit/full-audit at b001f5d. Severity: low. Effort: S. audit-key: tech-debt|games/_template/index.html|head

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

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de TMHSDigital/GH-Arcade

Todos los issues de TMHSDigital/GH-Arcade

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.