yeoman-generator 2.0.1 → 2.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -70,11 +70,11 @@ help.usage = function () {
70
70
  let args = '';
71
71
 
72
72
  if (this._arguments.length > 0) {
73
- args = this._arguments.map(formatArg).join(' ');
73
+ args = this._arguments.map(formatArg).join(' ') + ' ';
74
74
  }
75
75
 
76
76
  name = name.replace(/^yeoman:/, '');
77
- let out = `yo ${name} ${options} ${args}`;
77
+ let out = `yo ${name} ${args}${options}`;
78
78
 
79
79
  if (this.description) {
80
80
  out += '\n\n' + this.description;
@@ -46,6 +46,7 @@ install.runInstall = function (installer, paths, options, spawnOptions) {
46
46
 
47
47
  // Return early if we're skipping installation
48
48
  if (this.options.skipInstall) {
49
+ this.log('Skipping install command: ' + chalk.yellow(installer + ' ' + args.join(' ')));
49
50
  return resolve();
50
51
  }
51
52
 
@@ -53,9 +54,10 @@ install.runInstall = function (installer, paths, options, spawnOptions) {
53
54
  this.emit(`${installer}Install`, paths);
54
55
  this.spawnCommand(installer, args, spawnOptions)
55
56
  .on('error', err => {
56
- console.log(chalk.red('Could not finish installation. \n') +
57
+ this.log(chalk.red('Could not finish installation. \n') +
57
58
  'Please install ' + installer + ' with ' +
58
- chalk.yellow('npm install -g ' + installer) + ' and try again.'
59
+ chalk.yellow('npm install -g ' + installer) + ' and try again. \n' +
60
+ 'If ' + installer + ' is already installed, try running the following command manually: ' + chalk.yellow(installer + ' ' + args.join(' '))
59
61
  );
60
62
  reject(err);
61
63
  done();
@@ -190,7 +192,7 @@ install.npmInstall = function (pkgs, options, spawnOptions) {
190
192
  };
191
193
 
192
194
  /**
193
- * Receives a list of `packages` and an `options` object to install through npm.
195
+ * Receives a list of `packages` and an `options` object to install through yarn.
194
196
  *
195
197
  * The installation will automatically run during the run loop `install` phase.
196
198
  *
package/lib/index.js CHANGED
@@ -90,7 +90,7 @@ class Generator extends EventEmitter {
90
90
  default: false
91
91
  });
92
92
 
93
- // Checks required paramaters
93
+ // Checks required parameters
94
94
  assert(this.options.env, 'You must provide the environment object. Use env#create() to create a new generator.');
95
95
  assert(this.options.resolved, 'You must provide the resolved path value. Use env#create() to create a new generator.');
96
96
  this.env = this.options.env;
@@ -481,7 +481,7 @@ class Generator extends EventEmitter {
481
481
  let generator;
482
482
  options = options || {};
483
483
 
484
- // Pass down the default options so they're correclty mirrored down the chain.
484
+ // Pass down the default options so they're correctly mirrored down the chain.
485
485
  options = _.extend({
486
486
  skipInstall: this.options.skipInstall,
487
487
  'skip-install': this.options.skipInstall,
@@ -115,7 +115,9 @@ promptSuggestion.prefillQuestions = (store, questions) => {
115
115
 
116
116
  const storedValue = promptValues[question.name];
117
117
 
118
- if (storedValue === undefined) {
118
+ if ((storedValue === undefined) || _.isFunction(question.choices)) {
119
+ // Do not override prompt default when question.choices is a function,
120
+ // since can't guarantee that the `storedValue` will even be in the returned choices
119
121
  return question;
120
122
  }
121
123
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yeoman-generator",
3
- "version": "2.0.1",
3
+ "version": "2.0.5",
4
4
  "description": "Rails-inspired generator system that provides scaffolding for your apps",
5
5
  "license": "BSD-2-Clause",
6
6
  "repository": "yeoman/generator",
@@ -14,7 +14,6 @@
14
14
  "pretest": "xo",
15
15
  "test": "nyc mocha",
16
16
  "doc": "jsdoc -c jsdoc.json",
17
- "prepublish": "nsp check",
18
17
  "coverage": "nyc report --reporter=text-lcov | coveralls"
19
18
  },
20
19
  "files": [
@@ -34,46 +33,46 @@
34
33
  "app"
35
34
  ],
36
35
  "dependencies": {
37
- "async": "^2.5.0",
38
- "chalk": "^2.1.0",
36
+ "async": "^2.6.0",
37
+ "chalk": "^2.3.0",
39
38
  "cli-table": "^0.3.1",
40
- "cross-spawn": "^5.1.0",
39
+ "cross-spawn": "^6.0.5",
41
40
  "dargs": "^5.1.0",
42
- "dateformat": "^3.0.2",
41
+ "dateformat": "^3.0.3",
43
42
  "debug": "^3.1.0",
44
43
  "detect-conflict": "^1.0.0",
45
44
  "error": "^7.0.2",
46
45
  "find-up": "^2.1.0",
47
46
  "github-username": "^4.0.0",
48
- "istextorbinary": "^2.1.0",
49
- "lodash": "^4.11.1",
50
- "make-dir": "^1.0.0",
51
- "mem-fs-editor": "^3.0.0",
47
+ "istextorbinary": "^2.2.1",
48
+ "lodash": "^4.17.10",
49
+ "make-dir": "^1.1.0",
50
+ "mem-fs-editor": "^4.0.0",
52
51
  "minimist": "^1.2.0",
53
52
  "pretty-bytes": "^4.0.2",
54
53
  "read-chunk": "^2.1.0",
55
- "read-pkg-up": "^2.0.0",
54
+ "read-pkg-up": "^3.0.0",
56
55
  "rimraf": "^2.6.2",
57
56
  "run-async": "^2.0.0",
58
- "shelljs": "^0.7.8",
57
+ "shelljs": "^0.8.0",
59
58
  "text-table": "^0.2.0",
60
59
  "through2": "^2.0.0",
61
- "yeoman-environment": "^2.0.3"
60
+ "yeoman-environment": "^2.0.5"
62
61
  },
63
62
  "devDependencies": {
64
63
  "coveralls": "^3.0.0",
65
- "inquirer": "^3.3.0",
64
+ "inquirer": "^5.2.0",
66
65
  "jsdoc": "^3.5.5",
67
- "mocha": "^3.5.3",
66
+ "mocha": "^5.1.1",
68
67
  "mockery": "^2.1.0",
69
- "nock": "^9.0.22",
70
- "nsp": "^2.8.1",
71
- "nyc": "^11.2.1",
72
- "proxyquire": "^1.8.0",
73
- "sinon": "^4.0.0",
68
+ "nock": "^9.1.6",
69
+ "nsp": "^3.2.1",
70
+ "nyc": "^11.4.1",
71
+ "proxyquire": "^2.0.1",
72
+ "sinon": "^4.5.0",
74
73
  "tui-jsdoc-template": "^1.2.2",
75
- "xo": "^0.18.1",
76
- "yeoman-assert": "^3.1.0",
74
+ "xo": "^0.20.3",
75
+ "yeoman-assert": "^3.1.1",
77
76
  "yeoman-test": "^1.7.0"
78
77
  },
79
78
  "xo": {