Splits a Service Bag into focused services. All AST work goes through the
PublicApi of the transform context.
Classifies the class with api.analysis.responsibilityClassifier (the
same classification architecture:service-bag reports).
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.
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.
Keeps delegations, uncertain methods and guests in the original service.
Creates one focused service file per group (<Key>Service, kebab-case
file name next to the original).
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.
Splits a Service Bag into focused services. All AST work goes through the
PublicApiof the transform context.api.analysis.responsibilityClassifier(the same classificationarchitecture:service-bagreports).assignments(method name to group key, under the@angular-modernizer/plugin-angularkey of the config) for a method of the class.<Key>Service, kebab-case file name next to the original).Existing focused service files and constructor parameters are detected, so repeated runs do not duplicate them.
Example