generator-fedhipster
Version:
Spring Boot + Angular/React in one handy generator
129 lines (122 loc) • 4.88 kB
JavaScript
/**
* Copyright 2013-2019 the original author or authors from the JHipster project.
*
* This file is part of the JHipster project, see https://www.jhipster.tech/
* for more information.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
const chalk = require('chalk');
let customCommands = {};
const indexOfBlueprintArgv = process.argv.indexOf('--blueprint');
if (indexOfBlueprintArgv > -1) {
/* eslint-disable import/no-dynamic-require */
/* eslint-disable global-require */
const blueprint = process.argv[indexOfBlueprintArgv + 1];
try {
customCommands = require(`generator-jhipster-${blueprint}/cli/commands`);
} catch (e) {
const msg = `No custom command found within blueprint: generator-jhipster-${blueprint}`;
/* eslint-disable no-console */
console.info(`${chalk.green.bold('INFO!')} ${msg}`);
}
}
const defaultCommands = {
app: {
default: true,
desc: 'Create a new JHipster application based on the selected options'
},
aws: {
desc: 'Deploy the current application to Amazon Web Services'
},
'aws-containers': {
desc: 'Deploy the current application to Amazon Web Services using ECS'
},
'ci-cd': {
desc: 'Create pipeline scripts for popular Continuous Integration/Continuous Deployment tools'
},
cloudfoundry: {
desc: 'Generate a `deploy/cloudfoundry` folder with a specific manifest.yml to deploy to Cloud Foundry'
},
'docker-compose': {
desc: 'Create all required Docker deployment configuration for the selected applications'
},
entity: {
argument: ['name'],
desc: 'Create a new JHipster entity: JPA entity, Spring server-side components and Angular client-side components'
},
'export-jdl': {
argument: ['jdlFile'],
desc: 'Create a JDL file from the existing entities'
},
gae: {
desc: 'Deploy the current application to Google App Engine'
},
heroku: {
desc: 'Deploy the current application to Heroku'
},
'import-jdl': {
argument: ['jdlFiles...'],
cliOnly: true,
desc: `Create entities from the JDL file passed in argument.
By default everything is run in parallel. If you like to interact with the console use '--interactive' flag.`,
help: `
--skip-install
--interactive
--db
--json-only
--ignore-application
--ignore-deployments
--skip-ui-grouping
Arguments:
jdlFiles
Example:
jhipster import-jdl myfile.jdl
jhipster import-jdl myfile.jdl --interactive
jhipster import-jdl myfile1.jdl myfile2.jdl
`
},
info: {
desc: 'Display information about your current project and system'
},
kubernetes: {
desc: 'Deploy the current application to Kubernetes'
},
'kubernetes-helm': {
alias: 'k8s-helm',
desc: 'Deploy the current application to Kubernetes using Helm package manager'
},
languages: {
argument: ['languages...'],
desc: 'Select languages from a list of available languages. The i18n files will be copied to the /webapp/i18n folder'
},
openshift: {
desc: 'Deploy the current application to OpenShift'
},
'spring-service': {
alias: 'service',
argument: ['name'],
desc: 'Create a new Spring service bean'
},
'spring-controller': {
argument: ['name'],
desc: 'Create a new Spring controller'
},
upgrade: {
desc: 'Upgrade the JHipster version, and upgrade the generated application'
}
};
module.exports = {
...defaultCommands,
...customCommands
};