You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactors the documentation client for improved modularity, maintainability, and testability.
This involves:
- Separating concerns into dedicated modules for documentation scanning, class content parsing, class name resolution, and referenced types extraction.
- Enhancing security validation during documentation scanning.
- Improving performance through caching strategies.
- Providing a clearer and more extensible architecture for future enhancements.
-**DocumentationScanner** (`documentation-scanner.ts`): File discovery and class listing across all SFCC namespaces, scanning Markdown documentation files and building comprehensive class inventories
249
+
-**ClassContentParser** (`class-content-parser.ts`): Markdown parsing and content extraction, processing class documentation to extract methods, properties, constants, and inheritance information
250
+
-**ClassNameResolver** (`class-name-resolver.ts`): Class name normalization and resolution, handling various naming patterns and ensuring consistent class identification across the documentation system
251
+
-**ReferencedTypesExtractor** (`referenced-types-extractor.ts`): Type extraction from documentation content with circular reference protection, identifying SFCC types used in method signatures and class relationships
252
+
241
253
##### **Service Clients** (`clients/`)
242
-
-**DocsClient** (`docs-client.ts`): Processes SFCC documentation and provides search capabilities across all namespaces
254
+
-**DocsClient** (`docs-client.ts`): Main orchestrator for SFCC documentation processing that coordinates specialized modules for documentation scanning, content parsing, class name resolution, and type extraction across all namespaces
243
255
-**LogClient** (`log-client.ts`): Backward compatibility wrapper that re-exports the modular log system
244
256
-**SFRAClient** (`sfra-client.ts`): Provides comprehensive SFRA (Storefront Reference Architecture) documentation access including Server, Request, Response, QueryString, and render module documentation with method and property details
245
257
-**OCAPIClient** (`ocapi-client.ts`): Main OCAPI coordinator that orchestrates specialized clients and provides unified interface
-**Cartridge Generation**: Use `generate_cartridge_structure` tool for automated cartridge creation with direct file generation
436
448
-**Job Log Analysis**: Use job log tools for debugging custom job steps - `get_latest_job_log_files`, `get_job_log_entries`, `search_job_logs`, `search_job_logs_by_name`, `get_job_execution_summary`
437
449
-**Modular Log Development**: Work with individual log modules in `clients/logs/` for specific functionality - modify `log-analyzer.ts` for analysis improvements, `log-formatter.ts` for output changes, or `log-file-reader.ts` for reading optimizations
450
+
-**Modular Documentation Development**: Work with individual documentation modules in `clients/docs/` for specific functionality - modify `documentation-scanner.ts` for file discovery improvements, `class-content-parser.ts` for parsing enhancements, `class-name-resolver.ts` for name resolution logic, or `referenced-types-extractor.ts` for type extraction algorithms
438
451
-**Documentation Verification**: Always verify quantitative information (tool counts, file counts, etc.) using command line tools before updating documentation - use `grep -c`, `find`, `wc -l`, and `awk` commands to get accurate counts rather than estimating or assuming values
439
452
-**CI-Friendly Performance Testing**: When writing performance tests, use lenient timeouts (500ms+) and variation ratios (50x+) to account for GitHub Actions CI environment variability. Prioritize functional validation over strict timing requirements to prevent flaky failures due to infrastructure differences.
440
453
@@ -698,5 +711,19 @@ The comprehensive log client refactoring provides:
698
711
8.**Type Safety**: Comprehensive TypeScript interfaces in `log-types.ts` for all log operations
699
712
9.**Backward Compatibility**: Original API preserved through orchestrator pattern in main `log-client.ts`
700
713
714
+
### 📚 Modular Documentation Architecture Benefits
715
+
716
+
The comprehensive documentation client refactoring provides:
717
+
718
+
1.**Single Responsibility Principle**: Each module has one focused purpose (scanning, parsing, resolving, extracting)
719
+
2.**Improved Maintainability**: Changes to parsing logic don't affect file discovery or type extraction functionality
720
+
3.**Better Testing**: Individual modules can be tested in isolation with targeted test cases and mock data
721
+
4.**Performance Optimization**: File scanning and content parsing isolated for focused improvements and caching strategies
722
+
5.**Extensible Processing**: New content parsing patterns can be added to `class-content-parser.ts` without affecting other components
723
+
6.**Flexible Type Extraction**: Advanced type extraction algorithms in `referenced-types-extractor.ts` with circular reference protection
724
+
7.**Centralized Name Resolution**: All class name normalization logic managed in `class-name-resolver.ts`
725
+
8.**Type Safety**: Comprehensive TypeScript interfaces for all documentation operations
726
+
9.**Backward Compatibility**: Original API preserved through orchestrator pattern in main `docs-client.ts`
727
+
701
728
This MCP server empowers AI agents to provide accurate, real-time assistance for SFCC development workflows, significantly improving developer productivity and code quality
0 commit comments