-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* build * makepot * wp deploy - if we get listed :)
- Loading branch information
Showing
7 changed files
with
240 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
*.zip | ||
.DS_Store | ||
|
||
# Grunt.js SASS cache files | ||
/.sass-cache | ||
|
||
# NPM packages used by Grunt.js | ||
/node_modules | ||
|
||
# NPM debug log | ||
npm-debug.log | ||
|
||
# build directory | ||
/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* jshint node:true */ | ||
module.exports = function( grunt ) { | ||
'use strict'; | ||
|
||
// load all grunt tasks matching the `grunt-*` pattern | ||
require( 'load-grunt-tasks' )( grunt ); | ||
|
||
// Show elapsed time | ||
require( 'time-grunt' )( grunt ); | ||
|
||
var _ = require( 'underscore' ); | ||
var path = require( 'path' ); | ||
|
||
// Set plugin slug option | ||
grunt.option( 'plugin-slug', path.basename( process.cwd() ) ); | ||
|
||
var gruntConfig = {}; | ||
|
||
// options | ||
gruntConfig.options = {}; | ||
|
||
// Set folder templates | ||
gruntConfig.dirs = { | ||
css: 'assets/css', | ||
js: 'assets/js', | ||
images: 'assets/images', | ||
fonts: 'assets/fonts', | ||
build: 'build' | ||
}; | ||
|
||
function loadConfig( filepath ) { | ||
var object = {}; | ||
var key; | ||
|
||
filepath = path.normalize( path.resolve( process.cwd(), filepath ) + '/' ) | ||
|
||
var files = grunt.file.glob.sync( '*', { cwd: filepath } ); | ||
|
||
files.forEach( function( option ) { | ||
key = option.replace(/\.js$/,''); | ||
object = _.extend( object, require( filepath + option )( grunt ) ); | ||
}); | ||
|
||
return object; | ||
}; | ||
|
||
// load task configs | ||
gruntConfig = _.extend( gruntConfig, loadConfig( './grunt/configs/' ) ); | ||
|
||
// Init Grunt | ||
grunt.initConfig( gruntConfig ); | ||
|
||
// Register Tasks | ||
grunt.registerTask( 'default', [ | ||
'makepot', | ||
'clean:build_dir', | ||
'copy:build', | ||
'clean:build' | ||
] ); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* jshint node:true */ | ||
module.exports = function( grunt ) { | ||
'use strict'; | ||
|
||
var _ = require( 'underscore' ); | ||
var config = {}; | ||
|
||
// Delete source map from the CoffeeScript compilation | ||
config.clean = { | ||
dev: [ '<%= dirs.js %>/admin/*.min.js.map', '<%= dirs.js %>/frontend/*.min.js.map' ], | ||
build_dir: [ '<%= dirs.build %>/**' ], | ||
build: [ | ||
// Delete dev files and dirs | ||
'<%= dirs.build %>/grunt', | ||
'<%= dirs.build %>/node_modules', | ||
'<%= dirs.build %>/wp-assets', | ||
'<%= dirs.build %>/package.json', | ||
'<%= dirs.build %>/Gruntfile.js', | ||
|
||
// Delete map files | ||
'<%= dirs.build %>/<%= dirs.js %>/admin/*.map', | ||
'<%= dirs.build %>/<%= dirs.js %>/frontend/*.map', | ||
'<%= dirs.build %>/<%= dirs.css %>/admin/*.map', | ||
'<%= dirs.build %>/<%= dirs.css %>/frontend/*.map', | ||
|
||
// Delete .coffee files | ||
'<%= dirs.build %>/<%= dirs.js %>/admin/*.coffee', | ||
'<%= dirs.build %>/<%= dirs.js %>/frontend/*.coffee', | ||
|
||
// Delete unminified .js files | ||
'<%= dirs.build %>/<%= dirs.js %>/admin/*.js', | ||
'<%= dirs.build %>/<%= dirs.js %>/frontend/*.js', | ||
'!<%= dirs.build %>/<%= dirs.js %>/admin/*.min.js', | ||
'!<%= dirs.build %>/<%= dirs.js %>/frontend/*.min.js', | ||
|
||
// Delete .scss files | ||
'<%= dirs.build %>/<%= dirs.css %>/admin/*.scss', | ||
'<%= dirs.build %>/<%= dirs.css %>/frontend/*.scss', | ||
|
||
// Delete unminified .css files | ||
'<%= dirs.build %>/<%= dirs.css %>/admin/*.css', | ||
'<%= dirs.build %>/<%= dirs.css %>/frontend/*.css', | ||
'!<%= dirs.build %>/<%= dirs.css %>/admin/*.min.css', | ||
'!<%= dirs.build %>/<%= dirs.css %>/frontend/*.min.css', | ||
|
||
// Delete misc files | ||
'<%= dirs.build %>/modman', | ||
'<%= dirs.build %>/**.DS_Store', | ||
'<%= dirs.build %>/**.zip' | ||
] | ||
}; | ||
|
||
return config; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* jshint node:true */ | ||
module.exports = function( grunt ) { | ||
'use strict'; | ||
|
||
var util = grunt.option( 'util' ); | ||
var config = {}; | ||
|
||
function cleanSourceMaps( content, srcpath ) { | ||
|
||
if ( '.min.js' == srcpath.match( '.min.js$' ) || '.min.css' == srcpath.match( '.min.css$' ) ) { // jshint ignore:line | ||
content = content.replace( /^.*sourceMappingURL=.*$/mg, '' ); | ||
} | ||
|
||
return content; | ||
} | ||
|
||
// copy files to /build dir | ||
config.copy = { | ||
build: { | ||
files: [{ | ||
expand: true, | ||
src: [ '**' ], | ||
dest: 'build/' | ||
}], | ||
options: { | ||
process: cleanSourceMaps, | ||
noProcess: [ | ||
'**/*.{png,jpg,gif}', | ||
'**/*.{eot,svg,ttf,woff}' | ||
] | ||
} | ||
} | ||
}; | ||
|
||
return config; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* jshint node:true */ | ||
module.exports = function( grunt ) { | ||
'use strict'; | ||
|
||
var config = {}; | ||
|
||
// Makepot | ||
config.makepot = { | ||
makepot: { | ||
options: { | ||
cwd: '', | ||
domainPath: 'i18n/languages', | ||
potFilename: grunt.option( 'plugin-slug' ) + '.pot', | ||
potHeaders: { 'report-msgid-bugs-to': 'https://github.com/skyverge/' + grunt.option( 'plugin-slug' ) + '/issues' }, | ||
processPot: function( pot ) { | ||
delete pot.headers['x-generator']; | ||
return pot; | ||
}, // jshint ignore:line | ||
type: 'wp-plugin', | ||
updateTimestamp: false | ||
} | ||
} | ||
}; | ||
|
||
|
||
return config; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* jshint node:true */ | ||
module.exports = function( grunt ) { | ||
'use strict'; | ||
|
||
var config = {}; | ||
|
||
// Makepot | ||
config.wp_deploy = { | ||
deploy: { | ||
options: { | ||
plugin_slug: grunt.option( 'plugin-slug' ), | ||
svn_user: 'SkyVerge', | ||
build_dir: 'build', | ||
assets_dir: 'wp-assets' | ||
} | ||
} | ||
}; | ||
|
||
return config; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"name": "woocommerce-google-trusted-stores-integration", | ||
"version": "0.1.0-2", | ||
"author": "Enollo Team", | ||
"homepage": "http://enollo.com", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/enollo/woocommerce-google-trusted-stores-integration.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/enollo/woocommerce-google-trusted-stores-integration/issues" | ||
}, | ||
"engines": { | ||
"node": ">= 0.10.0" | ||
}, | ||
"devDependencies": { | ||
"grunt": "~0.4.5", | ||
"grunt-contrib-clean": "~0.5.0", | ||
"grunt-contrib-copy": "~0.5.0", | ||
"grunt-newer": "~0.7.0", | ||
"grunt-notify": "~0.3.0", | ||
"grunt-wp-deploy": "~1.0.3", | ||
"grunt-wp-i18n": "~0.4.5", | ||
"load-grunt-tasks": "~0.6.0", | ||
"time-grunt": "~0.4.0", | ||
"underscore": "~1.6.0", | ||
"underscore.string": "~2.3.3" | ||
} | ||
} |