publishing_event_handler.ts

Composable sinks for the publishing event stream.

A PublishingEventHandler is anything that can receive a PublishingEvent. Handlers compose: multi_handler fans out, masking_handler redacts secrets then forwards. Emission is best-effort and synchronous — an observability sink must never fail or slow a run. The executor always captures events for its result (capture_handler) and forwards them to the caller's sink when one is supplied.

view source

Declarations
#

8 declarations

capture_handler
#

publishing_event_handler.ts view source

(): CapturingEventHandler import {capture_handler} from '@fuzdev/fuz_repos/publishing_event_handler.js';

Collects events in memory. Used to build the run report and in tests.

returns

CapturingEventHandler

CapturingEventHandler
#

mask_secrets
#

publishing_event_handler.ts view source

(event: { event: "run_started"; wetrun: boolean; total: number; } | { event: "package_skipped"; name: string; reason: string; } | { event: "package_completed"; name: string; old_version: string; new_version: string; bump_type: "major" | ... 1 more ... | "patch"; breaking: boolean; commit: string; tag: string; } | ... 6 more ... | { ...; }): { ...; } | ... 8 more ... | { ...; } import {mask_secrets} from '@fuzdev/fuz_repos/publishing_event_handler.js';

Returns a copy of the event with secrets redacted from its string-valued fields.

event

returns

PublishingEvent

masking_handler
#

publishing_event_handler.ts view source

(inner: PublishingEventHandler): PublishingEventHandler import {masking_handler} from '@fuzdev/fuz_repos/publishing_event_handler.js';

Wraps a handler, masking secrets in each event's string fields (mask_secrets) before forwarding.

inner

the handler to forward masked events to

returns

PublishingEventHandler

multi_handler
#

PublishingEventHandler
#

publishing_event_handler.ts view source

PublishingEventHandler import type {PublishingEventHandler} from '@fuzdev/fuz_repos/publishing_event_handler.js';

A sink for publishing events.

emit

type (event: { event: "run_started"; wetrun: boolean; total: number; } | { event: "package_skipped"; name: string; reason: string; } | { event: "package_completed"; name: string; old_version: string; new_version: string; bump_type: "major" | ... 1 more ... | "patch"; breaking: boolean; commit: string; tag: string; } | ... 6 more ... | { ...; }): void

event

returns void

redact_secrets
#

publishing_event_handler.ts view source

(text: string): string import {redact_secrets} from '@fuzdev/fuz_repos/publishing_event_handler.js';

Redacts known secret shapes from a string.

text

type string

returns

string

stdout_handler
#

publishing_event_handler.ts view source

(write_line?: WriteStdout): PublishingEventHandler import {stdout_handler} from '@fuzdev/fuz_repos/publishing_event_handler.js';

Writes each event as one JSON object per line (JSON-lines) to stdout. Write failures are swallowed — the stream is observability, not control flow.

write_line

writes one line and its newline; defaults to process.stdout

default write_process_stdout_line

returns

PublishingEventHandler

Depends on
#

Imported by
#