new-game script mangles titles containing $, backticks or <
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 76/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- html, node.js, typescript
- Área
- build-system, tooling
Línea de trabajo
Lee scripts/new-game.mjs junto con games/_template/main.ts y games/_template/index.html para seguir cómo se sustituye el título y cuándo se escriben los archivos. Prueba la reproducción indicada y luego ejecuta npm run typecheck y npm run build. Se habrá terminado cuando los títulos con caracteres especiales indicados permitan crear un juego que se pueda compilar o se rechacen con un mensaje claro antes de escribir ningún archivo.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Summary
The scaffolder validates the slug but substitutes the title raw into an HTML file and a TypeScript template literal.
Where
scripts/new-game.mjs:21,scripts/new-game.mjs:23-29games/_template/main.ts:48,games/_template/index.html:7
Details
.replaceAll('__SLUG__', slug).replaceAll('__TITLE__', title)
A string replacement still interprets $$, $& and similar patterns. A title with a backtick or ${ produces a file that fails tsc; a title with < or & produces invalid HTML. The folder is copied before the registry is written, so a failure in between leaves a half-registered game. Derived from the code; not run.
Steps to reproduce
npm run new-game cash "Cash $$ Grab".games/cash/index.htmlsays "Cash $ Grab" while the registry has the correct title.
Suggested fix
Use function replacers (replaceAll('__TITLE__', () => escaped)), HTML-escape for .html, and write the title into the template as a JSON.stringify-ed constant. Or restrict titles to a safe character set.
Acceptance criteria
- Titles with
$, backticks,${,<and&either scaffold a building game or are rejected with a clear message before any file is written
Getting started
- Relevant files:
scripts/new-game.mjs,games/_template/main.ts,games/_template/index.html - 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: low. Effort: S. audit-key: bug|scripts/new-game.mjs|replaceAll
- 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
-
🐛 The Rulekeeper - An index run that gives up on the lock ends SucceededPosiblemente ocupada @github-actions la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
SSWConsulting/SSW.Rules#2809 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
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
-
bug
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