Skip to content

Latest commit

 

History

History
73 lines (58 loc) · 2.83 KB

CONTRIBUTING.md

File metadata and controls

73 lines (58 loc) · 2.83 KB

Contributing

Thanks for checking out the project!

  1. Pull Requests
  2. Filing Bugs
  3. Codebase
  4. Setting up Your Environment
  5. Commit Message Format
  6. Coding Style

Pull-requests

  1. Please review our suggested commit message format.
  2. Please add tests for your changes.
  • Tests are located in test/.
  • Run npm test to catch failing tests.
  1. Run npm run lint locally
  2. Test the app with npm run dev

Filing Bugs

If you found an error, typo, or any other issues, please report it using GitHub Issues. Try searching the issues to see if there is an existing report of your bug or feature request.

Provide as much detail as possible and if possible the steps to reproduce the problem. You could also include:

  1. A failing test
  2. Your environment: browser, operating system, etc
  3. Screenshot/gif (you can ctrl+v a clipboard picture to the github textarea)
  4. console error output

Codebase

You will need to be familar with some javascript/node for logic/server code, react for front-end development, and of course the game itself!

  • The core logic of the game is in the lib/ directory: starting with lib/ShengJi.js.
  • There is a corresponding folder called test/ which contains tests for all the lib/ files.
  • Check npm commands in the package.json file (listed in the README).

Setting up your environment

  1. Fork the shengji repository
  2. Clone your fork to your local machine
  • git clone git@github.com:YOUR_NAME/shengji.git
  • git clone https://github.com/YOUR_NAME/shengji.git
  1. Run npm install in your local fork
  2. Create a new branch for your fix: git checkout -b my-fix-branch master
  3. Implement your bug fix or feature request
  4. Implement the tests for your fix or feature
  5. Run npm run lint; npm test a lot
  6. Commit your code with a commit message that follows our commit message format if possible (otherwise we can do it)
  7. Push your branch to GitHub
  • git push origin my-fix-branch
  1. In GitHub, send a pull request to hzoo:development
  2. If more changes are needed (from people's feedback)
  • Make the required changes
  • Run the tests/linters again
  • Rebase your branch and then force push it to Github (updating the PR)
  • git rebase master -i
  • git push origin my-fix-branch -f

If there were changes pushed to the development branch while you were updating your PR, you will have to rebase your changes on top of the previous ones.

git pull --ff upstream master

Coding Style

  • We are using jscs to check for coding style. Our config is here.