Skip to content

Commit

Permalink
move languages compose to composeComponent
Browse files Browse the repository at this point in the history
  • Loading branch information
mshima committed May 13, 2024
1 parent f2d5b26 commit f1d66fb
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 11 deletions.
14 changes: 7 additions & 7 deletions generators/app/generator.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,13 +187,13 @@ describe(`generator - ${generator}`, () => {
"cacheProvider",
"enableHibernateCache",
"serverSideOptions",
"enableTranslation",
"nativeLanguage",
"languages",
"clientFramework",
"clientTestFrameworks",
"withAdminUi",
"clientTheme",
"enableTranslation",
"nativeLanguage",
"languages",
]
`);
});
Expand Down Expand Up @@ -225,14 +225,14 @@ describe(`generator - ${generator}`, () => {
"enableHibernateCache",
"serverSideOptions",
"enableGradleEnterprise",
"enableTranslation",
"nativeLanguage",
"languages",
"clientFramework",
"microfrontend",
"clientTestFrameworks",
"withAdminUi",
"clientTheme",
"enableTranslation",
"nativeLanguage",
"languages",
]
`);
});
Expand Down Expand Up @@ -262,10 +262,10 @@ describe(`generator - ${generator}`, () => {
"databaseType",
"cacheProvider",
"serverSideOptions",
"clientFramework",
"enableTranslation",
"nativeLanguage",
"languages",
"clientFramework",
]
`);
});
Expand Down
18 changes: 14 additions & 4 deletions generators/spring-boot/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ export default class SpringBootGenerator extends BaseApplicationGenerator {
cacheProvider,
skipClient,
clientFramework,
enableTranslation,
testFrameworks,
feignClient,
} = this.jhipsterConfigWithDefaults;
Expand All @@ -181,9 +180,6 @@ export default class SpringBootGenerator extends BaseApplicationGenerator {
await this.composeWithJHipster('jhipster:spring-cloud:gateway');
}

if (enableTranslation) {
await this.composeWithJHipster(GENERATOR_LANGUAGES);
}
if (testFrameworks?.includes(CUCUMBER)) {
await this.composeWithJHipster(GENERATOR_CUCUMBER);
}
Expand Down Expand Up @@ -225,6 +221,20 @@ export default class SpringBootGenerator extends BaseApplicationGenerator {
return this.delegateTasksToBlueprint(() => this.composing);
}

get composingComponent() {
return this.asComposingComponentTaskGroup({
async composeLanguages() {
if (this.jhipsterConfigWithDefaults.enableTranslation) {
await this.composeWithJHipster(GENERATOR_LANGUAGES);
}
},
});
}

get [BaseApplicationGenerator.COMPOSING_COMPONENT]() {
return this.delegateTasksToBlueprint(() => this.composingComponent);
}

get preparing() {
return this.asPreparingTaskGroup({
async loadCommand({ application }) {
Expand Down

0 comments on commit f1d66fb

Please sign in to comment.