Skip to content

Conversation

@anantham
Copy link
Owner

Summary\nDecomposes the monolithic services/epubService.ts into focused modules, while keeping the existing services/epub/* export pipeline intact.\n\n## Root Cause (why this shape)\nThe repo already has an EPUB export pipeline under services/epub/* with its own services/epub/types.ts. The initial decomposition work accidentally overwrote that types contract, breaking the pipeline + its tests.\n\n## Changes\n- services/epubService.ts: thin orchestrator, re-exports same public API (types + helpers + generateEpub)\n- services/epubService/**: extracted sanitizers/generators/data/packagers/templates + dedicated types.ts\n- services/epub/types.ts: restored (pipeline types remain the source of truth for services/epub/*)\n- docs/WORKLOG.md: logged the refactor\n\n## Testing\n- npx tsc --noEmit\n- npm test -- --run tests/services/epubService.test.ts tests/epub/*.test.ts\n\n## Notes\nThis PR intentionally isolates the epubService decomposition under services/epubService/ to avoid collisions with the pipeline implementation.

Aditya A P added 4 commits December 22, 2025 09:53
- **Sanitizers**: Extracted XML/XHTML logic to `services/epub/sanitizers/`
- **Generators**: Moved HTML generation to `services/epub/generators/`
- **Data**: Moved collection and stats logic to `services/epub/data/`
- **Packaging**: Moved JSZip logic to `services/epub/packagers/`
- **Orchestrator**: `epubService.ts` is now a thin facade (~120 LOC)
- **Tests**: Verified with existing suite (16 tests passed)
@vercel
Copy link

vercel bot commented Dec 22, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
lexicon-forge Ready Ready Preview, Comment Dec 22, 2025 4:46am

@anantham anantham merged commit 96998c3 into main Dec 22, 2025
3 checks passed
@anantham anantham deleted the refactor/epub-decompose branch December 22, 2025 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants