UNPKG

@yeepay/yeepay-cli

Version:

易宝前端脚手架

55 lines (54 loc) 1.57 kB
import Utils from '../lib/utils/utils.js'; const utils = new Utils() export const createProject = { projectName: { type: 'input', name: 'projectName', message: '请输入项目名称', validate(val) { val = val.trim(); if (val) { if (utils.checkFolderExists(val)) { return '该文件夹已存在,请重新输入项目名称'; } if (!utils.checkProjectName(val)) { return '请重新输入项目名称。项目名称仅支持小写字母、数字和连字符,且不能以连字符、数字开头,连字符结尾。'; } return true; } return '项目名称不能为空'; }, }, createGit: { type: 'confirm', name: 'createGit', message: '是否创建git仓库', default: true, }, projectType: { type: 'list', name: 'projectType', message: '请选择项目类型', choices: ['galaxy', 'dashbord', 'h5', 'uniapp', 'web', 'Back...'], filter(val) { return val }, }, galaxyType: { type: 'list', name: 'galaxyType', message: '请选择微前端项目的使用平台', choices: ['vue2', 'vue3', 'Back...'], filter(val) { return val }, }, } export const updateCli = [ { type: 'confirm', name: 'update', message: `是否升级?`, default: true, }, ]