feat: create highlight manager with IndexedDB storage

Implemented TDD approach for highlight persistence:
- Created IndexedDB store with 'highlights' object store
- Added indexes for syncStatus and verseId for efficient queries
- Implemented CRUD operations: add, update, get, getAll, delete
- Added query methods: getHighlightsByVerse, getPendingHighlights
- Full test coverage with fake-indexeddb mock
- Added structuredClone polyfill for test environment

Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-12 06:57:30 +00:00
parent 0e2167ade7
commit 90208808a2
5 changed files with 5207 additions and 25 deletions

View File

@@ -10,6 +10,8 @@
"build:prod": "NODE_OPTIONS='--max-old-space-size=8192' NODE_ENV=production next build",
"start": "next start -p 3010 -H 0.0.0.0",
"lint": "next lint",
"test": "jest",
"test:watch": "jest --watch",
"import-bible": "tsx scripts/import-bible.ts",
"db:migrate": "npx prisma migrate deploy",
"db:generate": "npx prisma generate",
@@ -98,10 +100,17 @@
"zustand": "^5.0.8"
},
"devDependencies": {
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.0",
"@types/bcryptjs": "^2.4.6",
"@types/jest": "^30.0.0",
"@types/jsonwebtoken": "^9.0.10",
"@types/nodemailer": "^7.0.2",
"fake-indexeddb": "^6.2.5",
"ignore-loader": "^0.1.2",
"jest": "^30.2.0",
"jest-environment-jsdom": "^30.2.0",
"ts-jest": "^29.4.5",
"tsx": "^4.20.5"
}
}