Skip to content

Conversation

@clydin
Copy link
Member

@clydin clydin commented Jan 14, 2026

The AnalyticsCollector class is made more modular and easier to test by removing its direct dependency on the CommandContext. Instead of accepting the entire context object, the constructor now receives only the specific dependencies it requires: the logger, user ID, and package manager information.
Also removes a circular reference:
packages/angular/cli/src/analytics/analytics-collector.tspackages/angular/cli/src/command-builder/command-module.ts

@clydin clydin added the target: minor This PR is targeted for the next minor release label Jan 14, 2026
…ntext`

The `AnalyticsCollector` class is made more modular and easier to test by removing its direct dependency on the `CommandContext`.

Instead of accepting the entire context object, the constructor now receives only the specific dependencies it requires: the logger, user ID, and package manager information. This improves separation of concerns and simplifies unit testing of the analytics collector.

Also removes a circular reference:
packages/angular/cli/src/analytics/analytics-collector.ts → packages/angular/cli/src/command-builder/command-module.ts
@clydin clydin force-pushed the cli/analytics-context-reduce branch from 33c4bb1 to b299d6c Compare January 14, 2026 16:31
@clydin clydin added the action: review The PR is still awaiting reviews from at least one requested reviewer label Jan 14, 2026
"packages/angular/build/src/tools/esbuild/utils.ts",
"packages/angular/build/src/utils/server-rendering/manifest.ts"
],
[
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

@clydin clydin added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Jan 14, 2026
@clydin clydin merged commit 630584e into angular:main Jan 14, 2026
36 checks passed
@clydin
Copy link
Member Author

clydin commented Jan 14, 2026

This PR was merged into the repository. The changes were merged into the following branches:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker area: @angular/cli target: minor This PR is targeted for the next minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants