Skip to content

Commit

Permalink
grunterino
Browse files Browse the repository at this point in the history
  • Loading branch information
jameskoster committed Oct 1, 2014
1 parent 3f3780a commit 67521cf
Show file tree
Hide file tree
Showing 17 changed files with 573 additions and 1,810 deletions.
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
.sass-cache
# Sass
.sass-cache

# Grunt
/node_modules/
/deploy/
24 changes: 24 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"boss": true,
"curly": true,
"eqeqeq": true,
"eqnull": true,
"es3": true,
"expr": true,
"immed": true,
"noarg": true,
"onevar": true,
"quotmark": "single",
"trailing": true,
"undef": true,
"unused": true,

"browser": true,

"globals": {
"_": false,
"Backbone": false,
"jQuery": false,
"wp": false
}
}
246 changes: 246 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,246 @@
/* jshint node:true */
module.exports = function( grunt ) {
'use strict';

grunt.initConfig({

// setting folder templates
dirs: {
wc_css: 'inc/woocommerce/css',
images: 'images',
js: 'js',
customizer_js: 'inc/customizer/js',
wc_js: 'inc/woocommerce/js'
},

// JavaScript linting with JSHint.
jshint: {
options: {
jshintrc: '.jshintrc'
},
all: [
'Gruntfile.js',
'<%= dirs.js %>/*.js',
'!<%= dirs.js %>/*.min.js',
'<%= dirs.customizer_js %>/*.js',
'!<%= dirs.customizer_js %>/*.min.js',
'<%= dirs.wc_js %>/*.js',
'!<%= dirs.wc_js %>/*.min.js'
]
},

// Minify .js files.
uglify: {
options: {
preserveComments: 'some'
},
main: {
files: [{
expand: true,
cwd: '<%= dirs.js %>/',
src: [
'*.js',
'!*.min.js'
],
dest: '<%= dirs.js %>/',
ext: '.min.js'
}]
},
woocommerce: {
files: [{
expand: true,
cwd: '<%= dirs.wc_js %>/',
src: [
'*.js',
'!*.min.js'
],
dest: '<%= dirs.wc_js %>/',
ext: '.min.js'
}]
},
customizer: {
files: [{
expand: true,
cwd: '<%= dirs.customizer_js %>/',
src: [
'*.js',
'!*.min.js'
],
dest: '<%= dirs.customizer_js %>/',
ext: '.min.js'
}]
}
},

// Compile all .scss files.
sass: {
compile: {
options: {
sourcemap: 'none',
loadPath: require( 'node-bourbon' ).includePaths
},
files: [{
'style.css': 'style.scss',
'inc/woocommerce/css/bookings.css': 'inc/woocommerce/css/bookings.scss',
'inc/woocommerce/css/brands.css': 'inc/woocommerce/css/brands.scss',
'inc/woocommerce/css/wishlists.css': 'inc/woocommerce/css/wishlists.scss',
'inc/woocommerce/css/woocommerce.css': 'inc/woocommerce/css/woocommerce.scss',
}]
}
},

// Minify all .css files.
cssmin: {
minify: {
files: [{
'style.css': 'style.scss',
'inc/woocommerce/css/bookings.css': 'inc/woocommerce/css/bookings.scss',
'inc/woocommerce/css/brands.css': 'inc/woocommerce/css/brands.scss',
'inc/woocommerce/css/wishlists.css': 'inc/woocommerce/css/wishlists.scss',
'inc/woocommerce/css/woocommerce.css': 'inc/woocommerce/css/woocommerce.scss',
}]
}
},

// Watch changes for assets.
watch: {
css: {
files: [
'style.scss',
'<%= dirs.wc_css %>/*.scss'
],
tasks: [
'sass',
'cssmin'
]
},
js: {
files: [
// main js
'<%= dirs.js %>/*js',
'!<%= dirs.js %>/*.min.js',

// wc js
'<%= dirs.wc_js %>/*js',
'!<%= dirs.wc_js %>/*.min.js',

// customizer js
'<%= dirs.customizer_js %>/*js',
'!<%= dirs.customizer_js %>/*.min.js'
],
tasks: ['uglify']
}
},

// Generate POT files.
makepot: {
options: {
type: 'wp-theme',
domainPath: 'languages',
potHeaders: {
'report-msgid-bugs-to': 'https://github.com/woothemes/storefront/issues',
'language-team': 'LANGUAGE <EMAIL@ADDRESS>'
},
},
frontend: {
options: {
potFilename: 'storefront.pot',
processPot: function ( pot ) {
pot.headers['project-id-version'];
return pot;
}
}
},
},

// Check textdomain errors.
// @todo
checktextdomain: {
options:{
text_domain: 'storefront',
keywords: [
'__:1,2d',
'_e:1,2d',
'_x:1,2c,3d',
'esc_html__:1,2d',
'esc_html_e:1,2d',
'esc_html_x:1,2c,3d',
'esc_attr__:1,2d',
'esc_attr_e:1,2d',
'esc_attr_x:1,2c,3d',
'_ex:1,2c,3d',
'_n:1,2,4d',
'_nx:1,2,4c,5d',
'_n_noop:1,2,3d',
'_nx_noop:1,2,3c,4d'
]
},
files: {
src: [
'**/*.php', // Include all files
'!node_modules/**' // Exclude node_modules/
],
expand: true
}
},

// Copy files to deploy.
copy: {
deploy: {
src: [
'**',
'!.*',
'!*.md',
'!.*/**',
'.htaccess',
'!Gruntfile.js',
'!sftp-config.json',
'!package.json',
'!node_modules/**',
],
dest: 'deploy',
expand: true,
dot: true
}
},

// Clean the directory.
clean: {
deploy: {
src: [ 'deploy' ]
}
}
});

// Load NPM tasks to be used here
grunt.loadNpmTasks( 'grunt-contrib-jshint' );
grunt.loadNpmTasks( 'grunt-contrib-uglify' );
grunt.loadNpmTasks( 'grunt-contrib-sass' );
grunt.loadNpmTasks( 'grunt-contrib-cssmin' );
grunt.loadNpmTasks( 'grunt-contrib-watch' );
grunt.loadNpmTasks( 'grunt-contrib-copy' );
grunt.loadNpmTasks( 'grunt-contrib-clean' );
grunt.loadNpmTasks( 'grunt-wp-i18n' );
grunt.loadNpmTasks( 'grunt-checktextdomain' );

// Register tasks
grunt.registerTask( 'default', [
'css',
'uglify'
]);

grunt.registerTask( 'css', [
'sass',
'cssmin'
]);

grunt.registerTask( 'dev', [
'default',
'makepot'
]);

grunt.registerTask( 'deploy', [
'clean:deploy',
'copy:deploy'
]);
};
Empty file added cwd
Empty file.
Empty file added dest
Empty file.
2 changes: 1 addition & 1 deletion inc/customizer/js/customizer.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

75 changes: 1 addition & 74 deletions inc/woocommerce/css/bookings.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions inc/woocommerce/css/bookings.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
* Imports
*/
@import 'bourbon';
@import '../../../sass/settings';
@import '../../../sass/mixins';
@import '../../../sass/gridset';
@import '../../../sass/modules/variables';
@import '../../../sass/modules/mixins';
@import '../../../sass/vendor/gridset';

#wc-bookings-booking-form {
border: 0;
Expand Down
Loading

0 comments on commit 67521cf

Please sign in to comment.