From 700bf0f1f11f40338eb84e4da728a99391c804a9 Mon Sep 17 00:00:00 2001 From: Sumit Gupta Date: Sun, 17 Dec 2017 20:41:55 +0530 Subject: [PATCH] Bugfix/user friendly startup message (#218) * remove dist from repo (#215) * bugfix - make startup message user friendly merged with v2 branch rephrased startup message updated yarn.lock file * small tweaks to formatting --- lib/generators/init-generator.js | 19 +++++++++++++------ package.json | 1 + yarn.lock | 12 ++++++------ 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/lib/generators/init-generator.js b/lib/generators/init-generator.js index 4cbe67e3187..6943e17a305 100644 --- a/lib/generators/init-generator.js +++ b/lib/generators/init-generator.js @@ -2,6 +2,7 @@ const Generator = require("yeoman-generator"); const chalk = require("chalk"); +const logSymbols = require("log-symbols"); const createCommonsChunkPlugin = require("webpack-addons") .createCommonsChunkPlugin; @@ -36,16 +37,22 @@ module.exports = class WebpackGenerator extends Generator { let regExpForStyles; let ExtractUseProps; let outputPath = "dist"; - process.stdout.write( - `\n${chalk.bold("Insecure about some of the questions?")}\n` + "\n" + + logSymbols.info + + chalk.blue(" INFO ") + + "For more information and a detailed description of each question, have a look at " + + chalk.bold.green( + "https://github.com/webpack/webpack-cli/blob/master/INIT.md" + ) + + "\n" ); process.stdout.write( - `\n${chalk.bold.green( - "https://github.com/webpack/webpack-cli/blob/master/INIT.md" - )}\n\n` + logSymbols.info + + chalk.blue(" INFO ") + + "Alternatively, run `webpack-cli --help` for usage info." + + "\n\n" ); - this.configuration.config.webpackOptions.module = { rules: [] }; diff --git a/package.json b/package.json index 6a91aa0bc57..ab06e3114ee 100644 --- a/package.json +++ b/package.json @@ -55,6 +55,7 @@ "listr": "^0.12.0", "loader-utils": "^1.1.0", "lodash": "^4.17.4", + "log-symbols": "2.1.0", "mkdirp": "^0.5.1", "p-each-series": "^1.0.0", "p-lazy": "^1.0.0", diff --git a/yarn.lock b/yarn.lock index a2ae239f44c..74cae5e1003 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3712,18 +3712,18 @@ lodash@^4.11.1, lodash@^4.13.1, lodash@^4.14.0, lodash@^4.15.0, lodash@^4.17.2, version "4.17.4" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" +log-symbols@2.1.0, log-symbols@^2.0.0, log-symbols@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-2.1.0.tgz#f35fa60e278832b538dc4dddcbb478a45d3e3be6" + dependencies: + chalk "^2.0.1" + log-symbols@^1.0.1, log-symbols@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-1.0.2.tgz#376ff7b58ea3086a0f09facc74617eca501e1a18" dependencies: chalk "^1.0.0" -log-symbols@^2.0.0, log-symbols@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-2.1.0.tgz#f35fa60e278832b538dc4dddcbb478a45d3e3be6" - dependencies: - chalk "^2.0.1" - log-update@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/log-update/-/log-update-1.0.2.tgz#19929f64c4093d2d2e7075a1dad8af59c296b8d1"