diff --git a/README.md b/README.md index 328a34a..919deae 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/templates/app/main.js b/templates/app/main.js index aebdbcc..85b05d8 100644 --- a/templates/app/main.js +++ b/templates/app/main.js @@ -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' diff --git a/templates/aura_components/main.js b/templates/aura_components/main.js index f0039e6..2251be3 100644 --- a/templates/aura_components/main.js +++ b/templates/aura_components/main.js @@ -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(); }, @@ -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); }); } }; -}); \ No newline at end of file +}); diff --git a/templates/common/Gruntfile.js b/templates/common/Gruntfile.js index 4772c90..dd7c0f9 100644 --- a/templates/common/Gruntfile.js +++ b/templates/common/Gruntfile.js @@ -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 } } }, @@ -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', ] } @@ -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']); }; diff --git a/templates/extensions/main.js b/templates/extensions/main.js index 9db6890..4d6e41f 100644 --- a/templates/extensions/main.js +++ b/templates/extensions/main.js @@ -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) %>'); } }; -}); \ No newline at end of file +});