< Summary - Envilder CLI

Information
Class: src/envilder/apps/gha/Startup.ts
Assembly: Default
File(s): src/envilder/apps/gha/Startup.ts
Tag: 561_41292037308
Line coverage
91%
Covered lines: 11
Uncovered lines: 1
Coverable lines: 12
Total lines: 53
Line coverage: 91.6%
Branch coverage
50%
Covered branches: 2
Total branches: 4
Branch coverage: 50%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

File(s)

src/envilder/apps/gha/Startup.ts

#LineLine coverage
 1import { Container } from 'inversify';
 2import type { MapFileConfig } from '../../core/domain/MapFileConfig.js';
 3import type { ILogger } from '../../core/domain/ports/ILogger.js';
 4import type { ISecretMasker } from '../../core/domain/ports/ISecretMasker.js';
 5import { GitHubActionsLogger } from '../../core/infrastructure/github/GitHubActionsLogger.js';
 6import { GitHubActionsSecretMasker } from '../../core/infrastructure/github/GitHubActionsSecretMasker.js';
 7import { ConsoleLogger } from '../../core/infrastructure/logger/ConsoleLogger.js';
 8import { TYPES } from '../../core/types.js';
 9import {
 10  configureApplicationServices,
 11  configureInfrastructureServices,
 12} from '../shared/ContainerConfiguration.js';
 13
 14export class Startup {
 15  private readonly container: Container;
 16
 17  constructor() {
 1518    this.container = new Container();
 19  }
 20
 21  static build(): Startup {
 1522    return new Startup();
 23  }
 24
 25  configureServices(): this {
 1526    configureApplicationServices(this.container);
 1527    return this;
 28  }
 29
 30  configureInfrastructure(config?: MapFileConfig): this {
 1531    if (!this.container.isBound(TYPES.ILogger)) {
 1532      this.container
 33        .bind<ILogger>(TYPES.ILogger)
 34        .toConstantValue(new GitHubActionsLogger(new ConsoleLogger()));
 35    }
 1536    if (!this.container.isBound(TYPES.ISecretMasker)) {
 1537      this.container
 38        .bind<ISecretMasker>(TYPES.ISecretMasker)
 39        .to(GitHubActionsSecretMasker)
 40        .inSingletonScope();
 41    }
 1542    configureInfrastructureServices(this.container, config);
 1543    return this;
 44  }
 45
 46  create(): Container {
 1547    return this.container;
 48  }
 49
 50  getServiceProvider(): Container {
 051    return this.container;
 52  }
 53}