UNPKG

@sap/cds-dk

Version:

Command line client and development toolkit for the SAP Cloud Application Programming Model

133 lines (131 loc) 4.53 kB
const path = require('node:path') const cds = require('../../lib/cds') const validate = require('./validate') const { bold } = require('../util/term') const { OPTIONS } = require('./constants') const { NODEJS, JAVA, XSUAA, APPROUTER, CONNECTIVITY, DESTINATION, HTML5_REPO, PORTAL, APPLICATION_LOGGING, AUDIT_LOGGING, NOTIFICATIONS, ENTERPRISE_MESSAGING, KAFKA, REDIS_MESSAGING, HANA, POSTGRES, MTA, HELM, CONTAINERIZE, MULTITENANCY, PIPELINE, TINY_SAMPLE, SAMPLE } = OPTIONS const cwd = process.cwd() module.exports = [{ title: 'Project Name', description: 'Enter your project name.', default: '', target: 'projectName', validate: async projectName => { try { cds.root = path.resolve(cwd, projectName || '.') validate.projectName(projectName) validate.projectFolder(path.join(cwd, projectName), cwd) } catch (e) { return e // BAS Yeoman generator requires error to be returned } return true }, guiOptions: { breadcrumb: 'Project Name', hint: 'This name is restricted to certain characters. A valid project name is compatible across platforms.', mandatory: true } }, { title: 'Type', description: `Select your runtime.`, default: NODEJS, choices: [ { name: 'Node.js', value: NODEJS }, { name: 'Java', value: JAVA } ], multiple: false, target: 'add', guiOptions: { breadcrumb: 'Runtime', hint: `The preferred runtime can't be changed afterwards. To use a different runtime, create a new project.`, mandatory: true } }, { title: 'Databases', description: 'Choose a database for your application.', default: '', choices: [ { name: 'SAP HANA Cloud', value: HANA }, { name: 'PostgreSQL', value: POSTGRES } ], multiple: true, target: 'add', guiOptions: { breadcrumb: 'Databases', hint: `Choose any combination of features enriching the capabilities of your project. You can also add features later with ${bold('cds add')}` } }, { title: 'Deployment', description: 'Choose which way to deploy your project.', default: '', choices: [ { name: 'Cloud Foundry: MTA Deployment', value: MTA }, { name: 'Kyma: Helm Deployment', value: HELM }, { name: 'Kyma: Containerization using ctz CLI', value: CONTAINERIZE }, { name: 'Multitenancy', value: MULTITENANCY }, { name: 'CI/CD Pipeline Integration', value: PIPELINE } ], multiple: true, target: 'add', guiOptions: { breadcrumb: 'Deployment', hint: `Choose any combination of features enriching the capabilities of your project. You can also add features later with ${bold('cds add')}` } }, { title: 'Runtime Features', description: 'Choose productive runtime capabilities for your application.', default: '', choices: [ { name: 'SAP BTP Authorization and Trust Management Service (XSUAA)', value: XSUAA }, { name: 'SAP BTP Application Router', value: APPROUTER }, { name: 'SAP BTP Connectivity Service', value: CONNECTIVITY }, { name: 'SAP BTP Destination Service', value: DESTINATION }, { name: 'SAP BTP HTML5 Application Repository', value: HTML5_REPO }, { name: 'SAP BTP Portal Service', value: PORTAL }, { name: 'SAP BTP Application Logging Service', value: APPLICATION_LOGGING }, { name: 'SAP BTP Audit Logging Service', value: AUDIT_LOGGING }, { name: 'SAP BTP Notification Service', value: NOTIFICATIONS } ], multiple: true, target: 'add', guiOptions: { breadcrumb: 'Runtime Features', hint: `Choose any combination of features enriching the capabilities of your project. You can also add features later with ${bold('cds add')}` } }, { title: 'Messaging', description: 'Choose messaging capabilities for your application.', default: '', choices: [ { name: 'SAP BTP Event Mesh', value: ENTERPRISE_MESSAGING }, { name: 'Apache Kafka', value: KAFKA }, { name: 'Redis', value: REDIS_MESSAGING } ], multiple: true, target: 'add', guiOptions: { breadcrumb: 'Messaging', hint: `Choose any combination of features enriching the capabilities of your project. You can also add features later with ${bold('cds add')}` } }, { title: 'Samples', description: `Add sample content to your project.`, default: '', choices: [ { name: 'Minimal Sample', value: TINY_SAMPLE }, { name: 'Extended Sample with UI', value: SAMPLE } ], multiple: true, target: 'add', guiOptions: { breadcrumb: 'Samples', hint: 'Speed up your ramp-up phase with sample files in your project.' } }]