Skip to content

Commit

Permalink
1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jameskoster committed Jan 27, 2017
1 parent f9d8c05 commit b86e90b
Show file tree
Hide file tree
Showing 17 changed files with 775 additions and 1,534 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Sass
.sass-cache

# Grunt
/node_modules/
/storefront/
npm-debug.log
189 changes: 189 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
/* jshint node:true */
module.exports = function( grunt ) {
'use strict';

grunt.initConfig({

// JavaScript linting with JSHint.
jshint: {
options: {
jshintrc: '.jshintrc'
},
all: [
'Gruntfile.js',
'assets/js/*.js',
'!assets/js/*.min.js'
]
},

// Minify .js files.
uglify: {
options: {
preserveComments: 'some'
},
main: {
files: [{
expand: true,
cwd: 'assets/js/',
src: [
'*.js',
'!*.min.js'
],
dest: 'assets/js/',
ext: '.min.js'
}]
}
},

// Compile all .scss files.
sass: {
dist: {
options: {
require: 'susy',
sourcemap: 'none',
includePaths: require( 'node-bourbon' ).includePaths
},
files: [{
'assets/css/style.css': 'assets/scss/style.scss',
}]
}
},

// Minify all .css files.
cssmin: {
minify: {
expand: true,
cwd: 'assets/css/',
src: ['*.css'],
dest: 'assets/css/',
ext: '.css'
}
},

// Watch changes for assets.
watch: {
css: {
files: [
'assets/scss/*.scss'
],
tasks: [
'sass',
'css'
]
},
js: {
files: [
// Main js
'assets/js/*js',
'assets/js/**/*.js',
'!assets/js/*.min.js'
],
tasks: ['uglify']
}
},

// Generate POT files.
makepot: {
options: {
type: 'wp-plugin',
domainPath: 'languages',
potHeaders: {
'report-msgid-bugs-to': 'https://github.com/jameskoster/woocommerce-cart-tab/issues',
'language-team': 'LANGUAGE <EMAIL@ADDRESS>'
}
},
frontend: {
options: {
potFilename: 'woocommerce-cart-tab.pot',
exclude: [
'woocommerce-cart-tab/.*' // Exclude deploy directory
],
processPot: function( pot ) {
pot.headers['project-id-version'];
return pot;
}
}
}
},

// Check textdomain errors.
checktextdomain: {
options:{
text_domain: 'woocommerce-cart-tab',
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
}
},

// Creates deploy-able plugin
copy: {
deploy: {
src: [
'**',
'!.*',
'!.*/**',
'.htaccess',
'!Gruntfile.js',
'!package.json',
'!node_modules/**',
'!.DS_Store',
'!npm-debug.log'
],
dest: 'woocommerce-cart-tab',
expand: true,
dot: true
}
}
});

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

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

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

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

grunt.registerTask( 'deploy', [
'makepot',
'copy'
]);
};
4 changes: 0 additions & 4 deletions README.md

This file was deleted.

122 changes: 0 additions & 122 deletions assets/css/mixins.less

This file was deleted.

Loading

0 comments on commit b86e90b

Please sign in to comment.