From ac35a315789ad9179700cda9e1991566ec6efe3e Mon Sep 17 00:00:00 2001 From: "devid.farinelli@gmail.com" Date: Tue, 23 Apr 2019 19:14:25 +0200 Subject: [PATCH] misc(generators): improve prompts --- packages/generators/utils/entry.ts | 4 ++-- packages/utils/run-prettier.ts | 12 +++++------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/packages/generators/utils/entry.ts b/packages/generators/utils/entry.ts index e9cb3d85587..6feca520301 100644 --- a/packages/generators/utils/entry.ts +++ b/packages/generators/utils/entry.ts @@ -24,7 +24,7 @@ export default function entry(self: CustomGenerator, multiEntries: boolean): Pro .prompt([ InputValidate( "multipleEntries", - "Type the names you want for your modules (entry files) separated by comma", + "How do you want to name your bundles? (separated by comma)", validate, "pageOne, pageTwo", ), @@ -102,7 +102,7 @@ export default function entry(self: CustomGenerator, multiEntries: boolean): Pro self.prompt([ InputValidate( `${entryProp}`, - `What is the location of "${entryProp}"?`, + `Which will be the entry point of "${entryProp}"?`, validate, `src/${entryProp}`, ), diff --git a/packages/utils/run-prettier.ts b/packages/utils/run-prettier.ts index 2b9e7083a8f..bf4980150d9 100644 --- a/packages/utils/run-prettier.ts +++ b/packages/utils/run-prettier.ts @@ -19,19 +19,17 @@ export default function runPrettier(outputPath: string, source: string, cb?: Fun try { prettySource = prettier.format(source, { filepath: outputPath, - parser: "babylon", + parser: "babel", singleQuote: true, tabWidth: 1, useTabs: true, }); } catch (err) { process.stdout.write( - "\n" + - chalk.yellow( - `WARNING: Could not apply prettier to ${outputPath}` + - " due validation error, but the file has been created\n" + - err, - ), + `\n${chalk.yellow( + `WARNING: Could not apply prettier to ${outputPath}` + + " due validation error, but the file has been created\n", + )}`, ); prettySource = source; error = err;