diff --git a/lib/commands/create-project.ts b/lib/commands/create-project.ts index 30360996ff..50c02b67fe 100644 --- a/lib/commands/create-project.ts +++ b/lib/commands/create-project.ts @@ -78,11 +78,11 @@ export class CreateProjectCommand implements ICommand { } private async interactiveFlavorSelection(adverb: string) { - const flavorSelection = await this.$prompter.promptForDetailedChoice(`${adverb}, which flavor would you like to use?`, [ - { key: constants.NgFlavorName, description: "Learn more at https://angular.io/" }, - { key: constants.VueFlavorName, description: "Learn more at https://vuejs.org/" }, - { key: constants.TsFlavorName, description: "Learn more at https://www.typescriptlang.org/" }, - { key: constants.JsFlavorName, description: "Learn more at https://www.javascript.com/" }, + const flavorSelection = await this.$prompter.promptForDetailedChoice(`${adverb}, which style of NativeScript project would you like to use:`, [ + { key: constants.NgFlavorName, description: "Learn more at https://nativescript.org/angular" }, + { key: constants.VueFlavorName, description: "Learn more at https://nativescript.org/vue" }, + { key: constants.TsFlavorName, description: "Learn more at https://nativescript.org/typescript" }, + { key: constants.JsFlavorName, description: "Use NativeScript without any framework" }, ]); return flavorSelection; } @@ -130,7 +130,7 @@ or --js flags.) const templateChoices = selectedFlavorTemplates.map((template) => { return { key: template.key, description: template.description }; }); - const selectedTemplateKey = await this.$prompter.promptForDetailedChoice(`${adverb}, which template would you like to start from?`, templateChoices); + const selectedTemplateKey = await this.$prompter.promptForDetailedChoice(`${adverb}, which template would you like to start from:`, templateChoices); selectedTemplate = selectedFlavorTemplates.find(t => t.key === selectedTemplateKey).value; } else { selectedTemplate = selectedFlavorTemplates[0].value; diff --git a/lib/common/prompter.ts b/lib/common/prompter.ts index 5f5d24b3b8..0a712f4b49 100644 --- a/lib/common/prompter.ts +++ b/lib/common/prompter.ts @@ -93,7 +93,7 @@ export class Prompter implements IPrompter { const longestKeyLength = choices.concat().sort(function (a, b) { return b.key.length - a.key.length; })[0].key.length; const inquirerChoices = choices.map((choice) => { return { - name: `${_.padEnd(choice.key, longestKeyLength)} ${this.descriptionSeparator} ${choice.description}`, + name: `${_.padEnd(choice.key, longestKeyLength)} ${choice.description ? this.descriptionSeparator : ""} ${choice.description}`, short: choice.key }; }); diff --git a/test/project-commands.ts b/test/project-commands.ts index ec136e2fc9..034c6c8207 100644 --- a/test/project-commands.ts +++ b/test/project-commands.ts @@ -13,10 +13,10 @@ let createProjectCalledWithForce: boolean; let validateProjectCallsCount: number; const dummyArgs = ["dummyArgsString"]; const expectedFlavorChoices = [ - { key: "Angular", description: "Learn more at https://angular.io/" }, - { key: "Vue.js", description: "Learn more at https://vuejs.org/" }, - { key: "Plain TypeScript", description: "Learn more at https://www.typescriptlang.org/" }, - { key: "Plain JavaScript", description: "Learn more at https://www.javascript.com/" } + { key: "Angular", description: "Learn more at https://nativescript.org/angular" }, + { key: "Vue.js", description: "Learn more at https://nativescript.org/vue" }, + { key: "Plain TypeScript", description: "Learn more at https://nativescript.org/typescript" }, + { key: "Plain JavaScript", description: "Use NativeScript without any framework" } ]; const expectedTemplateChoices = [ { key: "Hello World", description: "A Hello World app" }, @@ -85,12 +85,12 @@ describe("Project commands tests", () => { answers["First, what will be the name of your app?"] = opts.projectNameAnswer; } if (opts.flavorAnswer) { - const flavorQuestion = opts.projectNameAnswer ? "Next" : "First" + ", which flavor would you like to use?"; + const flavorQuestion = opts.projectNameAnswer ? "Next" : "First, which style of NativeScript project would you like to use:"; answers[flavorQuestion] = opts.flavorAnswer; questionChoices[flavorQuestion] = expectedFlavorChoices; } if (opts.templateAnswer) { - const templateQuestion = opts.projectNameAnswer ? "Finally" : "Next" + ", which template would you like to start from?"; + const templateQuestion = opts.projectNameAnswer ? "Finally" : "Next, which template would you like to start from:"; answers[templateQuestion] = opts.templateAnswer; questionChoices[templateQuestion] = expectedTemplateChoices; }