Skip to content

Latest commit

 

History

History
165 lines (123 loc) · 6.58 KB

CONTRIBUTING.md

File metadata and controls

165 lines (123 loc) · 6.58 KB

Contributing

Issues

If you have a bug or enhancement request, please file an issue.

When submitting an issue, please include context from your test and your application. If there's an error, please include the error text.

It's always easy to undestand the bug/problem visually, you can use a predefined jsfiddle example which loads a simple map, which you can use to document your issue:

http://jsfiddle.net/juristr/od60raL4/1/

Commit Message Guidelines

These guidelines have been taken and adapted from the official Angular guidelines. By following the rules also mentioned in conventional-changelog. This leads to much more readable and clearer commit messages.

Commit Message Format

Each commit message consists of a header, a body and a footer. The header has a special format that includes a type, a scope and a subject:

<type>(<scope>): <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>

The header is mandatory and the scope of the header is optional.

Any line of the commit message cannot be longer than 100 characters! This allows the message to be easier to read on GitHub as well as in various git tools.

Revert

If the commit reverts a previous commit, it should begin with revert: , followed by the header of the reverted commit. In the body it should say: This reverts commit <hash>., where the hash is the SHA of the commit being reverted.

Type

Must be one of the following:

  • feat: A new feature
  • fix: A bug fix
  • docs: Documentation only changes
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
  • refactor: A code change that neither fixes a bug nor adds a feature
  • perf: A code change that improves performance
  • test: Adding missing tests
  • chore: Changes to the build process or auxiliary tools and libraries such as documentation generation

Scope

The scope could be anything specifying place of the commit change. For example olHelper, layer, etc.

Subject

The subject contains succinct description of the change:

  • use the imperative, present tense: "change" not "changed" nor "changes"
  • don't capitalize first letter
  • no dot (.) at the end

Body

Just as in the subject, use the imperative, present tense: "change" not "changed" nor "changes". The body should include the motivation for the change and contrast this with previous behavior.

Footer

The footer should contain any information about Breaking Changes and is also the place to reference GitHub issues that this commit Closes.

Breaking Changes should start with the word BREAKING CHANGE: with a space or two newlines. The rest of the commit message is then used for this.

A detailed explanation can be found in this [document][commit-message-format].

Code style

Software development life-cycle

There are a some Grunt tasks defined to ease the development cycle. Let's see how to use them:

First, make sure you have npm and grunt-cli installed globally. Let's install the dependencies.

# Inside the project dir, install the dependencies
$ npm install
npm http GET https://registry.npmjs.org/protractor/0.14.0
npm http GET https://registry.npmjs.org/matchdep
npm http GET https://registry.npmjs.org/grunt-shell
npm http GET https://registry.npmjs.org/grunt-contrib-jshint
npm http GET https://registry.npmjs.org/grunt-contrib-connect
npm http GET https://registry.npmjs.org/grunt-karma
npm http GET https://registry.npmjs.org/grunt-ngmin
...
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected]
├── [email protected] ([email protected], [email protected], [email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], ..., [email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected])
$

Once you have the development dependencies installed, we can use our predefined grunt tasks. For example:

  • grunt test. Executes the karma unitary tests and the protractor e2e tests, reporting the actual state of the project.
  • grunt test:unit. Executes only the karma unitary tests.
  • grunt test:e2e. Executes only the protractor e2e tests.
  • grunt coverage. Generates a "coverage" folder with an istanbul report of wich part of the code is covered by the actual tests.
  • grunt. The default task watches for project files changes and when a change is detected, tries to build the library file passing the jshint filter and the tests. Let's see an example:
$ grunt
Running "watch:source" (watch) task
Waiting...OK
>> File "src/directives/openlayers.js" changed.

Running "jshint:source" (jshint) task
>> 18 files lint free.

Running "jshint:tests" (jshint) task
>> 14 files lint free.

Running "jshint:grunt" (jshint) task
>> 1 file lint free.

Running "concat:dist" (concat) task
File "dist/angular-openlayers-directive.js" created.

Running "ngmin:directives" (ngmin) task
ngminifying dist/angular-openlayers-directive.js

Running "uglify:dist" (uglify) task
File "dist/angular-openlayers-directive.min.no-header.js" created.

Running "karma:unit" (karma) task
INFO [karma]: Karma v0.10.8 server started at http://localhost:9018/
INFO [launcher]: Starting browser PhantomJS
INFO [PhantomJS 1.9.2 (Linux)]: Connected on socket WUeY410y1MZhG5OYnoyc
PhantomJS 1.9.2 (Linux): Executed 108 of 108 SUCCESS (0.875 secs / 0.625 secs)

Running "concat:license" (concat) task
File "dist/angular-openlayers-directive.min.js" created.

Done, without errors.
Completed in 9.714s at Sun Dec 15 2013 10:37:59 GMT+0100 (CET) - Waiting...

After a successful build, a new library distribution file will be generated inside the "dist" folder, which will be ready to use on your project:

$ ls -l dist/angular-openlayers-directive.min.js
-rw-r--r-- 1 dave dave 35255 dic 15 10:37 dist/angular-openlayers-directive.min.js