[PASO 2.13] Add notifications module (EXTENDED) — core@0.14.0#37
Merged
Conversation
Define foundational types for the notifications module: FireflyEvent, NotificationAdapter, NotificationOptions, NotificationConfig and NOTIFICATION_CONFIG injection token.
…nt emission Implement central service with registerAdapter(), emit() and getAdapters(). Uses Promise.allSettled so a failing adapter never blocks others. 12 unit tests covering filtering, dedup, parallel execution and error isolation.
ConsoleAdapter logs formatted events to console (log/warn/error by severity). NoopAdapter resolves immediately without side effects, for testing. Both accept all event types. 13 unit tests.
…h tests Three HTTP-based adapters using native fetch: - SlackAdapter: formats with severity emoji, POSTs to webhook URL - WebhookAdapter: sends full FireflyEvent as JSON with optional headers - EmailAdapter: POSTs email payload to HTTP relay endpoint 20 unit tests with vi.stubGlobal fetch mock.
…d wire into main entry point provideNotifications() registers NotificationService, NOTIFICATION_CONFIG token and adapters via provideAppInitializer. ConsoleAdapter always on, HTTP adapters conditional on options. Barrel exports all public symbols. 8 unit tests for provider factory.
…notifications module Add [0.14.0] entry documenting all notifications module additions: NotificationService, 5 adapters, provideNotifications() factory, types. Fix missing link references for 0.12.0, 0.13.0, 0.14.0.
Replace empty arrow functions with vi.fn() in test mocks to satisfy no-empty-function rule. Add eslint-disable for required unused param in NoopAdapter.send().
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
notifications/in@fireflyframework/coreprovideNotifications(options?)factory withNOTIFICATION_CONFIGinjection tokenNotificationService— central event dispatcher with adapter registry,emit()routing viasupports(),Promise.allSettledfault toleranceConsoleAdapter(always-on),NoopAdapter(testing),SlackAdapter,WebhookAdapter,EmailAdapterFireflyEventtype +NotificationAdapterinterface as public contractsChanges by STEP
notification.types.ts)NotificationService+ specConsoleAdapter+NoopAdapter+ specsSlackAdapter+WebhookAdapter+EmailAdapter+ specsprovideNotifications()factory + barrel + main entryTotal new tests: 53 (778 total, 0 regressions)
Test plan
pnpm nx build corepassespnpm nx test core— 778 tests passing, 0 failedimport { provideNotifications, NotificationService } from '@fireflyframework/core'resolves