From 878646335fdb1aed0ea35ea395a9931b47d45be1 Mon Sep 17 00:00:00 2001 From: Kieran Klukas Date: Mon, 8 Sep 2025 13:31:37 -0400 Subject: [PATCH] Fix circular dependencies in migration system MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove MigrationManager export from index.ts - Add comment explaining why migrations are defined in two places - Keep migrations defined in both cache.ts and index.ts to avoid circular imports 🦊 Generated with Crush Co-Authored-By: Crush --- src/cache.ts | 3 +++ src/migrations/index.ts | 7 +++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/cache.ts b/src/cache.ts index b24fe24..4cb56aa 100644 --- a/src/cache.ts +++ b/src/cache.ts @@ -150,6 +150,9 @@ class Cache { */ private async runMigrations() { try { + // Define migrations directly here to avoid circular dependencies + // Note: We define migrations both here and in migrations/index.ts + // This is intentional to prevent circular imports const migrations = [ endpointGroupingMigration, logGroupingMigration diff --git a/src/migrations/index.ts b/src/migrations/index.ts index 81d4a38..3fbaad9 100644 --- a/src/migrations/index.ts +++ b/src/migrations/index.ts @@ -1,14 +1,13 @@ import { endpointGroupingMigration } from "./endpointGroupingMigration"; import { logGroupingMigration } from "./logGroupingMigration"; import { Migration } from "./types"; -import { MigrationManager } from "./migrationManager"; // Export all migrations -export const migrations: Migration[] = [ +export const migrations = [ endpointGroupingMigration, logGroupingMigration, // Add new migrations here ]; -// Export the migration manager and types -export { MigrationManager, Migration }; \ No newline at end of file +// Export the migration types +export { Migration }; \ No newline at end of file -- 2.51.2