Skip to content

Commit 848df76

Browse files
Kahlil Lecheltvladikoff
Kahlil Lechelt
authored andcommitted
Squashed commit of the following:
commit 8a9bd2b737b2c7b764dffe77db566e57bed878af Author: Kahlil Lechelt <[email protected]> Date: Sun Oct 27 16:18:56 2013 +0100 Load all Grunt tasks via Sindre's module. commit bc114ddf8b04b3d6cc9bd53acd5e5fac008319f9 Author: Kahlil Lechelt <[email protected]> Date: Sun Oct 27 15:24:40 2013 +0100 Open the local server automatically after calling grunt serve. commit b8ef221395854265f4ebfa9c8089ef8483ba01bf Author: Kahlil Lechelt <[email protected]> Date: Sun Oct 27 15:22:22 2013 +0100 Edit .jshintrc commit a16fd4133a3d2e0402c220a68bcf78273aa07344 Author: Kahlil Lechelt <[email protected]> Date: Sun Oct 27 15:00:29 2013 +0100 Add .jshintrc and .editorconfig for consistency. Closes gruntjsgh-80.
1 parent 858d22a commit 848df76

File tree

4 files changed

+69
-17
lines changed

4 files changed

+69
-17
lines changed

.editorconfig

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# EditorConfig helps developers define and maintain consistent
2+
# coding styles between different editors and IDEs
3+
# editorconfig.org
4+
5+
root = true
6+
7+
[*]
8+
indent_style = space
9+
indent_size = 2
10+
11+
end_of_line = lf
12+
charset = utf-8
13+
trim_trailing_whitespace = true
14+
insert_final_newline = true
15+
16+
[*.md]
17+
trim_trailing_whitespace = false

.jshintrc

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"node": true,
3+
"browser": true,
4+
"esnext": true,
5+
"bitwise": true,
6+
"camelcase": false,
7+
"curly": true,
8+
"eqeqeq": true,
9+
"immed": true,
10+
"latedef": true,
11+
"newcap": true,
12+
"noarg": true,
13+
"quotmark": "single",
14+
"regexp": true,
15+
"undef": true,
16+
"unused": true,
17+
"strict": true,
18+
"trailing": true,
19+
"smarttabs": true,
20+
"sub": true,
21+
"boss": true,
22+
"eqnull": true,
23+
"es5": true,
24+
"jquery": true
25+
}

Gruntfile.js

+23-16
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
'use strict';
22

33
module.exports = function(grunt) {
4+
// Load all grunt tasks matching the `grunt-*` pattern.
5+
require('load-grunt-tasks')(grunt);
46

57
// Project configuration.
68
grunt.initConfig({
@@ -19,19 +21,19 @@ module.exports = function(grunt) {
1921
less: {
2022
development: {
2123
options: {
22-
paths: ["src/less"]
24+
paths: ['src/less']
2325
},
2426
files: {
25-
"build/css/main.css": "src/less/main.less"
27+
'build/css/main.css': 'src/less/main.less'
2628
}
2729
},
2830
production: {
2931
options: {
30-
paths: ["src/less"],
32+
paths: ['src/less'],
3133
yuicompress: true
3234
},
3335
files: {
34-
"build/css/main.css": "src/less/main.less"
36+
'build/css/main.css': 'src/less/main.less'
3537
}
3638
}
3739
},
@@ -69,7 +71,7 @@ module.exports = function(grunt) {
6971
}
7072
},
7173
files: {
72-
"build/404.html": "src/tmpl/404.jade"
74+
'build/404.html': 'src/tmpl/404.jade'
7375
}
7476
}
7577
},
@@ -121,24 +123,29 @@ module.exports = function(grunt) {
121123
},
122124
nodeunit: {
123125
all: ['test/*_test.js']
126+
},
127+
128+
// Open the local server.
129+
open: {
130+
dev: {
131+
path: 'http://localhost:<%= server_port %>/'
132+
}
133+
},
134+
135+
concurrent: {
136+
server: ['server', 'open']
124137
}
125138
});
126139

127-
// Load contrib tasks
128-
grunt.loadNpmTasks('grunt-contrib-clean');
129-
grunt.loadNpmTasks('grunt-contrib-jshint');
130-
grunt.loadNpmTasks('grunt-contrib-concat');
131-
grunt.loadNpmTasks('grunt-contrib-watch');
132-
grunt.loadNpmTasks('grunt-contrib-less');
133-
grunt.loadNpmTasks('grunt-contrib-jade');
134-
grunt.loadNpmTasks('grunt-contrib-copy');
135-
grunt.loadNpmTasks('grunt-contrib-nodeunit');
140+
// Load grunt tasks
141+
// All npm tasks are loaded via Sindre's load-grunt-tasks.
142+
136143
// Load local tasks
137144
grunt.loadTasks('tasks'); // getWiki, docs tasks
138-
145+
139146
grunt.registerTask('build', ['clean', 'copy', 'jade', 'docs', 'blog', 'plugins', 'concat']);
140147
grunt.registerTask('default', ['build', 'less:production']);
141148
grunt.registerTask('dev', ['build', 'less:development', 'jshint', 'watch']);
142149
grunt.registerTask('test', ['nodeunit']);
143-
grunt.registerTask('serve', ['server']);
150+
grunt.registerTask('serve', ['concurrent:server']);
144151
};

package.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@
3535
"devDependencies": {
3636
"grunt-contrib-watch": "~0.5.2",
3737
"grunt-contrib-jshint": "~0.1.1",
38-
"grunt-contrib-nodeunit": "~0.2.0"
38+
"grunt-contrib-nodeunit": "~0.2.0",
39+
"grunt-open": "~0.2.2",
40+
"grunt-concurrent": "~0.4.1",
41+
"load-grunt-tasks": "~0.2.0"
3942
}
4043
}

0 commit comments

Comments
 (0)