Contributions are welcome! Create an issue if there's something you'd like to see or send a pull request if you can implement it yourself.
To develop locally against a real, working instance, follow most of the Installation instructions in the README, except instead of step 5 (deploying to Heroku), clone this repo locally and then install dependencies:
$ git clone https://github.com/tdmalone/working-plusplus
$ cd working-plusplus
$ yarn
You'll need Node.js already installed on your system. In addition, if you don't have Yarn and don't want it, you can use npm install
instead of yarn
above (but you might not get exactly the same dependency versions).
You'll also need a local installation of PostgreSQL (or a server you can utilise) and a clean database you can use. Here's an easy-to-use Postgres app for Macs. Working PlusPlus++ requires at least PostgreSQL 9.5, but 10+ is recommended.
Make the following environment variables accessible to the app:
SLACK_BOT_USER_OAUTH_ACCESS_TOKEN
: from step 4 of the installation instructionsSLACK_VERIFICATION_TOKEN
: from step 4 of the installation instructionsDATABASE_URL
: in the formatpostgres://user@localhost:5432/databasename
Then, run the app:
$ node index.js
Or if you have the Heroku CLI installed:
$ heroku local
ℹ️ For more help on using heroku local
, see the Heroku Local Dev Center article.
If you make changes to the app, press Ctrl+C to exit, and then run it again.
Finally, you'll need to be able to have Slack contact your development instance directly. If you don't have the ability to forward a port through to your machine, I recommend ngrok. Download and extract, then in the directory you've extracted it in run:
./ngrok http 80 # Or port 5000 if you're running with heroku local.
ngrok will provide you with the public URL your app is accessible on. This is the URL you'll then need to use in step 6 of the installation instructions.
Other than the modifications to steps 5 and 6, make sure you've followed all the rest of the installation instructions. You should then be set up and ready with a local development instance that you can interact with directly on Slack! If you run into any problems, feel free to create an issue.
This app has an extensive test suite, just because. Before submitting pull requests, please check that your changes pass linting and tests by running yarn lint
and yarn test
. These will also be run for you by Travis CI, but it's often quicker to debug and resolve the issues locally.
ℹ️ If you don't have Yarn, you can replace any mention of yarn
in this section with npm run
.
You can run just a subset of tests:
- Unit tests with
yarn unit-tests
- Integration tests with
yarn integration-tests
- End-to-end tests with
yarn e2e-tests
You can modify the default testing behaviour by adjusting the relevant scripts
in package.json
or in some cases by passing additional Jest configuration parameters at the end of the test commands above.
If you come across annoying stylistic linting rules, feel free to change them in .eslintrc.js
as part of your pull request, providing they don't cause an adverse effect on existing code.
Many linting issues can be automatically fixed by running yarn fix
.