import BaseApplicationGenerator from '../../../base-application/index.js';
import { clientApplicationTemplatesBlock } from '../../support/index.js';
export default class CommonGenerator extends BaseApplicationGenerator {
    async beforeQueue() {
        if (!this.fromBlueprint) {
            await this.composeWithBlueprints();
        }
        if (!this.delegateToBlueprint) {
            await this.dependsOnBootstrapApplication();
        }
    }
    get writing() {
        return this.asWritingTaskGroup({
            async writing({ application }) {
                await this.writeFiles({
                    blocks: [
                        clientApplicationTemplatesBlock({
                            templates: ['shared/jhipster/problem-details.ts', 'shared/jhipster/headers.ts'],
                        }),
                    ],
                    context: application,
                });
            },
        });
    }
    get [BaseApplicationGenerator.WRITING]() {
        return this.delegateTasksToBlueprint(() => this.writing);
    }
}
