forked from collinforrester/angular-jqm
-
Notifications
You must be signed in to change notification settings - Fork 0
Development Guidelines
Marius Keppler edited this page Aug 7, 2013
·
13 revisions
- 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 so it is easy to maintain.
- If directives have attributes, try to prefix them with the directive name to avoid collisions. For example if we have a
jqm-cardirective, with aspeedoption, we would expose it like this:<div jqm-car jqm-car-speed="100"></div>
- Clone the repository
- Run
npm installandgrunt install - Run
grunt. This will install the pre-commit hooks to ensure a consistent format for commit messages. - Create a local feature branch
- Make all your changes in that branch. You may want to use
grunt devto watch your files and automatically execute your tests. - When you are finished run
gruntwithout arguments until you have no errors. - 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
- Push your changes to your github user
- Create a pull request for this commit
- Read the corresponding issue in the issue tracker and the jqm docs mentioned in the issue.
- 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).
- Add a new file under
src/directives. - 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.jsfor tools on this. - Create normal unit tests for your directive. See the other directives for examples.
- 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.
- Try your directive: Add it to
test/ngSnippet.htmland openhttp://localhost:9000/test/ngSnippet.html. You can also try the corresponding jqm widget usingtest/jqmSnippet.html.