Contributing to wiretap
Contributing to wiretap and developing locally.wiretap
is an open source project licenced under BUSL 1.1,
and we welcome contributions from the community.
Guidelines
There are currently very few tests in this project, so we ask that you please write tests for any new code, so we can start to build up a test suite.
How to develop locally
Wiretap is written in go, it uses libopenapi as the underlying OpenAPI library and ranch as the underlying web/API framework.
The monitor-ui uses lit to power the UI. It’s all written in Typescript. and is compiled using vite.
Prerequisites
Check out the code
Install go dependencies
Start the wiretap server
The backend is now up and running. You can run this in your IDE in a debugger if you prefer.
Open another terminal
You need to open another terminal to run the UI dev server.
Install UI dependencies
Set the UI to dev mode
This part is a little hacky, but it’s the easiest way to develop the UI locally. First we need to modify the index.html
file to be configured to use the vite dev server.
There is a line commented out in the index.html
file that looks like this:
sessionStorage.setItem('wiretapPort', '%WIRETAP_PORT%')
//sessionStorage.setItem('wiretapPort', '9092')
...
Flip the comments so that the line that is uncommented out is the one that sets the port to 9092
.
It should look like this:
//sessionStorage.setItem('wiretapPort', '%WIRETAP_PORT%')
sessionStorage.setItem('wiretapPort', '9092')
...
Run a production build
Copy UI assets
This makes possible to pick up the static assets when running in dev mode.
Start the UI dev server
View the UI
Open up http://localhost:5173/
Make changes
You can now make changes to the UI source, and they will be picked up by the dev server and reloaded instantly.