1
0
Fork 0
mirror of https://codeberg.org/icewind/haze.git synced 2026-10-01 16:54:08 +02:00
haze/DEVELOPING.md

80 lines
1.4 KiB
Markdown

# Developing
## Setup
### Nix based development environment
The recommended way to setup the development environment is to use
[Lix](https://lix.systems/install/)/[Nix](https://nixos.org/download/).
Once installed, you can enter the development shell using `nix develop` or,
setup [direnv](https://direnv.net/) to automatically enter the development shell
when you enter the folder.
The development shell provides all necessary tooling to develop haze.
### Without Nix
The fooling tools need to be setup to develop without using Nix to manage the
development setup:
- [`cargo`](https://doc.rust-lang.org/cargo/getting-started/installation.html) -
For building the program
- [`mdbook`](https://github.com/rust-lang/mdBook) - For building the
documentation
- [`prettier`](https://prettier.io/) - For formatting the non-rust files
- [`vale`](https://vale.sh/) - For checking documentation
## Building
```bash
cargo build
```
The binary can then be found at `target/debug/haze`.
## Formatting
### With Nix
```bash
nix fmt
```
### Without Nix
#### Rust code
```bash
cargo fmt
```
#### Documentation
```bash
prettier --write '**/*.md'
```
### Building documentation
```bash
mdbook serve
```
### Checking documentation
```bash
vale src/ book/src/ book/README.md *.md
```
### Run all checks
```bash
nix flake check
```
### Building docker images
```bash
nix run .#'"haze-image-php-8.4"'.copyToDockerDaemon
```