Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 8 additions & 4 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,13 @@ bun run dev
the server on :8080 and the web app with hot reload on :5173 (it proxies `/api`). Open
http://localhost:5173. Data goes to `./.data`. `WF_DEV_UI` (set by `bun run dev`) names the Vite
server the binary redirects to while no web app is built in; it is a development setting only.
Ctrl+C, closing the terminal or a SIGTERM stops both, with everything they started; when one of
them exits, the other is stopped too. Ctrl+Z suspends both, `fg` resumes them.
The two run as `dev:server` (`cargo run -p windfenster`) and `dev:web` (the web app's `bun run dev`)
side by side through `bun run --parallel`, which prefixes each line with the script's name and stops
the other when one of them fails. Their output goes through a pipe and their input is `/dev/null`,
so in a terminal `bun run dev` sets `FORCE_COLOR` and `CARGO_TERM_COLOR` to keep the colours, and
Vite's keyboard shortcuts (`h`, `r`, `o`, `q`) are only there with `bun run dev:web`. Ctrl+C,
Ctrl+Z and closing the terminal reach both from the terminal itself (they run in its foreground
process group): Ctrl+C stops both, Ctrl+Z suspends both, `fg` resumes them. Each can also run on its own (`bun run dev:server`, `bun run dev:web`).

Checks, as CI runs them:

Expand All @@ -36,8 +41,7 @@ bun run e2e # browser tests (Playwright): the map's shaders and t
## Tests

Unit tests: `cargo test` (next to the code, API and pipeline tests in `crates/*/tests` against
local stand-ins for the data sources), Vitest for the logic in `web/src/lib` and `bun test` for
the scripts in `scripts/` (`bun run test` runs both).
local stand-ins for the data sources) and Vitest for the logic in `web/src/lib` (`bun run test`).

`bun run e2e` runs two sets of browser tests in Chromium, with SwiftShader for a GPU; the
Playwright runner and the Vite server of the gpu tests run on Bun (`bun --bun playwright test`,
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
"web"
],
"scripts": {
"dev": "bun scripts/dev.ts",
"dev": "[ -f .env ] || { cp .env.example .env && echo '.env created from .env.example'; } && printf '\\n Windfenster: http://localhost:5173\\n\\n' && if [ -t 1 ]; then export FORCE_COLOR=1 CARGO_TERM_COLOR=always; fi && bun run --parallel dev:server dev:web",
"dev:server": "cargo run -p windfenster",
"dev:web": "bun run --cwd web dev",
"build": "bun run --filter @windfenster/web build",
"test": "bun test ./scripts && bun run --filter @windfenster/web test",
"test": "bun run --filter @windfenster/web test",
"typecheck": "bun run --filter @windfenster/web typecheck",
"bindings": "cargo test --workspace export_bindings",
"lint": "biome check .",
Expand Down
229 changes: 0 additions & 229 deletions scripts/dev.test.ts

This file was deleted.

49 changes: 0 additions & 49 deletions scripts/dev.ts

This file was deleted.

Loading