1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Add jsonlint step to build

This commit is contained in:
Nick O'Leary 2015-05-28 15:28:17 +01:00
parent 5522e57f65
commit 406f742d29
2 changed files with 21 additions and 2 deletions

View File

@ -158,6 +158,15 @@ module.exports = function(grunt) {
}] }]
} }
}, },
jsonlint: {
messages: {
src: [
'nodes/core/locales/en-US/messages.json',
'locales/en-US/editor.json',
'locales/en-US/runtime.json'
]
}
},
attachCopyright: { attachCopyright: {
js: { js: {
src: [ src: [
@ -198,6 +207,14 @@ module.exports = function(grunt) {
'editor/sass/**/*.scss' 'editor/sass/**/*.scss'
], ],
tasks: ['sass','attachCopyright:css'] tasks: ['sass','attachCopyright:css']
},
json: {
files: [
'nodes/core/locales/en-US/messages.json',
'locales/en-US/editor.json',
'locales/en-US/runtime.json'
],
tasks: ['jsonlint:messages']
} }
}, },
@ -207,7 +224,7 @@ module.exports = function(grunt) {
script: 'red.js', script: 'red.js',
options: { options: {
args:['-v'], args:['-v'],
ext: 'js,html', ext: 'js,html,json',
watch: [ watch: [
'red','nodes' 'red','nodes'
] ]
@ -314,6 +331,7 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-compress'); grunt.loadNpmTasks('grunt-contrib-compress');
grunt.loadNpmTasks('grunt-contrib-copy'); grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-chmod'); grunt.loadNpmTasks('grunt-chmod');
grunt.loadNpmTasks('grunt-jsonlint');
grunt.registerMultiTask('attachCopyright', function() { grunt.registerMultiTask('attachCopyright', function() {
var files = this.data.src; var files = this.data.src;
@ -379,7 +397,7 @@ module.exports = function(grunt) {
grunt.registerTask('build', grunt.registerTask('build',
'Builds editor content', 'Builds editor content',
['clean:build','concat:build','concat:vendor','uglify:build','sass:build','copy:build','attachCopyright']); ['clean:build','concat:build','concat:vendor','uglify:build','sass:build','jsonlint:messages','copy:build','attachCopyright']);
grunt.registerTask('dev', grunt.registerTask('dev',
'Developer mode: run node-red, watch for source changes and build/restart', 'Developer mode: run node-red, watch for source changes and build/restart',

View File

@ -70,6 +70,7 @@
"grunt-contrib-jshint": "0.11.2", "grunt-contrib-jshint": "0.11.2",
"grunt-contrib-uglify": "0.9.1", "grunt-contrib-uglify": "0.9.1",
"grunt-contrib-watch":"0.6.1", "grunt-contrib-watch":"0.6.1",
"grunt-jsonlint":"1.0.4",
"grunt-nodemon":"0.4.0", "grunt-nodemon":"0.4.0",
"grunt-sass":"1.0.0", "grunt-sass":"1.0.0",
"grunt-simple-mocha": "0.4.0", "grunt-simple-mocha": "0.4.0",