From 341a2d65d9414f01d0f87c0982b1c8ad0971eaa1 Mon Sep 17 00:00:00 2001 From: Dan Vanderkam Date: Sun, 22 Mar 2015 17:32:07 -0400 Subject: [PATCH] Update documentation --- CONTRIBUTING.md | 2 +- DEVELOP.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++ README.md | 12 ++++++++---- 3 files changed, 55 insertions(+), 5 deletions(-) create mode 100644 DEVELOP.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9e2f923..ee72da0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -18,4 +18,4 @@ do this: This makes error messages and debugging simpler. The jsfiddle does this automatically. -Sending a Pull Request? See our [guide to making dygraphs contributions](http://dygraphs.com/changes.html). +Sending a Pull Request? See our [guide to making dygraphs contributions](/DEVELOP.md). diff --git a/DEVELOP.md b/DEVELOP.md new file mode 100644 index 0000000..c8872f0 --- /dev/null +++ b/DEVELOP.md @@ -0,0 +1,46 @@ +## dygraphs developer notes + +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. + +### How-to + +To build dygraphs, run + + gulp dist + +To run the tests, run: + + gulp test + +To iterate on the code, open `tests/demo.html` (or one of the other demos) in your browser. + +To iterate on a unit test, change `it` to `it.only` in the Mocha test, change the browser from `PhantomJS` to `Chrome` (or whatever you like) in `auto_tests/karma.conf.js`, run + + ./node_modules/karma/bin/karma start auto_tests/karma.conf.js + +and hit "DEBUG" in the Karma UI. + +### dygraphs style + +When making a change, please try to follow the style of the existing dygraphs code. This will make the review process go much more smoothly. + +A few salient points: + +1. We try to adhere to Google's [JS style guide][gstyle] and would appreciate it if you try to as well. This means: + * No tabs! Indent using two spaces. + * Use camelCase for variable and function names. + * Limit lines to 80 characters. +1. If you've added a new feature, add a test for it (in the tests/ directory) or a gallery entry. +1. If you've added an option, document it in `dygraph-options-reference.js`. You'll get lots of warnings if you don't. +1. If you've fixed a bug or added a feature, add a unit test (in `auto_tests`) for it. + +Adding a unit test ensures that we won't inadvertently break your feature in the future. To do this, either add to an existing test in `auto_tests/tests` or create a new one. + +### Sending a Pull Request + +To make a change, you'll need to send a Pull Request. See GitHub's documentation [here][pr]. + +[gstyle]: http://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml +[pr]: http://help.github.com/send-pull-requests/ diff --git a/README.md b/README.md index b4bb0fc..7e3b0f2 100644 --- a/README.md +++ b/README.md @@ -46,10 +46,14 @@ Learn more by reading [the tutorial](http://www.dygraphs.com/tutorial.html) and seeing demonstrations of what dygraphs can do in the [gallery](http://www.dygraphs.com/gallery). -## Making Changes -If you've made a change to dygraphs and would like to contribute it back to the -community, please follow the [Guide to making dygraphs -changes](http://dygraphs.com/changes.html). +## Development + +To get going, clone the repo and run: + + npm install + gulp dist + +Read more about the dygraphs development process in the [developer guide](/DEVELOP.md). ## License(s) dygraphs uses: -- 2.7.4