docs: 📝 Improve contribution docs

This commit is contained in:
Jesse Wierzbinski 2024-06-28 21:31:17 -10:00
parent 5f7c77a3d8
commit a8132e8d53
No known key found for this signature in database

View file

@ -41,6 +41,35 @@ bun install
4. Copy the `config/config.example.toml` file to `config/config.toml` and edit it to set up the database connection and other settings. 4. Copy the `config/config.example.toml` file to `config/config.toml` and edit it to set up the database connection and other settings.
## HTTPS development
To develop with HTTPS, you need to generate a self-signed certificate. We will use [`mkcert`](https://github.com/FiloSottile/mkcert) for this purpose.
1. Install `mkcert`:
2. Generate a certificate for the domain you are using:
```sh
mkcert -install
# You can change the domain to whatever you want, but it must resolve via /etc/hosts
# *.localhost domains are automatically aliased to localhost by DNS
mkcert -key-file config/lysand.localhost-key.pem -cert-file config/lysand.localhost.pem lysand.localhost
```
3. Edit the config:
```toml
[http]
base_url = "https://lysand.localhost:9900"
bind = "lysand.localhost"
bind_port = 9900 # Change the port to whatever you want
[http.tls]
enabled = true
key = "config/lysand.localhost-key.pem"
cert = "config/lysand.localhost.pem"
passphrase = ""
ca = ""
```
Now, running the server will use the certificate you generated.
## Testing your changes ## Testing your changes
To start the live server on the address and port specified on the config file, run: To start the live server on the address and port specified on the config file, run:
@ -57,7 +86,7 @@ To run the tests, run:
bun test bun test
``` ```
The tests are located in the `tests/` directory and follow a Jest-like syntax. The server should be shut down before running the tests. The tests are located all around the codebase (filename `*.test.ts`) and follow a Jest-like syntax. The server should be shut down before running the tests.
## Code style ## Code style
@ -69,7 +98,7 @@ bun lint
To automatically fix the issues, run: To automatically fix the issues, run:
```sh ```sh
bun lint --apply bun lint --write
``` ```
You can also install the Biome Visual Studio Code extension and have it format your code automatically on save. You can also install the Biome Visual Studio Code extension and have it format your code automatically on save.
@ -80,6 +109,11 @@ Linting should not be ignored, except if they are false positives, in which case
TypeScript errors should be ignored with `// @ts-expect-error` comments, as well as with a reason for being ignored. TypeScript errors should be ignored with `// @ts-expect-error` comments, as well as with a reason for being ignored.
To scan for all TypeScript errors, run:
```sh
bun check
```
### Commit messages ### Commit messages
We use [Conventional Commits](https://www.conventionalcommits.org) for our commit messages. This allows us to automatically generate the changelog and the version number, while also making it easier to understand what changes were made in each commit. We use [Conventional Commits](https://www.conventionalcommits.org) for our commit messages. This allows us to automatically generate the changelog and the version number, while also making it easier to understand what changes were made in each commit.