Skip to content
Open
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
61 changes: 42 additions & 19 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = function (grunt) {

// load all grunt tasks
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
Expand All @@ -8,32 +8,32 @@ module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-karma');
grunt.loadNpmTasks('grunt-karma-coveralls');
grunt.loadNpmTasks('grunt-conventional-changelog');

// Default task.
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.registerTask('default', ['uglify', 'test']);
grunt.registerTask('test', ['clean', 'jshint', 'karma', 'coverage']);
grunt.registerTask('travis-test', ['jshint', 'karma', 'coverage', 'coveralls']);

var testConfig = function (configFile, customOptions) {
var options = { configFile: configFile, keepalive: true };
var travisOptions = process.env.TRAVIS && { browsers: ['PhantomJS'], reporters: ['dots','coverage'] };
return grunt.util._.extend(options, customOptions, travisOptions);
};

// Project configuration.
grunt.initConfig({
changelog: {options: {dest: 'changelog.md'}},
clean: ["coverage"],
coverage: {
options: {
thresholds: {
'statements': 100,
'branches': 100,
'lines': 100,
'functions': 100
options: {
thresholds: {
'statements': 100,
'branches': 100,
'lines': 100,
'functions': 100
},
dir: 'coverage'
}
}
},
coveralls: {
options: {
Expand All @@ -43,16 +43,16 @@ module.exports = function (grunt) {
}
},
karma: {
jquery: {
jquery: {
options: testConfig('karma-jquery.conf.js')
},
jqlite: {
},
jqlite: {
options: testConfig('karma-jqlite.conf.js')
}
}
},
jshint: {
files: ['src/textAngular.js', 'src/textAngularSetup.js', 'test/*.spec.js', 'test/taBind/*.spec.js'],// don't hint the textAngularSanitize as they will fail
options: {
files: ['src/textAngular.js', 'src/textAngularSetup.js', 'test/*.spec.js', 'test/taBind/*.spec.js'],// don't hint the textAngularSanitize as they will fail
options: {
eqeqeq: true,
immed: true,
latedef: true,
Expand All @@ -62,7 +62,7 @@ module.exports = function (grunt) {
boss: true,
eqnull: true,
globals: {}
}
}
},
uglify: {
options: {
Expand All @@ -78,6 +78,29 @@ module.exports = function (grunt) {
'dist/textAngular-sanitize.min.js': ['src/textAngular-sanitize.js']
}
}
},
cssmin: {
compress_css: {
files: {
'dist/textAngular.min.css': ['src/textAngular.css']
}
}
},
watch: {
scripts: {
files: ['src/*.js', 'src/*.css'],
tasks: ['jshint', 'uglify', 'connect'],
options: {
spawn: false
}
},
options: {
livereload: true
}
},
connect: {
site: {
}
}
});
};
10 changes: 5 additions & 5 deletions dist/textAngular.min.js

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,17 @@
"license": "MIT",
"homepage": "http://textangular.com",
"main": "./dist/textAngular.min.js",
"dependencies": {},
"dependencies": {
"grunt-contrib-connect": "^0.8.0"
},
"devDependencies": {
"bower": "^1.3.3",
"grunt": "~0.4.2",
"grunt-cli": "~0.1.11",
"grunt-contrib-clean": "~0.5.0",
"grunt-contrib-jshint": "^0.8.0",
"grunt-contrib-uglify": "^0.2.7",
"grunt-contrib-watch": "^0.6.1",
"grunt-conventional-changelog": "^1.1.0",
"grunt-istanbul-coverage": "~0.0.2",
"grunt-karma": "^0.6.2",
Expand All @@ -39,6 +42,7 @@
"karma-phantomjs-launcher": "~0.1.2",
"karma-script-launcher": "~0.1.0",
"phantomjs": "^1.9.7-5"

},
"scripts": {
"test": "grunt travis-test --verbose",
Expand Down
Loading