From e080ca0c6060533dbc55946c43cdaeab884522a6 Mon Sep 17 00:00:00 2001 From: "Steven T. Cramer" Date: Tue, 8 Jul 2025 16:54:13 +0700 Subject: [PATCH 1/3] Add task 032: Migrate from MediatR to TimeWarp.Mediator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Creates comprehensive kanban task for migrating TimeWarp.State from MediatR to TimeWarp.Mediator (a fork of MediatR). Task includes detailed checklist covering package references, namespace updates, service registration, and documentation requirements. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- ...grate-from-MediatR-to-TimeWarp-Mediator.md | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 Kanban/ToDo/032_Migrate-from-MediatR-to-TimeWarp-Mediator.md diff --git a/Kanban/ToDo/032_Migrate-from-MediatR-to-TimeWarp-Mediator.md b/Kanban/ToDo/032_Migrate-from-MediatR-to-TimeWarp-Mediator.md new file mode 100644 index 000000000..835c0a880 --- /dev/null +++ b/Kanban/ToDo/032_Migrate-from-MediatR-to-TimeWarp-Mediator.md @@ -0,0 +1,73 @@ +# Task 032: Migrate from MediatR to TimeWarp.Mediator + +## Description + +- Migrate TimeWarp.State from MediatR to TimeWarp.Mediator (a fork of MediatR) +- Since TimeWarp.Mediator maintains API compatibility with MediatR, this should be primarily package references and namespace updates +- Create migration documentation for both TimeWarp.State users and general MediatR users + +## Requirements + +- Replace MediatR package references with TimeWarp.Mediator in all project files +- Update all namespace imports from MediatR to TimeWarp.Mediator +- Update service registration to use TimeWarp.Mediator methods +- All existing tests must continue to pass +- Create comprehensive migration documentation +- Document any API differences discovered during migration + +## Checklist + +### Design +- [x] Research current MediatR usage across codebase (40+ files identified) +- [ ] Run all tests to ensure baseline functionality before migration +- [ ] Identify TimeWarp.Mediator package version and compatibility +- [ ] Plan migration strategy for minimal disruption + +### Implementation +- [ ] Update package references in 2 .csproj files: + - [ ] Source/TimeWarp.State/TimeWarp.State.csproj + - [ ] Tests/Test.App/Test.App.Contracts/Test.App.Contracts.csproj +- [ ] Update global using statements in 8 GlobalUsings.cs files: + - [ ] Source/TimeWarp.State/GlobalUsings.cs + - [ ] Source/TimeWarp.State.Plus/GlobalUsings.cs + - [ ] Tests/TimeWarp.State.Tests/GlobalUsings.cs + - [ ] Tests/Test.App/Test.App.Contracts/GlobalUsings.cs + - [ ] Tests/Test.App/Test.App.Client/GlobalUsings.cs + - [ ] Tests/Client.Integration.Tests/GlobalUsings.cs + - [ ] Samples/02-ActionTracking/Wasm/Sample02Wasm/GlobalUsings.cs +- [ ] Update service registration in ServiceCollectionExtensions.AddTimeWarpState.cs +- [ ] Verify all MediatR interfaces still work (IRequest, IRequestHandler, IMediator, ISender, IPublisher) +- [ ] Test pipeline behaviors (5 implementations) +- [ ] Test pre/post processors (6 implementations) +- [ ] Test notification handlers (9 implementations) +- [ ] Verify Redux DevTools integration continues to work + +### Documentation +- [ ] Create migration guide for TimeWarp.State users +- [ ] Create general MediatR → TimeWarp.Mediator migration document +- [ ] Update ai-context.md with new dependency information +- [ ] Document any breaking changes or API differences + +### Review +- [ ] Consider Accessibility Implications +- [ ] Consider Monitoring and Alerting Implications +- [ ] Consider Performance Implications (should be minimal/none) +- [ ] Consider Security Implications (should be minimal/none) +- [ ] Code Review + +## Notes + +- TimeWarp.Mediator is a fork of MediatR, so API compatibility should be maintained +- Current MediatR usage includes: + - Core interfaces: IRequest, IRequestHandler, IMediator, ISender, IPublisher + - Pipeline behaviors: 5 implementations for Redux DevTools, state transactions, action tracking + - Pre/post processors: 6 implementations for state initialization, render subscriptions, persistence + - Notifications: 9 handlers for various state management events +- Migration should be primarily mechanical (package + namespace changes) +- Need to create documentation for both internal migration and general MediatR users + +## Implementation Notes + +- Start with package references, then global usings, then service registration +- Test thoroughly at each step to ensure no breaking changes +- Document any unexpected API differences for future reference \ No newline at end of file From 9f9fc67c0abc077eff86fe7d4753eb7cdfa3b0b5 Mon Sep 17 00:00:00 2001 From: "Steven T. Cramer" Date: Tue, 8 Jul 2025 16:59:04 +0700 Subject: [PATCH 2/3] Disable claude-code-review workflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Renamed claude-code-review.yml to claude-code-review.yml.disabled to disable the workflow while preserving the file for future re-enabling. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .../{claude-code-review.yml => claude-code-review.yml.disabled} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{claude-code-review.yml => claude-code-review.yml.disabled} (100%) diff --git a/.github/workflows/claude-code-review.yml b/.github/workflows/claude-code-review.yml.disabled similarity index 100% rename from .github/workflows/claude-code-review.yml rename to .github/workflows/claude-code-review.yml.disabled From 825529049d67e23283f498b4baa4cdbfb3e84095 Mon Sep 17 00:00:00 2001 From: "Steven T. Cramer" Date: Tue, 8 Jul 2025 17:03:13 +0700 Subject: [PATCH 3/3] Update task 032 based on PR review and remove .clinerules MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Enhanced kanban task 032 with specific test commands from PR review - Added Directory.Packages.props update requirement - Added build validation and NuGet package creation steps - Added Claude.md documentation update step - Removed obsolete .clinerules file as it's no longer used 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .clinerules | 256 ------------------ ...grate-from-MediatR-to-TimeWarp-Mediator.md | 8 + 2 files changed, 8 insertions(+), 256 deletions(-) delete mode 100644 .clinerules diff --git a/.clinerules b/.clinerules deleted file mode 100644 index 20122b329..000000000 --- a/.clinerules +++ /dev/null @@ -1,256 +0,0 @@ -AI INSTRUCTION SET: - -CONFIRMATION REQUIREMENT: - -To ensure you understand my prompt, I need a piece of confirmation from you. Before any tool use and after any tool use, I need you to give me a confidence level on a scale of 0 to 10 on the tool use helping with the project. Remember to do this every time you are using a tool. - -USER: -- Name: Steven T. Cramer -- Projects (Author): - - https://github.com/TimeWarpEngineering/timewarp-state - - https://github.com/TimeWarpEngineering/timewarp-architecture - - https://github.com/TimeWarpEngineering/timewarp-fixie - - https://github.com/TimeWarpEngineering/timewarp-options-validation - - https://github.com/TimeWarpEngineering/timewarp-source-generators -- Focus Areas: - - State Management - - Blazor - - Clean Architecture - - Domain-Driven Design - - Test-Driven Development -- Preferred Patterns: - - CQRS -- Language Preferences: - - TypeScript over JavaScript -DEVELOPMENT PROCESS: - -KANBAN STRUCTURE: -- Track work using Kanban tasks -- Folders: - - Kanban/Backlog/ - - Kanban/ToDo/ - - Kanban/InProgress/ - - Kanban/Done/ - -TASK MANAGEMENT: -- Task Template Location: `Kanban\Task-Template.md` -- Task File Format: _.md - ✓ `002_Create-Game-Logic.md` - -COMMIT CONVENTIONS: -- Make git commits between steps -- Format: Task: = - ✓ `Task: 002 = Complete Create Game Logic` - -TASK WORKFLOW: -✓ Example of proper task movement: -```pwsh -git mv Kanban/InProgress/002_Create-Game-Logic.md Kanban/Done/002_Create-Game-Logic.md -git commit -m "Task: 002 = Complete Create Game Logic" -``` - -ENVIRONMENT: - -COMMAND SHELL: -- Format commands for pwsh - -C# CODING RULES: - -INDENTATION: -- Use 2 spaces (no tabs) -- Use LF line endings - -BRACKET ALIGNMENT (Allman Style): -- All bracket types must be on their own line, aligned with the parent construct -- Applies to: { }, < >, ( ), [ ] -- Each opening and closing bracket gets its own line - -✓ Correct indentation: -```csharp -public class Example -{ - private void Method(string param1, string param2) - { - List numbers = new List - [ - 1, - 2, - 3 - ]; - - if (param1 == "test") - { - Dictionary map = new() - { - ["key1"] = 1, - ["key2"] = 2 - }; - - DoSomething - ( - param1, - param2 - ); - } - } -} -``` - -✗ Incorrect indentation: -```csharp -public class Example -{ - private void Method() // Wrong - 4 spaces - { - DoSomething(); - } -} -``` - -NAMING CONVENTIONS: -1. Private Fields - - No underscore prefix - ✓ `private readonly HttpClient httpClient;` - ✗ `private readonly HttpClient _httpClient;` - -2. Scope-based Casing - - Class Scope: PascalCase for all members - ```csharp - private readonly HttpClient HttpClient; // Field - private int RequestCount; // Field - public string UserName { get; set; } // Property - public void HandleRequest() { } // Method - public event EventHandler DataChanged; // Event - ``` - - Method Scope: camelCase for local variables and parameters - ```csharp - public void ProcessData(string inputValue) // Parameter in camelCase - { - int itemCount = 0; // Local variable - string userName = GetUserName(); // Local variable - } - ``` - -LANGUAGE FEATURES: -1. Type Declaration - - Use var only when type is apparent from right side - - ✓ `List list = new(); // Type explicitly declared` - ✓ `var customer = new Customer(); // Type apparent from new` - ✓ `int count = 1 + 2; // Use explicit type for built-in types` - - ✗ `var items = GetItems(); // Type not apparent` - ✗ `var count = 1 + 2; // Don't use var for built-in types` - ✗ `var customer = await GetCustomer(); // Type not apparent` - -2. New Operator - - Use targeted type new - ✓ `HttpClient client = new();` - ✗ `HttpClient client = new HttpClient();` - -3. Namespaces - - Use file-scoped namespaces - ✓ `namespace ExampleNamespace;` - ✗ `namespace ExampleNamespace { ... }` - -4. Using Statements - - Prefer global usings in GlobalUsings.cs - - ✓ Place in GlobalUsings.cs: - ```csharp - global using System; - global using System.Collections.Generic; - ``` - - ✗ Don't place at top of each file: - ```csharp - using System; - using System.Collections.Generic; - ``` - -EXAMPLE CLASS PUTTING IT ALL TOGETHER: - -```csharp -namespace ExampleNamespace; - -public class UserService -{ - private readonly HttpClient HttpClient; - private readonly Dictionary CachedUsers; - private int RequestCount; - - public string UserName { get; set; } - - public UserService - ( - HttpClient httpClient, - Dictionary initialCache - ) - { - HttpClient = httpClient; - CachedUsers = initialCache ?? new Dictionary - { - ["default"] = new UserData - { - Id = "0", - Name = "Default User" - } - }; - } - - public async Task> GetUsersAsync - ( - string[] userIds, - bool useCache - ) - { - List results = new(); - - foreach (string userId in userIds) - { - if (useCache && CachedUsers.TryGetValue(userId, out UserData cachedData)) - { - results.Add(cachedData); - } - else - { - string requestUrl = $"/users/{userId}"; - HttpResponseMessage response = await HttpClient.GetAsync(requestUrl); - - if (response.IsSuccessStatusCode) - { - UserData userData = await response.Content.ReadFromJsonAsync(); - results.Add(userData); - CachedUsers[userId] = userData; - } - } - - RequestCount++; - } - - return results; - } -} - -.NET CONVENTIONS: - -FRAMEWORK: -- Target net8.0 - -PROJECT CONFIGURATION: -- Use Directory.Build.props for shared project properties -- Use Directory.Packages.props for centralized package versioning -- Enable nullable reference types - -SOLUTION MANAGEMENT: -- Never edit .sln file directly - ✓ `dotnet sln add ./src/MyProject/MyProject.csproj` - ✗ Manual .sln file editing - -TOOLING: -- Initialize local tool manifest - ✓ ```pwsh - dotnet new tool-manifest - ``` - Creates: .config/dotnet-tools.json - diff --git a/Kanban/ToDo/032_Migrate-from-MediatR-to-TimeWarp-Mediator.md b/Kanban/ToDo/032_Migrate-from-MediatR-to-TimeWarp-Mediator.md index 835c0a880..9e78b75b2 100644 --- a/Kanban/ToDo/032_Migrate-from-MediatR-to-TimeWarp-Mediator.md +++ b/Kanban/ToDo/032_Migrate-from-MediatR-to-TimeWarp-Mediator.md @@ -20,10 +20,15 @@ ### Design - [x] Research current MediatR usage across codebase (40+ files identified) - [ ] Run all tests to ensure baseline functionality before migration + - [ ] Run ./RunTests.ps1 to verify unit tests pass + - [ ] Run ./RunE2ETests.ps1 to verify end-to-end tests pass + - [ ] Run ./RunTestApp.ps1 to verify test application works + - [ ] Verify architecture tests in TimeWarp.State.Policies still pass - [ ] Identify TimeWarp.Mediator package version and compatibility - [ ] Plan migration strategy for minimal disruption ### Implementation +- [ ] Update Directory.Packages.props with TimeWarp.Mediator version - [ ] Update package references in 2 .csproj files: - [ ] Source/TimeWarp.State/TimeWarp.State.csproj - [ ] Tests/Test.App/Test.App.Contracts/Test.App.Contracts.csproj @@ -41,11 +46,14 @@ - [ ] Test pre/post processors (6 implementations) - [ ] Test notification handlers (9 implementations) - [ ] Verify Redux DevTools integration continues to work +- [ ] Verify all builds pass after package updates +- [ ] Test NuGet package creation with ./BuildNuGets.ps1 ### Documentation - [ ] Create migration guide for TimeWarp.State users - [ ] Create general MediatR → TimeWarp.Mediator migration document - [ ] Update ai-context.md with new dependency information +- [ ] Update Claude.md to reflect new TimeWarp.Mediator dependency - [ ] Document any breaking changes or API differences ### Review