Skip to content

Conversation

@Karnaukhov-kh
Copy link
Member

@Karnaukhov-kh Karnaukhov-kh commented Nov 17, 2025

This pull request refactors and improves the design system violation reporting tools in the Angular MCP server package. The main focus is on providing more structured, machine-readable output for violation reports, improving type safety, and making the output easier to consume programmatically. It also clarifies documentation and error handling, and removes legacy or redundant code.

image image

Key improvements and changes:

1. Structured, machine-readable output for violation reports

  • Both report-violations (single component) and report-all-violations (all components) tools now return structured JSON objects instead of plain text arrays, making them easier to consume by other tools or scripts. [1] [2] [3] [4]

2. Type and interface updates for violation reporting

  • Replaced legacy types with new, more descriptive interfaces such as ViolationEntry, ComponentViolationReport, AllViolationsEntry, AllViolationsComponentReport, and others, to better represent the new output structure. [1] [2]
  • Updated imports and exports in related files to use the new types. [1] [2]

3. Improved violation message parsing and processing

  • Added helper functions to extract violation class names and replacement suggestions from audit messages, with caching for performance. [1] [2]
  • Centralized and unified the audit processing logic to reduce code duplication between grouping modes. [1] [2]

4. Enhanced documentation and schema descriptions

  • Improved descriptions for directory and componentName fields in schemas to clarify their intent and usage.
  • Updated command descriptions to reflect the new output and usage patterns. [1] [2]

5. Error handling and code cleanup

  • Changed error handling for optional files (like llms.txt) and design system component scanning to silently ignore errors instead of logging them, reducing console noise. [1] [2]
  • Removed unused imports and legacy code from several files for clarity and maintainability. [1] [2]

These changes make the violation reporting tools more robust, easier to integrate with other systems, and more user-friendly for both CLI and programmatic use.


References:

@Karnaukhov-kh Karnaukhov-kh merged commit 2fe0087 into main Nov 17, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants