From 6ee09dfb6f1e26ba48181709053326eeb4f21085 Mon Sep 17 00:00:00 2001 From: Filip Barl Date: Fri, 24 May 2019 15:51:22 +0200 Subject: [PATCH] Add docs on how to contribute to frontend code. --- CONTRIBUTING.md | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 96b9f2e31..828dc6d32 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -47,19 +47,36 @@ This is a rough outline of how to prepare a contribution: ## How to build and run the project ```bash -make -./scope launch +make && ./scope stop && ./scope launch +``` + +After every change you make to the Go code, you will need to rerun the command above (recompiling and restarting Scope) and refresh the browser tab to see your changes. + +**Tip**: If you are only making changes to Scope frontend code, you can speed up the development cycle by additionally starting up the Webpack server, which will automatically recompile and hot-reload your browser tab http://localhost:4042 on every change: + +```bash +cd client && yarn install && yart start ``` ## How to run the test suite -You can run the linting and unit tests by simply doing +### Backend + +You can run the Go linting and unit tests by simply doing ```bash make tests ``` -There are integration tests for Scope, but unfortunately it's hard to set them up in forked repositories and the setup is not documented. Help is needed to improve this situation: https://github.com/weaveworks/scope/issues/2192 +There are integration tests for Scope, but unfortunately it's hard to set them up in forked repositories and the setup is not documented. Help is needed to improve this situation: [#2192](https://github.com/weaveworks/scope/issues/2192) + +### Frontend + +Use `yarn` to run all Javascript tests and linting checks: + +```bash +cd client && yarn install && yarn test && yarn lint +``` # Acceptance policy