-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First commit, already a lot to be done
- Loading branch information
0 parents
commit 4d2172f
Showing
22 changed files
with
1,930 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# EditorConfig helps developers define and maintain consistent | ||
# coding styles between different editors and IDEs | ||
# editorconfig.org | ||
|
||
root = true | ||
|
||
|
||
[*] | ||
|
||
# Change these settings to your own preference | ||
indent_style = space | ||
indent_size = 4 | ||
|
||
# We recommend you to keep these unchanged | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
temp | ||
node_modules | ||
libpeerconnection.log | ||
*.swp | ||
.*.swp | ||
*.iml | ||
.idea | ||
.project | ||
node_modules | ||
dist/angular-openlayers-directive.ngmin.js | ||
dist/angular-openlayers-directive.min.no-header.js | ||
selenium | ||
coverage | ||
bower_components |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
language: node_js | ||
node_js: | ||
- "0.10" | ||
before_script: | ||
- npm install -g grunt-cli |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
angular-openlayers-directive changelog | ||
====================================== | ||
|
||
## angular-openlayers-directive (trunk) | ||
* Init project |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
## How to contribute | ||
|
||
You can use grunt/karma to test your code, and grunt/jshint to lint your code. | ||
First, make sure you have npm and grunt-cli installed globally. | ||
|
||
``` | ||
# Inside the project dir, install the dependencies | ||
$ npm install | ||
# JSHINT | ||
$ grunt jshint | ||
Running "jshint:files" (jshint) task | ||
>> 2 files lint free. | ||
Done, without errors. | ||
# Execute the tests | ||
$ grunt test | ||
unning "karma:unit" (karma) task | ||
INFO [karma]: Karma v0.10.2 server started at http://localhost:9018/ | ||
INFO [launcher]: Starting browser Firefox | ||
INFO [Firefox 24.0.0 (Linux)]: Connected on socket bnKmKpTV3cNSXFDyvjdC | ||
Firefox 24.0.0 (Linux): Executed 74 of 74 SUCCESS (1.021 secs / 0.801 secs) | ||
Running "connect:testserver" (connect) task | ||
Started connect web server on 127.0.0.1:8000. | ||
Running "karma:e2e" (karma) task | ||
INFO [karma]: Karma v0.10.2 server started at http://localhost:9876/_karma_/ | ||
INFO [launcher]: Starting browser PhantomJS | ||
INFO [PhantomJS 1.9.2 (Linux)]: Connected on socket c5s9wh42qsmH6ctIvkh- | ||
PhantomJS 1.9.2 (Linux): Executed 1 of 1 SUCCESS (2.041 secs / 1.782 secs) | ||
Done, without errors. | ||
``` | ||
|
||
You can execute all the code cycle (lint, pass tests, concat files, uglify, deploy) with the grunt default task, which will start listening for file changes and execute the code cycle whenever a file has been changed. | ||
|
||
|
||
``` | ||
$ grunt | ||
unning "karma:background" (karma) task | ||
Running "watch" task | ||
Waiting...OK | ||
>> File "src/angular-openlayers-directive.js" changed. | ||
Running "karma:background:run" (karma) task | ||
[2013-10-19 14:45:44.815] [DEBUG] config - Loading config /home/dave/dev/angular-openlayers-directive/config/karma.conf.js | ||
PhantomJS 1.9.2 (Linux): Executed 74 of 74 SUCCESS (0.644 secs / 0.477 secs) | ||
Running "jshint:source" (jshint) task | ||
>> 1 file lint free. | ||
Running "jshint:tests" (jshint) task | ||
>> 2 files lint free. | ||
Running "jshint:grunt" (jshint) task | ||
>> 1 file lint free. | ||
Running "ngmin:directives" (ngmin) task | ||
ngminifying src/angular-openlayers-directive.js | ||
Running "uglify:dist" (uglify) task | ||
File "dist/angular-openlayers-directive.min.js" created. | ||
Done, without errors. | ||
Completed in 5.401s at Sat Oct 19 2013 14:45:49 GMT+0200 (CEST) - Waiting... | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,281 @@ | ||
module.exports = function(grunt) { | ||
|
||
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks); | ||
|
||
grunt.initConfig({ | ||
pkg: grunt.file.readJSON('package.json'), | ||
shell: { | ||
options: { | ||
stdout: true | ||
}, | ||
selenium: { | ||
command: './selenium/start', | ||
options: { | ||
stdout: false, | ||
async: true | ||
} | ||
}, | ||
protractor_install: { | ||
command: 'node ./node_modules/protractor/bin/install_selenium_standalone' | ||
}, | ||
npm_install: { | ||
command: 'npm install' | ||
} | ||
}, | ||
|
||
connect: { | ||
options: { | ||
base: 'examples/' | ||
}, | ||
webserver: { | ||
options: { | ||
port: 8888, | ||
keepalive: true | ||
} | ||
}, | ||
devserver: { | ||
options: { | ||
port: 8888 | ||
} | ||
}, | ||
testserver: { | ||
options: { | ||
port: 9999 | ||
} | ||
}, | ||
coverage: { | ||
options: { | ||
base: 'coverage/', | ||
directory: 'coverage/', | ||
port: 5555, | ||
keepalive: true | ||
} | ||
} | ||
}, | ||
|
||
protractor: { | ||
options: { | ||
keepAlive: true, | ||
configFile: "test/protractor.conf.js" | ||
}, | ||
singlerun: {}, | ||
auto: { | ||
keepAlive: true, | ||
options: { | ||
args: { | ||
seleniumPort: 4444 | ||
} | ||
} | ||
} | ||
}, | ||
|
||
uglify: { | ||
options: { | ||
banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %> */\n' | ||
}, | ||
dist: { | ||
files: { | ||
'dist/<%= pkg.name %>.min.no-header.js': ['dist/angular-openlayers-directive.ngmin.js'] | ||
} | ||
} | ||
}, | ||
|
||
ngmin: { | ||
directives: { | ||
expand: true, | ||
cwd: 'dist', | ||
src: ['angular-openlayers-directive.js'], | ||
dest: 'dist', | ||
ext: '.ngmin.js', | ||
flatten: 'src/' | ||
} | ||
}, | ||
|
||
jshint: { | ||
options: { | ||
node: true, | ||
browser: true, | ||
esnext: true, | ||
bitwise: true, | ||
curly: true, | ||
eqeqeq: true, | ||
immed: true, | ||
indent: 4, | ||
latedef: true, | ||
newcap: true, | ||
noarg: true, | ||
regexp: true, | ||
undef: true, | ||
unused: true, | ||
trailing: true, | ||
smarttabs: true, | ||
globals: { | ||
angular: false, | ||
OpenLayers: false, | ||
L: false, | ||
// Jasmine | ||
jasmine : false, | ||
isCommonJS : false, | ||
exports : false, | ||
spyOn : false, | ||
it : false, | ||
xit : false, | ||
expect : false, | ||
runs : false, | ||
waits : false, | ||
waitsFor : false, | ||
beforeEach : false, | ||
afterEach : false, | ||
describe : false, | ||
xdescribe : false, | ||
|
||
// Protractor | ||
protractor: false | ||
|
||
} | ||
}, | ||
source: { | ||
src: ['src/directives/*.js', 'src/services/*.js'] | ||
}, | ||
tests: { | ||
//src: ['test/unit/*.js', 'test/e2e/*.js'], | ||
src: ['test/unit/*.js'] | ||
}, | ||
grunt: { | ||
src: ['Gruntfile.js'] | ||
} | ||
}, | ||
|
||
karma: { | ||
unit: { | ||
configFile: 'test/karma-unit.conf.js', | ||
autoWatch: false, | ||
singleRun: true | ||
}, | ||
unit_auto: { | ||
configFile: 'test/karma-unit.conf.js', | ||
autoWatch: true, | ||
singleRun: false | ||
}, | ||
unit_coverage: { | ||
configFile: 'test/karma-unit.conf.js', | ||
autoWatch: false, | ||
singleRun: true, | ||
//logLevel: 'DEBUG', | ||
reporters: ['progress', 'coverage'], | ||
preprocessors: { | ||
'dist/angular-openlayers-directive.js': ['coverage'] | ||
}, | ||
coverageReporter: { | ||
type : 'html', | ||
dir : 'coverage/' | ||
} | ||
} | ||
}, | ||
|
||
watch: { | ||
options : { | ||
livereload: 7777 | ||
}, | ||
source: { | ||
files: ['src/**/*.js'], | ||
tasks: [ | ||
'jshint', | ||
'concat:dist', | ||
'ngmin', | ||
'uglify', | ||
'test:unit', | ||
//'test:e2e', | ||
'concat:license' | ||
] | ||
}, | ||
protractor: { | ||
files: ['src/**/*.js','test/e2e/**/*.js'], | ||
tasks: ['protractor:auto'] | ||
} | ||
}, | ||
|
||
open: { | ||
devserver: { | ||
path: 'http://localhost:8888' | ||
}, | ||
coverage: { | ||
path: 'http://localhost:5555' | ||
} | ||
}, | ||
|
||
bower: { | ||
install: { | ||
// options: { | ||
// targetDir: './bower_components', | ||
// cleanup: true | ||
// } | ||
} | ||
}, | ||
|
||
concat: { | ||
dist: { | ||
options: { | ||
banner: '(function() {\n\n"use strict";\n\n', | ||
footer: '\n}());' | ||
}, | ||
src: [ | ||
'src/directives/openlayers.js', | ||
//'src/directives/center.js', | ||
//'src/directives/tiles.js', | ||
//'src/directives/legend.js', | ||
//'src/directives/geojson.js', | ||
//'src/directives/layers.js', | ||
//'src/directives/bounds.js', | ||
//'src/directives/markers.js', | ||
//'src/directives/paths.js', | ||
//'src/directives/controls.js', | ||
//'src/directives/eventBroadcast.js', | ||
//'src/directives/maxBounds.js', | ||
'src/services/openlayersData.js', | ||
'src/services/openlayersMapDefaults.js', | ||
//'src/services/openlayersEvents.js', | ||
//'src/services/openlayersLayerHelpers.js', | ||
'src/services/openlayersHelpers.js' | ||
], | ||
dest: 'dist/angular-openlayers-directive.js', | ||
}, | ||
license: { | ||
src: [ | ||
'src/header-MIT-license.txt', | ||
'dist/angular-openlayers-directive.min.no-header.js' | ||
], | ||
dest: 'dist/angular-openlayers-directive.min.js', | ||
}, | ||
} | ||
}); | ||
|
||
//single run tests | ||
grunt.registerTask('test', ['jshint','test:unit', 'test:e2e']); | ||
grunt.registerTask('test:unit', ['karma:unit']); | ||
grunt.registerTask('test:e2e', ['connect:testserver', 'protractor:singlerun']); | ||
|
||
//autotest and watch tests | ||
grunt.registerTask('autotest', ['karma:unit_auto']); | ||
grunt.registerTask('autotest:unit', ['karma:unit_auto']); | ||
grunt.registerTask('autotest:e2e', ['connect:testserver', 'shell:selenium', 'watch:protractor']); | ||
|
||
//coverage testing | ||
grunt.registerTask('test:coverage', ['karma:unit_coverage']); | ||
grunt.registerTask('coverage', ['karma:unit_coverage', 'open:coverage', 'connect:coverage']); | ||
|
||
//installation-related | ||
grunt.registerTask('install', ['shell:npm_install', 'bower:install', 'shell:protractor_install']); | ||
|
||
//defaults | ||
grunt.registerTask('default', ['watch:source']); | ||
|
||
//development | ||
grunt.registerTask('dev', ['connect:devserver', 'open:devserver', 'watch:source']); | ||
|
||
//server daemon | ||
grunt.registerTask('serve', ['connect:webserver']); | ||
|
||
//travis | ||
grunt.registerTask('travis', 'bower:install', 'test:unit'); | ||
}; |
Oops, something went wrong.