Skip to content

Latest commit

 

History

History
76 lines (46 loc) · 1.8 KB

File metadata and controls

76 lines (46 loc) · 1.8 KB

Hacking

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.

Getting Started

You can install dependencies using npm by running:

$ npm install

The 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.

Running Locally

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 dev

By 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.

Running Tests

To just run the tests:

$ elm-test

To run the tests and generate a code coverage report:

$ elm-coverage

Building

To build minified JS and CSS files, you can run:

$ npm run build

The client is built using parcel. To build the client and stylesheet with parcel directly:

$ parcel build ./src/cactus.js ./src/style.css

Code Style

Code 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.