Maintinance to standardize some code structure and conventions #5

Merged
lentil merged 28 commits from chore/major-cleanup into main 2025-07-08 14:18:59 -05:00
Owner

Overview

This MR represents a significant cleanup and refactoring effort, focusing on improving code organization, test structure, and documentation. The changes touch multiple areas of the codebase with a particular emphasis on the custom resolvers system and test infrastructure.

Key Changes

1. Code Organization & Structure

  • Reorganized test files into logical directories (unit/, integration/, e2e/, performance/)
  • Moved and refactored custom resolvers into a more modular plugin architecture
  • Created dedicated directories for documentation and planning artifacts

2. New Features & Enhancements

  • Implemented JSON AST functionality for better delta analysis
  • Enhanced plugin system with inter-plugin dependency support
  • Added new built-in resolver plugins:
    • Concatenation
    • First Write Wins
    • Last Write Wins
    • Majority Vote
    • Max/Min
    • Running Average

3. Refactoring & Improvements

  • Replaced NegationHelper.createNegation with DeltaBuilder.negate
  • Improved relationship graph implementation
  • Optimized lossless view resolution
  • Enhanced resolver dependency handling and logging
  • Added comprehensive test coverage for new and refactored components

4. Documentation

  • Added extensive documentation for custom resolvers API
  • Created documentation for delta patterns and schema validation
  • Added test helper documentation
  • Organized planning documents in __plans__/ directory

5. Build & Tooling

  • Added module alias @src for better import paths
  • Removed unused scripts and logs
  • Updated package dependencies

Testing

  • Added numerous unit tests for new functionality
  • Reorganized test files for better maintainability
  • Added performance test cases
  • Ensured backward compatibility through comprehensive test coverage

Migration Notes

  • Some test files have been moved to new locations
  • Custom resolvers now use the new plugin architecture
  • Dependencies between resolvers should now be handled through the new dependency system
## Overview This MR represents a significant cleanup and refactoring effort, focusing on improving code organization, test structure, and documentation. The changes touch multiple areas of the codebase with a particular emphasis on the custom resolvers system and test infrastructure. ## Key Changes ### 1. Code Organization & Structure - Reorganized test files into logical directories (`unit/`, `integration/`, `e2e/`, `performance/`) - Moved and refactored custom resolvers into a more modular plugin architecture - Created dedicated directories for documentation and planning artifacts ### 2. New Features & Enhancements - Implemented JSON AST functionality for better delta analysis - Enhanced plugin system with inter-plugin dependency support - Added new built-in resolver plugins: - Concatenation - First Write Wins - Last Write Wins - Majority Vote - Max/Min - Running Average ### 3. Refactoring & Improvements - Replaced `NegationHelper.createNegation` with `DeltaBuilder.negate` - Improved relationship graph implementation - Optimized lossless view resolution - Enhanced resolver dependency handling and logging - Added comprehensive test coverage for new and refactored components ### 4. Documentation - Added extensive documentation for custom resolvers API - Created documentation for delta patterns and schema validation - Added test helper documentation - Organized planning documents in `__plans__/` directory ### 5. Build & Tooling - Added module alias `@src` for better import paths - Removed unused scripts and logs - Updated package dependencies ## Testing - Added numerous unit tests for new functionality - Reorganized test files for better maintainability - Added performance test cases - Ensured backward compatibility through comprehensive test coverage ## Migration Notes - Some test files have been moved to new locations - Custom resolvers now use the new plugin architecture - Dependencies between resolvers should now be handled through the new dependency system
lentil added 27 commits 2025-07-08 14:10:34 -05:00
- Remove NegationHelper.createNegation in favor of using DeltaBuilder's fluent API
- Update all test cases to use createDelta().negate().buildV1() pattern
- Update documentation to reflect the preferred way to create negation deltas
- Remove unused isNegationDeltaById helper method
- Implement RelationshipGraphResolver extending Lossy
- Add type-safe accumulator for relationship graph state
- Update tests and documentation
- Update ResolverPlugin interface to include context in update and resolve methods
- Modify CustomResolver to pass entity state and resolved values to plugins
- Update built-in plugins to accept and use the new context parameter
- Add comprehensive test for inter-plugin communication
- Add documentation for the new view composition patterns

This change enables plugins to access each other's states during both update and resolve phases, allowing for more powerful and flexible resolver compositions.
- Update ResolverPlugin interface with allStates parameter
- Modify CustomResolver to pass all plugin states
- Update built-in plugins for compatibility
- Add comprehensive tests for inter-plugin dependencies
- Add detailed documentation with examples
- Added  property to ResolverPlugin interface
- Implemented topological sorting for plugin execution order
- Added circular dependency detection
- Updated built-in plugins with dependency declarations
- Added comprehensive tests for plugin dependencies
- Updated documentation with examples and best practices
Core Changes:
- Completely rewrote CustomResolver reducer with dependency-ordered processing
- Enhanced plugin initialization with proper dependency injection
- Improved delta processing and property value tracking
- Added robust error handling for duplicate property IDs

Resolver Improvements:
- Updated to use new accumulator structure
- Implemented execution order processing for plugins
- Enhanced debug logging and error reporting
- Simplified TimestampResolver by removing unused initializer

Configuration Updates:
- Added TypeScript path aliases for test helpers
- Improved module resolution paths

Key Benefits:
- More robust plugin dependency management
- More efficient state updates
- Enhanced type safety
- Better error messages and debugging
- More consistent plugin initialization

This refactoring focuses on improving the robustness of the resolver,
especially around plugin lifecycle management and dependency handling.
The changes ensure better separation of concerns and more predictable
behavior when dealing with complex plugin dependencies.
- Optimize pointer handling and entity reference tracking in Lossless view
- Improve type safety with proper TypeScript types
- Add debug logging for better troubleshooting
- Clean up imports and unused variables
- Update test cases for DeltaBuilder
- Fixed AggregationResolver to properly accumulate values for sum/average/count operations
- Enhanced CustomResolver with detailed debug logging for dependency resolution
- Added execution order logging for better debugging
- Improved error messages and graph visualization in dependency resolution
- Moved valueFromCollapsedDelta to lossless.ts for better code organization
lentil added 1 commit 2025-07-08 14:13:14 -05:00
lentil merged commit 95ccc4942c into main 2025-07-08 14:18:59 -05:00
lentil deleted branch chore/major-cleanup 2025-07-08 14:18:59 -05:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: lentil/rhizome-node#5
No description provided.