Skip to content

Commit 13fb870

Browse files
committed
use time-grunt and jit-grunt
1 parent 7b7ee17 commit 13fb870

File tree

3 files changed

+16
-26
lines changed

3 files changed

+16
-26
lines changed

Gruntfile.js

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
var deepmerge = require('deepmerge');
22

33
module.exports = function(grunt) {
4+
require('time-grunt')(grunt);
5+
require('jit-grunt')(grunt);
6+
47
grunt.util.linefeed = '\n';
58

69
function removeJshint(src) {
@@ -62,7 +65,7 @@ module.exports = function(grunt) {
6265

6366
(function(){
6467
// list available plugins and languages
65-
grunt.file.expand('src/plugins/*/plugin.js')
68+
grunt.file.expand('src/plugins/**/plugin.js')
6669
.forEach(function(f) {
6770
var n = f.split('/')[2];
6871
all_plugins[n] = f;
@@ -209,7 +212,7 @@ module.exports = function(grunt) {
209212
}
210213
}
211214
},
212-
// compile language files
215+
// compile language files with AMD wrapper
213216
lang: {
214217
files: Object.keys(all_langs).map(function(name) {
215218
return {
@@ -218,13 +221,13 @@ module.exports = function(grunt) {
218221
};
219222
}),
220223
options: {
221-
stripBanners: false,
222224
process: function(src, file) {
223225
var wrapper = grunt.file.read('src/i18n/.wrapper.js').replace(/\r\n/g, '\n').split(/@@js\n/);
224226
return process_lang(file, src, wrapper);
225227
}
226228
}
227229
},
230+
// compîle language files without wrapper
228231
lang_temp: {
229232
files: Object.keys(all_langs).map(function(name) {
230233
return {
@@ -233,7 +236,6 @@ module.exports = function(grunt) {
233236
};
234237
}),
235238
options: {
236-
stripBanners: false,
237239
process: function(src, file) {
238240
return process_lang(file, src);
239241
}
@@ -242,7 +244,6 @@ module.exports = function(grunt) {
242244
// add banner to CSS files
243245
css: {
244246
options: {
245-
stripBanners: { block: true },
246247
banner: '<%= banner %>\n\n',
247248
},
248249
files: [{
@@ -254,7 +255,7 @@ module.exports = function(grunt) {
254255
},
255256

256257
wrap: {
257-
// add AMD wrapper
258+
// add AMD wrapper and banner
258259
js: {
259260
src: ['dist/js/query-builder.js'],
260261
dest: '',
@@ -346,7 +347,9 @@ module.exports = function(grunt) {
346347
},
347348

348349
// clean build dir
349-
clean: ['.temp'],
350+
clean: {
351+
temp: ['.temp']
352+
},
350353

351354
// jshint tests
352355
jshint: {
@@ -487,28 +490,13 @@ module.exports = function(grunt) {
487490
});
488491

489492

490-
grunt.loadNpmTasks('grunt-contrib-uglify');
491-
grunt.loadNpmTasks('grunt-contrib-copy');
492-
grunt.loadNpmTasks('grunt-contrib-cssmin');
493-
grunt.loadNpmTasks('grunt-contrib-concat');
494-
grunt.loadNpmTasks('grunt-contrib-qunit');
495-
grunt.loadNpmTasks('grunt-contrib-jshint');
496-
grunt.loadNpmTasks('grunt-contrib-watch');
497-
grunt.loadNpmTasks('grunt-qunit-blanket-lcov');
498-
grunt.loadNpmTasks('grunt-string-replace');
499-
grunt.loadNpmTasks('grunt-contrib-clean');
500-
grunt.loadNpmTasks('grunt-contrib-sass');
501-
grunt.loadNpmTasks('grunt-coveralls');
502-
grunt.loadNpmTasks('grunt-wrap');
503-
grunt.loadNpmTasks('grunt-bump');
504-
505493
grunt.registerTask('build_js', [
506494
'concat:lang_temp',
507495
'concat:js',
508496
'wrap:js',
509497
'concat:js_standalone',
510498
'uglify',
511-
'clean'
499+
'clean:temp'
512500
]);
513501

514502
grunt.registerTask('build_css', [

examples/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ <h1>jQuery QueryBuilder <small>Example</small></h1>
5656
<option value="nl" data-icon="flag flag-nl">Dutch</option>
5757
<option value="no" data-icon="flag flag-no">Norwegian</option>
5858
<option value="pl" data-icon="flag flag-pl">Polish</option>
59-
<option value="pt-BR" data-icon="flag flag-pt">Portuguese</option>
59+
<option value="pt-PT" data-icon="flag flag-pt-PT">Portuguese</option>
60+
<option value="pt-BR" data-icon="flag flag-pt-BR">Brazilian Portuguese</option>
6061
<option value="ro" data-icon="flag flag-ro">Romanian</option>
6162
<option value="ru" data-icon="flag flag-ru">Russian</option>
6263
</select>
@@ -102,7 +103,6 @@ <h3>Output</h3>
102103
<script>
103104
var $b = $('#builder');
104105

105-
// define filters
106106
var options = {
107107
allow_empty: true,
108108

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@
2323
"grunt-coveralls": "~1.0.0",
2424
"grunt-wrap": "~0.3.0",
2525
"deepmerge": "~0.2.7",
26-
"grunt-bump": "^0.3.0"
26+
"grunt-bump": "^0.3.0",
27+
"time-grunt": "^1.2.1",
28+
"jit-grunt": "^0.9.1"
2729
},
2830
"keywords": [
2931
"jquery",

0 commit comments

Comments
 (0)