From 907a1f76070352beca32dc96780de1eb0fa88a15 Mon Sep 17 00:00:00 2001 From: Even Stensberg Date: Fri, 5 May 2017 14:45:26 +0200 Subject: [PATCH] enhancements: rename write to type and split params to newline --- lib/creator/yeoman/utils/entry.js | 8 ++++---- lib/creator/yeoman/webpack-generator.js | 18 ++++++++++++++---- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/lib/creator/yeoman/utils/entry.js b/lib/creator/yeoman/utils/entry.js index 517f4741e88..cc957837a91 100644 --- a/lib/creator/yeoman/utils/entry.js +++ b/lib/creator/yeoman/utils/entry.js @@ -21,11 +21,11 @@ module.exports = (self, answer) => { } }; - if(answer['entryType'] == 'Multiple') { + if(answer['entryType'] === 'Multiple') { result = self.prompt([ InputValidate( 'multipleEntries', - 'Write the name you want for your modules seperated by comma', + 'Type the name you want for your modules seperated by comma', validate ) ]).then( (multipleEntriesAnswer) => { @@ -34,7 +34,7 @@ module.exports = (self, answer) => { return self.prompt([ InputValidate( 'objectProperties', - 'Write the location of those modules seperated by comma', + 'Type the location of those modules seperated by comma', validateProperties ) ]).then( (objectPropAnswer) => { @@ -54,7 +54,7 @@ module.exports = (self, answer) => { result = self.prompt([ InputValidate( 'singularEntry', - 'Write the location of module you would like to use', + 'Type the location of module you would like to use', validate ) ]).then( (singularAnswer) => `'${singularAnswer['singularEntry']}.js'`); diff --git a/lib/creator/yeoman/webpack-generator.js b/lib/creator/yeoman/webpack-generator.js index 1b8e890231b..b09ba2c83ed 100644 --- a/lib/creator/yeoman/webpack-generator.js +++ b/lib/creator/yeoman/webpack-generator.js @@ -28,8 +28,11 @@ module.exports = class WebpackGenerator extends Generator { this.configuration.config.webpackOptions.module = getDefaultLoaders(); this.configuration.config.webpackOptions.plugins = getDefaultPlugins(); this.prompt([ - RawList('entryType', 'Would you like to bundle a single or multiple javascript modules?', - ['Single', 'Multiple']) + RawList( + 'entryType', + 'Would you like to bundle a single or multiple javascript modules?', + ['Single', 'Multiple'] + ) ]).then( (entryTypeAnswer) => { // Ask different questions for entry points entryQuestions(self, entryTypeAnswer).then(entryOptions => { @@ -38,7 +41,11 @@ module.exports = class WebpackGenerator extends Generator { }).then( () => { this.prompt([ - InputValidate('outputType', 'What folder do you want to put those files in?', validate) + InputValidate( + 'outputType', + 'What folder do you want to put those files in?', + validate + ) ]).then( (outputTypeAnswer) => { if(!this.configuration.config.webpackOptions.entry.length) { this.configuration.config.webpackOptions.output = { @@ -54,7 +61,10 @@ module.exports = class WebpackGenerator extends Generator { }).then( () => { // Ask if the user wants to use extractPlugin this.prompt([ - Input('extractPlugin', 'What\'s the name of your css file? (press enter to skip)') + Input( + 'extractPlugin', + 'What\'s the name of your css file? (press enter to skip)' + ) ]).then( (extractAnswer) => { if(extractAnswer['extractPlugin'].length !== 0) { this.configuration.config.webpackOptions.plugins.push(