-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
questions.ts
68 lines (61 loc) · 2.06 KB
/
questions.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import { Answers, ListQuestion, Question } from "inquirer";
import { AITools, IPluginOptions } from "./interfaces";
import Separator from "inquirer/lib/objects/separator";
import { questions as openAIQuestions } from "./models/openAI/openai.questions";
import { questions as ollamaQuestions } from "./models/ollama/ollama.questions";
export const qAIChoice: ListQuestion<Answers> = {
when: (answers: IPluginOptions) => answers.aiTool == undefined,
type: "list",
name: "aiTool",
message: "Which AI Tool do you want to use?",
default: AITools.openAI,
choices: Object.keys(AITools),
};
export const qAICompDescription: Question<Answers> = {
when: (answers: IPluginOptions) => answers.compDescription == undefined,
type: "input",
name: "compDescription",
message:
"Please describe the component (please write it on one line, multiline is not supported):",
};
export const qAIStyleLibrary: ListQuestion<Answers> = {
when: (answers: IPluginOptions) => answers.styleLibrary == undefined,
type: "list",
name: "styleLibrary",
message: "Which style library do you want to use?",
choices: ["Chakra UI", "Material UI", new Separator(), "None"],
filter(val: string) {
return val.toLowerCase();
},
};
export const qAITypescript: Question<Answers> = {
when: (answers: IPluginOptions) => answers.isTS == undefined,
type: "confirm",
name: "isTS",
message: "Do you want to use typescript?",
default: true,
};
export const qCreateStorybook: Question<Answers> = {
when: (answers: IPluginOptions) => answers.aiCreateStorybook == undefined,
type: "confirm",
name: "aiCreateStorybook",
message: "Do you want to use storybook?",
default: false,
};
export const qCreateTestFile: Question<Answers> = {
when: (answers: IPluginOptions) => answers.aiCreateTest == undefined,
type: "confirm",
name: "aiCreateTest",
message: "Do you want test file?",
default: false,
};
export const questions: Question[] = [
qAICompDescription,
qAIStyleLibrary,
qAITypescript,
qCreateStorybook,
qCreateTestFile,
qAIChoice,
...openAIQuestions,
...ollamaQuestions,
];