Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(templates:common): Lint bower.json before executing wiredep. #200

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
26 changes: 19 additions & 7 deletions templates/common/_Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ module.exports = function (grunt) {
watch: {
bower: {
files: ['bower.json'],
tasks: ['wiredep', 'newer:copy:app']
tasks: ['rebuilddep', 'newer:copy:app']
},
html: {
files: ['<%%= yeoman.app %>/**/*.html'],
Expand Down Expand Up @@ -165,6 +165,13 @@ module.exports = function (grunt) {
}<% } %>
},

// Jsonlint on bower configuration
jsonlint: {
all: {
files: [{ src: ['bower.json'] }]
}
},

<% if (compass) { %>
// Compiles Sass to CSS and generates necessary files if requested
compass: {
Expand Down Expand Up @@ -449,7 +456,7 @@ module.exports = function (grunt) {
// over to <%%= yeoman.dist %>/. Last step is running cordova prepare so we can refresh the ripple
// browser tab to see the changes. Technically ripple runs `cordova prepare` on browser
// refreshes, but at this time you would need to re-run the emulator to see changes.
grunt.registerTask('ripple', ['wiredep', 'newer:copy:app', 'ripple-emulator']);
grunt.registerTask('ripple', ['rebuilddep', 'newer:copy:app', 'ripple-emulator']);
grunt.registerTask('ripple-emulator', function () {
grunt.config.set('watch', {
all: {
Expand Down Expand Up @@ -498,7 +505,7 @@ module.exports = function (grunt) {
});

grunt.registerTask('test', [
'wiredep',
'rebuilddep',
'clean',
'concurrent:test',
'autoprefixer',
Expand All @@ -512,7 +519,7 @@ module.exports = function (grunt) {
}

grunt.config('concurrent.ionic.tasks', ['ionic:serve', 'watch']);
grunt.task.run(['wiredep', 'init', 'concurrent:ionic']);
grunt.task.run(['rebuilddep', 'init', 'concurrent:ionic']);
});
grunt.registerTask('emulate', function() {
grunt.config('concurrent.ionic.tasks', ['ionic:emulate:' + this.args.join(), 'watch']);
Expand All @@ -529,7 +536,7 @@ module.exports = function (grunt) {
grunt.registerTask('init', [
'clean',
'ngconstant:development',
'wiredep',
'rebuilddep',
'concurrent:server',
'autoprefixer',
'newer:copy:app',
Expand All @@ -540,7 +547,7 @@ module.exports = function (grunt) {
grunt.registerTask('compress', [
'clean',
'ngconstant:production',
'wiredep',
'rebuilddep',
'useminPrepare',
'concurrent:dist',
'autoprefixer',
Expand All @@ -558,8 +565,13 @@ module.exports = function (grunt) {
'connect:coverage:keepalive'
]);

grunt.registerTask('rebuilddep', [
'jsonlint',
'wiredep'
]);

grunt.registerTask('default', [
'wiredep',
'rebuilddep',
'newer:jshint',
'karma:continuous',
'compress'
Expand Down
3 changes: 2 additions & 1 deletion templates/common/_package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
"ripple-emulator": "~0.9.24",
"elementtree": "0.1.6",
"plist": "1.1.0",
"win-spawn": "^2.0.0"
"win-spawn": "^2.0.0",
"grunt-jsonlint": "~1.0.4"
},
"engines": {
"node": ">=0.10.0"
Expand Down