Skip to content

Commit 4bd29eb

Browse files
committed
Split out development info from README.md into DEVELOPMENT.md
1 parent e3edfee commit 4bd29eb

2 files changed

Lines changed: 80 additions & 75 deletions

File tree

DEVELOPMENT.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# Development
2+
3+
## Git hooks
4+
5+
After editing any file in `src/`, run `./build` to regenerate `hdi`, then commit both. CI will fail if `hdi` is out of date with `src/`.
6+
7+
A pre-commit hook is included that automatically rebuilds `hdi` when `src/` files are staged. To install it:
8+
9+
```bash
10+
git config core.hooksPath .githooks
11+
```
12+
13+
## Testing
14+
15+
Tests use [bats-core](https://github.com/bats-core/bats-core). Linting uses [ShellCheck](https://www.shellcheck.net/).
16+
17+
```bash
18+
brew install bats-core shellcheck # or: apt-get install bats shellcheck
19+
shellcheck hdi
20+
bats test/hdi.bats
21+
```
22+
23+
### Running Linux tests locally with Act
24+
25+
This assumes that the host system is macOS.
26+
27+
CI runs tests on both macOS and Ubuntu. To run the Ubuntu job locally using [Act](https://github.com/nektos/act) (requires Docker / Docker Desktop):
28+
29+
```bash
30+
brew install act
31+
act -j test --matrix os:ubuntu-latest --container-architecture linux/amd64
32+
```
33+
34+
## Demo
35+
36+
The demo GIFs are generated with [VHS](https://github.com/charmbracelet/vhs). To regenerate them:
37+
38+
```bash
39+
brew install vhs
40+
vhs ./demo/demo-latte.tape
41+
vhs ./demo/demo-mocha.tape
42+
```
43+
44+
Or:
45+
46+
```bash
47+
vhs demo/demo-latte.tape & vhs demo/demo-mocha.tape & wait
48+
```
49+
50+
These output GIFs in `./demo/`.
51+
52+
## Website
53+
54+
See `website/README.md` for instructions on running the demo website locally.
55+
56+
It is deployed to https://hdi.md via GitHub Pages on every release.
57+
58+
## Benchmarking
59+
60+
Static benchmark READMEs in `bench/` (small, medium, large, stress) exercise parsing path at different scales. Run benchmarks with:
61+
62+
```bash
63+
./bench/run # run benchmarks, print results
64+
./bench/run --compare # compare current results against last release
65+
./bench/run --log # also save to bench/results.csv (should only be used by release script / only run when creating a new release)
66+
```
67+
68+
Benchmarks run automatically during `./release` and are recorded in `bench/results.csv`. A chart (`bench/results.svg`) is also generated to visualise performance across releases (via `bench/chart`).
69+
70+
## Publishing a new release
71+
72+
The `release` script bumps the version in `src/header.sh`, rebuilds `hdi`, commits, tags and pushes. The `release` Actions workflow will automatically build and publish a GitHub release when the tag is pushed, and the demo site is built and deployed via the `pages` workflow. The script then prints the `url` and `sha256` values to update in the [homebrew-tap](https://github.com/grega/homebrew-tap) repo (`Formula/hdi.rb`).
73+
74+
```bash
75+
./release patch # 0.1.0 → 0.1.1
76+
./release minor # 0.1.0 → 0.2.0
77+
./release major # 0.1.0 → 1.0.0
78+
./release 1.2.3 # explicit version
79+
```

README.md

Lines changed: 1 addition & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -132,81 +132,7 @@ No dependencies, just Bash. Works on macOS and Linux.
132132

133133
## Development
134134

135-
After editing any file in `src/`, run `./build` to regenerate `hdi`, then commit both. CI will fail if `hdi` is out of date with `src/`.
136-
137-
A pre-commit hook is included that automatically rebuilds `hdi` when `src/` files are staged. To install it:
138-
139-
```bash
140-
git config core.hooksPath .githooks
141-
```
142-
143-
## Testing
144-
145-
Tests use [bats-core](https://github.com/bats-core/bats-core). Linting uses [ShellCheck](https://www.shellcheck.net/).
146-
147-
```bash
148-
brew install bats-core shellcheck # or: apt-get install bats shellcheck
149-
shellcheck hdi
150-
bats test/hdi.bats
151-
```
152-
153-
### Running Linux tests locally with Act
154-
155-
This assumes that the host system is macOS.
156-
157-
CI runs tests on both macOS and Ubuntu. To run the Ubuntu job locally using [Act](https://github.com/nektos/act) (requires Docker / Docker Desktop):
158-
159-
```bash
160-
brew install act
161-
act -j test --matrix os:ubuntu-latest --container-architecture linux/amd64
162-
```
163-
164-
## Demo
165-
166-
The demo GIFs are generated with [VHS](https://github.com/charmbracelet/vhs). To regenerate them:
167-
168-
```bash
169-
brew install vhs
170-
vhs ./demo/demo-latte.tape
171-
vhs ./demo/demo-mocha.tape
172-
```
173-
174-
Or:
175-
176-
```bash
177-
vhs demo/demo-latte.tape & vhs demo/demo-mocha.tape & wait
178-
```
179-
180-
These output GIFs in `./demo/`.
181-
182-
## Website
183-
184-
See `website/README.md` for instructions on running the demo website locally.
185-
186-
It is deployed to https://hdi.md via GitHub Pages on every release.
187-
188-
## Benchmarking
189-
190-
Static benchmark READMEs in `bench/` (small, medium, large, stress) exercise parsing path at different scales. Run benchmarks with:
191-
192-
```bash
193-
./bench/run # run benchmarks, print results
194-
./bench/run --compare # compare current results against last release
195-
./bench/run --log # also save to bench/results.csv (should only be used by release script / only run when creating a new release)
196-
```
197-
198-
Benchmarks run automatically during `./release` and are recorded in `bench/results.csv`. A chart (`bench/results.svg`) is also generated to visualise performance across releases (via `bench/chart`).
199-
200-
## Publishing a new release
201-
202-
The `release` script bumps the version in `src/header.sh`, rebuilds `hdi`, commits, tags and pushes. The `release` Actions workflow will automatically build and publish a GitHub release when the tag is pushed, and the demo site is built and deployed via the `pages` workflow. The script then prints the `url` and `sha256` values to update in the [homebrew-tap](https://github.com/grega/homebrew-tap) repo (`Formula/hdi.rb`).
203-
204-
```bash
205-
./release patch # 0.1.0 → 0.1.1
206-
./release minor # 0.1.0 → 0.2.0
207-
./release major # 0.1.0 → 1.0.0
208-
./release 1.2.3 # explicit version
209-
```
135+
See `DEVELOPMENT.md` for instructions on setting up a local development environment, running tests, benchmarking, and generating demo GIFs.
210136

211137
## AI transparency
212138

0 commit comments

Comments
 (0)