diff --git a/README.md b/README.md index 4811e51f1..e1c237974 100644 --- a/README.md +++ b/README.md @@ -42,3 +42,14 @@ Pull requests are welcome if you would like to help contribute. However, before ### File structure This bot is made using [Strife.js](https://github.com/RedGuy12/strife.js). Please follow its style guide and structure. In addition, the `common` directory contains code used across multiple features, and the `util` directory contains utility functions used across the codebase. `util` is different from `common` as its functions are not specific to this bot but could be useful in other apps as well. + +### Commands + +When testing your code, it is recommended to run `npm run serve & npm run dev` to automatically build and restart the bot all in the same terminal. Before committing your code, it is necessary to run `npm run format`, then `npm run lint` and fix any lint errors, then repeat both until no more lint errors are left. See below for a full description of all available commands: + +- To build the code once, run `npm run build`. +- To start the bot after building the code, run `npm start`. +- To rebuild the code on every code change, run `npm run dev`. +- To restart the bot on every successful build, run `npm run serve`. +- To format the code, run `npm run format`. This command must be run before your PR is merged. If you don't run it, it is automatically run in the workflow. +- To lint the code, run `npm run lint`. No lint errors may be present when your PR is merged. Warnings may be allowed depending on the context. Some lint errors may be fixed automatically with `npm run lint -- --fix`, but it is important to manually confirm it worked as intended. The workflow fails if warnings are present.