UNPKG

cloudux-starter-kit

Version:

Starter kit for UX developers in MediaCentral - NPM package

38 lines 1.29 kB
const constants = require('./constants'); const fs = require('fs'); let CHOICES = fs.readdirSync(constants.templatePath); CHOICES = CHOICES.filter(items => items !== '.DS_Store'); const QUESTIONS = [{ name: 'project-choice', type: 'list', message: 'What project template would you like to generate?', choices: CHOICES }, { name: 'project-name', type: 'input', message: 'Project name:', validate: function (input) { if (/^([a-z0-9\-]{1,253})$/gm.test(input)) return true;else if (input.length === 0) return 'Empty input. Please try again.';else return 'A project name should be up to maximum length of 253 characters and consist of lower case alphanumeric characters and -'; } }, { name: 'project-description', type: 'input', message: 'Project description:', validate: function (input) { if (input.length === 0) return 'Empty input. Please try again.';else return true; } }, { name: 'project-hostIp', type: 'input', message: 'Your MediaCentral server host IP (for development): ', validate: function (input) { if (input.length === 0) return 'Empty input. Please try again.';else return true; } }, { name: 'project-hostPort', type: 'input', message: 'Your MediaCentral server host port (optional): ' }]; module.exports = { QUESTIONS };