Angular Modernizer
    Preparing search index...

    Splits a Service Bag into focused services. All AST work goes through the PublicApi of the transform context.

    1. Classifies the class with api.analysis.responsibilityClassifier (the same classification architecture:service-bag reports).
    2. Splits only a bag (more than 10 public methods) or when the caller passes assignments (method name to group key, under the @angular-modernizer/plugin-angular key of the config) for a method of the class.
    3. Groups methods: one group per counted backend area when there are several, otherwise one data-access group; one group per counted technical concern (event, ui-dom, file, ...). Assignments override the grouping.
    4. Keeps delegations, uncertain methods and guests in the original service.
    5. Creates one focused service file per group (<Key>Service, kebab-case file name next to the original).
    6. Updates the imports of the original service, injects the focused services via constructor DI and delegates the moved methods to them.

    Existing focused service files and constructor parameters are detected, so repeated runs do not duplicate them.

    const orchestrator = new ServiceBagTransformOrchestrator();
    const context = ContextFactory.createTransformContext({ sourceFile, project, api });
    await orchestrator.run(context);
    Index

    Constructors

    Methods

    Constructors

    Methods

    • Main orchestration method - executes the complete transformation.

      Parameters

      Returns Promise<void>

      Promise that resolves when transformation is complete