diff --git a/.jshintrc b/.jshintrc index 0918c7458..aa3788f1e 100644 --- a/.jshintrc +++ b/.jshintrc @@ -11,8 +11,5 @@ "noarg": true, "undef": true, "strict": false, - "globalstrict": true, - "trailing": true, - "smarttabs": true, - "node": true + "globalstrict": true } diff --git a/CHANGELOG.md b/CHANGELOG.md index 770cd9a66..ed5eadcac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,51 @@ + +## 0.10.0 (2014-11-07) + + +#### Bug Fixes + +* **build:** + * allow to copy font files from subfolders ([eb5a096e](yeoman/generator-angular/commit/eb5a096e27c7c8a7f00541b97fffe2873bafd462)) + * do not clean git related subfolders of dist ([00673f5e](yeoman/generator-angular/commit/00673f5e4385c106738837899b2b838a27c22499)) +* **gen:** + * replace named function with anonymous ([c82f336b](yeoman/generator-angular/commit/c82f336bbbdc9bcf44beddbd620b471a60f832eb)) + * fix coffee service using wrong name ([3437a270](yeoman/generator-angular/commit/3437a270df349b0fbcd2855a530b208282ca170d)) + + +#### Features + +* **app:** add ngAria and ngMessages ([dfbfd1f4](yeoman/generator-angular/commit/dfbfd1f4feb788608dd71dbd54fced69c5a09fb3), closes [#917](yeoman/generator-angular/issues/917)) + + + +### 0.9.8 (2014-09-08) + + +#### Bug Fixes + +* **wiredep:** remove cwd property ([dbe5d3e5](yeoman/generator-angular/commit/dbe5d3e5d85965ba67e5a47dfc2abb959992791d)) + + + +### 0.9.7 (2014-09-03) + + +#### Bug Fixes + +* **deps:** use latest 1.2.x ng ([45c3eb67](yeoman/generator-angular/commit/45c3eb67b1440956fb2fdaf0d536ff766f13fa0f)) + + + +### 0.9.6 (2014-09-03) + + +#### Bug Fixes + +* **build:** no need to ngAnnotate oldieshim ([ed413a19](yeoman/generator-angular/commit/ed413a19880511f37f2b40c5c94ef0f675796e2f)) +* **deps:** update Angular to v1.2.23 ([8667f1cb](yeoman/generator-angular/commit/8667f1cbb29a1290b39ea67db8957683dce7295e)) +* **oldieshim:** avoid json3 being injected twice ([b421e13b](yeoman/generator-angular/commit/b421e13ba6029eeae3e43cd12b65813464471b5b)) + + ### 0.9.5 (2014-07-13) diff --git a/Gruntfile.js b/Gruntfile.js index 17d32dba9..12a06a4b9 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -30,7 +30,12 @@ module.exports = function (grunt) { bump: false, // we have our own bump file: 'package.json', commitMessage: 'chore(release): Release version <%= version %>', - tagName: 'v<%= version %>' + tagName: 'v<%= version %>', + github: { + repo: 'yeoman/generator-angular', + usernameVar: 'GITHUB_USERNAME', + passwordVar: 'GITHUB_AUTHTOKEN' + } } }, stage: { diff --git a/app/index.js b/app/index.js index b9f1156cb..2095141c9 100644 --- a/app/index.js +++ b/app/index.js @@ -26,7 +26,7 @@ var Generator = module.exports = function Generator(args, options) { if (typeof this.env.options.appPath === 'undefined') { this.option('appPath', { - desc: 'Generate CoffeeScript instead of JavaScript' + desc: 'Allow to choose where to write the files' }); this.env.options.appPath = this.options.appPath; @@ -76,10 +76,18 @@ var Generator = module.exports = function Generator(args, options) { enabledComponents.push('angular-animate/angular-animate.js'); } + if (this.ariaModule) { + enabledComponents.push('angular-aria/angular-aria.js'); + } + if (this.cookiesModule) { enabledComponents.push('angular-cookies/angular-cookies.js'); } + if (this.messagesModule) { + enabledComponents.push('angular-messages/angular-messages.js'); + } + if (this.resourceModule) { enabledComponents.push('angular-resource/angular-resource.js'); } @@ -239,6 +247,10 @@ Generator.prototype.askForModules = function askForModules() { value: 'animateModule', name: 'angular-animate.js', checked: true + }, { + value: 'ariaModule', + name: 'angular-aria.js', + checked: false }, { value: 'cookiesModule', name: 'angular-cookies.js', @@ -247,6 +259,10 @@ Generator.prototype.askForModules = function askForModules() { value: 'resourceModule', name: 'angular-resource.js', checked: true + }, { + value: 'messagesModule', + name: 'angular-messages.js', + checked: false }, { value: 'routeModule', name: 'angular-route.js', @@ -266,7 +282,9 @@ Generator.prototype.askForModules = function askForModules() { this.prompt(prompts, function (props) { var hasMod = function (mod) { return props.modules.indexOf(mod) !== -1; }; this.animateModule = hasMod('animateModule'); + this.ariaModule = hasMod('ariaModule'); this.cookiesModule = hasMod('cookiesModule'); + this.messagesModule = hasMod('messagesModule'); this.resourceModule = hasMod('resourceModule'); this.routeModule = hasMod('routeModule'); this.sanitizeModule = hasMod('sanitizeModule'); @@ -278,10 +296,18 @@ Generator.prototype.askForModules = function askForModules() { angMods.push("'ngAnimate'"); } + if (this.ariaModule) { + angMods.push("'ngAria'"); + } + if (this.cookiesModule) { angMods.push("'ngCookies'"); } + if (this.messagesModule) { + angMods.push("'ngMessages'"); + } + if (this.resourceModule) { angMods.push("'ngResource'"); } diff --git a/package.json b/package.json index 25d39f7e1..788bbc223 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "generator-angular", - "version": "0.9.5", + "version": "0.10.0", "description": "Yeoman generator for AngularJS", "keywords": [ "yeoman-generator", diff --git a/readme.md b/readme.md index 1c3385501..89f85efce 100644 --- a/readme.md +++ b/readme.md @@ -204,30 +204,13 @@ To output JavaScript files, even if CoffeeScript files exist (the default is to ### Minification Safe -**Removed** - -[Related Issue #452](https://github.com/yeoman/generator-angular/issues/452): This option has been removed from the generator. Initially it was needed as ngMin was not entirely stable. As it has matured, the need to keep separate versions of the script templates has led to extra complexity and maintenance of the generator. By removing these extra burdens, new features and bug fixes should be easier to implement. If you are dependent on this option, please take a look at ngMin and seriously consider implementing it in your own code. It will help reduce the amount of typing you have to do (and look through) as well as make your code cleaner to look at. +**tl;dr**: You don't need to write annotated code as the build step will +handle it for you. By default, generators produce unannotated code. Without annotations, AngularJS's DI system will break when minified. Typically, these annotations that make minification safe are added automatically at build-time, after application files are concatenated, but before they are minified. The annotations are important because minified code will rename variables, making it impossible for AngularJS to infer module names based solely on function parameters. -The recommended build process uses `ngmin`, a tool that automatically adds these annotations. However, if you'd rather not use `ngmin`, you have to add these annotations manually yourself. **One thing to note is that `ngmin` does not produce minsafe code for things that are not main level elements like controller, services, providers, etc.: - -```javascript -resolve: { - User: function(myService) { - return MyService(); - } -} -``` - -will need to be manually done like so: -```javascript -resolve: { - User: ['myService', function(myService) { - return MyService(); - }] -} -``` +The recommended build process uses `ng-annotate`, a tool that automatically adds these annotations. However, if you'd rather not use it, you have to add these annotations manually yourself. Why would you do that though? If you find a bug +in the annotated code, please file an issue at [ng-annotate](https://github.com/olov/ng-annotate/issues). ### Add to Index @@ -253,8 +236,10 @@ The following packages are always installed by the [app](#app) generator: The following additional modules are available as components on bower, and installable via `bower install`: +* angular-animate +* angular-aria * angular-cookies -* angular-loader +* angular-messages * angular-resource * angular-sanitize @@ -277,6 +262,11 @@ You can change the `app` directory by adding a `appPath` property to `bower.json ``` This will cause Yeoman-generated client-side files to be placed in `public`. +Note that you can also achieve the same results by adding an `--appPath` option when starting generator: +```bash +yo angular [app-name] --appPath=public +``` + ## Testing Running `grunt test` will run the unit tests with karma. diff --git a/route/index.js b/route/index.js index 4ef2d3e64..c7862c20d 100644 --- a/route/index.js +++ b/route/index.js @@ -8,6 +8,11 @@ var angularUtils = require('../util.js'); var Generator = module.exports = function Generator() { ScriptBase.apply(this, arguments); + this.option('uri', { + desc: 'Allow a custom uri for routing', + type: String, + required: false + }); var bower = require(path.join(process.cwd(), 'bower.json')); var match = require('fs').readFileSync(path.join( diff --git a/templates/coffeescript/service/service.coffee b/templates/coffeescript/service/service.coffee index cdf751209..21bf6cd6f 100644 --- a/templates/coffeescript/service/service.coffee +++ b/templates/coffeescript/service/service.coffee @@ -8,5 +8,5 @@ # Service in the <%= scriptAppName %>. ### angular.module('<%= scriptAppName %>') - .service '<%= classedName %>', -> + .service '<%= cameledName %>', -> # AngularJS will instantiate a singleton by calling "new" on this function diff --git a/templates/common/app/index.html b/templates/common/app/index.html index c23179cdf..cc7c683a8 100644 --- a/templates/common/app/index.html +++ b/templates/common/app/index.html @@ -23,9 +23,9 @@

<%= appname %>

@@ -44,10 +44,10 @@

<%= appname %>