Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
5044a98
Octree fixes
chrisnew Apr 1, 2026
5821c7f
introducing TypeScript tooling
chrisnew Apr 2, 2026
e4c5888
TS: Defs and Vector
chrisnew Apr 2, 2026
e295f91
removing Vector.mjs
chrisnew Apr 2, 2026
78c725a
TS: Octree, BSpline
chrisnew Apr 2, 2026
887cf67
TS: Q and Keys
chrisnew Apr 2, 2026
f82f9fc
TS: ClientEdict
chrisnew Apr 2, 2026
39c7e1c
removed d.ts for EventBus and registry
chrisnew Apr 2, 2026
4872e7b
TS: GameInterfaces
chrisnew Apr 2, 2026
814c231
TS: network/Protocol
chrisnew Apr 2, 2026
a207c2e
TS: network/MSG
chrisnew Apr 2, 2026
b9fdb33
TS: network/
chrisnew Apr 2, 2026
ab49cdd
TS: common/CRC, common/Def, common/Errors
chrisnew Apr 2, 2026
0b7b323
removed Host.client
chrisnew Apr 2, 2026
8d8fc82
TS: common/Cmd, common/Cvar
chrisnew Apr 2, 2026
7e8618f
TS: common/Console
chrisnew Apr 2, 2026
4faad0b
TS: common/Com
chrisnew Apr 2, 2026
0e3fd19
TS: common/Com improvements
chrisnew Apr 2, 2026
4d79df3
TS: common/Sys
chrisnew Apr 2, 2026
2777777
TS: common/W
chrisnew Apr 2, 2026
b187d13
TS: common/ anything Worker
chrisnew Apr 2, 2026
15c6831
TS: common/Pmove
chrisnew Apr 2, 2026
aba0840
clean up of Host.mjs
chrisnew Apr 2, 2026
a2fd54b
TS: common/Host
chrisnew Apr 2, 2026
f0d00cc
TS: common/model/* and common/Mod
chrisnew Apr 2, 2026
e2cfd78
TS: common/model/loaders/* and more
chrisnew Apr 2, 2026
61b7c7f
TS: adopt the stricter guidelines
chrisnew Apr 2, 2026
61b68a5
TS: common/model/loaders/* and more
chrisnew Apr 2, 2026
29c8000
TS: common/GameAPIs, common/CollisionModelSource
chrisnew Apr 3, 2026
66e22ca
TS: server/physics/
chrisnew Apr 3, 2026
7c47db3
TS: added missing JSDocs
chrisnew Apr 3, 2026
c80732c
TS: server/ part 1
chrisnew Apr 3, 2026
fb21fb3
TS: server/ part 2
chrisnew Apr 3, 2026
9975502
QuakeC support: fallback value for alpha
chrisnew Apr 3, 2026
964debf
TS: server/ part 3
chrisnew Apr 3, 2026
289eed1
TS: server/ part 4
chrisnew Apr 3, 2026
a50cf9a
TS: server/Com, server/Sys
chrisnew Apr 3, 2026
3679355
TS: server/ part 5
chrisnew Apr 3, 2026
e214d31
TS: entrypoints
chrisnew Apr 3, 2026
21fbbde
TS: removing shims
chrisnew Apr 3, 2026
ad248be
TS: client/ part 1
chrisnew Apr 4, 2026
fc8d93c
TS: client/ part 2
chrisnew Apr 4, 2026
00bfaf0
TS: client/ part 3
chrisnew Apr 4, 2026
191cefd
TS: client/ part 4
chrisnew Apr 4, 2026
3245c92
TS: client/ part 5
chrisnew Apr 4, 2026
23da906
TS: client/ part 6
chrisnew Apr 4, 2026
80b8a8e
TS: client/ part 7
chrisnew Apr 4, 2026
6bde923
TS: registry
chrisnew Apr 4, 2026
5607e67
TS: instructions for porting game code in future
chrisnew Apr 4, 2026
3b7ccb2
TS: polish tsc findings
chrisnew Apr 4, 2026
0917b4b
TS: polish tsc findings
chrisnew Apr 4, 2026
f74e280
TS: polish tsc findings
chrisnew Apr 4, 2026
9613c6c
TS: polish tsc findings
chrisnew Apr 4, 2026
5b2b18d
game update
chrisnew Apr 4, 2026
64c57f2
ditched the node TS execution path for dedicated in favor of annotations
chrisnew Apr 4, 2026
63337d4
TS: updated instructions on how to port the game, more game updates
chrisnew Apr 4, 2026
4805c96
TS: making GameAPIs more solid
chrisnew Apr 4, 2026
8abdc2c
installed fallow to detect dead code and unused files
chrisnew Apr 5, 2026
219ac05
TS: huge polish of files, more TS stuff, also overhauled Key
chrisnew Apr 6, 2026
1ff1a7d
simplifying code and more cleaning up TS porting residue
chrisnew Apr 6, 2026
129bc74
lots of tests to make sure the base game logic is in good standing
chrisnew Apr 6, 2026
9a7ee40
lots of tests to test the game code
chrisnew Apr 7, 2026
9a49dbd
StartGameInterface
chrisnew Apr 7, 2026
54eaf5a
TS: final polish
chrisnew Apr 8, 2026
213ea06
unit tests
chrisnew Apr 8, 2026
14bb1f2
npm audit fix
chrisnew Apr 8, 2026
08d54ea
documentation updates
chrisnew Apr 8, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .fallowrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"entry": [
"source/cloudflare/worker.mjs",
"source/engine/main-browser.ts",
"source/game/**/main.ts"
],
"ignorePatterns": [
".fallow/**",
"dist/**"
]
}
4 changes: 4 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ eventBus.subscribe("registry.frozen", () => {
- **No `any`, `unknown`, or `*`**. Use specific types (e.g. `ArrayBuffer`).
- **No `@returns {void}`**.

### Helper Functions
- **Prefer function declarations** for helper functions when lexical `this`, expression semantics, or very local inline usage are not needed.
- **Use `const foo = (...) => ...`** only when arrow-function behavior is actually relevant.

## Specific Patterns to Observe

- **Module System**: ES Modules exclusively (`type: "module"` in package.json).
Expand Down
12 changes: 8 additions & 4 deletions .github/instructions/build-and-deploy.instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,12 @@

### Three different kinds of builds

We need to make sure the correct build is used at all times.
All code is always compiled through esbuild (via Vite) before execution. This ensures full TypeScript feature support (decorators, const enum, etc.) across every environment.

1. Dedicated development server: The code is executed in node.js directly, no build step required.
2. Dedicated production server: The code is built using `npm run build:production` and the output files in `dist/` are executed in node.js. This is required to strip out all console.assert statements and other development-only code for optimal performance.
3. Client code: The code is built using `npm run build:production` and the output files in `dist/` are executed in the browser.
1. Dedicated development server: Build with `npm run dedicated:dev` (Vite watch mode), run with `npm run dedicated:start`. The build step compiles TypeScript to JavaScript in `dist/dedicated/` with source maps enabled.
2. Dedicated production server: Build with `npm run dedicated:build:production` and run with `npm run dedicated:start`. Strips console.assert and other development-only code for optimal performance.
3. Client code: Build with `npm run build:production` and serve the output in `dist/browser/` to the browser.

### Testing

Tests use `tsx` (esbuild-based) as the Node.js loader, ensuring the same TypeScript compilation behavior as the Vite builds. Run with `npm test`.
18 changes: 11 additions & 7 deletions .github/instructions/code-style-guide.instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,18 @@ Use `eventBus` for **business logic events and lifecycle hooks**.

## File Organization

### No index.mjs Files
### No index.ts Files

- **Avoid barrel exports**. Use direct imports instead.
- Example: Import `BrushModelRenderer` from `./renderer/BrushModelRenderer.mjs`, not `./renderer`.
- Example: Import `BrushModelRenderer` from `./renderer/BrushModelRenderer.ts`, not `./renderer`.

## General Style Guidelines

- **Use `const` and `let`** instead of `var`.
- **Use camelCase** for variables and functions, PascalCase for classes.
- **Use descriptive names** for variables and functions.
- **Keep functions small** and focused on a single task or a single responsibility.
- **Prefer function declarations** for helper functions when arrow-function semantics are not needed.
- **Use early returns** to reduce nesting and improve readability.
- **Avoid deep nesting**; refactor into helper functions if necessary.
- **Never mutate function parameters**; create new variables instead.
Expand Down Expand Up @@ -153,13 +154,15 @@ class GL {

### `null` initializations

- **Explicitly initialize variables to `null`** when they will later hold an object reference and provide JSDoc type annotations either as cast or an inline comment.
- Example: `let model = /** @type {BaseModel} */ (null);`
- **Explicitly initialize variables to `null`** when they will later hold an object reference.
- In `.ts` files: `let model: BaseModel | null = null;`
- In `.mjs` files: `let model = /** @type {BaseModel} */ (null);`

### Empty Arrays

- **Initialize empty arrays with `[]`** instead of `new Array()` and provide JSDoc type annotations.
- Example: `let vertices = /** @type {number[]} */ ([]);`
- **Initialize empty arrays with `[]`** instead of `new Array()`.
- In `.ts` files: `const vertices: number[] = [];`
- In `.mjs` files: `let vertices = /** @type {number[]} */ ([]);`

## Class and Interface Design

Expand All @@ -172,6 +175,7 @@ class GL {

- **Use `_` prefix** for protected methods. Add `@protected` JSDoc tag.
- **Use `#` prefix** for private methods.
- In `.ts` files, prefer native `protected` / `private` keywords. See `typescript-port.instructions.md`.

### Respect boundaries of abstraction

Expand All @@ -184,7 +188,7 @@ class GL {
- `model` (or `clmodel`) instead of `m`.
- `entity` instead of `ent` or `e`.
- **Constants:** UPPER_CASE.
- **Files:** PascalCase for classes (`BrushModelRenderer.mjs`), camelCase for utils (`modelUtils.mjs`). Always `.mjs`.
- **Files:** PascalCase for classes (`BrushModelRenderer.ts`), camelCase for utils (`modelUtils.ts`). Always `.ts` for TypeScript source files.

## Comments

Expand Down
Loading
Loading