import { DecoratorDriver } from '../../engine/code-writer/drivers/decorator.driver.js';
import { ImportDriver } from '../../engine/code-writer/drivers/import.driver.js';
import { changeSharedModuleAdapter, declareBackPackageModule, runGraphqlTypes, } from '../package-helpers.js';
export default async function install(ctx) {
    declareBackPackageModule(ctx, 'CommonModule', '@app/modules/common/common.module');
    const sharedModule = ctx.sourceFile('app', 'shared.module.ts');
    changeSharedModuleAdapter(sharedModule, 'providers', 'CoreGetLangsService', 'CommonGetLangsService', '@app/modules/common/lang/application/get/common-get-langs.service', ['CommonGetLangsService']);
    ImportDriver.createImportItems(sharedModule, '@app/modules/common/attachment/application/common-attachments.service', ['CommonAttachmentsService']);
    DecoratorDriver.addModuleDecoratorProperty(sharedModule, 'SharedModule', 'Module', 'providers', 'CommonAttachmentsService');
    DecoratorDriver.addModuleDecoratorProperty(sharedModule, 'SharedModule', 'Module', 'exports', 'CommonAttachmentsService');
    sharedModule.saveSync();
    await runGraphqlTypes(ctx);
}
