refactor(act): extract logger into port/adapter pattern#517
Merged
refactor(act): extract logger into port/adapter pattern#517
Conversation
Replace the hard-coded pino dependency with a Logger port following the same pattern as store() and cache(). The default ConsoleLogger emits JSON lines in production and colorized output in development with zero external dependencies. Pino moves to a new @rotorsoft/act-pino adapter. - Add Logger interface (extends Disposable) to types/ports.ts - Add ConsoleLogger adapter with pino-inspired optimizations - Add log() port via port() factory, consistent with store() and cache() - Create @rotorsoft/act-pino package with PinoLogger adapter - Remove pino and pino-pretty from @rotorsoft/act dependencies - Update act-pg to use log() port - Add full test coverage for ConsoleLogger and PinoLogger - Update README, docusaurus docs, and vitest config Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add @rotorsoft/act-pino to libraries section with full badge set - Add missing Coverage badge to act-diagram - Add blank lines between library entries for readability - Reorder: act, act-pg, act-pino, act-patch, act-sse, act-diagram Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2 tasks
|
🎉 This PR is included in version @rotorsoft/act-v0.25.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version @rotorsoft/act-pg-v0.14.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Loggerport following the sameport()factory pattern asstore()andcache()ConsoleLoggeremits JSON lines in production, colorized output in development — zero external dependencies@rotorsoft/act-pinoadapter package for pino userspinoandpino-prettyfrom@rotorsoft/actdependenciesChanges
Core (
@rotorsoft/act)Loggerinterface intypes/ports.ts(extendsDisposable)ConsoleLoggeradapter with pino-inspired optimizations (numeric level gating, noop method replacement,stdout.write)log()port viaport()factory —const logger = log()in consuming filesports.tsfully documented with JSDoc, organized into sectionsNew package (
@rotorsoft/act-pino)PinoLoggeradapter wrapping pino, withdispose()flush supportUpdated
act-pg/PostgresStore.ts— useslog()portevent-sourcing.spec.ts— replaced logger spy tests with behavior assertionsvite.config.ts— added act-pino aliasTest plan
🤖 Generated with Claude Code