Skip to content
This repository has been archived by the owner on Jan 15, 2019. It is now read-only.

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Jarrod Payne <[email protected]>
  • Loading branch information
paynecodes committed Jun 8, 2014
1 parent a0ab98a commit cfd62e0
Show file tree
Hide file tree
Showing 10 changed files with 72 additions and 55 deletions.
88 changes: 48 additions & 40 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,20 @@ module.exports = function (grunt) {
// Package Config
'pkg': grunt.file.readJSON('package.json'),

'amdClean': function(path) {
var amdclean = module.require('amdclean'),
outputFile = path,
cleanedCode = amdclean.clean({
'filePath': outputFile
});

cleanedCode = cleanedCode.replace(/jquery/g, 'jQuery');
cleanedCode = cleanedCode.replace(/underscore/g, '_');
cleanedCode = cleanedCode.replace(/backbonemarionette/g, 'Marionette');

return cleanedCode;
},

// Project settings
yeoman: {
// Configurable paths
Expand Down Expand Up @@ -90,51 +104,45 @@ module.exports = function (grunt) {
},

requirejs: {
options: {
baseUrl: '<%= yeoman.app %>/scripts',
paths: {
'jquery': '../bower_components/jquery/dist/jquery',
'underscore': '../bower_components/underscore/underscore',
'backbone': '../bower_components/backbone/backbone',
'backbone.marionette': '../bower_components/backbone.marionette/lib/backbone.marionette',
'almond': '../bower_components/almond/almond',
'TweenLite': '../bower_components/gsap/src/uncompressed/TweenLite',
'CSSPlugin': '../bower_components/gsap/src/uncompressed/plugins/CSSPlugin'
},
shim: {
'CSSPlugin': {
exports: 'CSSPlugin',
deps: ['TweenLite']
dist: {
options: {
baseUrl: '<%= yeoman.app %>/scripts',
paths: {
'jquery': '../bower_components/jquery/dist/jquery',
'underscore': '../bower_components/underscore/underscore',
'backbone': '../bower_components/backbone/backbone',
'backbone.marionette': '../bower_components/backbone.marionette/lib/backbone.marionette',
'TweenLite': '../bower_components/gsap/src/uncompressed/TweenLite',
'CSSPlugin': '../bower_components/gsap/src/uncompressed/plugins/CSSPlugin'
},
'TweenLite': {
exports: 'TweenLite'
shim: {
'CSSPlugin': {
exports: 'CSSPlugin',
deps: ['TweenLite']
},
'TweenLite': {
exports: 'TweenLite'
}
},
include: ['MarionetteTransition'],
exclude: ['jquery', 'underscore', 'backbone', 'backbone.marionette', 'TweenLite', 'CSSPlugin'],
out: '<%= yeoman.dist %>/MarionetteTransition.js',
optimize: 'none',
skipModuleInsertion: true,
onModuleBundleComplete: function(data) {
var fs = module.require('fs'),
cleanedCode = grunt.config.get('amdClean')(data.path);

grunt.log.writeln('this is a test');

fs.writeFileSync(data.path, cleanedCode);
}
},
include: ['MarionetteTransition'],
exclude: ['jquery', 'underscore', 'backbone', 'backbone.marionette', 'TweenLite', 'CSSPlugin'],
out: '<%= yeoman.dist %>/MarionetteTransition.js',
optimize: 'none',
skipModuleInsertion: true,
onModuleBundleComplete: function(data) {
var fs = module.require('fs'),
amdclean = module.require('amdclean'),
outputFile = data.path,
cleanedCode = amdclean.clean({
'filePath': outputFile
});

cleanedCode = cleanedCode.replace(/jquery/g, 'jQuery');
cleanedCode = cleanedCode.replace(/underscore/g, '_');
cleanedCode = cleanedCode.replace(/backbonemarionette/g, 'Marionette');

fs.writeFileSync(outputFile, cleanedCode);
}
},
dist: {},
}
},

umd: {
all: {
main: {
src: '<%= yeoman.dist %>/MarionetteTransition.js',
objectToExport: 'MarionetteTransition',
template: 'umd',
Expand Down Expand Up @@ -187,7 +195,7 @@ module.exports = function (grunt) {
'clean:dist',
'copy:amd',
'requirejs:dist',
'umd:all',
'umd:main',
'concat:amd',
'concat:umd',
'uglify:umd',
Expand Down
3 changes: 1 addition & 2 deletions dist/MarionetteTransition.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
}
}(this, function (jQuery, _, Marionette, TweenLite, CSSPlugin) {

/*jshint unused:false */
var animations_horizontalSlideToPosition = function (TweenLite, CSSPlugin) {
var animations_horizontalSlideToPosition = function (TweenLite) {

return function (el, position, options) {
return TweenLite.to(el, options.duration, {
Expand Down
3 changes: 1 addition & 2 deletions dist/amd/animations/horizontalSlideToPosition.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/*jshint unused:false */
define(['TweenLite', 'CSSPlugin'], function(TweenLite, CSSPlugin) {
define(['TweenLite', 'CSSPlugin'], function(TweenLite) {
'use strict';

return function(el, position, options) {
Expand Down
3 changes: 1 addition & 2 deletions dist/amd/animations/opacity.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/*jshint unused:false */
define(['TweenLite', 'CSSPlugin'], function(TweenLite, CSSPlugin) {
define(['TweenLite', 'CSSPlugin'], function(TweenLite) {
'use strict';

return function(el, options) {
Expand Down
3 changes: 1 addition & 2 deletions dist/amd/animations/verticalSlideToPosition.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/*jshint unused:false */
define(['TweenLite', 'CSSPlugin'], function(TweenLite, CSSPlugin) {
define(['TweenLite', 'CSSPlugin'], function(TweenLite) {
'use strict';

return function(el, position, options) {
Expand Down
16 changes: 16 additions & 0 deletions examples/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
GEM
remote: https://rubygems.org/
specs:
chunky_png (1.3.0)
compass (0.12.3)
chunky_png (~> 1.2)
fssm (>= 0.2.7)
sass (= 3.2.14)
fssm (0.2.10)
sass (3.2.14)

PLATFORMS
ruby

DEPENDENCIES
compass
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"dependencies": {},
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-copy": "~0.4.1",
"grunt-contrib-copy": "~0.5.0",
"grunt-contrib-jshint": "~0.7.0",
"grunt-contrib-clean": "~0.5.0",
"grunt-newer": "~0.6.0",
Expand Down
3 changes: 1 addition & 2 deletions src/scripts/animations/horizontalSlideToPosition.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/*jshint unused:false */
define(['TweenLite', 'CSSPlugin'], function(TweenLite, CSSPlugin) {
define(['TweenLite', 'CSSPlugin'], function(TweenLite) {
'use strict';

return function(el, position, options) {
Expand Down
3 changes: 1 addition & 2 deletions src/scripts/animations/opacity.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/*jshint unused:false */
define(['TweenLite', 'CSSPlugin'], function(TweenLite, CSSPlugin) {
define(['TweenLite', 'CSSPlugin'], function(TweenLite) {
'use strict';

return function(el, options) {
Expand Down
3 changes: 1 addition & 2 deletions src/scripts/animations/verticalSlideToPosition.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/*jshint unused:false */
define(['TweenLite', 'CSSPlugin'], function(TweenLite, CSSPlugin) {
define(['TweenLite', 'CSSPlugin'], function(TweenLite) {
'use strict';

return function(el, position, options) {
Expand Down

0 comments on commit cfd62e0

Please sign in to comment.