-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #89 from skyverge/4.0-beta
Howdy 4.0.0
- Loading branch information
Showing
29 changed files
with
813 additions
and
732 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,3 +1,10 @@ | ||
/.settings | ||
/.project | ||
*.zip | ||
.sass-cache* | ||
|
||
# NPM packages used by Grunt.js | ||
/node_modules | ||
|
||
# NPM debug log | ||
npm-debug.log |
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', [ | ||
'coffee', | ||
'uglify', | ||
'sass', | ||
'clean' | ||
] ); | ||
}; |
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,21 @@ | ||
/* jshint node:true */ | ||
module.exports = function( grunt ) { | ||
'use strict'; | ||
|
||
var util = grunt.option( 'util' ); | ||
var _ = require( 'underscore' ); | ||
var config = {}; | ||
|
||
// Delete source map from the CoffeeScript compilation | ||
config.clean = { | ||
options: { | ||
force: true | ||
}, | ||
clean: [ | ||
// Delete map files | ||
'woocommerce/payment-gateway/assets/js/frontend/*.min.js.map' | ||
] | ||
}; | ||
|
||
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,33 @@ | ||
/* jshint node:true */ | ||
module.exports = function( grunt ) { | ||
'use strict'; | ||
|
||
var config = {}; | ||
|
||
// Compile CoffeeScript | ||
config.coffee = { | ||
compile: { | ||
options: { | ||
sourceMap: true | ||
}, | ||
files: [ | ||
{ | ||
expand: true, | ||
cwd: 'woocommerce/payment-gateway/assets/js/admin/', | ||
dest: 'woocommerce/payment-gateway/assets/js/admin/', | ||
src: '*.coffee', | ||
ext: '.min.js' | ||
}, | ||
{ | ||
expand: true, | ||
cwd: 'woocommerce/payment-gateway/assets/js/frontend/', | ||
dest: 'woocommerce/payment-gateway/assets/js/frontend/', | ||
src: '*.coffee', | ||
ext: '.min.js' | ||
} | ||
] | ||
} | ||
}; | ||
|
||
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,34 @@ | ||
/* jshint node:true */ | ||
module.exports = function( grunt ) { | ||
'use strict'; | ||
|
||
var config = {}; | ||
|
||
// Compile all .scss files. | ||
config.sass = { | ||
compile: { | ||
options: { | ||
style: 'compressed', | ||
sourcemap: true | ||
}, | ||
files: [ | ||
{ | ||
expand: true, | ||
cwd: 'woocommerce/payment-gateway/assets/css/admin/', | ||
dest: 'woocommerce/payment-gateway/assets/css/admin/', | ||
src: ['*.scss', '!_*.scss'], | ||
ext: '.min.css' | ||
}, | ||
{ | ||
expand: true, | ||
cwd: 'woocommerce/payment-gateway/assets/css/frontend/', | ||
dest: 'woocommerce/payment-gateway/assets/css/frontend/', | ||
src: ['*.scss', '!_*.scss'], | ||
ext: '.min.css' | ||
} | ||
] | ||
} | ||
}; | ||
|
||
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,23 @@ | ||
/* jshint node:true */ | ||
module.exports = function( grunt ) { | ||
'use strict'; | ||
var config = {}; | ||
|
||
// Add Uglify task with legacy rules | ||
config.uglify = { | ||
uglify: { | ||
options : { | ||
sourceMap: true, | ||
sourceMapIncludeSources: true, | ||
sourceMapIn: 'woocommerce/payment-gateway/assets/js/frontend/sv-wc-payment-gateway-frontend.min.js.map', // input sourcemap from CoffeeScript compilation | ||
sourceMapName: 'woocommerce/payment-gateway/assets/js/frontend/sv-wc-payment-gateway-frontend.min.map' | ||
}, | ||
files : [{ | ||
src: [ 'woocommerce/payment-gateway/assets/js/frontend/sv-wc-payment-gateway-frontend.min.js' ], // uglify JS from CoffeeScript compilation | ||
dest: 'woocommerce/payment-gateway/assets/js/frontend/sv-wc-payment-gateway-frontend.min.js' | ||
}] | ||
} | ||
} | ||
|
||
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": "wc-plugin-framework", | ||
"version": "4.0.0", | ||
"author": "SkyVerge Team", | ||
"homepage": "http://www.skyverge.com", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/skyverge/wc-plugin-framework.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/skyverge/wc-plugin-framework/issues" | ||
}, | ||
"engines": { | ||
"node": ">= 0.10.0" | ||
}, | ||
"devDependencies": { | ||
"grunt": "~0.4.5", | ||
"grunt-newer": "~1.1.1", | ||
"grunt-notify": "~0.4.1", | ||
"grunt-contrib-clean": "~0.6.0", | ||
"grunt-contrib-coffee": "~0.13.0", | ||
"grunt-contrib-uglify": "~0.9.1", | ||
"grunt-contrib-sass": "~0.9.2", | ||
"load-grunt-tasks": "~3.2.0", | ||
"time-grunt": "~1.2.1", | ||
"underscore": "~1.8.3", | ||
"underscore.string": "~3.1.1" | ||
} | ||
} |
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
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
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.