-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
prompt.ts
38 lines (32 loc) · 1.05 KB
/
prompt.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
/* eslint-disable unused-imports/no-unused-vars */
import { consolji } from './utils'
async function main() {
const name = await consolji.prompt('What is your name?', {
placeholder: 'Not sure',
initial: 'java',
})
const confirmed = await consolji.prompt('Do you want to continue?', {
type: 'confirm',
})
const projectType = await consolji.prompt('Pick a project type.', {
type: 'select',
options: [
'TypeScript',
'TypeScript',
{ label: 'CoffeeScript', value: 'CoffeeScript', hint: 'oh no' },
],
})
const tools = await consolji.prompt('Select additional tools.', {
type: 'multiselect',
required: false,
options: [
{ value: 'eslint', label: 'ESLint', hint: 'recommended' },
{ value: 'prettier', label: 'Prettier' },
{ value: 'gh-action', label: 'GitHub Action' },
],
})
await consolji.start('Creating project...')
await new Promise(resolve => setTimeout(resolve, 1000))
await consolji.success('Project created!')
}
main()