Skip to content

Conversation

erikhfj
Copy link
Member

@erikhfj erikhfj commented Sep 5, 2026

Summary

Closes #4 — the data-layer foundation:

  • src/types.ts: Book domain type + OpenLibrary search response types (OpenLibrarySearchDoc, OpenLibrarySearchResponse, CoverSize)
  • src/api/openLibrary.ts: searchBooksBySubject() (field-filtered search.json request, limit 10), coverUrl() helper, defensive normalization (?? []/?? null for missing fields)
  • src/api/openLibrary.test.ts: 5 unit tests with stubbed fetch (no network) — normalization defaults, request params (subject/limit/fields), error handling, cover URLs
  • ROADMAP status refresh

Notes for reviewers

Checklist

  • npm run lint — 0 warnings
  • npm test — 8 passed (3 App + 5 API client)
  • npm run build — passes
  • npm run format:check — passes

AI-assisted: implementation generated with AI assistance, reviewed and verified.

- src/types.ts: Book domain type and OpenLibrary search response types
- src/api/openLibrary.ts: searchBooksBySubject with field-filtered
  requests, coverUrl helper, normalization with defensive defaults
- src/api/openLibrary.test.ts: unit tests with stubbed fetch (no network)
  covering normalization, request params, error handling, cover urls

Closes #4
@erikhfj erikhfj requested a review from a team as a code owner September 5, 2026 20:10
@erikhfj erikhfj added this to the M1 — Setup milestone Sep 5, 2026
@erikhfj erikhfj added type: feature New functionality or requirement area: api OpenLibrary REST API and TanStack Query priority: high Required for first delivery ai-assisted Substantial AI-generated code (documented per spec) status: in-review PR is open and awaiting review labels Sep 5, 2026
@erikhfj erikhfj requested review from rachelks and robertky September 5, 2026 20:10
Copy link
Member

@robertky robertky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! The API layer is cleanly structured, handles missing fields safely, and has solid test coverage. Approved.

@robertky robertky merged commit dfac525 into main Sep 6, 2026
1 check failed
Sign in to join this conversation on GitHub.
Labels
ai-assisted Substantial AI-generated code (documented per spec) area: api OpenLibrary REST API and TanStack Query priority: high Required for first delivery status: in-review PR is open and awaiting review type: feature New functionality or requirement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: Add TypeScript types and OpenLibrary API client
2 participants