Guide to making dygraphs changes
So you've made a change to dygraphs and would like to contribute it back
to the open source project. Wonderful! This is a step-by-step guide
explaining how to do it.
The list of steps may look a bit daunting, but it's not too bad,
especially if you have any familiarity with git or github. If you run into
any problems while following the instructions, feel free to contact
dygraphs-users.
Why not just take patches? This process means less work for me (the
maintainer) and it also results in your name appearing in the list of
dygraphs commits. This lets you take credit for your work.
- Create an account on github. This is
free, painless and will let you claim credit for your changes.
- Install git. github has a good writeup here.
- Create a fork of the dygraphs repository on github by
clicking this link and
then the "Fork" button.
- You should see a URL along the lines of
git@github.com:yourname/dygraphs.git
Copy this, open up a
terminal and run
git clone git@github.com:yourname/dygraphs.git
This
pulls the dygraphs code down onto your local disk.
- cd into the dygraphs directory and make your changes.
If you've already got them somewhere else, just copy them over.
I try to adhere to Google's
JS style guide and would appreciate it if you try to as well.
- Be a good citizen!
- If you've added a new feature, add a test for it (in the tests/
directory).
- If you've added a new option, add it to the list of options on the
documentation page (docs/index.html).
You'll have to do this before I accept your changes, so you may as well
do it now
- Commit your changes locally: run
git add .
git commit
Type in a description of your change. This will
eventually appear in the dygraphs commit list.
- Push your changes to github by running
git push
This will
send your changes to your forked repository on github.
- Go to your fork of dygraphs on github (i.e.
github.com/yourname/dygraphs).
Click the "Pull Request" button.
This will send me an email with a pointer to your changes.
- I'll review your changes and (unless your code is perfect!) give you
some feedback. Make these suggested changes in your local git client and
re-run "git commit" and "git push" so that I can see them.
- Once your change is ready, I'll pull it into the main dygraphs
repository and publish it to the web.