UNPKG

gen-jhipster

Version:

VHipster - Spring Boot + Angular/React/Vue in one handy generator

66 lines (65 loc) 2.31 kB
import { getDBTypeFromDBValue } from "./support/database.js"; const command = { configs: { enableSwaggerCodegen: { description: 'API first development using OpenAPI-generator', cli: { type: Boolean, }, scope: 'storage', }, searchEngine: { description: 'Provide search engine for the application when skipping server side generation', cli: { type: String, }, choices: ['no', 'elasticsearch', 'couchbase'], scope: 'storage', }, skipCheckLengthOfIdentifier: { description: 'Skip check the length of the identifier, only for recent Oracle databases that support 30+ characters metadata', cli: { type: Boolean, }, scope: 'storage', }, skipFakeData: { description: 'Skip generation of fake data for development', cli: { type: Boolean, }, scope: 'storage', }, websocket: { description: 'Provide websocket option for the application when skipping server side generation', cli: { type: String, }, scope: 'storage', }, db: { description: 'Provide DB name for the application when skipping server side generation', cli: { type: String, }, configure: (gen, value) => { if (value) { const databaseType = getDBTypeFromDBValue(value); if (databaseType) { gen.jhipsterConfig.databaseType = databaseType; } else if (!gen.jhipsterConfig.databaseType) { throw new Error(`Could not detect databaseType for database ${value}`); } if (value !== value) { gen.jhipsterConfig.devDatabaseType = value; gen.jhipsterConfig.prodDatabaseType = value; } } }, scope: 'none', }, }, import: ['common', 'spring-boot'], }; export default command;