Skip to content

Commit

Permalink
add prettier to monorepository root
Browse files Browse the repository at this point in the history
  • Loading branch information
mshima committed Jul 11, 2024
1 parent 12a76b1 commit 6ef5169
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion generators/workspaces/generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { existsSync } from 'fs';
import { GENERATOR_ANGULAR, GENERATOR_BOOTSTRAP_WORKSPACES, GENERATOR_GIT } from '../generator-list.js';

import BaseWorkspacesGenerator from '../base-workspaces/index.js';
import { packageJson } from '../../lib/index.js';

/**
* Base class for a generator that can be extended through a blueprint.
Expand Down Expand Up @@ -88,7 +89,9 @@ export default class WorkspacesGenerator extends BaseWorkspacesGenerator {
return this.asComposingTaskGroup({
async composeGit() {
if (this.options.monorepository || this.jhipsterConfig.monorepository) {
await this.composeWithJHipster(GENERATOR_GIT);
const generatorOptions = { monorepositoryRoot: true };
await this.composeWithJHipster(GENERATOR_GIT, { generatorOptions });
await this.composeWithJHipster('jhipster:javascript:prettier', { generatorOptions });
}
},
async generateApplications() {
Expand Down Expand Up @@ -187,6 +190,14 @@ export default class WorkspacesGenerator extends BaseWorkspacesGenerator {
},
});
}

if (applications.some(app => app.backendTypeJavaAny)) {
this.packageJson.merge({
devDependencies: {
'prettier-plugin-java': packageJson.dependencies['prettier-plugin-java'],
},
});
}
},
});
}
Expand Down

0 comments on commit 6ef5169

Please sign in to comment.