Skip to content

Commit 9ccff1c

Browse files
committed
Build: Upgrade to Grunt 0.4.5
* Upgrade to grunt-check-modules 0.2.0 * Upgrade to grunt-jquery-content 1.0.0
1 parent 47c2b40 commit 9ccff1c

File tree

3 files changed

+23
-26
lines changed

3 files changed

+23
-26
lines changed

.gitignore

+3-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
vendor
2-
tmp/*
3-
tmp
4-
config.json
5-
node_modules/
6-
dist/
7-
.DS_Store
1+
/dist/
2+
/node_modules/
3+
config.js*

grunt.js renamed to Gruntfile.js

+17-15
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
11
var rimraf = require( "rimraf" ),
2-
spawnback = require( "spawnback" );
2+
spawnback = require( "spawnback" ),
3+
jqueryContent = require( "grunt-jquery-content" );
34

45
module.exports = function( grunt ) {
56

67
grunt.loadNpmTasks( "grunt-check-modules" );
78
grunt.loadNpmTasks( "grunt-jquery-content" );
8-
grunt.loadNpmTasks( "grunt-wordpress" );
99

1010
grunt.initConfig({
1111
"build-pages": {
12-
all: grunt.file.expandFiles( "page/**" )
12+
all: "page/**"
1313
},
1414
"build-resources": {
15-
all: grunt.file.expandFiles( "resources/**/*" )
15+
all: "resources/**"
1616
},
17-
wordpress: grunt.utils._.extend({
18-
dir: "dist/wordpress"
19-
}, grunt.file.readJSON( "config.json" ) )
17+
wordpress: (function() {
18+
var config = require( "./config" );
19+
config.dir = "dist/wordpress";
20+
return config;
21+
})()
2022
});
2123

2224
grunt.registerTask( "clean", function() {
@@ -117,26 +119,26 @@ function contributorAttribution( post, fileName, callback ) {
117119
value: JSON.stringify( contribs )
118120
});
119121

120-
callback( null );
122+
callback( null, post );
121123
});
122124
}
123125

124-
grunt.registerHelper( "build-pages-preprocess", (function() {
126+
jqueryContent.preprocessPost = (function() {
125127
var orderMap = getOrderMap();
126128

127-
return function( post, fileName, done ) {
128-
var slug = fileName.replace( /^.+?\/(.+)\.\w+$/, "$1" ),
129+
return function( post, postPath, callback ) {
130+
var slug = postPath.replace( /^.+?\/(.+)\.\w+$/, "$1" ),
129131
menuOrder = orderMap[ slug ];
130132

131133
if ( menuOrder ) {
132134
post.menuOrder = menuOrder;
133135
}
134136

135-
contributorAttribution( post, fileName, done );
137+
contributorAttribution( post, postPath, callback );
136138
};
137-
})());
139+
})();
138140

139-
grunt.registerTask( "build", "build-pages build-resources" );
140-
grunt.registerTask( "build-wordpress", "check-modules clean build" );
141+
grunt.registerTask( "build", [ "build-pages", "build-resources" ] );
142+
grunt.registerTask( "build-wordpress", [ "check-modules", "clean", "build" ] );
141143

142144
};

package.json

+3-4
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,9 @@
2121
}
2222
],
2323
"dependencies": {
24-
"grunt": "0.3.17",
25-
"grunt-wordpress": "1.2.1",
26-
"grunt-jquery-content": "0.13.0",
27-
"grunt-check-modules": "0.1.0",
24+
"grunt": "0.4.5",
25+
"grunt-check-modules": "0.2.0",
26+
"grunt-jquery-content": "1.0.0",
2827
"rimraf": "2.2.8",
2928
"spawnback": "1.0.0"
3029
}

0 commit comments

Comments
 (0)