From a7d1579d6c9463016ab9313574772aa2959363f8 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Wed, 31 Dec 2025 16:59:55 +0900 Subject: feat(crdt): add client-side CRDT migration script MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add one-time migration script to convert existing local IndexedDB entities to Automerge CRDT documents. Includes: - Migration with idempotency check (runs only once) - Batch processing option for large datasets - Progress callback for UI feedback - Unit tests for migration logic 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- src/client/sync/crdt/index.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/client/sync/crdt/index.ts') diff --git a/src/client/sync/crdt/index.ts b/src/client/sync/crdt/index.ts index 4a3d600..2256260 100644 --- a/src/client/sync/crdt/index.ts +++ b/src/client/sync/crdt/index.ts @@ -47,7 +47,18 @@ export { saveIncremental, updateDocument, } from "./document-manager"; - +// Migration utilities +export { + clearAllCrdtState, + getMigrationStatus, + isMigrationCompleted, + MIGRATION_VERSION, + type MigrationProgress, + type MigrationResult, + resetMigration, + runMigration, + runMigrationWithBatching, +} from "./migration"; // CRDT-aware repository wrappers export { type CrdtDocumentResult, @@ -66,7 +77,6 @@ export { getRepositoryForDocumentId, mergeAndConvert, } from "./repositories"; - // Sync state management export { base64ToBinary, @@ -80,7 +90,6 @@ export { entriesToSyncPayload, syncPayloadToEntries, } from "./sync-state"; - // Type definitions export { type CrdtCardDocument, -- cgit v1.2.3-70-g09d2