Skip to content

Commit 929eabc

Browse files
committed
Update developers.md
Add graoh-editor related infos
1 parent d7e8490 commit 929eabc

1 file changed

Lines changed: 64 additions & 0 deletions

File tree

docs/src/developers.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ PlantSimEngine currently has three main local environments:
2626
- `docs/` for the Documenter build;
2727
- `benchmark/` for benchmark scripts used to compare performance locally.
2828

29+
The graph viewer/editor also has a small frontend workspace in `frontend/`. It
30+
is a Vite/React application that is compiled into `frontend/dist/` and then
31+
embedded by the Julia static viewer and graph editor extension.
32+
2933
## Running checks locally
3034

3135
### Main test suite
@@ -51,6 +55,66 @@ The docs environment includes the extra packages needed for examples and API
5155
documentation, such as `Documenter`, `CairoMakie`, `PlantMeteo`, and
5256
`MultiScaleTreeGraph`.
5357

58+
### Graph viewer frontend
59+
60+
The graph viewer and editor UI lives in `frontend/`. Use Node 22 or newer, then
61+
install the JavaScript dependencies from the repository root with:
62+
63+
```bash
64+
cd frontend
65+
npm ci
66+
```
67+
68+
For local development, run the Vite server:
69+
70+
```bash
71+
npm run dev
72+
```
73+
74+
This is useful for frontend-only iteration. The Julia package, however, serves
75+
the compiled assets from `frontend/dist/`, so rebuild the bundle before testing
76+
the Julia viewer/editor or before committing frontend changes:
77+
78+
```bash
79+
npm run build
80+
```
81+
82+
`frontend/dist/` is intentionally committed because registered Julia packages
83+
need the browser assets without requiring users to run a Node build step.
84+
85+
Run the lightweight frontend checks with:
86+
87+
```bash
88+
npm run typecheck
89+
npm test
90+
```
91+
92+
The end-to-end tests use Playwright and start a real Julia graph editor session.
93+
Install the Chromium browser once, then run the suite:
94+
95+
```bash
96+
npx playwright install --with-deps chromium
97+
npm run test:e2e
98+
```
99+
100+
The E2E helper starts Julia with `julia --project=test --startup-file=no`, loads
101+
`PlantSimEngine`, `PlantSimEngine.Examples`, and `HTTP`, then drives the browser
102+
against the local editor URL. If you already have an editor session running and
103+
want Playwright to use it, set `PSE_GRAPH_EDITOR_URL` to the full session URL,
104+
including the `token` query parameter.
105+
106+
After changing the viewer UI, rebuild the docs to verify the static embedded
107+
viewer too:
108+
109+
```bash
110+
cd ..
111+
julia --project=docs docs/make.jl
112+
```
113+
114+
The docs build writes `docs/src/www/simple_dependency_graph.html` as an
115+
intermediate generated asset and copies it into `docs/build/`; that source-side
116+
HTML file is ignored by git.
117+
54118
### Benchmarks
55119

56120
Benchmark scripts live in `benchmark/`. They are useful when a change may alter

0 commit comments

Comments
 (0)