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

Ouverte
#44 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Évaluation

Difficulté
3/5
Temps estimé
1-2 jours
Accessibilité débutants
72/100
Type d'issue
Refactorisation
Clarté
Clairement spécifiée
Activité
Active
Stack technique
html, typescript, vite
Domaine
build-system

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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

Langage dominant
TypeScript
Étoiles
3
Forks
3
Métriques de merge des PR
Aucune PR mergée en 30 j

Préparer son environnement

Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de TMHSDigital/GH-Arcade

Toutes les issues de TMHSDigital/GH-Arcade

Issues similaires

Plus d'issues TypeScript

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.