Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 90 lines (65 sloc) 4.728 kB
f8f09c4 @gorillamania updated documentation
gorillamania authored
1 # Pilotfish development guide
2
4332c96 @gorillamania Checkpoint commit for release_core
gorillamania authored
3 You are welcome to fork this repository. We'd love getting pull requests. We work in master, so if it's committed there it's assumed that it's good to go live. We'll likely develop a more advanced branching strategy later.
8e9f408 @gorillamania Updated docs
gorillamania authored
4
f8f09c4 @gorillamania updated documentation
gorillamania authored
5 ## Environment Setup
6 Here are some recommendations for setting up your environment so that the code you write smells like the main project.
4ddb30e @gorillamania updated docs
gorillamania authored
7
f8f09c4 @gorillamania updated documentation
gorillamania authored
8 * [editorconfig](http://editorconfig.org/) so we have the same spacing style
4332c96 @gorillamania Checkpoint commit for release_core
gorillamania authored
9 * [jshint](http://www.jshint.com/) for all files (we have a [.jshintrc](../.jshintrc), and lint is run on every commit with [travis](../.travis.yml))
5369d4d @gorillamania grunt added. qunit tests now run on every commit via phantomjs. Minif…
gorillamania authored
10 * phantomjs - to automatically run all the qunit tests for you
f787fa4 @gorillamania Updated instructions for capser js on *nix
gorillamania authored
11 * Mac - `brew install phantomjs` is the easiest. [Alternatives](http://ariya.ofilabs.com/2012/02/phantomjs-and-mac-os-x.html)
12 * *nix - [Download](http://phantomjs.org/download.html) or [Build from source](http://phantomjs.org/build.html)
13 * casperjs -
14 * Mac - `brew install casperjs` [Additional instructions](http://casperjs.org/installation.html)
15
8e9f408 @gorillamania Updated docs
gorillamania authored
16 ## Testing
f8f09c4 @gorillamania updated documentation
gorillamania authored
17 We recommend [Test Driven Development](http://en.wikipedia.org/wiki/Test-driven_development) be used, and we aim for 100% coverage. If you use `grunt watch`, you can have it run the tests every time you write a file.
1c79b5f @gorillamania updated docs
gorillamania authored
18
19 We use travis-ci for automagic testing on every commit. Current test status:
20
21 [![Build Status](https://secure.travis-ci.org/pilotfish/pilotfish.png)](http://travis-ci.org/pilotfish/pilotfish)
22
8e9f408 @gorillamania Updated docs
gorillamania authored
23
24 ### Running Tests
25
4332c96 @gorillamania Checkpoint commit for release_core
gorillamania authored
26 * `grunt test` will run the qunit tests
27 * `grunt server casperjs` will run all the casperjs tests
28
29 ## Deployment/Release
30 To release, the files are run through a set of checks and then copied to the [/dist/](../dist/) directory. The minified versions are also created, along with any building of CSS or images.
31
9fabaa9 @gorillamania Update doc/development.md
gorillamania authored
32 We tag them in git with `release/$version`, making it easy for folks to go to that point in history. For example, to see where it all started, check out the [0.1.0 version of Pilotfish](https://github.com/pilotfish/pilotfish/tree/release/0.1.0). Each plugin also has it's own version, and releases are tagged as `release/plugin/$plugin/$version`. [Full tag listing](https://github.com/pilotfish/pilotfish/tags)
4332c96 @gorillamania Checkpoint commit for release_core
gorillamania authored
33
34 Grunt tasks for release:
35
36 * `grunt release_core`
37 1. `lint`, `test`, and other sanity checks
38 1. minify (create [pilotfish.min.js](../pilotfish.min.js]))
39 1. Generate documentation
40 1. Copy pilotfish.js and pilotfish.min.js to:
41 * /dist/latest/
42 * /dist/$major/
43 * /dist/$major/$minor
44 * /dist/$major/$minor/$patch
45 1. git add/commit files in /dist/
46 1. git push with tags
47 * `grunt release_plugin[:$plugin]`
48 * `grunt release_cdn`. This is how files get to http://cdn.pilotfish.io/client/. Assumes that the [pilotfish.github.com](https://github.com/pilotfish/pilotfish.github.com) repo is checked out at in the same directory as this repo.
49 1. Santy checks
50 1. copy the files from dist to ../pilotfish.github.com/client/
51 1. git add/commit
52 1. git tag with current release.
53 1. git push (with tags)
54
55
56 See `grunt --help` for more info.
57
8e9f408 @gorillamania Updated docs
gorillamania authored
58
59 ## Coding Philosophy
60 In order to ensure high quality code, we ask that contributors follow some coding standards.
61
4332c96 @gorillamania Checkpoint commit for release_core
gorillamania authored
62 Our overarching principals are **simplicity, readability, and maintainability.**
63
64 This should be fun!
8e9f408 @gorillamania Updated docs
gorillamania authored
65
66 ### Pedantic coding standards
67 Most of the suggestions below apply to Javascript in specific, since most of the project is written in javascript. For the most part, we follow the [jQuery Core Style Guidelines](http://docs.jquery.com/JQuery_Core_Style_Guidelines), but we'd like to call out the following additional points:
68
f8f09c4 @gorillamania updated documentation
gorillamania authored
69 * Spaces, not tabs. 4 of them. Pro tip: Use an editor that supports [editorconfig](http://editorconfig.org/), and this will be handled for you.
8e9f408 @gorillamania Updated docs
gorillamania authored
70 * Minification is the computer's job, not yours. Use explicit variable names.
71 * Braces on the same line, or I am afraid this won't work out.
72 * Cleverness is seldom required. When it is, comment it.
5f1c5ef @gorillamania spelling
gorillamania authored
73 * Be considerate of other contributors. Will someone who reads your code later understand what you've done?
8e9f408 @gorillamania Updated docs
gorillamania authored
74 * Names matter. Use names that make sense for clarity.
4332c96 @gorillamania Checkpoint commit for release_core
gorillamania authored
75 * Minimize the use of assumed globals, explicitly reference `window` when you need to.
8e9f408 @gorillamania Updated docs
gorillamania authored
76 * Always use semicolons;
77 * Always use braces, no one-line shortcuts.
78 * Triple equals where it is a good idea. Don't leave type to chance.
79
80 Have a suggestion? Fork this page and issue a pull request! :)
81
82 ## External resources
83 Here are a few interesting resources:
84
85 * http://neil.rashbrook.org/JS.htm
86 * https://developer.mozilla.org/En/Mozilla_Coding_Style_Guide
87 * http://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml
88 * https://developers.google.com/closure/compiler/docs/js-for-compiler
f787fa4 @gorillamania Updated instructions for capser js on *nix
gorillamania authored
89 * http://substack.net/posts/b96642
Something went wrong with that request. Please try again.