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

value + type

"publish" | "network" | "drift" | "not_ready"

type "publish" | "network" | "drift" | "not_ready"

import {PublishingErrorCode} from '@fuzdev/fuz_repos/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

value + 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 more...

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" | "minor" | "patch"; breaking: boolean; commit: string; tag: string; } | { event: "npm_waited"; name: string; version: string; } | { event: "package_failed"; name: string; error: string; code: "publish" | "network" | "drift" | "not_ready"; } | { event: "dependency_updated"; dependent: string; dependency: string; version: string; dep_type: "prod" | "peer" | "dev"; creates_changeset: boolean; } | { event: "deploy_started"; name: string; } | { event: "deploy_completed"; name: string; } | { event: "deploy_failed"; name: string; error: string; } | { event: "run_finished"; summary: { total: number; published: number; failed: number; skipped: number; duration: number; }; }

import {PublishingEvent} from '@fuzdev/fuz_repos/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

value + type

{ total: number; published: number; failed: number; skipped: number; duration: number; } import {PublishingRunSummary} from '@fuzdev/fuz_repos/publishing_event.js';

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

total

type number

published

type number

failed

type number

skipped

type number

duration

type number

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_repos/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

duration

wall-clock duration in milliseconds

type number

returns

PublishingRunSummary

Imported by
#