UNPKG

generator-begcode

Version:

Spring Boot + Angular/React/Vue in one handy generator

49 lines (48 loc) 1.92 kB
import BaseApplicationGenerator from '../base-application/index.js'; import { GENERATOR_GIT } from '../generator-list.js'; import { files, readme } from './files.js'; export default class InitGenerator extends BaseApplicationGenerator { generateReadme = true; async beforeQueue() { if (!this.fromBlueprint) { await this.composeWithBlueprints(); } if (!this.delegateToBlueprint) { await this.dependsOnJHipster('begcode:javascript:bootstrap'); } } get composing() { return this.asComposingTaskGroup({ async compose() { await this.composeWithJHipster(GENERATOR_GIT); const generatorOptions = { fromInit: true }; await this.composeWithJHipster('begcode:javascript:prettier', { generatorOptions }); await this.composeWithJHipster('begcode:javascript:husky', { generatorOptions }); await this.composeWithJHipster('begcode:javascript:eslint', { generatorOptions }); }, }); } get [BaseApplicationGenerator.COMPOSING]() { return this.delegateTasksToBlueprint(() => this.composing); } get writing() { return this.asWritingTaskGroup({ cleanup() { if (this.isJhipsterVersionLessThan('7.5.1')) { this.removeFile('.lintstagedrc.js'); } }, async writeFiles({ application }) { await this.writeFiles({ sections: files, context: application }); }, async writeReadme({ application }) { if (this.generateReadme) { await this.writeFiles({ sections: readme, context: application }); } }, }); } get [BaseApplicationGenerator.WRITING]() { return this.delegateTasksToBlueprint(() => this.writing); } }