Skip to content

Commit

Permalink
feat(gen): add welcome message and dep notice for minsafe
Browse files Browse the repository at this point in the history
Adds a Yeoman welcome message. Add a deprecation notice for the minsafe
option.

Closes #452
  • Loading branch information
eddiemonge committed Dec 7, 2013
1 parent a358c1a commit f0bb8da
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
19 changes: 19 additions & 0 deletions app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,25 @@ var Generator = module.exports = function Generator(args, options) {

util.inherits(Generator, yeoman.generators.Base);

Generator.prototype.welcome = function welcome() {
// welcome message
if (!this.options['skip-welcome-message']) {
console.log(this.yeoman);
console.log(
'Out of the box I include Bootstrap and some AngularJS recommended modules.\n'
);

// Deprecation notice for minsafe
if (this.options.minsafe) {
console.warn(
'\n** The --minsafe flag is being deprecated in 0.7.0 and removed in ' +
'0.8.0. For more information, see ' +
'https://github.com/yeoman/generator-angular#minification-safe. **\n'
);
}
}
};

Generator.prototype.askForBootstrap = function askForBootstrap() {
var cb = this.async();

Expand Down
9 changes: 7 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,15 @@ angular.module('myMod')

A project can mix CoffeScript and JavaScript files.

To output JavaScript files, even if CoffeeScript files exist (the default is to output CoffeeScript files if
the generator finds any in the project), use `--coffee=false`.
To output JavaScript files, even if CoffeeScript files exist (the default is to output CoffeeScript files if the generator finds any in the project), use `--coffee=false`.

### Minification Safe

**Deprecated**

[Related Issue #452](https://github.com/yeoman/generator-angular/issues/452): This option is being removed in future versions of 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.


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. By providing the `--minsafe` option, the code generated will out-of-the-box be ready for minification. The trade-off is between amount of boilerplate, and build process complexity.

#### Example
Expand Down

0 comments on commit f0bb8da

Please sign in to comment.