yeoman-generator 5.6.1 → 5.7.1

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.
Files changed (2) hide show
  1. package/lib/index.js +14 -16
  2. package/package.json +5 -5
package/lib/index.js CHANGED
@@ -547,7 +547,7 @@ class Generator extends Base {
547
547
  storageForQuestion[name] = questionStorage;
548
548
  const value = questionStorage.getPath(name);
549
549
  if (value !== undefined) {
550
- question.default = value;
550
+ question.default = (answers) => answers[name];
551
551
  return [name, value];
552
552
  }
553
553
  }
@@ -566,20 +566,14 @@ class Generator extends Base {
566
566
  }
567
567
  }
568
568
 
569
- // Pre-fill answers with storage values.
570
- const answers = {};
571
-
572
569
  questions = promptSuggestion.prefillQuestions(
573
570
  this._globalConfig,
574
571
  questions
575
572
  );
576
573
  questions = promptSuggestion.prefillQuestions(this.config, questions);
577
- questions
578
- .map(getAnswerFromStorage)
579
- .filter((a) => a)
580
- .forEach(([key, value]) => {
581
- answers[key] = value;
582
- });
574
+ const answers = Object.fromEntries(
575
+ questions.map(getAnswerFromStorage).filter(Boolean)
576
+ );
583
577
 
584
578
  return this.env.adapter.prompt(questions, answers).then((answers) => {
585
579
  Object.entries(storageForQuestion).forEach(([name, questionStorage]) => {
@@ -1111,10 +1105,13 @@ class Generator extends Base {
1111
1105
  resolve();
1112
1106
  })
1113
1107
  .catch((error) => {
1114
- debug(
1115
- `An error occured while running ${namespace}#${methodName}`,
1116
- error
1117
- );
1108
+ const errorMessage = `An error occured while running ${namespace}#${methodName}`;
1109
+ if (this.log.error) {
1110
+ this.log.error(errorMessage);
1111
+ } else {
1112
+ debug(errorMessage);
1113
+ }
1114
+
1118
1115
  if (reject) {
1119
1116
  debug('Rejecting task promise, queue will continue normally');
1120
1117
  reject(error);
@@ -1546,9 +1543,10 @@ this.composeWith({
1546
1543
  *
1547
1544
  * @param {stream.Transform|stream.Transform[]} streams An array of Transform stream
1548
1545
  * or a single one.
1546
+ * @param {any} options Environment.applyTransforms options parameter
1549
1547
  * @return {this} This generator
1550
1548
  */
1551
- queueTransformStream(transformStreams) {
1549
+ queueTransformStream(transformStreams, options) {
1552
1550
  assert(
1553
1551
  transformStreams,
1554
1552
  'expected to receive a transform stream as parameter'
@@ -1556,7 +1554,7 @@ this.composeWith({
1556
1554
 
1557
1555
  this.queueTask({
1558
1556
  method() {
1559
- return this.env.applyTransforms(transformStreams);
1557
+ return this.env.applyTransforms(transformStreams, options);
1560
1558
  },
1561
1559
  taskName: 'transformStream',
1562
1560
  queueName: 'transform'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yeoman-generator",
3
- "version": "5.6.1",
3
+ "version": "5.7.1",
4
4
  "description": "Rails-inspired generator system that provides scaffolding for your apps",
5
5
  "homepage": "http://yeoman.io",
6
6
  "author": "Yeoman",
@@ -26,18 +26,18 @@
26
26
  },
27
27
  "devDependencies": {
28
28
  "coveralls": "^3.0.3",
29
- "inquirer": "^7.3.2",
29
+ "inquirer": "^8.2.4",
30
30
  "jsdoc": "^3.6.7",
31
31
  "mem-fs": "^2.1.0",
32
32
  "mem-fs-editor": "^9.0.0",
33
- "mocha": "^8.0.1",
33
+ "mocha": "^9.2.2",
34
34
  "mockery": "^2.1.0",
35
35
  "nock": "^13.0.2",
36
36
  "nyc": "^15.0.0",
37
37
  "prettier": "^2.0.5",
38
38
  "proxyquire": "^2.1.0",
39
39
  "rimraf": "^3.0.2",
40
- "sinon": "^9.0.2",
40
+ "sinon": "^13.0.2",
41
41
  "through2": "^4.0.2",
42
42
  "tui-jsdoc-template": "^1.2.2",
43
43
  "xo": "^0.38.1",
@@ -64,7 +64,7 @@
64
64
  "chalk": "^4.1.0",
65
65
  "dargs": "^7.0.0",
66
66
  "debug": "^4.1.1",
67
- "execa": "^4.1.0",
67
+ "execa": "^5.1.1",
68
68
  "github-username": "^6.0.0",
69
69
  "lodash": "^4.17.11",
70
70
  "minimist": "^1.2.5",