Thank you for being interested in Cactus Comments! Contributions are very welcome! This document is here to help you get started hacking on the web client.
You can install dependencies using npm by running:
$ npm installThe web client is written in Elm, so you'll need the elm compiler.
Other useful tools include elm-format, elm-test, elm-coverage, and elm-analyse.
If you're using Nix, you can use the shell.nix file to get the tools you need.
Run nix-shell to enter the environment.
The examples/dev.html file is small example page, which runs the code you have in src/.
You can serve it by running:
$ npm run devBy default, Parcel will serve it on all interfaces, meaning you can access it on localhost:8080 on the same device or on your local network on DEVICE_IP:8080.
It uses the public matrix.cactus.chat homeserver and appservice.
To just run the tests:
$ elm-testTo run the tests and generate a code coverage report:
$ elm-coverageTo build minified JS and CSS files, you can run:
$ npm run buildThe client is built using parcel. To build the client and stylesheet with parcel directly:
$ parcel build ./src/cactus.js ./src/style.cssCode is formatted according to the Elm style guide.
You can use the elm-format tool to format files automatically.
Please format your files using elm-format, when you make a merge request ✨
If you use vim, I highly recommend the elm-vim plugin.