Skip to content

Commit 8e27688

Browse files
author
DimitarTachev
committed
chore: update the interactive create descriptions based on the DevRel feedback.
1 parent 2b5416c commit 8e27688

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

lib/commands/create-project.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,11 @@ export class CreateProjectCommand implements ICommand {
7878
}
7979

8080
private async interactiveFlavorSelection(adverb: string) {
81-
const flavorSelection = await this.$prompter.promptForDetailedChoice(`${adverb}, which flavor would you like to use?`, [
82-
{ key: constants.NgFlavorName, description: "Learn more at https://angular.io/" },
83-
{ key: constants.VueFlavorName, description: "Learn more at https://vuejs.org/" },
84-
{ key: constants.TsFlavorName, description: "Learn more at https://www.typescriptlang.org/" },
85-
{ key: constants.JsFlavorName, description: "Learn more at https://www.javascript.com/" },
81+
const flavorSelection = await this.$prompter.promptForDetailedChoice(`${adverb}, which the style of NativeScript project would you like to use:`, [
82+
{ key: constants.NgFlavorName, description: "Learn more at https://nativescript.org/angular" },
83+
{ key: constants.VueFlavorName, description: "Learn more at https://nativescript.org/vue" },
84+
{ key: constants.TsFlavorName, description: "Learn more at https://nativescript.org/typescript" },
85+
{ key: constants.JsFlavorName, description: "" },
8686
]);
8787
return flavorSelection;
8888
}
@@ -130,7 +130,7 @@ or --js flags.)
130130
const templateChoices = selectedFlavorTemplates.map((template) => {
131131
return { key: template.key, description: template.description };
132132
});
133-
const selectedTemplateKey = await this.$prompter.promptForDetailedChoice(`${adverb}, which template would you like to start from?`, templateChoices);
133+
const selectedTemplateKey = await this.$prompter.promptForDetailedChoice(`${adverb}, which template would you like to start from:`, templateChoices);
134134
selectedTemplate = selectedFlavorTemplates.find(t => t.key === selectedTemplateKey).value;
135135
} else {
136136
selectedTemplate = selectedFlavorTemplates[0].value;

lib/common/prompter.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export class Prompter implements IPrompter {
9393
const longestKeyLength = choices.concat().sort(function (a, b) { return b.key.length - a.key.length; })[0].key.length;
9494
const inquirerChoices = choices.map((choice) => {
9595
return {
96-
name: `${_.padEnd(choice.key, longestKeyLength)} ${this.descriptionSeparator} ${choice.description}`,
96+
name: `${_.padEnd(choice.key, longestKeyLength)} ${choice.description ? this.descriptionSeparator : ""} ${choice.description}`,
9797
short: choice.key
9898
};
9999
});

test/project-commands.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ let createProjectCalledWithForce: boolean;
1313
let validateProjectCallsCount: number;
1414
const dummyArgs = ["dummyArgsString"];
1515
const expectedFlavorChoices = [
16-
{ key: "Angular", description: "Learn more at https://angular.io/" },
17-
{ key: "Vue.js", description: "Learn more at https://vuejs.org/" },
18-
{ key: "Plain TypeScript", description: "Learn more at https://www.typescriptlang.org/" },
19-
{ key: "Plain JavaScript", description: "Learn more at https://www.javascript.com/" }
16+
{ key: "Angular", description: "Learn more at https://nativescript.org/angular" },
17+
{ key: "Vue.js", description: "Learn more at https://nativescript.org/vue" },
18+
{ key: "Plain TypeScript", description: "Learn more at https://nativescript.org/typescript" },
19+
{ key: "Plain JavaScript", description: "" }
2020
];
2121
const expectedTemplateChoices = [
2222
{ key: "Hello World", description: "A Hello World app" },
@@ -85,12 +85,12 @@ describe("Project commands tests", () => {
8585
answers["First, what will be the name of your app?"] = opts.projectNameAnswer;
8686
}
8787
if (opts.flavorAnswer) {
88-
const flavorQuestion = opts.projectNameAnswer ? "Next" : "First" + ", which flavor would you like to use?";
88+
const flavorQuestion = opts.projectNameAnswer ? "Next" : "First" + ", which the style of NativeScript project would you like to use:";
8989
answers[flavorQuestion] = opts.flavorAnswer;
9090
questionChoices[flavorQuestion] = expectedFlavorChoices;
9191
}
9292
if (opts.templateAnswer) {
93-
const templateQuestion = opts.projectNameAnswer ? "Finally" : "Next" + ", which template would you like to start from?";
93+
const templateQuestion = opts.projectNameAnswer ? "Finally" : "Next" + ", which template would you like to start from:";
9494
answers[templateQuestion] = opts.templateAnswer;
9595
questionChoices[templateQuestion] = expectedTemplateChoices;
9696
}

0 commit comments

Comments
 (0)