carloscuesta/gitmoji-cli

View on GitHub
src/commands/config/prompts.js

Summary

Maintainability
A
0 mins
Test Coverage
// @flow
import configurationVault from '@utils/configurationVault'
import { CONFIG, EMOJI_COMMIT_FORMATS } from '@constants/configuration'
import guard from './guard'

export default (): Array<Object> => [
  {
    name: CONFIG.AUTO_ADD,
    message: 'Enable automatic "git add ."',
    type: 'confirm',
    default: configurationVault.getAutoAdd()
  },
  {
    name: CONFIG.EMOJI_FORMAT,
    message: 'Select how emojis should be used in commits',
    type: 'list',
    choices: [
      { name: '😄', value: EMOJI_COMMIT_FORMATS.EMOJI },
      { name: ':smile:', value: EMOJI_COMMIT_FORMATS.CODE }
    ],
    default: configurationVault.getEmojiFormat()
  },
  {
    name: CONFIG.SCOPE_PROMPT,
    message: 'Enable scope prompt',
    type: 'confirm',
    default: configurationVault.getScopePrompt()
  },
  {
    name: CONFIG.MESSAGE_PROMPT,
    message: 'Enable message prompt',
    type: 'confirm',
    default: configurationVault.getMessagePrompt()
  },
  {
    name: CONFIG.CAPITALIZE_TITLE,
    message: 'Capitalize title',
    type: 'confirm',
    default: configurationVault.getCapitalizeTitle()
  },
  {
    name: CONFIG.GITMOJIS_URL,
    message: 'Set gitmojis api url',
    type: 'input',
    default: configurationVault.getGitmojisUrl(),
    validate: guard.url
  }
]