forked from woocommerce/storefront
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3f3780a
commit 67521cf
Showing
17 changed files
with
573 additions
and
1,810 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 |
---|---|---|
@@ -1 +1,6 @@ | ||
.sass-cache | ||
# Sass | ||
.sass-cache | ||
|
||
# Grunt | ||
/node_modules/ | ||
/deploy/ |
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,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 | ||
} | ||
} |
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,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' | ||
]); | ||
}; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Oops, something went wrong.