Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion generators/base-application/support/prepare-entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export default function prepareEntity(entityWithConfig: BaseApplicationEntity, g

entityWithConfig.useMicroserviceJson = entityWithConfig.useMicroserviceJson || entityWithConfig.microserviceName !== undefined;
entityWithConfig.microserviceAppName = '';
if ((generator.jhipsterConfig as any).applicationType === APPLICATION_TYPE_GATEWAY && entityWithConfig.useMicroserviceJson) {
if (generator.jhipsterConfig.applicationType === APPLICATION_TYPE_GATEWAY && entityWithConfig.useMicroserviceJson) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generator should be BaseApplicationGenerator. It’s the highest level generator that supports entities.

if (!entityWithConfig.microserviceName) {
throw new Error('Microservice name for the entity is not found. Entity cannot be generated!');
}
Expand Down
5 changes: 5 additions & 0 deletions generators/base-core/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,18 @@
import type { BaseFeatures as YeomanFeatures, BaseOptions as YeomanOptions } from 'yeoman-generator';

import type { JHipsterCommandDefinition, JHipsterConfigs } from '../../lib/command/types.ts';
import type { ApplicationType } from '../../lib/core/application-types.ts';
import type { JDLApplicationConfig } from '../../lib/jdl/core/types/parsing.ts';

export type GenericTask<ThisType, Arg1Type> = (this: ThisType, arg1: Arg1Type) => unknown;

export type Config = {
autoCrlf?: boolean;
defaultCommand?: string;
applicationType?: ApplicationType;
clientFramework?: 'angular' | 'react' | 'vue' | 'no';
skipServer?: boolean;
skipClient?: boolean;
};

export type Options = YeomanOptions & {
Expand Down
2 changes: 1 addition & 1 deletion generators/bootstrap/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ export default class BootstrapGenerator extends CommandBaseGenerator<typeof comm
await createPrettierTransform.call(this, {
ignoreErrors,
prettierPackageJson: true,
prettierJava: !(this.jhipsterConfig as any).skipServer,
prettierJava: !this.jhipsterConfig.skipServer,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
prettierJava: !this.jhipsterConfig.skipServer,
// Prettier support is implemented in core bootstrap instead of java:bootstrap to improve parallelism in commit.
// Can be replaced by some form of prettier config injection in commit task.
prettierJava: !this.jhipsterConfig.skipServer,

extensions: this.prettierExtensions.join(','),
prettierOptions: this.prettierOptions,
}),
Expand Down
2 changes: 1 addition & 1 deletion generators/cypress/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export default class CypressGenerator extends BaseApplicationGenerator<CypressEn
await this.prompt(
[
{
when: (this.jhipsterConfig as any).clientFramework === ANGULAR,
when: this.jhipsterConfig.clientFramework === ANGULAR,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe CypressConfig should extend ClientConfig or implement coverage support for others clients.

type: 'confirm',
name: 'cypressCoverage',
message: 'Would you like to generate code coverage for Cypress tests? [Experimental]',
Expand Down
6 changes: 1 addition & 5 deletions generators/java/generators/node/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,7 @@ export default class NodeGenerator extends JavaApplicationGenerator {
this.setFeatures({
customInstallTask: async (preferredPm, defaultInstallTask) => {
const { buildTool } = this.jhipsterConfigWithDefaults;
if (
(preferredPm && preferredPm !== 'npm') ||
(this.jhipsterConfig as any).skipClient ||
(buildTool !== 'gradle' && buildTool !== 'maven')
) {
if ((preferredPm && preferredPm !== 'npm') || this.jhipsterConfig.skipClient || (buildTool !== 'gradle' && buildTool !== 'maven')) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

skyClient may not be relevant anymore.
If java:node is used, wrapper can be safely used.

Suggested change
if ((preferredPm && preferredPm !== 'npm') || this.jhipsterConfig.skipClient || (buildTool !== 'gradle' && buildTool !== 'maven')) {
if ((preferredPm && preferredPm !== 'npm') || (buildTool !== 'gradle' && buildTool !== 'maven')) {

await defaultInstallTask();
return;
}
Expand Down
Loading