Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .csslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"adjoining-classes": false,
"box-sizing": false,
"box-model": false,
"compatible-vendor-prefixes": false,
"floats": false,
"font-sizes": false,
"gradients": false,
"important": false,
"known-properties": false,
"outline-none": false,
"qualified-headings": false,
"regex-selectors": false,
"shorthand": false,
"text-indent": false,
"unique-headings": false,
"universal-selector": false,
"unqualified-attributes": false
}
13 changes: 13 additions & 0 deletions .htmllintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"attr-name-style": "dash",
"attr-quote-style": "double",
"id-class-style": "dash",
"indent-style": "spaces",
"indent-width": 2,
"line-end-style": "lf",
"attr-req-value": false,
"html-req-lang": true,
"title-max-length": 120,
"img-req-src": false,
"tag-bans": ["!style"]
}
9 changes: 5 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: node_js
node_js:
- "0.12"
- "6.1"
env:
global:
- secure: h8dx7ZK94tKsp965RwL+PjUfoOcgiGYSKnwyRGPnK4Acjgl+UhhdtOW0SkgjRW2PLr2Umpfi8jKGoS3cJCiLL4vQvDmPJ6xS3BmVYWImVJwt2vCShDc6O1z82ebUE5F9QagBapYFOG3r8dOUqEYKsL+9WLsGRckLQpvQCo0EIt948UoqoVosKKD7ALaPHKeYCeAiRthCiWrN7jTnTm5U92bLtiMIZEBZrVzHpFxnUA33TIFgnkeSCyf5sO/iwjRrGO3IEXyVOKisjzXkug/ODjVXH33M5IJl7sZ+R2ZGtCQHh0CZNDI6oyAhzz9QaItA0V1YtzvbcdyAzPsP2a2izM6EgQGsnVEm2A5BzIdo4AtUalHxssf4e9kerE8cDDKruEZhNVP5lZ8wxP5Dw9Tl704AUCDDzqJZFnf8/wwg+Vyc6+hHj5TBw5vPmoNy/yBQ9GnAYvrBUba5NJ+4aDYtxzn9Qq5JuckUiQsfKUGdYNKC/wFg0U1NR+7RA0WBnp0NyTyaGtKe6oRydIaXGX1km5aqNDIgsEqMzpZULRIHfJiOF3MIVOoZesvx/14amHpuB60XxUwVUhqjRMRQ6Fmy0gjQheTVK5LTPDJxl6vMB6wXe7F6sjeO21XlZkv5oVwgzg1p+TIgrQ7dVS+fFcCnBy8ncwF6RXVr2opZtU3i76A=
Expand All @@ -10,10 +10,11 @@ before_install:
- webdriver-manager update
install:
- npm install
- bower install
script:
- grunt test:development
- grunt test
- grunt e2e --ci
- grunt test:unit:development
- grunt test:unit:production
- grunt test:e2e --ci
after_success:
- ./node_modules/coveralls/bin/coveralls.js < coverage/lcov.info
addons:
Expand Down
162 changes: 83 additions & 79 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ module.exports = function (grunt) {
var base = grunt.option('base-dir') || '',
env = grunt.option('env') || 'development',
protractorConf = grunt.option('ci') ?
'./tests/e2e/protractor.saucelabs.conf.js' :
'./tests/e2e/protractor.conf.js' ;
'./tests/e2e/protractor.saucelabs.conf.js':
'./tests/e2e/protractor.conf.js';

grunt.initConfig({

Expand All @@ -35,8 +35,8 @@ module.exports = function (grunt) {
livereload: true,
middleware: function ( connect, options, middlewares ) {
var rules = (base === 'dist') ?
[ '^/[^\.]*$ /index.html' ] :
[ '^/app/[^\.]*$ /app/index.html' ];
[ '^/[^\.]*$ ./index.html' ] :
[ '^/app/[^\.]*$ ./app/index.html' ];
middlewares.unshift( modRewrite( rules ) );
return middlewares;
}
Expand All @@ -48,7 +48,7 @@ module.exports = function (grunt) {
livereload: false,
base: '<%= config.outputDir %>',
middleware: function ( connect, options, middlewares ) {
var rules = [ '^/[^\.]*$ /index.html' ];
var rules = [ '^/[^\.]*$ ./index.html' ];
middlewares.unshift( modRewrite( rules ) );
return middlewares;
}
Expand All @@ -58,40 +58,53 @@ module.exports = function (grunt) {

watch: {
options: {
nospawn: false,
livereload: true
spawn: true,
livereload: true,
event: ['changed', 'added', 'deleted']
},
css: {
html: {
files: [
'./app/index.html',

'./app/less/*.less',
'./app/less/**/*.less',
'./app/less/**/**/*.less',
'app/index.html',

'./app/partials/*.html',
'./app/partials/**/*.html',
'./app/partials/**/**/*.html',
'app/partials/*.html',
'app/partials/**/*.html',
'app/partials/**/**/*.html',

'./modules/*.html',
'./modules/**/*.html',
'./modules/**/**/*.html'
'modules/*.html',
'modules/**/*.html',
'modules/**/**/*.html'
],
tasks: ['htmllint']
},
css: {
files: [
'app/less/*.less',
'app/less/**/*.less',
'app/less/**/**/*.less'
],
tasks: ['less:development']
tasks: ['lesslint','less:development']
},
javascript: {
files: [
'./scripts.json',
'app/data/*.json',
'app/data/**/*.json',
'app/data/**/**/*.json',

'./app/js/*.js',
'./app/js/**/*.js',
'./app/js/**/**/*.js',
'app/js/*.js',
'app/js/**/*.js',
'app/js/**/**/*.js',

'./tests/unit/*.js',
'./tests/unit/**/*.js',
'./tests/unit/**/**/*.js'
'tests/unit/*.js',
'tests/unit/**/*.js',
'tests/unit/**/**/*.js'
],
tasks: ['sails-linker', 'test:development']
tasks: ['jshint', 'test:unit:development']
},
scriptsJson: {
files: [
'scripts.json'
],
tasks: ['sails-linker']
}
},

Expand Down Expand Up @@ -131,12 +144,14 @@ module.exports = function (grunt) {
jasmine: {
options: {
vendor: ['<%= config.vendorFiles %>'],
helpers:['./app/components/angular-mocks/angular-mocks.js'],
specs: ['./tests/unit/**/*.js'],
helpers:['app/components/angular-mocks/angular-mocks.js'],
specs: ['tests/unit/**/*.js'],
keepRunner: true,
},
development: {
src: ['<%= config.applicationFiles %>'],
src: [
'<%= config.applicationFiles %>'
],
options: {
template: require('grunt-template-jasmine-istanbul'),
templateOptions: {
Expand Down Expand Up @@ -182,27 +197,28 @@ module.exports = function (grunt) {

concat: {
options: {
sourceMap: false,
sourceMap: true,
separator: ';',
banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today(\'yyyy-mm-dd\') %> */\n'
},
production: {
src: '<%= config.applicationFiles %>',
src: ['<%= config.applicationFiles %>'],
dest: '<%= config.outputDir %><%= pkg.name %>.js'
}
},

uglify: {
options: {
sourceMap: false,
sourceMap: true,
sourceMapIncludeSources: true,
enclose: { window: 'window' },
banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today(\'yyyy-mm-dd\') %> */\n'
},
production: {
files: {
'<%= config.outputDir %><%= pkg.name %>.min.js': [ '<%= config.outputDir %><%= pkg.name %>.js' ]
'<%= config.outputDir %><%= pkg.name %>.min.js': [ '<%= config.applicationFiles %>' ]
}
}
},
Expand Down Expand Up @@ -238,7 +254,7 @@ module.exports = function (grunt) {
cwd: './app/data',
src: ['**/*', '*'],
dest: '<%= config.outputDir %>data/'
}]
}],
},
e2e: {
files: [{
Expand All @@ -253,10 +269,7 @@ module.exports = function (grunt) {
},

clean: {
beforeBuild: {
src: ['<%= config.outputDir %>', './docs']
},
afterTest: {
dist: {
src: ['<%= config.outputDir %>']
}
},
Expand Down Expand Up @@ -300,7 +313,7 @@ module.exports = function (grunt) {
commitFiles: ['-a'],
createTag: true,
push: true,
pushTo: 'origin master'
pushTo: 'origin'
}
},

Expand Down Expand Up @@ -347,7 +360,7 @@ module.exports = function (grunt) {
options: {
imports: ['app/less/**/*.less'],
csslint: {
csslintrc: './app/less/.csslintrc',
csslintrc: '.csslintrc',
}
}
},
Expand All @@ -358,10 +371,15 @@ module.exports = function (grunt) {
*/
htmllint: {
options: {
force: true,
htmllintrc: './app/partials/.htmllintrc'
htmllintrc: '.htmllintrc'
},
src: ['./app/*.html','./app/partials/**/*.html']
src: [
'./app/index.html',

'./app/partials/*.html',
'./app/partials/**/*.html',
'./app/partials/**/**/*.html'
]
}

});
Expand All @@ -386,8 +404,9 @@ module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-htmllint');

grunt.registerTask('build', [
'clean:beforeBuild',
'minify'
'clean',
'concat',
'uglify'
]);

grunt.registerTask('release', [
Expand All @@ -396,57 +415,42 @@ module.exports = function (grunt) {
'bump-commit'
]);

grunt.registerTask('minify', [
'concat',
'uglify'
]);

grunt.registerTask('server', [
'less:development',
'ngconstant',
'sails-linker',
'precompile',
'connect:server',
'watch:css'
'watch'
]);

grunt.registerTask('serverjs', [
grunt.registerTask('precompile', [
'less:development',
'ngconstant',
'sails-linker',
'connect:server',
'watch:javascript'
'sails-linker'
]);

grunt.registerTask('serverall', [
'less:development',
'ngconstant',
'sails-linker',
'connect:server',
'watch'
grunt.registerTask('minify', [
'concat',
'uglify'
]);

grunt.registerTask('lint', [
'htmllint',
'lesslint'
'lesslint',
'jshint'
]);

grunt.registerTask('test', [
'clean:beforeBuild',
grunt.registerTask('test:unit:development', [
'ngconstant',
'jshint',
'minify',
'jasmine:production',
'clean:afterTest'
'jasmine:development'
]);

grunt.registerTask('test:development', [
grunt.registerTask('test:unit:production', [
'ngconstant',
'jshint',
'jasmine:development'
'minify',
'jasmine:production'
]);

grunt.registerTask('e2e', [
'clean:beforeBuild',
grunt.registerTask('test:e2e', [
'clean:dist',
'less:production',
'ngconstant',
'minify',
Expand All @@ -455,7 +459,7 @@ module.exports = function (grunt) {
'connect:servertest',
'protractor_webdriver',
'protractor:dist',
'clean:afterTest'
'clean:dist'
]);

grunt.registerTask('default', ['build']);
Expand Down
Loading