UNPKG

generator-jhipster-dotnetcore

Version:

[![NPM version][npm-image]][npm-url] [![Documentation Status](https://readthedocs.org/projects/jhipsternet/badge/?version=latest)](https://jhipsternet.readthedocs.io/en/latest/?badge=latest) [![Generator Build Status][github-actions-generator-image]][gith

193 lines (167 loc) 5.21 kB
import EntityGenerator from 'generator-jhipster/generators/entity'; import command from './command.js'; import prompts from './prompts.js'; export default class extends EntityGenerator { constructor(args, opts, features) { super(args, opts, { ...features, unique: undefined, checkBlueprint: true, }); } async beforeQueue() { await super.beforeQueue(); } get [EntityGenerator.INITIALIZING]() { return this.asInitializingTaskGroup({ async initializingTemplateTask() { this.parseJHipsterArguments(command.arguments); this.parseJHipsterOptions(command.options); }, ...super.initializing, }); } get [EntityGenerator.PROMPTING]() { return this.asPromptingTaskGroup({ ...super.prompting, }); } get [EntityGenerator.CONFIGURING]() { return this.asConfiguringTaskGroup({ ...super.configuring, async configuringTemplateTask() {}, }); } get [EntityGenerator.COMPOSING]() { return this.asComposingTaskGroup({ ...super.composing, async composingTemplateTask() {}, }); } get [EntityGenerator.LOADING]() { return this.asLoadingTaskGroup({ ...super.loading, async loadingTemplateTask() {}, }); } get [EntityGenerator.PREPARING]() { return this.asPreparingTaskGroup({ ...super.preparing, async preparingTemplateTask() {}, }); } get [EntityGenerator.POST_PREPARING]() { return this.asPostPreparingTaskGroup({ /* ask question to user if s/he wants to update entity */ askForUpdate: prompts.askForUpdate, askForFields: prompts.askForFields, askForFieldsToRemove: prompts.askForFieldsToRemove, askForRelationships: prompts.askForRelationships, askForRelationsToRemove: prompts.askForRelationsToRemove, askForTableName: prompts.askForTableName, askForService: prompts.askForService, askForDTO: prompts.askForDTO, // askForFiltering: prompts.askForFiltering, askForPagination: prompts.askForPagination, async composeEntities() { // We need to compose with others entities to update relationships. await this.composeWithJHipster('jhipster:entities', { generatorArgs: this.options.singleEntity ? [this.entityData.name] : [], generatorOptions: { skipDbChangelog: this.options.skipDbChangelog, skipInstall: this.options.skipInstall, }, }); }, }); } get [EntityGenerator.CONFIGURING_EACH_ENTITY]() { return this.asConfiguringEachEntityTaskGroup({ ...super.configuringEachEntity, async configuringEachEntityTemplateTask() {}, }); } get [EntityGenerator.LOADING_ENTITIES]() { return this.asLoadingEntitiesTaskGroup({ ...super.loadingEntities, async loadingEntitiesTemplateTask() {}, }); } get [EntityGenerator.PREPARING_EACH_ENTITY]() { return this.asPreparingEachEntityTaskGroup({ ...super.preparingEachEntity, async preparingEachEntityTemplateTask() {}, }); } get [EntityGenerator.PREPARING_EACH_ENTITY_FIELD]() { return this.asPreparingEachEntityFieldTaskGroup({ ...super.preparingEachEntityField, async preparingEachEntityFieldTemplateTask() {}, }); } get [EntityGenerator.PREPARING_EACH_ENTITY_RELATIONSHIP]() { return this.asPreparingEachEntityRelationshipTaskGroup({ ...super.preparingEachEntityRelationship, async preparingEachEntityRelationshipTemplateTask() {}, }); } get [EntityGenerator.POST_PREPARING_EACH_ENTITY]() { return this.asPostPreparingEachEntityTaskGroup({ ...super.postPreparingEachEntity, async postPreparingEachEntityTemplateTask() {}, }); } get [EntityGenerator.DEFAULT]() { return this.asDefaultTaskGroup({ ...super.default, async defaultTemplateTask() {}, }); } get [EntityGenerator.WRITING]() { return this.asWritingTaskGroup({ ...super.writing, async writingTemplateTask() {}, }); } get [EntityGenerator.WRITING_ENTITIES]() { return this.asWritingEntitiesTaskGroup({ ...super.writingEntities, async writingEntitiesTemplateTask() {}, }); } get [EntityGenerator.POST_WRITING]() { return this.asPostWritingTaskGroup({ ...super.postWriting, }); } get [EntityGenerator.POST_WRITING_ENTITIES]() { return this.asPostWritingEntitiesTaskGroup({ ...super.postWritingEntities, async postWritingEntitiesTemplateTask() {}, }); } get [EntityGenerator.LOADING_TRANSLATIONS]() { return this.asLoadingTranslationsTaskGroup({ ...super.loadingTranslations, async loadingTranslationsTemplateTask() {}, }); } get [EntityGenerator.INSTALL]() { return this.asInstallTaskGroup({ ...super.install, async installTemplateTask() {}, }); } get [EntityGenerator.POST_INSTALL]() { return this.asPostInstallTaskGroup({ ...super.postInstall, async postInstallTemplateTask() {}, }); } get [EntityGenerator.END]() { return this.asEndTaskGroup({ ...super.end, async endTemplateTask() {}, }); } }