Skip to content

Commit 4986437

Browse files
author
DavidQ
committed
Add import rules to template
1 parent 403bf05 commit 4986437

5 files changed

Lines changed: 29 additions & 4 deletions

File tree

docs/dev/CODEX_COMMANDS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
MODEL: GPT-5.4-codex
22
REASONING: low
33
COMMAND:
4-
Execute docs/pr/BUILD_PR_GAMES_82_TEMPLATE_PLACEHOLDERS.md exactly.
5-
Package to <project folder>/tmp/BUILD_PR_GAMES_82_TEMPLATE_PLACEHOLDERS_delta.zip
4+
Execute docs/pr/BUILD_PR_GAMES_83_TEMPLATE_IMPORT_RULES.md exactly.
5+
Package to <project folder>/tmp/BUILD_PR_GAMES_83_TEMPLATE_IMPORT_RULES_delta.zip

docs/dev/COMMIT_COMMENT.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Add placeholder files to template
1+
Add import rules to template
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Add placeholder files to template
1+
Add import rules to template
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# BUILD PR — Games Template Import Pattern
2+
3+
## Purpose
4+
Standardize how imports should be written inside games.
5+
6+
## File
7+
- games/_template/README.md
8+
9+
## Add
10+
- required import patterns (src/shared, src/engine)
11+
- forbid relative climbing (../../)
12+
13+
## Constraints
14+
- doc only

games/_template/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,14 @@ import templateFlow from "./index.js";
1818
// templateFlow.attract
1919
// templateFlow.intro
2020
```
21+
22+
## Import Rules
23+
24+
Use direct project-root relative imports for shared and engine modules:
25+
26+
```js
27+
import { sanitizeText } from "src/shared/utils/stringUtils.js";
28+
import { createEngineLoop } from "src/engine/core/createEngineLoop.js";
29+
```
30+
31+
Do not use relative climbing imports like `../../` inside games code.

0 commit comments

Comments
 (0)