Feature: add new /kindle-sync command#15
Feature: add new /kindle-sync command#15theryananderson wants to merge 9 commits intoheyitsnoah:mainfrom
Conversation
|
@claude review please |
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
|
@theryananderson think we could do TS instead of JS? |
Yes absolutely! I wrote it originally as a standalone app in TS and then I think the AI ported it to JS when I was moving it into Claudesidian because the rest of the repo looked like it was JS. But that should be an easy enough update. |
|
@heyitsnoah alright, typesafe version for you to review! |
heyitsnoah
left a comment
There was a problem hiding this comment.
Great feature! Did a YAGNI/KISS review and found a few pieces of unused code that can be removed:
1. Dead logic in sync.ts:266
const needsScraping = force || all || specificBooks || !allThis is always true (if all is false, !all is true). Suggest simplifying to just run the auth check unconditionally:
const hasAuth = await checkAuthExists()
if (!hasAuth) {
console.log('⚠️ No authentication found.\n')
await runAuth()
}2. Unused FileSystemError class in lib/errors.ts:36-43
Defined but never instantiated anywhere. Can be deleted.
3. Unused validateBookExport function in lib/validation.ts:84-96
Only parseBookExports is used. This function can be deleted.
4. Unused extractBookId function in lib/utils.ts:27-42
ASIN is extracted directly from DOM element IDs in the scraper. This function is never called.
5. Unused config properties in lib/config.ts
In ScrapingConfig, only rateLimitBaseDelay and rateLimitJitter are used. These can be removed:
maxLazyLoadRoundsmaxStableRoundspageLoadTimeoutscrollBaseDelayscrollDelayIncreasescrollJitter
6. Unused colorAttribute selector in lib/config.ts
The scraper doesn't extract highlight colors. This selector can be removed from HighlightSelectors.
These are all minor cleanups (~64 lines). The feature itself works great! 🎉
|
@heyitsnoah dead code cleaned up and logic simplified. I also cleaned out the 3 merge conflicts (2 small things and one set of package updates). |
Adds a complete Kindle highlights sync system that automatically scrapes highlights from read.amazon.com/notebookand saves them as formatted Markdown notes in the user's vault. The integration includes smart authentication, caching, and an interactive Claude Code command for syncing.
Key features: