< Summary - Envilder CLI

Information
Class: src/envilder/apps/gha/Startup.ts
Assembly: Default
File(s): src/envilder/apps/gha/Startup.ts
Tag: 484_34168995013
Line coverage
90%
Covered lines: 9
Uncovered lines: 1
Coverable lines: 10
Total lines: 49
Line coverage: 90%
Branch coverage
50%
Covered branches: 1
Total branches: 2
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 { ISecretMasker } from '../../core/domain/ports/ISecretMasker.js';
 4import { GitHubActionsSecretMasker } from '../../core/infrastructure/github/GitHubActionsSecretMasker.js';
 5import { TYPES } from '../../core/types.js';
 6import {
 7  configureApplicationServices,
 8  configureInfrastructureServices,
 9  type InfrastructureOptions,
 10} from '../shared/ContainerConfiguration.js';
 11
 12export class Startup {
 13  private readonly container: Container;
 14
 15  constructor() {
 1516    this.container = new Container();
 17  }
 18
 19  static build(): Startup {
 1520    return new Startup();
 21  }
 22
 23  configureServices(): this {
 1524    configureApplicationServices(this.container);
 1525    return this;
 26  }
 27
 28  configureInfrastructure(
 29    config?: MapFileConfig,
 30    options?: InfrastructureOptions,
 31  ): this {
 1532    if (!this.container.isBound(TYPES.ISecretMasker)) {
 1533      this.container
 34        .bind<ISecretMasker>(TYPES.ISecretMasker)
 35        .to(GitHubActionsSecretMasker)
 36        .inSingletonScope();
 37    }
 1538    configureInfrastructureServices(this.container, config, options);
 1539    return this;
 40  }
 41
 42  create(): Container {
 1543    return this.container;
 44  }
 45
 46  getServiceProvider(): Container {
 047    return this.container;
 48  }
 49}