Skip to content

feat: implement cover#8

Merged
mehdiasadli merged 4 commits into
mainfrom
feat/covers
Feb 11, 2026
Merged

feat: implement cover#8
mehdiasadli merged 4 commits into
mainfrom
feat/covers

Conversation

@mehdiasadli
Copy link
Copy Markdown
Contributor

@mehdiasadli mehdiasadli commented Feb 11, 2026

Description

Add the covers module for building image urls of authors and books

Closes #

Type of Change

  • Bug fix
  • New feature
  • Enhancement (refactor, performance, DX improvement)
  • Documentation
  • Breaking change

What Changed

  • src/schemas/cover-schema.ts – Added cover schema for cover key type, size and resource
  • src/modules/cover.module.ts – Added cover module and url builder
  • src/client.ts – Wired covers module to client
  • __tests__ populated with newly added features

Summary by CodeRabbit

  • New Features

    • Added cover module with fluent URL builder for generating author and book cover image URLs
    • Support for multiple identifier types: ISBN, OCLC, LCCN, OLID, and default ID
    • Configurable cover image sizes: small, medium, and large
  • Tests

    • Added comprehensive test suite for cover module functionality

@mehdiasadli mehdiasadli merged commit f2ca495 into main Feb 11, 2026
4 checks passed
@mehdiasadli mehdiasadli deleted the feat/covers branch February 11, 2026 12:07
@github-actions github-actions Bot mentioned this pull request Feb 11, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Feb 11, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

This PR introduces a new Cover module with a fluent URL builder API for constructing Open Library cover image URLs. The module supports different key types (isbn, oclc, lccn, olid, id), sizes (S, M, L), and resources (author, book). The feature is integrated into the main OpenLibrary client with corresponding type exports and comprehensive test coverage.

Changes

Cohort / File(s) Summary
Cover Module Implementation
src/modules/cover.module.ts, src/schemas/cover-schema.ts
Introduces CoverModule and UrlBuilder classes with fluent API for building Open Library cover image URLs. Defines Zod schemas for cover key types (isbn, oclc, lccn, olid, id), sizes (S, M, L), and resources (author, book).
API Integration
src/client.ts, src/index.ts
Exposes new covers property on OpenLibrary class; updates public exports to include UrlBuilder and cover-related types while removing createOpenLibraryClient export.
Test Suite
__tests__/modules/cover.module.test.ts
Comprehensive test coverage for CoverModule creation, author/book URL builders, key type changes, size variations, and UrlBuilder chaining behavior.
Release Configuration
.changeset/loose-donuts-count.md
Declares minor version bump for @asmelabs/olib with description of new cover module feature.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A cover so fine, for each book and each author,
Built fluent and smooth, just as builders ought-er,
With sizes and types in an elegant chain,
The URLs flow forth like fresh carrots and grain! 📚✨

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/covers

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant