new-game script mangles titles containing $, backticks or <
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 76/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- html, node.js, typescript
- Lĩnh vực
- build-system, tooling
Hướng nghiên cứu
Đọc scripts/new-game.mjs cùng với games/_template/main.ts và games/_template/index.html để theo dõi cách tiêu đề được thay thế và thời điểm các tệp được ghi. Thử tái hiện trường hợp đã nêu, sau đó chạy npm run typecheck và npm run build. Hoàn tất khi các tiêu đề có ký tự đặc biệt được liệt kê có thể tạo ra một trò chơi biên dịch được hoặc bị từ chối với thông báo rõ ràng trước khi bất kỳ tệp nào được ghi.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- 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