# Contributing

You want to contribute to Mapael? That's great, first of all, thank you !

There are several ways you can contribute :

- **Wanna give a little hand?** Go to the [Issues](https://github.com/neveldo/jQuery-Mapael/issues) list and start helping people!

- **Found a bug?** Submit a [bug report](https://github.com/neveldo/jQuery-Mapael/issues) and describe your problem.

- **Add a new map** You can share your Map by submitting a Pull Request on the [mapael-maps repository](https://github.com/neveldo/mapael-maps).

- **Improve the documentation** The mapael documentation can be improved by submitting a Pull Request on the [mapael-documentation repository](https://github.com/neveldo/mapael-documentation).

- **Know how to resolve a bug / Want to add a feature?** Submit a Pull Request (*PR*). Your code will be reviewed and merged into Mapael (see link 2 below)

- **You want to help, but don't know what to do?** Check the [TODO list](https://github.com/neveldo/jQuery-Mapael/wiki/TODO-list) for features/issues we need/are working on.

Here are some readings: <https://guides.github.com/activities/contributing-to-open-source>

---

# Dev information

## Cloning the repository

Before making any modification to Mapael, you will need your own Mapael fork!

Here are some reading to get a local Mapael:
1. <https://help.github.com/articles/fork-a-repo/>
1. <http://kbroman.org/github_tutorial/pages/fork.html>

## Environment

Mapael uses [NPM](https://www.npmjs.com/) to manage package dependencies 
and [Grunt](https://gruntjs.com/) to run development tasks.

After cloning locally the Mapael repository, run this command-line:
```
npm install
```

Then you will be able to run all related Grunt tasks.

## Code quality

Mapael uses [JSHint](http://jshint.com/about/) to check code quality.
The rules are [explained in the Wiki](https://github.com/neveldo/jQuery-Mapael/wiki/JSHint).

You can run this check with the following command-line:
```
grunt jshint
```

## Test suite

There is a test suite in the `/test` folder, power by [QUnit](http://qunitjs.com/).
While not broken, it is, however, very light. We sadly don't have the time to expand it for now.

When submitting a new PR, it is not expected from you to add any tests. 
But if you feel like you can, please do so.

You can run this check with the following command-line 
(note: it will run JSHint, then the Test Suite):
```
grunt test
```

## Build (minimified version)

Mapael is distributed as a minified file for production (`jquery.mapael.min.js`).
[UglifyJS](http://lisperator.net/uglifyjs/) is used for this operation.

You can build it with the following command-line 
(note: it will run JSHint, then build the minimified files):
```
grunt build
```

When submitting a new PR, it is not expected from you to provide the minified version.
This version is usually generated by maintainers before tagging a new release.

## Continuous Integration (CI)

When submitting a new PR, you will see that [Travis](https://travis-ci.org/) (the CI tool)
will automatically run some tests on your code. It performs two tests:
1. Run JSHint to check code quality
2. Run the Test Suite to check regression

You will be able to check the result then, and perform adjustements if necessary
(by pushing a new commit to the branch).

These two tests are expected to pass when submitting a new PR.
Please check your code so 
