Skip to content
Permalink
Browse files
Build: Upgrade to Grunt 0.4.5
* Upgrade to grunt-check-modules 0.2.0
* Upgrade to grunt-jquery-content 1.0.0
  • Loading branch information
scottgonzalez committed Dec 5, 2014
1 parent 47c2b40 commit 9ccff1cbba4fe3b22d7353358b00128c9720ded0
Showing with 23 additions and 26 deletions.
  1. +3 −7 .gitignore
  2. +17 −15 grunt.js → Gruntfile.js
  3. +3 −4 package.json
@@ -1,7 +1,3 @@
vendor
tmp/*
tmp
config.json
node_modules/
dist/
.DS_Store
/dist/
/node_modules/
config.js*
@@ -1,22 +1,24 @@
var rimraf = require( "rimraf" ),
spawnback = require( "spawnback" );
spawnback = require( "spawnback" ),
jqueryContent = require( "grunt-jquery-content" );

module.exports = function( grunt ) {

grunt.loadNpmTasks( "grunt-check-modules" );
grunt.loadNpmTasks( "grunt-jquery-content" );
grunt.loadNpmTasks( "grunt-wordpress" );

grunt.initConfig({
"build-pages": {
all: grunt.file.expandFiles( "page/**" )
all: "page/**"
},
"build-resources": {
all: grunt.file.expandFiles( "resources/**/*" )
all: "resources/**"
},
wordpress: grunt.utils._.extend({
dir: "dist/wordpress"
}, grunt.file.readJSON( "config.json" ) )
wordpress: (function() {
var config = require( "./config" );
config.dir = "dist/wordpress";
return config;
})()
});

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

callback( null );
callback( null, post );
});
}

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

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

if ( menuOrder ) {
post.menuOrder = menuOrder;
}

contributorAttribution( post, fileName, done );
contributorAttribution( post, postPath, callback );
};
})());
})();

grunt.registerTask( "build", "build-pages build-resources" );
grunt.registerTask( "build-wordpress", "check-modules clean build" );
grunt.registerTask( "build", [ "build-pages", "build-resources" ] );
grunt.registerTask( "build-wordpress", [ "check-modules", "clean", "build" ] );

};
@@ -21,10 +21,9 @@
}
],
"dependencies": {
"grunt": "0.3.17",
"grunt-wordpress": "1.2.1",
"grunt-jquery-content": "0.13.0",
"grunt-check-modules": "0.1.0",
"grunt": "0.4.5",
"grunt-check-modules": "0.2.0",
"grunt-jquery-content": "1.0.0",
"rimraf": "2.2.8",
"spawnback": "1.0.0"
}

0 comments on commit 9ccff1c

Please sign in to comment.