publishing_event.ts

Structured events for multi-repo publishing.

Publishing emits a stream of tagged events alongside its human-readable logging, so machine consumers (CI, dashboards) can follow a run step by step. Every run opens with a run_started event carrying wetrun: when false, the run is a dry run and every package_completed is a prediction (its commit is 'simulated') rather than an applied change. A run's run_finished summary is derived from the same event list via summarize_events, so the stream and the summary never drift.

Events are consumed through a PublishingEventHandler sink (see publishing_event_handler.ts).

view source

Declarations
#

4 declarations

PublishingErrorCode
#

publishing_event.ts view source

ZodEnum<{ publish: "publish"; network: "network"; auth: "auth"; dependency: "dependency"; build: "build"; drift: "drift"; other: "other"; }> import type {PublishingErrorCode} from '@fuzdev/fuz_gitops/publishing_event.js';

Coarse triage classification for a failed package. Lets consumers branch on failure kind without parsing the message.

PublishingEvent
#

publishing_event.ts view source

ZodDiscriminatedUnion<[ZodObject<{ event: ZodLiteral<"run_started">; wetrun: ZodBoolean; total: ZodNumber; }, $strict>, ZodObject<{ event: ZodLiteral<"package_skipped">; name: ZodString; reason: ZodString; }, $strict>, ... 7 more ..., ZodObject<...>], "event"> import type {PublishingEvent} from '@fuzdev/fuz_gitops/publishing_event.js';

A single structured event emitted during a publishing run. Tagged on event so the union serializes as one self-describing JSON object per event (JSON-lines on the wire).

PublishingRunSummary
#

publishing_event.ts view source

ZodObject<{ total: ZodNumber; published: ZodNumber; failed: ZodNumber; skipped: ZodNumber; duration: ZodNumber; }, $strict> import type {PublishingRunSummary} from '@fuzdev/fuz_gitops/publishing_event.js';

Tallied outcome of a publishing run, derived from its events via summarize_events.

summarize_events
#

publishing_event.ts view source

(events: ({ 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 ... | { ...; })[], duration: number): { ...; } import {summarize_events} from '@fuzdev/fuz_gitops/publishing_event.js';

Derives a run summary from the captured event list — the single canonical path from events to summary, so the run_finished summary always agrees with the stream. Call before emitting run_finished (which is not itself counted).

events

the events captured so far this run

type ({ 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 mor...

duration

wall-clock duration in milliseconds

type number

returns

{ total: number; published: number; failed: number; skipped: number; duration: number; }

Imported by
#