diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-12-31 16:59:55 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-12-31 16:59:55 +0900 |
| commit | a7d1579d6c9463016ab9313574772aa2959363f8 (patch) | |
| tree | 8697fc207226da948bb5ca002bbf7c71cdbe6f15 /src/client/sync/crdt/index.ts | |
| parent | 29aed156d0ec252c3ce49c5c68183aaa6d45a531 (diff) | |
| download | kioku-a7d1579d6c9463016ab9313574772aa2959363f8.tar.gz kioku-a7d1579d6c9463016ab9313574772aa2959363f8.tar.zst kioku-a7d1579d6c9463016ab9313574772aa2959363f8.zip | |
feat(crdt): add client-side CRDT migration script
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 <noreply@anthropic.com>
Diffstat (limited to 'src/client/sync/crdt/index.ts')
| -rw-r--r-- | src/client/sync/crdt/index.ts | 15 |
1 files changed, 12 insertions, 3 deletions
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, |
