Skip to content

Commit 67d5a10

Browse files
committed
feat: add prompt for init command
1 parent 6204cea commit 67d5a10

File tree

2 files changed

+64
-0
lines changed

2 files changed

+64
-0
lines changed

src/prompts/PromptInit.ts

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
import type { PromptObject } from 'prompts';
2+
3+
export const PromptInit = [
4+
{
5+
type: 'select',
6+
name: 'configFormat',
7+
message: 'What format do you want your config file to be in?',
8+
choices: [
9+
{ title: 'JSON', value: 'json' },
10+
{ title: 'YAML', value: 'yml' }
11+
]
12+
},
13+
{
14+
type: 'select',
15+
name: 'projectLanguage',
16+
message: 'Choose the language used in your project',
17+
choices: [
18+
{ title: 'TypeScript', value: 'ts' },
19+
{ title: 'JavaScript', value: 'js' }
20+
]
21+
},
22+
{
23+
type: 'text',
24+
name: 'base',
25+
message: 'Your base directory',
26+
initial: 'src'
27+
},
28+
{
29+
type: 'text',
30+
name: 'commands',
31+
message: 'Where do you store your commands? (do not include the base)',
32+
initial: 'commands'
33+
},
34+
{
35+
type: 'text',
36+
name: 'listeners',
37+
message: 'Where do you store your listeners? (do not include the base)',
38+
initial: 'listeners'
39+
},
40+
{
41+
type: 'text',
42+
name: 'arguments',
43+
message: 'Where do you store your arguments? (do not include the base)',
44+
initial: 'arguments'
45+
},
46+
{
47+
type: 'text',
48+
name: 'preconditions',
49+
message: 'Where do you store your preconditions? (do not include the base)',
50+
initial: 'preconditions'
51+
},
52+
{
53+
type: 'confirm',
54+
name: 'cftEnabled',
55+
message: 'Do you want to enable custom file templates?'
56+
},
57+
{
58+
type: (prev) => (prev ? 'text' : null),
59+
name: 'cftLocation',
60+
message: 'Where do you store your custom file templates?',
61+
initial: 'templates'
62+
}
63+
] as PromptObject<any>[];

src/prompts/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
export * from '#prompts/PromptNew';
2+
export * from '#prompts/PromptInit';

0 commit comments

Comments
 (0)