Skip to content

4.2.0

Choose a tag to compare

@GregOnNet GregOnNet released this 18 Sep 17:49
· 13 commits to main since this release

Breaking

  • Package is now pure ESM ("type": "module" in package.json). Internal
    imports use .js-suffixed paths and tsconfig.json targets ES2023 with
    nodenext module resolution. Anything require()-ing bookmonkey-api or its
    internals from CommonJS needs to switch to import.
  • createdAt / updatedAt are now required, server-managed fields on every
    book.
    They're set on POST and refreshed on PUT / PATCH; any
    createdAt / updatedAt sent by the client is ignored. Every book response
    now carries two additional fields that weren't there before.
  • book.price is of type number

Added

  • GET /books/:isbn/exists – lightweight existence check, responds with
    { isbn, exists }. Registered ahead of GET /books/:isbn so exists isn't
    swallowed as an ISBN.
  • predecessorIsbn / successorIsbn on the book schema: the ISBN of the
    previous / next volume in the same series, or null for standalone titles and
    at the ends of a series. Follow them with GET /books/:isbn. The fields are
    accepted on POST / PUT / PATCH and appear in the OpenAPI schema.
  • ?_devError=true on every /books endpoint (GET /books,
    GET /books/:isbn, GET /books/:isbn/exists, POST, PUT, PATCH,
    DELETE) forces a 400 response, for practicing client-side error handling
    in workshops.

Infrastructure

  • Test suite migrated from Jest to Vitest (vitest.config.ts /
    vitest.config.e2e.ts), replacing jest.config.js / test/jest-e2e.json.
    npm test / npm run test:e2e now run under Vitest; added test:watch and
    test:cov scripts.
  • Linting switched from ESLint to oxlint (oxlint.json); eslint.config.mjs
    and its dependencies are gone.

Changed

  • Seed data replaced. The 250 technical books are gone; the shipped seed now
    holds 50 well-known fiction and non-fiction titles – Harry Potter, The Lord
    of the Rings, The Hunger Games, The Wheel of Time, A Song of Ice and Fire,
    Mistborn, His Dark Materials and more, plus standalones such as The Willpower
    Instinct
    and How to Win Friends and Influence People. All cover images under
    covers/<isbn>.png were swapped accordingly. Seed prices are now currency: "EUR".

Fixed

  • POST /dev/reset's Swagger summary is now in English (previously it was
    German-only).