Normalize ascii_world demo require paths to relative style
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 76/100
Hướng nghiên cứu
Start by inspecting the six Lua files under lua-learning-website/public/demos/ascii_world/ and compare their require style with the other demos. Run /demos/ascii_world/main.lua in the editor, then run the existing demos-related e2e tests. Done means the game still supports movement, combat, and NPCs, with no remaining require("demos/...") matches under public/demos/ascii_world/.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Background
In PR #751, `ascii_world` was migrated from `/examples` to `/demos`. Its internal requires used mount-absolute paths (`require("examples/ascii_world/config")`) which were mechanically rewritten to `require("demos/ascii_world/config")`. The reviewer flagged the inconsistency:
`flaming-goat/main.lua` uses relative `require("state")` and `require("rooms.subway")` while ascii_world uses absolute mount-path requires (`require("demos/ascii_world/config")`). [...] verify this is stable if the demo is ever moved, or normalize to absolute requires for consistency.
All other demos (`minesweeper`, `space_shooter`, `flaming-goat`) use the project's prevailing relative require style and have been validated to work via e2e. `ascii_world` is the outlier.
Proposal
Normalize `ascii_world` to relative requires to match the other three demos. This also makes the workspace mount-agnostic — if `/demos` is ever re-mounted or renamed, nothing breaks.
Example:
```lua
-- Before (ascii_world/game.lua)
local config = require("demos/ascii_world/config")
local ui = require("demos/ascii_world/ui")
-- After
local config = require("config")
local ui = require("ui")
```
Files
Six `.lua` files under `lua-learning-website/public/demos/ascii_world/` currently hold mount-absolute requires:
- `main.lua` — `require("demos/ascii_world/game")`
- `game.lua` — 7 internal requires
- `ui.lua` — 1 require
- `combat.lua` — 4 requires
- `maps.lua` — 1 require
- `player.lua` — 2 requires
(`config.lua`, `items.lua`, `monsters.lua` don't need changes.)
Verification
- Manually run `/demos/ascii_world/main.lua` in the editor — game starts, movement/combat/NPCs work
- Existing demos-related e2e tests still pass
- No remaining `require("demos/...")` matches under `public/demos/ascii_world/`
Risk
Low. Lua's require resolver already supports this style — minesweeper, space_shooter, and flaming-goat all rely on it. This is a consistency normalization, not a behavior change.
Deferred from #751 per reviewer feedback.
- Ngôn ngữ chính
- TypeScript
- Star
- 1
- Fork
- 0
- 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
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
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 jcollard/LuaInTheWeb
-
tech-debt
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
jcollard/LuaInTheWeb#752 ·
-
tech-debt
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
jcollard/LuaInTheWeb#690 ·
-
tech-debt
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
jcollard/LuaInTheWeb#590 ·
-
tech-debt
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
jcollard/LuaInTheWeb#518 ·
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
jcollard/LuaInTheWeb#235 ·
Tất cả issue của jcollard/LuaInTheWeb
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
radix-ui/primitives#4228 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
SignalK/freeboard-sk#1093 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[测试] 等待仓库加载后再记录多仓库排序基线Có thể đã có người làm @myot233 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày