# Contributing

## Features and Issues

For features and issues, please submit a GH Issue appropriately tagged. I'm open to all comments and suggestions, simply file GH Issue with any input or conerns.

## Getting Started

Create your own [fork](https://help.github.com/articles/fork-a-repo) of this repository.

```bash
# Clone it
$ git clone git@github.com:me/react-donut-chart.git

# Change directory
$ cd react-donut-chart

# Add the upstream repo
$ git remote add upstream git://github.com/vonbearshark/react-donut-chart.git

# Get the latest upstream changes
$ git pull upstream

# Install dependencies
$ npm install

# Run scripts to verify installation
$ npm test
$ npm run lint
```

## Directory structure

* `demo` - contains the GH Pages demo
    * `dist` - contains the generated output for GH Pages
    * `src` - contains the source files for the GH Pages
* `lib` - contains the module source files
    * `DonutChart.jsx` - main component; requires all subcomponents, initalizes the properties
    * `DonutInnerText.jsx` - inner donut text component resposible for showing the selected item's label and value
    * `Arcs.jsx` - main chart area, responsible for iterating over data and rendering the arc paths
    * `ArcPath.jsx` - rendered arc expressions of each item
    * `Legend.jsx` - optional legend component
    * `LegendItem.jsx` - individual legend item showing the colored rectangle, label, and value
* `mock` - contains the mock data used in testing and demoing
* `tests` - contains testing for all `lib` files
    
## NPM commands

* `npm start` starts the webpack dev server for the demo
* `npm run build:lib` builds the `lib/dist` with webpack
* `npm run build:demo` builds the `demo/dist` with webpack
* `npm run build` builds both
* `npm run lint` runs ESLint checks against the source
* `npm run test` runs Tape test suite
* `npm run publish` publishes to GH Pages
* `npm run deploy` lints, tests, builds, and push to GH Pages


## Making Changes
1. Make sure that your changes adhere to the current coding conventions used throughout the project, indentation, accurate comments, etc.
2. Lint your code regularly and ensure it passes prior to submitting a PR:
`$ npm run lint`.
3. Ensure existing tests pass (`$ npm test`) and include test cases which fail without your change and succeed with it.

## Submitting Changes
1. Ensure that no errors are generated by linting.
2. Commit your changes in logical chunks, i.e. keep your changes small per single commit.
3. Locally merge (or rebase) the upstream branch into your topic branch: `$ git pull upstream && git merge`.
4. Push your topic branch up to your fork: `$ git push origin <topic-branch-name>`.
5. Open a [Pull Request](https://help.github.com/articles/using-pull-requests) with a clear title and description.
