Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some Gruntfile fixes #18

Merged
merged 4 commits into from
Aug 4, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,4 @@ See the [contributing docs](https://github.com/yeoman/yeoman/blob/master/contrib

## License

[BSD license](http://opensource.org/licenses/bsd-license.php)
[MIT license](http://opensource.org/licenses/mit-license.php)
1 change: 1 addition & 0 deletions templates/app/main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
require.config({
paths: {
eventemitter: 'bower_components/eventemitter2/lib/eventemitter2',
aura: 'bower_components/aura/lib',
jquery: 'bower_components/jquery/jquery',
underscore: 'bower_components/underscore/underscore'
Expand Down
9 changes: 5 additions & 4 deletions templates/aura_components/main.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
define(['underscore'], function (_) {
'use strict';

return {

initialize: function () {
this.$el.on('click', this.someCoolFeature.bind(this));
this.$el.on('click', _.bind(this.someCoolFeature, this));
this.render();
},

Expand All @@ -12,13 +13,13 @@ define(['underscore'], function (_) {
this.$el.html('Click me: ' + this.$el.html());
},

someCoolFeature: function(){
someCoolFeature: function () {
//Awesome code
var element = this.$el;
element.fadeOut(200, function(){
element.fadeOut(200, function () {
element.fadeIn(200);
});
}
};

});
});
22 changes: 11 additions & 11 deletions templates/common/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,24 +45,24 @@ module.exports = function (grunt) {
requirejs: {
compile: {
options: {
baseUrl: '.',
optimize: 'none',
baseUrl: '<%= yeoman.app %>',
paths: {
aura: 'app/bower_components/aura/lib',
aura: 'bower_components/aura/lib',
jquery: 'empty:',
underscore: 'empty:',
eventemitter: 'app/bower_components/eventemitter2/lib/eventemitter2'
eventemitter: 'bower_components/eventemitter2/lib/eventemitter2'
},
shim: {
underscore: {
exports: '_'
}
},
include: [
'app/main'
modules: [
{name: 'main'}
],
exclude: ['jquery', 'aura/aura'],
out: '<%= yeoman.dist %>/main.js'
dir: '<%= yeoman.dist %>',
fileExclusionRegExp: /^(tests?|spec|Gruntfile\.js)$/,
removeCombined: true
}
}
},
Expand Down Expand Up @@ -92,8 +92,8 @@ module.exports = function (grunt) {
},
files: {
src: [
'app/aura_components/**.js',
'app/extensions/**.js',
'app/aura_components/**/*.js',
'app/extensions/*.js',
'app/main.js',
]
}
Expand Down Expand Up @@ -155,6 +155,6 @@ module.exports = function (grunt) {
// watch-spec allows us to use the spec task within a watch without having
// connect try to launch a server on each cycle (which throws a Fatal error);
grunt.registerTask('watch-spec', ['jshint', 'mocha']);
grunt.registerTask('build', ['clean', 'compass', 'spec', 'copy', 'requirejs']);
grunt.registerTask('build', ['clean', 'compass', 'spec', 'requirejs']);
grunt.registerTask('default', ['compass', 'spec', 'watch']);
};
6 changes: 4 additions & 2 deletions templates/extensions/main.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
define(['underscore'], function (_) {
define(function () {
'use strict';

return {
name: '<%= _.slugify(name) %>',
initialize: function (application) {
// Your brilliant code here!
application.logger.log('Initializing extension: <%= _.slugify(name) %>');
}
};

});
});