Skip to content

Commit

Permalink
Merge pull request #13413 from qmonmert/feature/13412
Browse files Browse the repository at this point in the history
Wrong config for microservices in .yo-rc.json
  • Loading branch information
DanielFran authored Jan 7, 2021
2 parents 6ce5d7e + ec727da commit 49ed810
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
4 changes: 3 additions & 1 deletion generators/generator-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,13 @@ const constants = require('./generator-constants');
const PrivateBase = require('./generator-base-private');
const NeedleApi = require('./needle-api');
const { defaultConfig } = require('./generator-defaults');
const { defaultConfigMicroservice } = require('./generator-defaults');
const { detectLanguage } = require('../utils/language');
const { formatDateForChangelog } = require('../utils/liquibase');
const { calculateDbNameWithLimit, hibernateSnakeCase } = require('../utils/db');
const defaultApplicationOptions = require('../jdl/jhipster/default-application-options');
const databaseTypes = require('../jdl/jhipster/database-types');
const MICROSERVICE = require('../jdl/jhipster/application-types');

const JHIPSTER_CONFIG_DIR = constants.JHIPSTER_CONFIG_DIR;
const MODULES_HOOK_FILE = `${JHIPSTER_CONFIG_DIR}/modules/jhi-hooks.json`;
Expand Down Expand Up @@ -2606,7 +2608,7 @@ templates: ${JSON.stringify(existingTemplates, null, 2)}`;
return { ...defaultAppTypeConfig, ...defaultConfig };
}

setConfigDefaults(defaults = defaultConfig) {
setConfigDefaults(defaults = this.jhipsterConfig.applicationType !== MICROSERVICE ? defaultConfig : defaultConfigMicroservice) {
const jhipsterVersion = packagejs.version;
const baseName = this.getDefaultAppName();
const creationTimestamp = new Date().getTime();
Expand Down
7 changes: 7 additions & 0 deletions generators/generator-defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,12 @@ const defaultConfig = {
...translationDefaultConfig,
};

const defaultConfigMicroservice = {
...appDefaultConfig,
...serverDefaultConfig,
...translationDefaultConfig,
};

const entityDefaultConfig = {
pagination: binaryOptions.DefaultValues[binaryOptions.Options.PAGINATION],
validation: false,
Expand All @@ -134,6 +140,7 @@ module.exports = {
serverDefaultConfig,
clientDefaultConfig,
defaultConfig,
defaultConfigMicroservice,
requiredDefaultConfig,
entityDefaultConfig,
translationDefaultConfig,
Expand Down
1 change: 1 addition & 0 deletions jdl/jhipster/default-application-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ function getConfigForMicroserviceApplication(customOptions = {}) {
delete options[CLIENT_THEME];
delete options[CLIENT_THEME_VARIANT];
delete options[SKIP_SERVER];
delete options[WITH_ADMIN_UI];
if (typeof options[SKIP_USER_MANAGEMENT] !== 'boolean') {
options[SKIP_USER_MANAGEMENT] = true;
}
Expand Down

0 comments on commit 49ed810

Please sign in to comment.