Skip to content

feat: expose Logger interface for defineApi (rename hooks → logger)#332

Open
mismosmi wants to merge 6 commits into
mainfrom
claude/issue-329-20260523-1304
Open

feat: expose Logger interface for defineApi (rename hooks → logger)#332
mismosmi wants to merge 6 commits into
mainfrom
claude/issue-329-20260523-1304

Conversation

@mismosmi
Copy link
Copy Markdown
Member

Expose a server-side logger for use customization with vite-tapi.

  • Add shared Logger interface (error-only)
  • defineApi accepts logger?: Logger, stored on ApiDefinition
  • Rename hookslogger across server, client, worker
  • Bunny uses api.logger when set, otherwise defaults to console.error
  • Logger type exported from server and client index files

Closes #329

Generated with Claude Code

- Add shared Logger interface (error-only) in packages/1-tapi/src/shared/logger.ts
- defineApi now accepts logger option, stored on ApiDefinition
- createRequestHandler: rename hooks -> logger, falls back to api.logger then console.error
- createFetchClient and client Cache: rename hooks -> logger
- handleTapiRequest (worker): accept logger option
- Bunny (create-bunny-app, dev): use api.logger if set, otherwise default console.error
- vite-plugin-tapi: rename hooks -> logger
- Export Logger type from server and client index files

Closes #329

Co-authored-by: Michel Smola <mismosmi@users.noreply.github.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 23, 2026

🦋 Changeset detected

Latest commit: 7559307

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@farbenmeer/tapi Minor
@farbenmeer/bunny Patch
@farbenmeer/react-tapi Major
@farbenmeer/vite-plugin-tapi Major
@farbenmeer/tapi-example-tables Patch
@farbenmeer/vite-plugin-tapi-example-demo Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@mismosmi mismosmi requested a review from pex May 23, 2026 14:45
Mirrors the Bunny pattern: assign the logger onto api.logger before
calling createRequestHandler now that the option no longer exists.
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.

Expose server-side logger for use customization with vite-tapi

2 participants