Skip to content

Latest commit

 

History

History
29 lines (26 loc) · 2.11 KB

CONTRIBUTING.md

File metadata and controls

29 lines (26 loc) · 2.11 KB

Development Guidelines

Golden Rules

  • Keep directives as simple as possible
  • Use plain angular, without jQuery or other libs.
  • If it makes the directive easier, change the syntax from jqm. We don't want too many hacks in this lib - it should be easy to maintain.
  • Try to put the presentation logic in the template, and the business logic into the javascript.
  • For directives with isolate scopes, use jqm-scope-as (TODO: Explain jqm-scope-as)

How to contribute

  1. Clone the repository
  2. Run npm install and grunt install
  3. Run grunt. This will install the pre-commit hooks to ensure a consistent format for commit messages.
  4. Create a local feature branch
  5. Make all your changes in that branch. You may want to use grunt dev to watch your files and automatically execute your tests.
  6. When you are finished run grunt without arguments until you have no errors.
  7. Stash all your commits into one commit (see e.g. http://davidwalsh.name/squash-commits-git), using our rules for commit messages: https://github.com/btford/grunt-conventional-changelog
  8. Push your changes to your github user
  9. Create a pull request for this commit

New directives

  1. Read the corresponding issue in the issue tracker and the jqm docs mentioned in the issue.
  2. Add a comment in the issue that you start to work on this issue (so we don't have multiple people working on the same thing).
  3. Add a new file under src/directives.
  4. Add a template under src/templates.
  5. Create unit tests for your directive that compare the DOM generated by your directive with the DOM generated by jqm. See the other directives for examples, and test/lib/testutils.js for tools on this.
  6. Create normal unit tests for your directive. See the other directives for examples.
  7. Create inline docs that can be processed by https://github.com/m7r/grunt-ngdocs. As an example see https://github.com/opitzconsulting/angular-jqm/blob/master/src/directives/jqmCheckbox.js.
  8. Try your directive: Add it to test/ngSnippet.html and open http://localhost:9000/test/ngSnippet.html. You can also try the corresponding jqm widget using test/jqmSnippet.html.