1- module . exports = function ( grunt ) {
2- var browsers = grunt . option ( 'browsers' ) && grunt . option ( 'browsers' ) . split ( ',' ) ;
3- // Project configuration.
4- grunt . initConfig ( {
5- pkg : grunt . file . readJSON ( 'package.json' ) ,
6- uglify : {
7- options : {
8- banner : '/*! <%= pkg.name %> <%= pkg.version %> */\n'
9- } ,
10- build : {
11- src : 'dist/flow.js' ,
12- dest : 'dist/flow.min.js'
13- }
14- } ,
15- concat : {
16- build : {
17- files : {
18- 'dist/flow.js' : [
19- 'src/flow.js'
20- ]
21- }
22- }
23- } ,
24- jst : {
25- compile : {
26- options : {
27-
28- } ,
29- files : {
30- "dist/flow.js" : [ "dist/flow.js" ]
31- }
32- }
33- } ,
34- coveralls : {
35- options : {
36- coverage_dir : 'coverage/'
37- }
38- } ,
39- karma : {
40- options : {
41- configFile : 'karma.conf.js' ,
42- browsers : browsers || [ 'Chrome' ]
43- } ,
44- watch : {
45- autoWatch : true ,
46- background : false
47- } ,
48- continuous : {
49- singleRun : true
50- } ,
51- coverage : {
52- singleRun : true ,
53- reporters : [ 'progress' , 'coverage' ] ,
54- preprocessors : {
55- 'src/*.js' : 'coverage'
56- } ,
57- coverageReporter : {
58- type : "lcov" ,
59- dir : "coverage/"
60- }
61- } ,
62- travis : {
63- singleRun : true ,
64- reporters : [ 'progress' , 'coverage' ] ,
65- preprocessors : {
66- 'src/*.js' : 'coverage'
67- } ,
68- coverageReporter : {
69- type : "lcov" ,
70- dir : "coverage/"
71- } ,
72- // Buggiest browser
73- browsers : browsers || [ 'sl_chrome' ] ,
74- // global config for SauceLabs
75- sauceLabs : {
76- username : grunt . option ( 'sauce-username' ) || process . env . SAUCE_USERNAME ,
77- accessKey : grunt . option ( 'sauce-access-key' ) || process . env . SAUCE_ACCESS_KEY ,
78- startConnect : grunt . option ( 'sauce-local' ) ? false : true ,
79- testName : 'flow.js'
80- }
81- }
82- } ,
83- clean : {
84- release : [ "dist/" ]
85- } ,
86- bump : {
87- options : {
88- files : [ 'package.json' , 'bower.json' ] ,
89- updateConfigs : [ 'pkg' ] ,
90- commit : true ,
91- commitMessage : 'Release v%VERSION%' ,
92- commitFiles : [ '-a' ] , // '-a' for all files
93- createTag : true ,
94- tagName : 'v%VERSION%' ,
95- tagMessage : 'Version %VERSION%' ,
96- push : true ,
97- pushTo : 'origin' ,
98- gitDescribeOptions : '--tags --always --abbrev=1 --dirty=-d' // options to use with '$ git describe'
99- }
100- } ,
101- 'template' : {
102- 'release' : {
103- 'options' : {
104- 'data' : {
105- 'version' : '<%= pkg.version %>'
106- }
107- } ,
108- 'files' : {
109- 'dist/flow.js' : [ 'dist/flow.js' ]
110- }
111- }
112- }
113- } ) ;
114-
115- // Loading dependencies
116- for ( var key in grunt . file . readJSON ( "package.json" ) . devDependencies ) {
117- if ( key !== "grunt" && key . indexOf ( "grunt" ) === 0 ) grunt . loadNpmTasks ( key ) ;
118- }
119-
120- // Default task.
121- grunt . registerTask ( 'default' , [ 'test' ] ) ;
122- // Release tasks
123- grunt . registerTask ( 'build' , [ 'concat' , 'template' , 'uglify' ] ) ;
124- grunt . registerTask ( 'release' , function ( type ) {
125- type = type ? type : 'patch' ;
126- grunt . task . run ( 'bump-only:' + type ) ;
127- grunt . task . run ( 'clean' , 'build' ) ;
128- grunt . task . run ( 'bump-commit' ) ;
129- } ) ;
130- // Development
131- grunt . registerTask ( 'test' , [ "karma:travis" ] ) ;
132- } ;
1+ module . exports = function ( grunt ) {
2+ // Project configuration.
3+ grunt . initConfig ( {
4+ pkg : grunt . file . readJSON ( 'package.json' ) ,
5+ uglify : {
6+ options : {
7+ banner : '/*! <%= pkg.name %> <%= pkg.version %> */\n'
8+ } ,
9+ build : {
10+ src : 'dist/flow.js' ,
11+ dest : 'dist/flow.min.js'
12+ }
13+ } ,
14+ concat : {
15+ build : {
16+ files : {
17+ 'dist/flow.js' : [
18+ 'src/flow.js'
19+ ]
20+ }
21+ }
22+ } ,
23+ jst : {
24+ compile : {
25+ options : {
26+
27+ } ,
28+ files : {
29+ "dist/flow.js" : [ "dist/flow.js" ]
30+ }
31+ }
32+ } ,
33+ coveralls : {
34+ options : {
35+ coverage_dir : 'coverage/'
36+ }
37+ } ,
38+ karma : {
39+ options : {
40+ configFile : 'karma.conf.js'
41+ } ,
42+ watch : {
43+ autoWatch : true ,
44+ background : false
45+ } ,
46+ continuous : {
47+ singleRun : true
48+ } ,
49+ coverage : {
50+ singleRun : true ,
51+ reporters : [ 'progress' , 'coverage' ] ,
52+ preprocessors : {
53+ 'src/*.js' : 'coverage'
54+ } ,
55+ coverageReporter : {
56+ type : "lcov" ,
57+ dir : "coverage/"
58+ }
59+ } ,
60+ travis : {
61+ singleRun : true ,
62+ reporters : [ 'progress' , 'coverage' ] ,
63+ preprocessors : {
64+ 'src/*.js' : 'coverage'
65+ } ,
66+ coverageReporter : {
67+ type : "lcov" ,
68+ dir : "coverage/"
69+ } ,
70+ // global config for SauceLabs
71+ sauceLabs : {
72+ username : grunt . option ( 'sauce-username' ) || process . env . SAUCE_USERNAME ,
73+ accessKey : grunt . option ( 'sauce-access-key' ) || process . env . SAUCE_ACCESS_KEY ,
74+ startConnect : grunt . option ( 'sauce-local' ) ? false : true ,
75+ testName : 'flow.js'
76+ }
77+ }
78+ } ,
79+ clean : {
80+ release : [ "dist/" ]
81+ } ,
82+ bump : {
83+ options : {
84+ files : [ 'package.json' , 'bower.json' ] ,
85+ updateConfigs : [ 'pkg' ] ,
86+ commit : true ,
87+ commitMessage : 'Release v%VERSION%' ,
88+ commitFiles : [ '-a' ] , // '-a' for all files
89+ createTag : true ,
90+ tagName : 'v%VERSION%' ,
91+ tagMessage : 'Version %VERSION%' ,
92+ push : true ,
93+ pushTo : 'origin' ,
94+ gitDescribeOptions : '--tags --always --abbrev=1 --dirty=-d' // options to use with '$ git describe'
95+ }
96+ } ,
97+ 'template' : {
98+ 'release' : {
99+ 'options' : {
100+ 'data' : {
101+ 'version' : '<%= pkg.version %>'
102+ }
103+ } ,
104+ 'files' : {
105+ 'dist/flow.js' : [ 'dist/flow.js' ]
106+ }
107+ }
108+ }
109+ } ) ;
110+
111+ // Loading dependencies
112+ for ( var key in grunt . file . readJSON ( "package.json" ) . devDependencies ) {
113+ if ( key !== "grunt" && key . indexOf ( "grunt" ) === 0 ) grunt . loadNpmTasks ( key ) ;
114+ }
115+
116+ // Default task.
117+ grunt . registerTask ( 'default' , [ 'test' ] ) ;
118+ // Release tasks
119+ grunt . registerTask ( 'build' , [ 'concat' , 'template' , 'uglify' ] ) ;
120+ grunt . registerTask ( 'release' , function ( type ) {
121+ type = type ? type : 'patch' ;
122+ grunt . task . run ( 'bump-only:' + type ) ;
123+ grunt . task . run ( 'clean' , 'build' ) ;
124+ grunt . task . run ( 'bump-commit' ) ;
125+ } ) ;
126+ // Development
127+ grunt . registerTask ( 'test' , [ "karma:travis" ] ) ;
128+ } ;
0 commit comments