Skip to content

Commit f0bb8da

Browse files
committed
feat(gen): add welcome message and dep notice for minsafe
Adds a Yeoman welcome message. Add a deprecation notice for the minsafe option. Closes #452
1 parent a358c1a commit f0bb8da

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

Diff for: app/index.js

+19
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,25 @@ var Generator = module.exports = function Generator(args, options) {
104104

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

107+
Generator.prototype.welcome = function welcome() {
108+
// welcome message
109+
if (!this.options['skip-welcome-message']) {
110+
console.log(this.yeoman);
111+
console.log(
112+
'Out of the box I include Bootstrap and some AngularJS recommended modules.\n'
113+
);
114+
115+
// Deprecation notice for minsafe
116+
if (this.options.minsafe) {
117+
console.warn(
118+
'\n** The --minsafe flag is being deprecated in 0.7.0 and removed in ' +
119+
'0.8.0. For more information, see ' +
120+
'https://github.com/yeoman/generator-angular#minification-safe. **\n'
121+
);
122+
}
123+
}
124+
};
125+
107126
Generator.prototype.askForBootstrap = function askForBootstrap() {
108127
var cb = this.async();
109128

Diff for: readme.md

+7-2
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,15 @@ angular.module('myMod')
191191

192192
A project can mix CoffeScript and JavaScript files.
193193

194-
To output JavaScript files, even if CoffeeScript files exist (the default is to output CoffeeScript files if
195-
the generator finds any in the project), use `--coffee=false`.
194+
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`.
196195

197196
### Minification Safe
197+
198+
**Deprecated**
199+
200+
[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.
201+
202+
198203
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.
199204

200205
#### Example

0 commit comments

Comments
 (0)