api #

a tool for managing many repos

55 modules ยท 222 declarations

Modules
#

analyze_repos
#

graph_validation.ts view source

(repos: LocalRepo[]): RepoAnalysis import {analyze_repos} from '@fuzdev/fuz_gitops/graph_validation.js';

Builds the dependency graph and runs cycle/wildcard analysis, tolerating cycles (reports rather than throws). The shared core of gitops_analyze and gitops_validate, which format the result themselves โ€” so this stays silent (no log) to avoid emitting a redundant "Analyzing dependencies" line.

repos

type LocalRepo[]

returns

RepoAnalysis

Args
#

gitops_run.task.ts view source

ZodObject<{ _: ZodDefault<ZodArray<ZodString>>; config: ZodDefault<ZodString>; concurrency: ZodDefault<ZodNumber>; format: ZodDefault<...>; outfile: ZodOptional<...>; }, $strict> import type {Args} from '@fuzdev/fuz_gitops/gitops_run.task.js';

BuildOperations
#

operations.ts view source

BuildOperations import type {BuildOperations} from '@fuzdev/fuz_gitops/operations.js';

Build operations for validating packages compile before publishing.

build_package

Builds a package using gro build.

type (options: { repo: LocalRepo; log?: Logger; }) => Promise<Result<object, {message: string; output?: string}>>

BumpType
#

version_utils.ts view source

BumpType import type {BumpType} from '@fuzdev/fuz_gitops/version_utils.js';

A semver bump kind: major, minor, or patch.

calculate_dependency_updates
#

publishing_plan_helpers.ts view source

(repos: LocalRepo[], predicted_versions: Map<string, string>, breaking_packages: Set<string>): { dependency_updates: DependencyUpdate[]; breaking_cascades: Map<...>; } import {calculate_dependency_updates} from '@fuzdev/fuz_gitops/publishing_plan_helpers.js';

Calculates all dependency updates between packages based on predicted versions.

Iterates through all repos, checking prod, peer, and dev dependencies to find which packages will need dependency version bumps after publishing.

Also tracks "breaking cascades" - when a breaking change propagates to dependents.

repos

type LocalRepo[]

predicted_versions

type Map<string, string>

breaking_packages

type Set<string>

returns

{ dependency_updates: DependencyUpdate[]; breaking_cascades: Map<string, string[]>; }

calculate_next_version
#

version_utils.ts view source

(current_version: string, bump_type: BumpType): string import {calculate_next_version} from '@fuzdev/fuz_gitops/version_utils.js';

current_version

type string

bump_type

returns

string

capture_handler
#

publishing_event_handler.ts view source

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

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

returns

CapturingEventHandler

CapturingEventHandler
#

cargo_toml_load
#

cargo_toml.ts view source

(repo_dir: string): Promise<CargoMetadata | null> import {cargo_toml_load} from '@fuzdev/fuz_gitops/cargo_toml.js';

Best-effort read of a repo's root Cargo.toml for the identity fields the gitops dashboard renders. Returns null when there's no Cargo.toml.

repo_dir

absolute path to the repo

type string

returns

Promise<CargoMetadata | null>

cargo_toml_parse
#

cargo_toml.ts view source

(contents: string): CargoMetadata import {cargo_toml_parse} from '@fuzdev/fuz_gitops/cargo_toml.js';

Extracts name/version/description/repository from the [package] and [workspace.package] tables of a Cargo.toml.

Deliberately not a full TOML parser: it scans for simple key = "value" string entries in those two tables, which covers both a single-crate manifest and a workspace root. Inline-table values like version = { workspace = true } (and the equivalent version.workspace = true) are ignored โ€” a member crate inheriting from the workspace has no literal here, and gitops only ever reads a repo's root manifest, where these are concrete. The first non-empty value for a key wins, so a top-level [package] takes precedence over [workspace.package] when both appear.

contents

type string

returns

CargoMetadata

CargoMetadata
#

cargo_toml.ts view source

CargoMetadata import type {CargoMetadata} from '@fuzdev/fuz_gitops/cargo_toml.js';

The handful of identity fields gitops reads from a Rust repo's Cargo.toml to render it on the dashboard. Everything is optional โ€” a workspace root has no name, and any field may be absent or inherited.

name?

type string

version?

type string

description?

type string

repository?

type string

ChangesetInfo
#

changeset_reader.ts view source

ChangesetInfo import type {ChangesetInfo} from '@fuzdev/fuz_gitops/changeset_reader.js';

filename

type string

packages

type Array<{name: string; bump_type: BumpType}>

summary

type string

ChangesetOperations
#

operations.ts view source

ChangesetOperations import type {ChangesetOperations} from '@fuzdev/fuz_gitops/operations.js';

Changeset operations for reading and predicting versions from .changeset/*.md files.

has_changesets

Checks if a repo has any changeset files. Returns true if changesets exist, false if none found.

type (options: { repo: LocalRepo; }) => Promise<Result<{value: boolean}, {message: string}>>

read_changesets

Reads all changeset files from a repo. Returns array of changeset info, or error if reading fails.

type (options: { repo: LocalRepo; log?: Logger; }) => Promise<Result<{value: Array<ChangesetInfo>}, {message: string}>>

predict_next_version

Predicts the next version based on changesets. Returns null if no changesets found (expected, not an error). Returns error Result if changesets exist but can't be read/parsed.

type (options: { repo: LocalRepo; log?: Logger; }) => Promise<Result<{version: string; bump_type: BumpType}, {message: string}> | null>

check_package_available
#

npm_registry.ts view source

(pkg: string, version: string, options?: { log?: Logger | undefined; }): Promise<boolean> import {check_package_available} from '@fuzdev/fuz_gitops/npm_registry.js';

pkg

type string

version

type string

options

type { log?: Logger | undefined; }
default {}

returns

Promise<boolean>

CiDrift
#

ci_reconcile.ts view source

CiDrift import type {CiDrift} from '@fuzdev/fuz_gitops/ci_reconcile.js';

repo_url

type string

ci

The declared/derived ci value.

type boolean

has_workflows

type boolean

kind

type CiDriftKind

CiDriftKind
#

ci_reconcile.ts view source

CiDriftKind import type {CiDriftKind} from '@fuzdev/fuz_gitops/ci_reconcile.js';

How a repo's declared ci diverges from its workflow files on disk.

CiReconcileInput
#

ci_reconcile.ts view source

CiReconcileInput import type {CiReconcileInput} from '@fuzdev/fuz_gitops/ci_reconcile.js';

repo_url

type string

ci

The declared/derived ci value from the gitops config.

type boolean

has_workflows

Whether the repo has at least one workflow file on disk.

type boolean

checkable

Whether the repo is checked out locally; uncheckable repos are skipped.

type boolean

archived

Whether the repo is archived (frozen) on its host; archived repos are skipped.

type boolean

collect_repo_files
#

repo_ops.ts view source

(dir: string, options?: WalkOptions | undefined): Promise<string[]> import {collect_repo_files} from '@fuzdev/fuz_gitops/repo_ops.js';

Collect all files from walk_repo_files into an array. Convenience function for when you need all paths upfront.

dir

type string

options?

type WalkOptions | undefined
optional

returns

Promise<string[]>

compare_bump_types
#

version_utils.ts view source

(a: BumpType, b: BumpType): number import {compare_bump_types} from '@fuzdev/fuz_gitops/version_utils.js';

Compares bump types. Returns positive if a > b, negative if a < b, 0 if equal.

a

b

returns

number

ConfigDrift
#

config_reconcile.ts view source

ConfigDrift import type {ConfigDrift} from '@fuzdev/fuz_gitops/config_reconcile.js';

repo_url

type string

config

Name of the subset config whose entry diverges.

type string

kind

type ConfigDriftKind

field?

The field that disagrees, set when kind is 'field_mismatch'.

type IntrinsicField

canonical_value?

The canonical config's value, set when kind is 'field_mismatch'.

type string

config_value?

The subset config's value, set when kind is 'field_mismatch'.

type string

ConfigDriftKind
#

create_changeset_for_dependency_updates
#

changeset_generator.ts view source

(repo: LocalRepo, updates: DependencyVersionChange[], options?: { log?: Logger | undefined; fs_ops?: FsOperations | undefined; }): Promise<...> import {create_changeset_for_dependency_updates} from '@fuzdev/fuz_gitops/changeset_generator.js';

Creates a changeset file for dependency updates. Returns the path to the created changeset file.

repo

updates

type DependencyVersionChange[]

options

type { log?: Logger | undefined; fs_ops?: FsOperations | undefined; }
default {}

returns

Promise<string>

create_dependency_updates
#

changeset_generator.ts view source

(dependencies: Map<string, string>, published_versions: Map<string, PublishedVersion>): DependencyVersionChange[] import {create_dependency_updates} from '@fuzdev/fuz_gitops/changeset_generator.js';

dependencies

type Map<string, string>

published_versions

type Map<string, PublishedVersion>

returns

DependencyVersionChange[]

create_empty_gitops_config
#

gitops_config.ts view source

(): GitopsConfig import {create_empty_gitops_config} from '@fuzdev/fuz_gitops/gitops_config.js';

returns

GitopsConfig

create_fs_fetch_value_cache
#

fs_fetch_value_cache.ts view source

(name: string, dir?: string): Promise<FetchCache> import {create_fs_fetch_value_cache} from '@fuzdev/fuz_gitops/fs_fetch_value_cache.js';

Creates file-system backed cache for fuz_util's fetch.js API responses.

Cache invalidation strategy: If cache file can't be read or parsed, entire cache is cleared (delete file) and starts fresh. This handles format changes.

Uses structuredClone to track changes - only writes to disk if data modified. Formatted with Prettier before writing for version control friendliness.

name

cache filename (without .json extension)

type string

dir

cache directory (defaults to .gro/build/fetch/)

type string
default join(paths.build, 'fetch')

returns

Promise<FetchCache>

cache object with Map-based data and save() method

CreateGitopsConfig
#

gitops_config.ts view source

CreateGitopsConfig import type {CreateGitopsConfig} from '@fuzdev/fuz_gitops/gitops_config.js';

(call)

type (base_config: GitopsConfig): RawGitopsConfig | Promise<RawGitopsConfig>

base_config

returns RawGitopsConfig | Promise<RawGitopsConfig>

decide_publish_gate
#

publish_gate.ts view source

(options: PublishGateOptions): PublishGate import {decide_publish_gate} from '@fuzdev/fuz_gitops/publish_gate.js';

Decides whether a publish run must block, prompt for confirmation, or proceed without prompting, from the pre-execution inputs.

  • blocked: a real publish whose plan has errors โ€” fail loud before prompting. The executor enforces this too, so --no-plan can't bypass the gate; this branch only avoids prompting for (and printing the "this will publish" banner of) a plan that can't run.
  • confirm: a real publish that shows its plan โ€” the user must confirm interactively.
  • proceed: a dry run, or a --no-plan real publish โ€” no prompt.

options

returns

PublishGate

default_build_operations
#

default_changeset_operations
#

DEFAULT_EXCLUDE_DIRS
#

repo_ops.ts view source

readonly ["node_modules", ".git", ".gro", ".svelte-kit", ".deno", ".vscode", ".idea", "dist", "build", "coverage", ".cache", ".turbo"] import {DEFAULT_EXCLUDE_DIRS} from '@fuzdev/fuz_gitops/repo_ops.js';

Default directories to exclude from file walking

DEFAULT_EXCLUDE_EXTENSIONS
#

repo_ops.ts view source

readonly [".png", ".jpg", ".jpeg", ".gif", ".svg", ".ico", ".webp", ".woff", ".woff2", ".ttf", ".eot", ".mp4", ".webm", ".mp3", ".wav", ".ogg", ".zip", ".tar", ".gz", ".lock", ".pdf"] import {DEFAULT_EXCLUDE_EXTENSIONS} from '@fuzdev/fuz_gitops/repo_ops.js';

Default binary/non-text extensions to exclude from content processing

default_fs_operations
#

default_git_operations
#

default_gitops_operations
#

operations_defaults.ts view source

GitopsOperations import {default_gitops_operations} from '@fuzdev/fuz_gitops/operations_defaults.js';

Combined default operations for all gitops functionality.

default_npm_operations
#

default_preflight_operations
#

default_process_operations
#

DEFAULT_REPOS_DIR
#

paths.ts view source

".." import {DEFAULT_REPOS_DIR} from '@fuzdev/fuz_gitops/paths.js';

Default repos directory relative to gitops config file. Resolves to the parent of the directory with the config (e.g., ~/dev/repo/gitops.config.ts resolves to ~/dev/).

DEPENDENCY_TYPE
#

dependency_graph.ts view source

{ readonly PROD: "prod"; readonly PEER: "peer"; readonly DEV: "dev"; } import {DEPENDENCY_TYPE} from '@fuzdev/fuz_gitops/dependency_graph.js';

DependencyAnalysis
#

graph_validation.ts view source

{ production_cycles: string[][]; dev_cycles: string[][]; wildcard_deps: { pkg: string; dep: string; version: string; }[]; missing_peers: { pkg: string; dep: string; }[]; } import type {DependencyAnalysis} from '@fuzdev/fuz_gitops/graph_validation.js';

Cycles, wildcard deps, and missing peers produced by DependencyGraphBuilder.analyze.

production_cycles

type string[][]

dev_cycles

type string[][]

wildcard_deps

type { pkg: string; dep: string; version: string; }[]

missing_peers

type { pkg: string; dep: string; }[]

DependencyGraph
#

dependency_graph.ts view source

import {DependencyGraph} from '@fuzdev/fuz_gitops/dependency_graph.js';

nodes

type Map<string, DependencyNode>

edges

type Map<string, Set<string>>

constructor

type new (): DependencyGraph

init_from_repos

type (repos: LocalRepo[]): void

public

repos

type LocalRepo[]
returns void

get_node

type (name: string): DependencyNode | undefined

name

type string
returns DependencyNode | undefined

get_dependents

type (name: string): Set<string>

name

type string
returns Set<string>

get_dependencies

type (name: string): Map<string, DependencySpec>

name

type string
returns Map<string, DependencySpec>

topological_sort

Computes topological sort order for dependency graph.

Delegates to @fuzdev/fuz_util/sort.ts for the sorting algorithm. Throws if cycles detected.

type (exclude_dev?: boolean): string[]

exclude_dev

if true, excludes dev dependencies to break cycles Publishing uses exclude_dev=true to handle circular dev deps.

type boolean
default false
returns string[]

array of package names in dependency order (dependencies before dependents)

throws

  • if - circular dependencies detected in included dependency types

detect_cycles_by_type

Detects circular dependencies, categorized by severity.

Production/peer cycles prevent publishing (impossible to order packages). Dev cycles are normal (test utils, shared configs) and safely ignored.

Uses DFS traversal with recursion stack to identify back edges. Deduplicates cycles using sorted cycle keys.

type (): { production_cycles: string[][]; dev_cycles: string[][]; }

returns { production_cycles: string[][]; dev_cycles: string[][]; }

object with production_cycles (errors) and dev_cycles (info)

toJSON

type (): DependencyGraphJson

DependencyGraphBuilder
#

dependency_graph.ts view source

import {DependencyGraphBuilder} from '@fuzdev/fuz_gitops/dependency_graph.js';

Builder for creating and analyzing dependency graphs.

build_from_repos

Constructs dependency graph from local repos.

Two-pass algorithm: first creates nodes, then builds edges (dependents). Prioritizes prod/peer deps over dev deps when same package appears in multiple dependency types (stronger constraint wins).

type (repos: LocalRepo[]): DependencyGraph

repos

type LocalRepo[]

fully initialized dependency graph with all nodes and edges

compute_publishing_order

Computes publishing order using topological sort with dev deps excluded.

Excludes dev dependencies to break circular dev dependency cycles while preserving production/peer dependency ordering. This allows patterns like shared test utilities that depend on each other for development.

type (graph: DependencyGraph): string[]

graph

returns string[]

package names in safe publishing order (dependencies before dependents)

throws

  • if - production/peer cycles detected (cannot be resolved by exclusion)

analyze

type (graph: DependencyGraph): { production_cycles: string[][]; dev_cycles: string[][]; wildcard_deps: { pkg: string; dep: string; version: string; }[]; missing_peers: { pkg: string; dep: string; }[]; }

graph

returns { production_cycles: string[][]; dev_cycles: string[][]; wildcard_deps: { pkg: string; dep: string; version: string; }[]; missing_peers: { pkg: string; dep: string; }[]; }

DependencyGraphJson
#

dependency_graph.ts view source

DependencyGraphJson import type {DependencyGraphJson} from '@fuzdev/fuz_gitops/dependency_graph.js';

nodes

type Array<{ name: string; version: string; dependencies: Array<{name: string; spec: DependencySpec}>; dependents: Array<string>; publishable: boolean; }>

edges

type Array<{from: string; to: string}>

DependencyNode
#

dependency_graph.ts view source

DependencyNode import type {DependencyNode} from '@fuzdev/fuz_gitops/dependency_graph.js';

name

type string

version

type string

repo?

type LocalRepo

dependencies

type Map<string, DependencySpec>

dependents

type Set<string>

publishable

type boolean

DependencySpec
#

DependencyType
#

DependencyUpdate
#

publishing_plan.ts view source

DependencyUpdate import type {DependencyUpdate} from '@fuzdev/fuz_gitops/publishing_plan.js';

dependent_package

type string

updated_dependency

type string

current_version

type string

new_version

type string

type

type 'dependencies' | 'devDependencies' | 'peerDependencies'

DependencyVersionChange
#

changeset_generator.ts view source

DependencyVersionChange import type {DependencyVersionChange} from '@fuzdev/fuz_gitops/changeset_generator.js';

package_name

type string

from_version

type string

to_version

type string

bump_type

type 'major' | 'minor' | 'patch'

breaking

type boolean

derive_publish_steps
#

publish_steps.ts view source

(plan: PublishingPlan, options?: DerivePublishStepsOptions): PublishStep[] import {derive_publish_steps} from '@fuzdev/fuz_gitops/publish_steps.js';

Derives the ordered side-effects a wetrun would perform from a frozen plan.

Reads only publishing_order, version_changes, and dependency_updates โ€” the same data execute_publishing_plan consumes, in the same order โ€” so the preview reflects the real pass. A dependency is only propagated to its dependents if it actually publishes this run.

plan

options

default {}

returns

PublishStep[]

DerivePublishStepsOptions
#

publish_steps.ts view source

DerivePublishStepsOptions import type {DerivePublishStepsOptions} from '@fuzdev/fuz_gitops/publish_steps.js';

deploy?

Include the deploy phase (the publisher only deploys with --deploy).

type boolean

detect_bump_type
#

version_utils.ts view source

(old_version: string, new_version: string): BumpType import {detect_bump_type} from '@fuzdev/fuz_gitops/version_utils.js';

old_version

type string

new_version

type string

returns

BumpType

determine_bump_from_changesets
#

changeset_reader.ts view source

(changesets: ChangesetInfo[], package_name: string): BumpType | null import {determine_bump_from_changesets} from '@fuzdev/fuz_gitops/changeset_reader.js';

Determines the bump type for a package from its changesets.

When multiple changesets exist for the same package, returns the highest bump type (major > minor > patch) to ensure the most significant change is reflected in the version bump.

changesets

type ChangesetInfo[]

package_name

type string

returns

BumpType | null

the highest bump type, or null if package has no changesets

execute_publishing_plan
#

multi_repo_publisher.ts view source

(all_repos: LocalRepo[], plan: PublishingPlan, options: PublishingOptions): Promise<PublishingResult> import {execute_publishing_plan} from '@fuzdev/fuz_gitops/multi_repo_publisher.js';

Executes a frozen publishing plan in a single linear pass โ€” the "dumb executor" half of the zap model. The plan is the single source of truth; this re-derives nothing.

Fails loud when the plan couldn't be fully computed (plan.errors): a wetrun aborts before any side effect, a dry run still reports the partial cascade but returns ok: false. This is the single error gate โ€” --no-plan can't bypass it.

all_repos

type LocalRepo[]

plan

options

returns

Promise<PublishingResult>

fetch_github_check_runs
#

github.ts view source

(repo_info: GithubRepoInfo, options?: { cache?: Map<string, { key: string; url: string; params: any; value: any; etag: string | null; last_modified: string | null; }> | undefined; log?: Logger | undefined; token?: string | undefined; api_version?: string | undefined; ref?: string | undefined; }): Promise<...> import {fetch_github_check_runs} from '@fuzdev/fuz_gitops/github.js';

repo_info

options

type { cache?: Map<string, { key: string; url: string; params: any; value: any; etag: string | null; last_modified: string | null; }> | undefined; log?: Logger | undefined; token?: string | undefined; api_version?: string | undefined; ref?: string | undefined; }
default {}

returns

Promise<{ status: "queued" | "in_progress" | "completed"; conclusion: "success" | "failure" | "neutral" | "cancelled" | "skipped" | "timed_out" | "action_required" | null; } | null>

see also

fetch_github_pull_requests
#

github.ts view source

(repo_info: GithubRepoInfo, options?: { cache?: Map<string, { key: string; url: string; params: any; value: any; etag: string | null; last_modified: string | null; }> | undefined; log?: Logger | undefined; token?: string | undefined; api_version?: string | undefined; }): Promise<...> import {fetch_github_pull_requests} from '@fuzdev/fuz_gitops/github.js';

repo_info

options

type { cache?: Map<string, { key: string; url: string; params: any; value: any; etag: string | null; last_modified: string | null; }> | undefined; log?: Logger | undefined; token?: string | undefined; api_version?: string | undefined; }
default {}

returns

Promise<{ number: number; title: string; user: { login: string; }; draft: boolean; }[] | null>

see also

fetch_repo_data
#

fetch_repo_data.ts view source

(resolved_repos: LocalRepo[], token?: string | undefined, cache?: Map<string, { key: string; url: string; params: any; value: any; etag: string | null; last_modified: string | null; }> | undefined, log?: Logger | undefined, delay?: number, github_api_version?: string | undefined): Promise<...> import {fetch_repo_data} from '@fuzdev/fuz_gitops/fetch_repo_data.js';

Fetches GitHub metadata (CI status, PRs) for all repos.

Fetches sequentially with delay between requests to respect GitHub API rate limits. Uses await_in_loop intentionally to avoid parallel requests overwhelming the API.

Error handling: Logs fetch failures but continues processing remaining repos. Repos with failed fetches will have null for check_runs or pull_requests.

resolved_repos

type LocalRepo[]

token?

type string | undefined
optional

cache?

optional cache from fuz_util's fetch.js for response memoization

type Map<string, { key: string; url: string; params: any; value: any; etag: string | null; last_modified: string | null; }> | undefined
optional

log?

type Logger | undefined
optional

delay

milliseconds between API requests (default: 33ms)

type number
default 33

github_api_version?

type string | undefined
optional

returns

Promise<RepoJson[]>

array of Repo objects with GitHub metadata attached

FetchCache
#

fs_fetch_value_cache.ts view source

FetchCache import type {FetchCache} from '@fuzdev/fuz_gitops/fs_fetch_value_cache.js';

name

type string

data

type FetchValueCache

save

type () => Promise<boolean>

FilterPullRequest
#

github_helpers.ts view source

FilterPullRequest import type {FilterPullRequest} from '@fuzdev/fuz_gitops/github_helpers.js';

(call)

type (pull_request: { number: number; title: string; user: { login: string; }; draft: boolean; }, repo: Repo): boolean

pull_request

type { number: number; title: string; user: { login: string; }; draft: boolean; }

repo

type Repo
returns boolean

find_updates_needed
#

dependency_updater.ts view source

(repo: LocalRepo, published: Map<string, string>): Map<string, { current: string; new: string; type: "dependencies" | "devDependencies" | "peerDependencies"; }> import {find_updates_needed} from '@fuzdev/fuz_gitops/dependency_updater.js';

repo

published

type Map<string, string>

returns

Map<string, { current: string; new: string; type: "dependencies" | "devDependencies" | "peerDependencies"; }>

format_and_output
#

output_helpers.ts view source

<T>(data: T, formatters: OutputFormatters<T>, options: OutputOptions): Promise<void> import {format_and_output} from '@fuzdev/fuz_gitops/output_helpers.js';

Formats data and outputs to file or stdout based on options.

Supports three formats:

  • stdout: Uses logger for colored/styled output (cannot use with --outfile)
  • json: Stringified JSON
  • markdown: Formatted markdown text

data

type T

formatters

type OutputFormatters<T>

options

returns

Promise<void>

generics

format_and_output<T>
T

throws

  • if - stdout format used with `outfile`, or if logger missing for stdout

format_dev_cycles
#

log_helpers.ts view source

(analysis: { production_cycles: string[][]; dev_cycles: string[][]; wildcard_deps: { pkg: string; dep: string; version: string; }[]; missing_peers: { pkg: string; dep: string; }[]; }): string[] import {format_dev_cycles} from '@fuzdev/fuz_gitops/log_helpers.js';

Formats dev circular dependencies as styled strings. Returns array of lines for inclusion in output.

analysis

type { production_cycles: string[][]; dev_cycles: string[][]; wildcard_deps: { pkg: string; dep: string; version: string; }[]; missing_peers: { pkg: string; dep: string; }[]; }

returns

string[]

format_production_cycles
#

log_helpers.ts view source

(analysis: { production_cycles: string[][]; dev_cycles: string[][]; wildcard_deps: { pkg: string; dep: string; version: string; }[]; missing_peers: { pkg: string; dep: string; }[]; }): string[] import {format_production_cycles} from '@fuzdev/fuz_gitops/log_helpers.js';

Formats production/peer circular dependencies as styled strings. Returns array of lines for inclusion in output.

analysis

type { production_cycles: string[][]; dev_cycles: string[][]; wildcard_deps: { pkg: string; dep: string; version: string; }[]; missing_peers: { pkg: string; dep: string; }[]; }

returns

string[]

format_publish_steps
#

publish_steps.ts view source

(steps: PublishStep[]): string[] import {format_publish_steps} from '@fuzdev/fuz_gitops/publish_steps.js';

Formats steps as human-readable lines (one per step) for stdout and markdown output. Returns a single placeholder line when there are no side effects.

steps

type PublishStep[]

returns

string[]

format_wildcard_dependencies
#

log_helpers.ts view source

(analysis: { production_cycles: string[][]; dev_cycles: string[][]; wildcard_deps: { pkg: string; dep: string; version: string; }[]; missing_peers: { pkg: string; dep: string; }[]; }): string[] import {format_wildcard_dependencies} from '@fuzdev/fuz_gitops/log_helpers.js';

Formats wildcard dependencies as styled strings. Returns array of lines for inclusion in output.

analysis

type { production_cycles: string[][]; dev_cycles: string[][]; wildcard_deps: { pkg: string; dep: string; version: string; }[]; missing_peers: { pkg: string; dep: string; }[]; }

returns

string[]

FsOperations
#

operations.ts view source

FsOperations import type {FsOperations} from '@fuzdev/fuz_gitops/operations.js';

File system operations for reading and writing files.

Errors are typed via FsError (`not_found | permission_denied | already_exists | io_error) so callers can branch on kind` instead of regex-matching message. See @fuzdev/fuz_util/fs.ts.

readFile

Reads a file from the file system.

type (options: { path: string; encoding: BufferEncoding; }) => Promise<Result<{value: string}, FsError>>

writeFile

Writes a file to the file system.

type (options: {path: string; content: string}) => Promise<Result<object, FsError>>

mkdir

Creates a directory, optionally with recursive creation.

type (options: {path: string; recursive?: boolean}) => Promise<Result<object, FsError>>

exists

Checks if a path exists on the file system.

type (options: {path: string}) => Promise<boolean>

generate_changeset_content
#

changeset_generator.ts view source

(package_name: string, updates: DependencyVersionChange[], bump_type: "major" | "minor" | "patch"): string import {generate_changeset_content} from '@fuzdev/fuz_gitops/changeset_generator.js';

Generates markdown changeset content for dependency updates.

Creates properly formatted changeset with YAML frontmatter, summary, and categorized list of breaking vs regular updates. Output format matches changesets CLI for consistency.

package_name

package receiving the dependency updates

type string

updates

list of dependency changes with version info

type DependencyVersionChange[]

bump_type

required bump type (calculated from breaking changes)

type "major" | "minor" | "patch"

returns

string

markdown content ready to write to .changeset/*.md file

generate_publishing_plan
#

publishing_plan.ts view source

(all_repos: LocalRepo[], options?: GeneratePlanOptions): Promise<PublishingPlan> import {generate_publishing_plan} from '@fuzdev/fuz_gitops/publishing_plan.js';

Generates a publishing plan showing what would happen during publishing. Shows version changes, dependency updates, and breaking change cascades. Uses fixed-point iteration to resolve transitive cascades.

all_repos

type LocalRepo[]

options

default {}

returns

Promise<PublishingPlan>

GeneratePlanOptions
#

get_gitops_ready
#

gitops_task_helpers.ts view source

(options: GetGitopsReadyOptions): Promise<{ config_path: string; repos_dir: string; gitops_config: GitopsConfig; local_repos: LocalRepo[]; }> import {get_gitops_ready} from '@fuzdev/fuz_gitops/gitops_task_helpers.js';

Central initialization function for all gitops tasks.

Initialization sequence:

  1. Loads and normalizes config from gitops.config.ts
  2. Resolves local repo paths (creates missing with --download)
  3. If sync, switches branches and pulls latest changes (in parallel by default)
  4. If sync, auto-installs deps if package.json changed during pull

With sync: false (the default for read-only diagnostics), steps 3-4 are skipped and repos are loaded exactly as checked out โ€” no branch switch, pull, install, or clean-workspace check.

Priority for path resolution:

options

returns

Promise<{ config_path: string; repos_dir: string; gitops_config: GitopsConfig; local_repos: LocalRepo[]; }>

initialized config and fully loaded repos ready for operations

throws

  • if - config loading or repo resolution fails

get_package_info
#

npm_registry.ts view source

(pkg: string, options?: { log?: Logger | undefined; }): Promise<PackageInfo | null> import {get_package_info} from '@fuzdev/fuz_gitops/npm_registry.js';

Fetches package metadata from NPM registry.

Returns name and latest version. Returns null if package doesn't exist or registry is unreachable.

pkg

type string

options

type { log?: Logger | undefined; }
default {}

returns

Promise<PackageInfo | null>

package info or null on error/not found

get_repo_paths
#

repo_ops.ts view source

(config_path?: string | undefined): Promise<RepoPath[]> import {get_repo_paths} from '@fuzdev/fuz_gitops/repo_ops.js';

Get repo paths from gitops config without full git sync. Lighter weight than get_gitops_ready() - just resolves paths.

config_path?

path to the gitops config file (defaults to gitops.config.ts)

type string | undefined
optional

returns

Promise<RepoPath[]>

array of repo info with name, path, and url

get_required_bump_for_dependencies
#

publishing_plan_helpers.ts view source

(repo: LocalRepo, dependency_updates: DependencyUpdate[], breaking_packages: Set<string>): BumpType | null import {get_required_bump_for_dependencies} from '@fuzdev/fuz_gitops/publishing_plan_helpers.js';

Determines the required bump type for a package based on its dependency updates.

Returns null if no prod/peer dependency updates, otherwise returns the minimum required bump type (major for breaking deps, patch otherwise).

Respects pre-1.0 semver conventions (minor for breaking in 0.x).

repo

dependency_updates

type DependencyUpdate[]

breaking_packages

type Set<string>

returns

BumpType | null

get_update_prefix
#

version_utils.ts view source

(current_version: string, default_strategy?: "" | "^" | "~" | ">="): string import {get_update_prefix} from '@fuzdev/fuz_gitops/version_utils.js';

Determines version prefix to use when updating dependencies.

Strategy:

  • Wildcard (*): Use caret (^) as default
  • Has existing prefix: Preserve it (^, ~, >=, <=, etc)
  • No prefix: Use default_strategy

This preserves user intent while handling wildcard replacements sensibly.

current_version

type string

default_strategy

prefix to use when no existing prefix found

type "" | "^" | "~" | ">="
default '^'

returns

string

get_version_prefix
#

version_utils.ts view source

(version: string): string import {get_version_prefix} from '@fuzdev/fuz_gitops/version_utils.js';

Gets the version prefix (^, ~, >=, <=, or empty string).

version

type string

returns

string

GetGitopsReadyOptions
#

gitops_task_helpers.ts view source

GetGitopsReadyOptions import type {GetGitopsReadyOptions} from '@fuzdev/fuz_gitops/gitops_task_helpers.js';

config

type string

dir?

type string

download

type boolean

log?

type Logger

git_ops?

type GitOperations

npm_ops?

type NpmOperations

parallel?

type boolean

concurrency?

type number

sync?

Sync each repo's working tree to its configured branch before loading (switch branch, pull, install). When false, repos load exactly as they sit on disk โ€” the safe default for read-only diagnostics. Defaults to true.

type boolean

allow_dirty?

When syncing, tolerate uncommitted changes instead of throwing. Defaults to false.

type boolean

git_add
#

git_operations.ts view source

(files: string | string[], options?: SpawnOptions | undefined): Promise<void> import {git_add} from '@fuzdev/fuz_gitops/git_operations.js';

Adds files to git staging area and throws if anything goes wrong.

files

type string | string[]

options?

type SpawnOptions | undefined
optional

returns

Promise<void>

git_add_and_commit
#

git_operations.ts view source

(files: string | string[], message: string, options?: SpawnOptions | undefined): Promise<void> import {git_add_and_commit} from '@fuzdev/fuz_gitops/git_operations.js';

Adds files and commits in one operation and throws if anything goes wrong.

files

type string | string[]

message

type string

options?

type SpawnOptions | undefined
optional

returns

Promise<void>

git_check_clean_workspace_as_boolean
#

git_operations.ts view source

(options?: SpawnOptions | undefined): Promise<boolean> import {git_check_clean_workspace_as_boolean} from '@fuzdev/fuz_gitops/git_operations.js';

Wrapper for gro's git_check_clean_workspace that returns a boolean.

options?

type SpawnOptions | undefined
optional

returns

Promise<boolean>

git_commit
#

git_operations.ts view source

(message: string, options?: SpawnOptions | undefined): Promise<void> import {git_commit} from '@fuzdev/fuz_gitops/git_operations.js';

Commits staged changes with a message and throws if anything goes wrong.

message

type string

options?

type SpawnOptions | undefined
optional

returns

Promise<void>

git_current_branch_name_required
#

git_operations.ts view source

(options?: SpawnOptions | undefined): Promise<string> import {git_current_branch_name_required} from '@fuzdev/fuz_gitops/git_operations.js';

Wrapper for gro's git_current_branch_name that throws if null.

options?

type SpawnOptions | undefined
optional

returns

Promise<string>

git_current_commit_hash_required
#

git_operations.ts view source

(branch?: string | undefined, options?: SpawnOptions | undefined): Promise<string> import {git_current_commit_hash_required} from '@fuzdev/fuz_gitops/git_operations.js';

Wrapper for gro's git_current_commit_hash that throws if null.

branch?

type string | undefined
optional

options?

type SpawnOptions | undefined
optional

returns

Promise<string>

git_has_changes
#

git_operations.ts view source

(options?: SpawnOptions | undefined): Promise<boolean> import {git_has_changes} from '@fuzdev/fuz_gitops/git_operations.js';

Returns true if the working tree has any changes โ€” staged, unstaged, or untracked (git status --porcelain). Broader than git_list_uncommitted_files, which reports only tracked working-tree changes relative to HEAD.

options?

type SpawnOptions | undefined
optional

returns

Promise<boolean>

git_has_file_changed
#

git_operations.ts view source

(from_commit: string, to_commit: string, file_path: string, options?: SpawnOptions | undefined): Promise<boolean> import {git_has_file_changed} from '@fuzdev/fuz_gitops/git_operations.js';

from_commit

type string

to_commit

type string

file_path

type string

options?

type SpawnOptions | undefined
optional

returns

Promise<boolean>

git_has_remote
#

git_operations.ts view source

(remote?: string, options?: SpawnOptions | undefined): Promise<boolean> import {git_has_remote} from '@fuzdev/fuz_gitops/git_operations.js';

remote

type string
default 'origin'

options?

type SpawnOptions | undefined
optional

returns

Promise<boolean>

git_list_uncommitted_files
#

git_operations.ts view source

(options?: SpawnOptions | undefined): Promise<string[]> import {git_list_uncommitted_files} from '@fuzdev/fuz_gitops/git_operations.js';

Lists uncommitted files in the working tree (git diff --name-only HEAD).

options?

type SpawnOptions | undefined
optional

returns

Promise<string[]>

git_push_tag
#

git_operations.ts view source

(tag_name: string, origin?: GitOrigin, options?: SpawnOptions | undefined): Promise<void> import {git_push_tag} from '@fuzdev/fuz_gitops/git_operations.js';

Pushes a tag to origin and throws if anything goes wrong.

tag_name

type string

origin

type GitOrigin
default 'origin' as GitOrigin

options?

type SpawnOptions | undefined
optional

returns

Promise<void>

git_stash
#

git_operations.ts view source

(message?: string | undefined, options?: SpawnOptions | undefined): Promise<void> import {git_stash} from '@fuzdev/fuz_gitops/git_operations.js';

Stashes current changes and throws if anything goes wrong.

message?

type string | undefined
optional

options?

type SpawnOptions | undefined
optional

returns

Promise<void>

git_stash_pop
#

git_operations.ts view source

(options?: SpawnOptions | undefined): Promise<void> import {git_stash_pop} from '@fuzdev/fuz_gitops/git_operations.js';

Applies stashed changes and throws if anything goes wrong.

options?

type SpawnOptions | undefined
optional

returns

Promise<void>

git_switch_branch
#

git_operations.ts view source

(branch: GitBranch, pull?: boolean, options?: SpawnOptions | undefined): Promise<void> import {git_switch_branch} from '@fuzdev/fuz_gitops/git_operations.js';

Switches to a branch with safety checks and throws if workspace is not clean.

branch

type GitBranch

pull

type boolean
default true

options?

type SpawnOptions | undefined
optional

returns

Promise<void>

git_tag
#

git_operations.ts view source

(tag_name: string, message?: string | undefined, options?: SpawnOptions | undefined): Promise<void> import {git_tag} from '@fuzdev/fuz_gitops/git_operations.js';

Creates a git tag and throws if anything goes wrong.

tag_name

type string

message?

type string | undefined
optional

options?

type SpawnOptions | undefined
optional

returns

Promise<void>

GithubCheckRuns
#

github.ts view source

ZodObject<{ total_count: ZodNumber; check_runs: ZodArray<ZodObject<{ status: ZodEnum<{ queued: "queued"; in_progress: "in_progress"; completed: "completed"; }>; conclusion: ZodNullable<ZodEnum<{ success: "success"; ... 5 more ...; action_required: "action_required"; }>>; }, $strip>>; }, $strip> import type {GithubCheckRuns} from '@fuzdev/fuz_gitops/github.js';

GithubCheckRunsItem
#

github.ts view source

ZodObject<{ status: ZodEnum<{ queued: "queued"; in_progress: "in_progress"; completed: "completed"; }>; conclusion: ZodNullable<ZodEnum<{ success: "success"; failure: "failure"; neutral: "neutral"; cancelled: "cancelled"; skipped: "skipped"; timed_out: "timed_out"; action_required: "action_required"; }>>; }, $strip> import type {GithubCheckRunsItem} from '@fuzdev/fuz_gitops/github.js';

see also

GithubPullRequest
#

GithubPullRequests
#

github.ts view source

ZodArray<ZodObject<{ number: ZodNumber; title: ZodString; user: ZodObject<{ login: ZodString; }, $strip>; draft: ZodBoolean; }, $strip>> import type {GithubPullRequests} from '@fuzdev/fuz_gitops/github.js';

GithubRepoInfo
#

github.ts view source

GithubRepoInfo import type {GithubRepoInfo} from '@fuzdev/fuz_gitops/github.js';

Minimal interface for GitHub API calls - works with both Pkg and Repo.

owner_name

type string | null

repo_name

type string

GitOperations
#

operations.ts view source

GitOperations import type {GitOperations} from '@fuzdev/fuz_gitops/operations.js';

Git operations for branch management, commits, tags, and workspace state. All operations return Result instead of throwing errors.

current_branch_name

Gets the current branch name.

type (options?: { cwd?: string; }) => Promise<Result<{value: string}, {message: string}>>

current_commit_hash

Gets the current commit hash.

type (options?: { branch?: string; cwd?: string; }) => Promise<Result<{value: string}, {message: string}>>

check_clean_workspace

Checks if the workspace is clean (no uncommitted changes).

type (options?: { cwd?: string; }) => Promise<Result<{value: boolean}, {message: string}>>

checkout

Checks out a branch.

type (options: {branch: string; cwd?: string}) => Promise<Result<object, {message: string}>>

pull

Pulls changes from remote.

type (options?: { origin?: string; branch?: string; cwd?: string; }) => Promise<Result<object, {message: string}>>

switch_branch

Switches to a branch, optionally pulling.

type (options: { branch: string; pull?: boolean; cwd?: string; }) => Promise<Result<object, {message: string}>>

has_remote

Checks if a remote exists.

type (options?: { remote?: string; cwd?: string; }) => Promise<Result<{value: boolean}, {message: string}>>

add

Stages files for commit.

type (options: { files: string | Array<string>; cwd?: string; }) => Promise<Result<object, {message: string}>>

commit

Creates a commit.

type (options: {message: string; cwd?: string}) => Promise<Result<object, {message: string}>>

add_and_commit

Stages files and creates a commit.

type (options: { files: string | Array<string>; message: string; cwd?: string; }) => Promise<Result<object, {message: string}>>

has_changes

Checks whether the working tree has any changes โ€” staged, unstaged, or untracked (git status --porcelain). Broader than list_uncommitted_files, which reports only tracked working-tree changes relative to HEAD.

type (options?: {cwd?: string}) => Promise<Result<{value: boolean}, {message: string}>>

list_uncommitted_files

Lists uncommitted files in the working tree (git diff --name-only HEAD), i.e. working-tree changes relative to HEAD (not a diff between two refs).

type (options?: { cwd?: string; }) => Promise<Result<{value: Array<string>}, {message: string}>>

tag

Creates a git tag.

type (options: { tag_name: string; message?: string; cwd?: string; }) => Promise<Result<object, {message: string}>>

push_tag

Pushes a tag to remote.

type (options: { tag_name: string; origin?: string; cwd?: string; }) => Promise<Result<object, {message: string}>>

stash

Stashes uncommitted changes.

type (options?: {message?: string; cwd?: string}) => Promise<Result<object, {message: string}>>

stash_pop

Pops the most recent stash.

type (options?: {cwd?: string}) => Promise<Result<object, {message: string}>>

has_file_changed

Checks if a specific file changed between two commits.

type (options: { from_commit: string; to_commit: string; file_path: string; cwd?: string; }) => Promise<Result<{value: boolean}, {message: string}>>

GITOPS_CONCURRENCY_DEFAULT
#

gitops_constants.ts view source

5 import {GITOPS_CONCURRENCY_DEFAULT} from '@fuzdev/fuz_gitops/gitops_constants.js';

Default number of repos to process concurrently during parallel operations.

GITOPS_CONFIG_PATH_DEFAULT
#

gitops_constants.ts view source

"gitops.config.ts" import {GITOPS_CONFIG_PATH_DEFAULT} from '@fuzdev/fuz_gitops/gitops_constants.js';

Default path to the gitops configuration file.

GITOPS_MAX_ITERATIONS_DEFAULT
#

gitops_constants.ts view source

10 import {GITOPS_MAX_ITERATIONS_DEFAULT} from '@fuzdev/fuz_gitops/gitops_constants.js';

Maximum number of iterations for fixed-point iteration during publishing. Used in both plan generation and actual publishing to resolve transitive dependency cascades.

In practice, most repos converge in 2-3 iterations. Deep dependency chains may require more iterations.

GITOPS_NPM_WAIT_TIMEOUT_DEFAULT
#

gitops_constants.ts view source

600000 import {GITOPS_NPM_WAIT_TIMEOUT_DEFAULT} from '@fuzdev/fuz_gitops/gitops_constants.js';

Default timeout in milliseconds for waiting on NPM package propagation (10 minutes). NPM's CDN uses eventual consistency, so published packages may not be immediately available.

GitopsConfig
#

gitops_config.ts view source

GitopsConfig import type {GitopsConfig} from '@fuzdev/fuz_gitops/gitops_config.js';

repos

type Array<GitopsRepoConfig>

repos_dir

type string

GitopsConfigModule
#

gitops_config.ts view source

GitopsConfigModule import type {GitopsConfigModule} from '@fuzdev/fuz_gitops/gitops_config.js';

default

type RawGitopsConfig | CreateGitopsConfig

readonly

GitopsOperations
#

GitopsRepoConfig
#

gitops_config.ts view source

GitopsRepoConfig import type {GitopsRepoConfig} from '@fuzdev/fuz_gitops/gitops_config.js';

repo_url

The HTTPS URL to the repo. Does not include a .git suffix.

type Url

'https://github.com/fuzdev/fuz_ui'

repo_dir

Relative or absolute path to the repo's local directory. If null, the directory is inferred from the URL and cwd.

type string | null

'relative/path/to/repo'
'/absolute/path/to/repo'

branch

The branch name to use when fetching the repo. Defaults to main.

type GitBranch

visibility

Visibility of the repo on its host. Defaults to 'public'.

type GitopsRepoVisibility

ci

Whether the repo runs CI. Defaults to true for public repos and false for private repos, unless set explicitly.

type boolean

archived

Whether the repo is archived (read-only) on its host. Defaults to false.

type boolean

GitopsRepoVisibility
#

gitops_config.ts view source

GitopsRepoVisibility import type {GitopsRepoVisibility} from '@fuzdev/fuz_gitops/gitops_config.js';

Visibility of a repo on its host, mirroring the host's own model (e.g. GitHub's visibility field). Named to avoid confusion with the npm package.json private flag, which is a separate publishing concern.

GraphValidationResult
#

graph_validation.ts view source

GraphValidationResult import type {GraphValidationResult} from '@fuzdev/fuz_gitops/graph_validation.js';

graph

type DependencyGraph

publishing_order

type Array<string>

production_cycles

type Array<Array<string>>

dev_cycles

type Array<Array<string>>

sort_error?

type string

group_dependency_updates
#

multi_repo_publisher.ts view source

(updates: DependencyUpdate[], published: Map<string, PublishedVersion>, predicate: (update: DependencyUpdate) => boolean): Map<...> import {group_dependency_updates} from '@fuzdev/fuz_gitops/multi_repo_publisher.js';

Groups dependency updates by dependent package โ€” `dependent โ†’ (dependency โ†’ new version), the shape update_package_json consumes. Restricted by predicate` (e.g. prod/peer for a given package, or all dev deps) and to dependencies that actually published this run, so a failed/aborted publish never propagates to its dependents.

updates

type DependencyUpdate[]

published

type Map<string, PublishedVersion>

predicate

type (update: DependencyUpdate) => boolean

returns

Map<string, Map<string, string>>

has_changesets
#

changeset_reader.ts view source

(repo: LocalRepo): Promise<boolean> import {has_changesets} from '@fuzdev/fuz_gitops/changeset_reader.js';

Checks if a repo has any changeset files (excluding README.md).

Used by preflight checks and publishing workflow to determine which packages need to be published. Returns false if .changeset directory doesn't exist or contains only README.md.

repo

returns

Promise<boolean>

true if repo has unpublished changesets

import_gitops_config
#

gitops_task_helpers.ts view source

(config_path: string): Promise<GitopsConfig> import {import_gitops_config} from '@fuzdev/fuz_gitops/gitops_task_helpers.js';

config_path

type string

returns

Promise<GitopsConfig>

IntrinsicField
#

config_reconcile.ts view source

"visibility" | "ci" | "archived" | "branch" import type {IntrinsicField} from '@fuzdev/fuz_gitops/config_reconcile.js';

is_breaking_change
#

version_utils.ts view source

(old_version: string, bump_type: BumpType): boolean import {is_breaking_change} from '@fuzdev/fuz_gitops/version_utils.js';

Determines if a bump is a breaking change based on semver rules. Pre-1.0: minor bumps are breaking 1.0+: major bumps are breaking

old_version

type string

bump_type

returns

boolean

is_wildcard
#

version_utils.ts view source

(version: string): boolean import {is_wildcard} from '@fuzdev/fuz_gitops/version_utils.js';

version

type string

returns

boolean

load_gitops_config
#

gitops_config.ts view source

(config_path: string): Promise<GitopsConfig | null> import {load_gitops_config} from '@fuzdev/fuz_gitops/gitops_config.js';

config_path

type string

returns

Promise<GitopsConfig | null>

local_repo_load
#

local_repo.ts view source

({ local_repo_path, log: _log, git_ops, npm_ops, sync, allow_dirty, }: { local_repo_path: LocalRepoPath; log?: Logger | undefined; git_ops?: GitOperations | undefined; npm_ops?: NpmOperations | undefined; sync?: boolean | undefined; allow_dirty?: boolean | undefined; }): Promise<...> import {local_repo_load} from '@fuzdev/fuz_gitops/local_repo.js';

Loads repo data, optionally syncing the working tree first.

When sync is false (the default for read-only diagnostics like gitops_analyze/gitops_plan), the repo is loaded exactly as it sits on disk โ€” no branch switch, pull, install, or clean-workspace check. This makes those commands safe to run on an active workspace with uncommitted changes or feature branches checked out.

When sync is true (used by gitops_sync), the working tree is brought in line with the configured branch first:

  1. Records current commit hash (for detecting changes)
  2. Switches to target branch if needed (requires clean workspace unless allow_dirty)
  3. Pulls latest changes from remote (skipped for local-only repos)
  4. Validates workspace is clean after pull (skipped if allow_dirty)
  5. Auto-installs dependencies if package.json changed

Either way it then: 6. Loads library_json via library_load_from_repo (svelte-docinfo analysis) 7. Creates Library and extracts dependency maps

__0

type { local_repo_path: LocalRepoPath; log?: Logger | undefined; git_ops?: GitOperations | undefined; npm_ops?: NpmOperations | undefined; sync?: boolean | undefined; allow_dirty?: boolean | undefined; }

returns

Promise<LocalRepo>

throws

  • if - syncing fails (dirty workspace, branch switch, install) or analysis fails

local_repo_locate
#

local_repo.ts view source

({ repo_config, repos_dir, }: { repo_config: GitopsRepoConfig; repos_dir: string; }): LocalRepoPath | LocalRepoMissing import {local_repo_locate} from '@fuzdev/fuz_gitops/local_repo.js';

__0

type { repo_config: GitopsRepoConfig; repos_dir: string; }

returns

LocalRepoPath | LocalRepoMissing

local_repos_ensure
#

local_repo.ts view source

({ resolved_config, repos_dir, gitops_config, download, log, npm_ops, }: { resolved_config: ResolvedGitopsConfig; repos_dir: string; gitops_config: GitopsConfig; download: boolean; log?: Logger | undefined; npm_ops?: NpmOperations | undefined; }): Promise<...> import {local_repos_ensure} from '@fuzdev/fuz_gitops/local_repo.js';

__0

type { resolved_config: ResolvedGitopsConfig; repos_dir: string; gitops_config: GitopsConfig; download: boolean; log?: Logger | undefined; npm_ops?: NpmOperations | undefined; }

returns

Promise<LocalRepoPath[]>

local_repos_load
#

local_repo.ts view source

({ local_repo_paths, log, git_ops, npm_ops, parallel, concurrency, sync, allow_dirty, }: { local_repo_paths: LocalRepoPath[]; log?: Logger | undefined; git_ops?: GitOperations | undefined; npm_ops?: NpmOperations | undefined; parallel?: boolean | undefined; concurrency?: number | undefined; sync?: boolean | undefined; allow_dirty?: boolean | undefined; }): Promise<...> import {local_repos_load} from '@fuzdev/fuz_gitops/local_repo.js';

__0

type { local_repo_paths: LocalRepoPath[]; log?: Logger | undefined; git_ops?: GitOperations | undefined; npm_ops?: NpmOperations | undefined; parallel?: boolean | undefined; concurrency?: number | undefined; sync?: boolean | undefined; allow_dirty?: boolean | undefined; }

returns

Promise<LocalRepo[]>

LocalRepo
#

local_repo.ts view source

LocalRepo import type {LocalRepo} from '@fuzdev/fuz_gitops/local_repo.js';

Fully loaded local repo with Library and extracted dependency data. Does not extend LocalRepoPath - Library is source of truth for name/repo_url/etc.

kind

Which packaging ecosystem the repo belongs to. npm repos (with a package.json) take part in the changeset publishing cascade; cargo repos (a Rust Cargo.toml, no package.json) are dashboard-only โ€” fetched and rendered like any repo but excluded from publishing/analysis. See repo_is_npm.

type 'npm' | 'cargo'

library

type Library

package_json

The repo's full package.json (with dependencies/devDependencies).

type PackageJson

repo_dir

type string

repo_git_ssh_url

type string

repo_config

type GitopsRepoConfig

dependencies?

type Map<string, string>

dev_dependencies?

type Map<string, string>

peer_dependencies?

type Map<string, string>

LocalRepoMissing
#

local_repo.ts view source

LocalRepoMissing import type {LocalRepoMissing} from '@fuzdev/fuz_gitops/local_repo.js';

A repo that is missing from the filesystem (needs cloning).

type

type 'local_repo_missing'

repo_name

type string

repo_url

type string

repo_git_ssh_url

type string

repo_config

type GitopsRepoConfig

LocalRepoPath
#

local_repo.ts view source

LocalRepoPath import type {LocalRepoPath} from '@fuzdev/fuz_gitops/local_repo.js';

A repo that has been located on the filesystem (path exists). Used before loading - just filesystem/git concerns.

type

type 'local_repo_path'

repo_name

type string

repo_dir

type string

repo_url

type string

repo_git_ssh_url

type string

repo_config

type GitopsRepoConfig

log_dependency_analysis
#

log_helpers.ts view source

(analysis: { production_cycles: string[][]; dev_cycles: string[][]; wildcard_deps: { pkg: string; dep: string; version: string; }[]; missing_peers: { pkg: string; dep: string; }[]; }, log: Logger, indent?: string): void import {log_dependency_analysis} from '@fuzdev/fuz_gitops/log_helpers.js';

Logs all dependency analysis results (wildcards, production cycles, dev cycles). Convenience function that calls all three logging functions in order.

analysis

type { production_cycles: string[][]; dev_cycles: string[][]; wildcard_deps: { pkg: string; dep: string; version: string; }[]; missing_peers: { pkg: string; dep: string; }[]; }

log

type Logger

indent

type string
default ''

returns

void

log_dev_cycles
#

log_helpers.ts view source

(analysis: { production_cycles: string[][]; dev_cycles: string[][]; wildcard_deps: { pkg: string; dep: string; version: string; }[]; missing_peers: { pkg: string; dep: string; }[]; }, log: Logger, indent?: string): void import {log_dev_cycles} from '@fuzdev/fuz_gitops/log_helpers.js';

Logs dev circular dependencies as info. Dev cycles are normal and non-blocking, so they're informational, not warnings.

analysis

type { production_cycles: string[][]; dev_cycles: string[][]; wildcard_deps: { pkg: string; dep: string; version: string; }[]; missing_peers: { pkg: string; dep: string; }[]; }

log

type Logger

indent

type string
default ''

returns

void

log_production_cycles
#

log_helpers.ts view source

(analysis: { production_cycles: string[][]; dev_cycles: string[][]; wildcard_deps: { pkg: string; dep: string; version: string; }[]; missing_peers: { pkg: string; dep: string; }[]; }, log: Logger, indent?: string): void import {log_production_cycles} from '@fuzdev/fuz_gitops/log_helpers.js';

Logs production/peer circular dependencies as errors. Production cycles block publishing and must be resolved.

analysis

type { production_cycles: string[][]; dev_cycles: string[][]; wildcard_deps: { pkg: string; dep: string; version: string; }[]; missing_peers: { pkg: string; dep: string; }[]; }

log

type Logger

indent

type string
default ''

returns

void

log_publishing_plan
#

publishing_plan_logging.ts view source

also exported from publishing_plan.ts

(plan: PublishingPlan, log: Logger, options?: LogPlanOptions): void import {log_publishing_plan} from '@fuzdev/fuz_gitops/publishing_plan_logging.js';

Logs a complete publishing plan to the console.

Displays errors, publishing order, version changes grouped by scenario, dependency-only updates, warnings, and a summary.

plan

log

type Logger

options

default {}

returns

void

log_wildcard_dependencies
#

log_helpers.ts view source

(analysis: { production_cycles: string[][]; dev_cycles: string[][]; wildcard_deps: { pkg: string; dep: string; version: string; }[]; missing_peers: { pkg: string; dep: string; }[]; }, log: Logger, indent?: string): void import {log_wildcard_dependencies} from '@fuzdev/fuz_gitops/log_helpers.js';

Logs wildcard dependencies as warnings. Wildcard dependencies require attention and should be reviewed.

analysis

type { production_cycles: string[][]; dev_cycles: string[][]; wildcard_deps: { pkg: string; dep: string; version: string; }[]; missing_peers: { pkg: string; dep: string; }[]; }

log

type Logger

indent

type string
default ''

returns

void

LogPlanOptions
#

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_gitops/publishing_event_handler.js';

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

event

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...

returns

{ 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...

masking_handler
#

publishing_event_handler.ts view source

(inner: PublishingEventHandler, mask?: (event: { event: "run_started"; wetrun: boolean; total: number; } | { event: "package_skipped"; name: string; reason: string; } | { ...; } | ... 6 more ... | { ...; }) => { ...; } | ... 8 more ... | { ...; }): PublishingEventHandler import {masking_handler} from '@fuzdev/fuz_gitops/publishing_event_handler.js';

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

inner

the handler to forward masked events to

mask

the masking function, defaults to mask_secrets

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; } | .....
default mask_secrets

returns

PublishingEventHandler

ModulesDetail
#

ModulesDetail.svelte view source

import ModulesDetail from '@fuzdev/fuz_gitops/ModulesDetail.svelte';

repos

type Repo[]

nav_footer?

type Snippet<[]>
optional

ModulesNav
#

ModulesNav.svelte view source

import ModulesNav from '@fuzdev/fuz_gitops/ModulesNav.svelte';

repos_modules

type { repo: Repo; modules: unknown[]; }[]

ModulesPage
#

multi_handler
#

publishing_event_handler.ts view source

(handlers: PublishingEventHandler[]): PublishingEventHandler import {multi_handler} from '@fuzdev/fuz_gitops/publishing_event_handler.js';

Fans an event out to every handler in order.

handlers

type PublishingEventHandler[]

returns

PublishingEventHandler

NamedRepos
#

config_reconcile.ts view source

NamedRepos import type {NamedRepos} from '@fuzdev/fuz_gitops/config_reconcile.js';

name

type string

repos

type Array<GitopsRepoConfig>

needs_update
#

version_utils.ts view source

(current: string, new_version: string): boolean import {needs_update} from '@fuzdev/fuz_gitops/version_utils.js';

current

type string

new_version

type string

returns

boolean

normalize_gitops_config
#

normalize_version_for_comparison
#

version_utils.ts view source

(version: string): string import {normalize_version_for_comparison} from '@fuzdev/fuz_gitops/version_utils.js';

Normalizes version string for comparison.

Strips prefixes (^, ~, >=) to get bare version number. Handles wildcards as-is. Used by needs_update to compare versions.

version

type string

returns

string

examples

normalize_version_for_comparison('^1.2.3') // '1.2.3'
normalize_version_for_comparison('>=2.0.0') // '2.0.0'
normalize_version_for_comparison('*') // '*'

NpmOperations
#

operations.ts view source

NpmOperations import type {NpmOperations} from '@fuzdev/fuz_gitops/operations.js';

NPM registry operations for package availability checks and authentication. Includes exponential backoff for waiting on package propagation.

wait_for_package

Waits for a package version to be available on NPM. Uses exponential backoff with configurable timeout.

type (options: { pkg: string; version: string; wait_options?: WaitOptions; log?: Logger; }) => Promise<Result<object, {message: string; timeout?: boolean}>>

check_auth

Checks npm authentication status.

type () => Promise<Result<{username: string}, {message: string}>>

check_registry

Checks if npm registry is reachable.

type () => Promise<Result<object, {message: string}>>

install

Installs npm dependencies.

type (options?: { cwd?: string; }) => Promise<Result<object, {message: string; stderr?: string}>>

null_handler
#

publishing_event_handler.ts view source

(): PublishingEventHandler import {null_handler} from '@fuzdev/fuz_gitops/publishing_event_handler.js';

Drops every event. The default when no handler is supplied.

returns

PublishingEventHandler

OutputFormat
#

OutputFormatters
#

output_helpers.ts view source

OutputFormatters<T> import type {OutputFormatters} from '@fuzdev/fuz_gitops/output_helpers.js';

generics

OutputFormatters<T>
T

json

type (data: T) => string

markdown

type (data: T) => Array<string>

stdout

This function should call log methods directly for colored/styled output.

type (data: T, log: Logger) => void

OutputOptions
#

package_exists
#

npm_registry.ts view source

(pkg: string, options?: { log?: Logger | undefined; }): Promise<boolean> import {package_exists} from '@fuzdev/fuz_gitops/npm_registry.js';

pkg

type string

options

type { log?: Logger | undefined; }
default {}

returns

Promise<boolean>

PackageInfo
#

npm_registry.ts view source

PackageInfo import type {PackageInfo} from '@fuzdev/fuz_gitops/npm_registry.js';

name

type string

version

type string

PageFooter
#

PageHeader
#

parse_changeset_content
#

changeset_reader.ts view source

(content: string, filename?: string): ChangesetInfo | null import {parse_changeset_content} from '@fuzdev/fuz_gitops/changeset_reader.js';

Parses changeset content string from markdown format.

Pure function for testability - no file I/O, just string parsing. Extracts package names, bump types, and summary from YAML frontmatter format. Returns null if format is invalid or no packages found.

Expected format:

--- "package-name": patch "@scope/package": minor --- Summary of changes

content

changeset markdown with YAML frontmatter

type string

filename

optional filename for error reporting context

type string
default 'changeset.md'

returns

ChangesetInfo | null

parsed changeset info or null if invalid format

parse_changeset_file
#

changeset_reader.ts view source

(filepath: string, log?: Logger | undefined): Promise<ChangesetInfo | null> import {parse_changeset_file} from '@fuzdev/fuz_gitops/changeset_reader.js';

filepath

type string

log?

type Logger | undefined
optional

returns

Promise<ChangesetInfo | null>

predict_next_version
#

changeset_reader.ts view source

(repo: LocalRepo, log?: Logger | undefined): Promise<{ version: string; bump_type: BumpType; } | null> import {predict_next_version} from '@fuzdev/fuz_gitops/changeset_reader.js';

Predicts the next version by analyzing all changesets in a repo.

Reads all changesets, determines the highest bump type for the package, and calculates the next version. Returns null if no changesets found.

Critical for dry-run mode accuracy - allows simulating publishes without actually running gro publish which consumes changesets.

repo

log?

type Logger | undefined
optional

returns

Promise<{ version: string; bump_type: BumpType; } | null>

predicted version and bump type, or null if no changesets

PreflightOperations
#

operations.ts view source

PreflightOperations import type {PreflightOperations} from '@fuzdev/fuz_gitops/operations.js';

Preflight validation operations to ensure repos are ready for publishing. Validates workspace state, branches, builds, and npm authentication.

run_preflight_checks

Runs preflight validation checks before publishing.

type (options: { repos: Array<LocalRepo>; preflight_options: PreflightOptions; git_ops?: GitOperations; npm_ops?: NpmOperations; build_ops?: BuildOperations; changeset_ops?: ChangesetOperations; }) => Promise<PreflightResult>

PreflightOptions
#

preflight_checks.ts view source

PreflightOptions import type {PreflightOptions} from '@fuzdev/fuz_gitops/preflight_checks.js';

skip_changesets?

type boolean

skip_build_validation?

type boolean

required_branch?

type string

check_remote?

type boolean

estimate_time?

type boolean

log?

type Logger

PreflightResult
#

preflight_checks.ts view source

PreflightResult import type {PreflightResult} from '@fuzdev/fuz_gitops/preflight_checks.js';

ok

type boolean

warnings

type Array<string>

errors

type Array<string>

repos_with_changesets

type Set<string>

repos_without_changesets

type Set<string>

estimated_duration?

type number

npm_username?

type string

ProcessOperations
#

operations.ts view source

ProcessOperations import type {ProcessOperations} from '@fuzdev/fuz_gitops/operations.js';

Process spawning operations for running shell commands.

spawn

Spawns a child process and waits for completion.

type (options: { cmd: string; args: Array<string>; cwd?: string; }) => Promise<Result<{stdout?: string; stderr?: string}, {message: string; stderr?: string}>>

publish_repos
#

multi_repo_publisher.ts view source

(repos: LocalRepo[], options: PublishingOptions): Promise<PublishingResult> import {publish_repos} from '@fuzdev/fuz_gitops/multi_repo_publisher.js';

repos

type LocalRepo[]

options

returns

Promise<PublishingResult>

publish_run_failed
#

publish_gate.ts view source

(result: Pick<PublishingResult, "ok">, fatal_error: Error | null): boolean import {publish_run_failed} from '@fuzdev/fuz_gitops/publish_gate.js';

Whether a finished run should exit non-zero: an unsuccessful result, or a fatal error thrown out of the executor.

result

type Pick<PublishingResult, "ok">

fatal_error

type Error | null

returns

boolean

PublishedVersion
#

multi_repo_publisher.ts view source

PublishedVersion import type {PublishedVersion} from '@fuzdev/fuz_gitops/multi_repo_publisher.js';

name

type string

old_version

type string

new_version

type string

bump_type

type 'major' | 'minor' | 'patch'

breaking

type boolean

commit

type string

tag

type string

PublishGate
#

publish_gate.ts view source

PublishGate import type {PublishGate} from '@fuzdev/fuz_gitops/publish_gate.js';

What the task should do with a generated plan before executing the cascade.

PublishGateOptions
#

publish_gate.ts view source

PublishGateOptions import type {PublishGateOptions} from '@fuzdev/fuz_gitops/publish_gate.js';

wetrun

A real publish (--wetrun); a dry run never prompts.

type boolean

show_plan

Show the plan and confirm (plan); --no-plan skips the prompt.

type boolean

plan

type Pick<PublishingPlan, 'errors'>

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).

PublishingEventHandler
#

publishing_event_handler.ts view source

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

A sink for publishing events.

emit

type (event: PublishingEvent) => void

PublishingOptions
#

PublishingPlan
#

publishing_plan.ts view source

PublishingPlan import type {PublishingPlan} from '@fuzdev/fuz_gitops/publishing_plan.js';

publishing_order

type Array<string>

version_changes

type Array<VersionChange>

dependency_updates

type Array<DependencyUpdate>

breaking_cascades

type Map<string, Array<string>>

warnings

type Array<string>

info

type Array<string>

errors

type Array<string>

verbose_data?

type VerboseData

PublishingResult
#

multi_repo_publisher.ts view source

PublishingResult import type {PublishingResult} from '@fuzdev/fuz_gitops/multi_repo_publisher.js';

ok

type boolean

published

type Array<PublishedVersion>

failed

type Array<{name: string; error: Error}>

duration

type number

events

The structured event stream for this run, in emission order.

type Array<PublishingEvent>

summary

Tallied outcome, derived from events.

type PublishingRunSummary

plan_errors

Plan errors that blocked (wetrun) or would block (dry run) publishing; empty when clean.

type Array<string>

plan_warnings

Non-blocking plan warnings (e.g. the fixed-point iteration limit).

type Array<string>

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.

PublishStep
#

publish_steps.ts view source

PublishStep import type {PublishStep} from '@fuzdev/fuz_gitops/publish_steps.js';

One ordered side-effect a wetrun would perform.

PublishStepVia
#

publish_steps.ts view source

PublishStepVia import type {PublishStepVia} from '@fuzdev/fuz_gitops/publish_steps.js';

How a package's version bump arises in the plan.

PullRequestMeta
#

PullRequestsDetail
#

PullRequestsPage
#

RawGitopsConfig
#

gitops_config.ts view source

RawGitopsConfig import type {RawGitopsConfig} from '@fuzdev/fuz_gitops/gitops_config.js';

repos?

type Array<Url | RawGitopsRepoConfig>

repos_dir?

type string

RawGitopsRepoConfig
#

gitops_config.ts view source

RawGitopsRepoConfig import type {RawGitopsRepoConfig} from '@fuzdev/fuz_gitops/gitops_config.js';

repo_url

type Url

repo_dir?

type string | null

branch?

type GitBranch

visibility?

Visibility of the repo on its host. Defaults to 'public'.

type GitopsRepoVisibility

ci?

Whether the repo runs CI. Defaults to true for public, false for private.

type boolean

archived?

Whether the repo is archived (read-only) on its host. Defaults to false.

type boolean

read_changesets
#

changeset_reader.ts view source

(repo: LocalRepo, log?: Logger | undefined): Promise<ChangesetInfo[]> import {read_changesets} from '@fuzdev/fuz_gitops/changeset_reader.js';

repo

log?

type Logger | undefined
optional

returns

Promise<ChangesetInfo[]>

reconcile_ci
#

ci_reconcile.ts view source

(repos: CiReconcileInput[]): CiDrift[] import {reconcile_ci} from '@fuzdev/fuz_gitops/ci_reconcile.js';

Compares each repo's declared ci against its actual workflow presence.

repos

type CiReconcileInput[]

returns

CiDrift[]

one CiDrift per repo whose declaration and reality disagree

reconcile_configs
#

config_reconcile.ts view source

(canonical: NamedRepos, subsets: NamedRepos[]): ConfigDrift[] import {reconcile_configs} from '@fuzdev/fuz_gitops/config_reconcile.js';

Compares each subset config against the canonical config. Repos that live only in the canonical config are fine โ€” the subsets are intentional partial views.

canonical

subsets

type NamedRepos[]

returns

ConfigDrift[]

one ConfigDrift per subset entry that is missing from the canonical config or whose intrinsic fields disagree with it

redact_secrets
#

publishing_event_handler.ts view source

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

Redacts known secret shapes from a string.

text

type string

returns

string

Repo
#

repo.svelte.ts view source

import {Repo} from '@fuzdev/fuz_gitops/repo.svelte.js';

Runtime repo with Library composition for package metadata.

Wraps a Library instance and adds GitHub-specific data (CI status, PRs). Convenience getters delegate to this.library.* for common properties.

library

type Library

readonly

package_json

The repo's full package.json (with dependencies/devDependencies).

type PackageJson

readonly

check_runs

type GithubCheckRunsItem | null

pull_requests

type Array<GithubPullRequest> | null

constructor

type new (repo_json: RepoJson): Repo

repo_json

name

type string

getter

repo_name

type string

getter

repo_url

type Url

getter

homepage_url

type Url | null

getter

logo_url

type Url | null

getter

logo_alt

type string

getter

npm_url

type Url | null

getter

changelog_url

type Url | null

getter

pkg_json

Curated package identity, delegating to library. Distinct from the full package_json.

type PkgJson

getter

source_json

type SourceJson

getter

repo_has_workflows
#

ci_reconcile.ts view source

(repo_dir: string): boolean import {repo_has_workflows} from '@fuzdev/fuz_gitops/ci_reconcile.js';

Whether a local repo directory contains at least one GitHub Actions workflow.

repo_dir

absolute or cwd-relative path to the repo's local directory

type string

returns

boolean

repo_is_npm
#

local_repo.ts view source

(repo: LocalRepo): boolean import {repo_is_npm} from '@fuzdev/fuz_gitops/local_repo.js';

Whether a repo is an npm package and so participates in publishing and dependency analysis. Non-npm repos (e.g. Rust cargo repos) are still synced and rendered on the dashboard, but excluded from the changeset cascade.

repo

returns

boolean

RepoAnalysis
#

RepoJson
#

repo.svelte.ts view source

RepoJson import type {RepoJson} from '@fuzdev/fuz_gitops/repo.svelte.js';

Serialized repo data as stored in repos.ts (JSON).

package_json is the repo's full package.json, carried alongside library_json because gitops reads dependencies/devDependencies for the publishing cascade โ€” fields the curated LibraryJson.pkg_json omits.

library_json

type LibraryJson

package_json

type PackageJson

check_runs

type GithubCheckRunsItem | null

pull_requests

type Array<GithubPullRequest> | null

RepoPath
#

repo_ops.ts view source

RepoPath import type {RepoPath} from '@fuzdev/fuz_gitops/repo_ops.js';

name

type string

path

type string

url

type string

Repos
#

repos_context
#

repo.svelte.ts view source

{ get: (error_message?: string | undefined) => Repos; get_maybe: () => Repos | undefined; set: (value: Repos) => Repos; } import {repos_context} from '@fuzdev/fuz_gitops/repo.svelte.js';

repos_parse
#

repo.svelte.ts view source

(repos: Repo[], homepage_url: string): Repos import {repos_parse} from '@fuzdev/fuz_gitops/repo.svelte.js';

repos

type Repo[]

homepage_url

type string

returns

Repos

ReposTable
#

ReposTable.svelte view source

import ReposTable from '@fuzdev/fuz_gitops/ReposTable.svelte';

repos

type Repo[]

deps?

type string[]
optional default ['@fuzdev/fuz_ui', '@fuzdev/gro']

ReposTree
#

ReposTree.svelte view source

import ReposTree from '@fuzdev/fuz_gitops/ReposTree.svelte';

repos

type Repo[]

selected_repo?

type Repo
optional

nav

type Snippet<[]>

ReposTreeNav
#

ReposTreeNav.svelte view source

accepts children

import ReposTreeNav from '@fuzdev/fuz_gitops/ReposTreeNav.svelte';

repos

type Repo[]

selected_repo?

type Repo
optional

children

type Snippet<[]>

required_bump_for_dependency_update
#

version_utils.ts view source

(current_version: string, has_breaking_deps: boolean): BumpType import {required_bump_for_dependency_update} from '@fuzdev/fuz_gitops/version_utils.js';

The bump a package must take when one of its prod/peer dependencies updates. Pre-1.0: minor for a breaking dependency, otherwise patch. 1.0+: major for a breaking dependency, otherwise patch.

Single source of truth for the dependency-driven bump rule, shared by the plan (get_required_bump_for_dependencies) and the auto-changeset generator (calculate_required_bump) so the two never drift.

current_version

the package's current version, used to detect the pre-1.0 regime

type string

has_breaking_deps

whether any updated dependency is a breaking change

type boolean

returns

BumpType

resolve_gitops_config
#

resolved_gitops_config.ts view source

(gitops_config: GitopsConfig, repos_dir: string): ResolvedGitopsConfig import {resolve_gitops_config} from '@fuzdev/fuz_gitops/resolved_gitops_config.js';

gitops_config

repos_dir

type string

returns

ResolvedGitopsConfig

resolve_gitops_paths
#

ResolvedGitopsConfig
#

resolved_gitops_config.ts view source

ResolvedGitopsConfig import type {ResolvedGitopsConfig} from '@fuzdev/fuz_gitops/resolved_gitops_config.js';

local_repos

type Array<LocalRepoPath | LocalRepoMissing> | null

local_repo_paths

type Array<LocalRepoPath> | null

local_repos_missing

type Array<LocalRepoMissing> | null

ResolveGitopsPathsOptions
#

gitops_task_helpers.ts view source

ResolveGitopsPathsOptions import type {ResolveGitopsPathsOptions} from '@fuzdev/fuz_gitops/gitops_task_helpers.js';

config

type string

dir?

type string

config_repos_dir?

type string

run_preflight_checks
#

preflight_checks.ts view source

({ repos, preflight_options, git_ops, npm_ops, build_ops, changeset_ops, }: RunPreflightChecksOptions): Promise<PreflightResult> import {run_preflight_checks} from '@fuzdev/fuz_gitops/preflight_checks.js';

Validates all requirements before publishing can proceed.

Performs comprehensive pre-flight validation:

  • Clean workspaces (100% clean required - no uncommitted changes)
  • Correct branch (usually main)
  • Changesets present (unless skip_changesets=true)
  • Builds successful (fail-fast to prevent broken state)
  • Git remote reachability
  • NPM authentication with username
  • NPM registry connectivity

Build validation runs BEFORE any publishing to prevent the scenario where version is bumped but build fails, leaving repo in broken state.

__0

returns

Promise<PreflightResult>

result with ok=false if any errors, plus warnings and detailed status

RunPreflightChecksOptions
#

should_exclude_path
#

repo_ops.ts view source

(file_path: string, options?: WalkOptions | undefined): boolean import {should_exclude_path} from '@fuzdev/fuz_gitops/repo_ops.js';

Check if a path should be excluded based on options.

file_path

type string

options?

type WalkOptions | undefined
optional

returns

boolean

stdout_handler
#

publishing_event_handler.ts view source

(): PublishingEventHandler import {stdout_handler} from '@fuzdev/fuz_gitops/publishing_event_handler.js';

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

returns

PublishingEventHandler

strip_version_prefix
#

version_utils.ts view source

(version: string): string import {strip_version_prefix} from '@fuzdev/fuz_gitops/version_utils.js';

Strips version prefix (^, ~, >=, <=, etc) from a version string.

version

type string

returns

string

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; }

TablePage
#

task
#

gitops_run.task.ts view source

Task<{ _: string[]; config: string; concurrency: number; format: "json" | "text"; outfile?: string | undefined; }, ZodType<Args, Args, $ZodTypeInternals<Args, Args>>, unknown> import {task} from '@fuzdev/fuz_gitops/gitops_run.task.js';

to_pull_requests
#

github_helpers.ts view source

(repos: Repo[], filter_pull_request?: FilterPullRequest | undefined): PullRequestMeta[] import {to_pull_requests} from '@fuzdev/fuz_gitops/github_helpers.js';

repos

type Repo[]

filter_pull_request?

type FilterPullRequest | undefined
optional

returns

PullRequestMeta[]

to_pull_url
#

github_helpers.ts view source

(repo_url: string, pull: { number: number; title: string; user: { login: string; }; draft: boolean; }): string import {to_pull_url} from '@fuzdev/fuz_gitops/github_helpers.js';

repo_url

type string

pull

type { number: number; title: string; user: { login: string; }; draft: boolean; }

returns

string

TreeItemPage
#

TreePage
#

update_all_repos
#

dependency_updater.ts view source

(repos: LocalRepo[], published: Map<string, string>, options?: UpdateAllReposOptions): Promise<{ updated: number; failed: { repo: string; error: Error; }[]; }> import {update_all_repos} from '@fuzdev/fuz_gitops/dependency_updater.js';

repos

type LocalRepo[]

published

type Map<string, string>

options

default {}

returns

Promise<{ updated: number; failed: { repo: string; error: Error; }[]; }>

update_package_json
#

dependency_updater.ts view source

(repo: LocalRepo, updates: Map<string, string>, options?: UpdatePackageJsonOptions): Promise<void> import {update_package_json} from '@fuzdev/fuz_gitops/dependency_updater.js';

Updates package.json dependencies and creates changeset if needed.

Workflow:

  1. Updates all dependency types (dependencies, devDependencies, peerDependencies)
  2. Writes updated package.json with tabs formatting
  3. Creates auto-changeset if published_versions provided (for transitive updates)
  4. Commits both package.json and changeset with standard message

Uses version strategy to determine prefix (exact, caret, tilde) while preserving existing prefixes when possible.

repo

updates

type Map<string, string>

options

default {}

returns

Promise<void>

throws

  • if - file operations or git operations fail

UpdateAllReposOptions
#

UpdatePackageJsonOptions
#

validate_dependency_graph
#

graph_validation.ts view source

(repos: LocalRepo[], options?: { log?: Logger | undefined; throw_on_prod_cycles?: boolean | undefined; log_cycles?: boolean | undefined; log_order?: boolean | undefined; }): GraphValidationResult import {validate_dependency_graph} from '@fuzdev/fuz_gitops/graph_validation.js';

Shared utility for building dependency graph, detecting cycles, and computing publishing order. This centralizes logic that was duplicated across multi_repo_publisher, publishing_plan, and gitops_analyze.

repos

type LocalRepo[]

options

type { log?: Logger | undefined; throw_on_prod_cycles?: boolean | undefined; log_cycles?: boolean | undefined; log_order?: boolean | undefined; }
default {}

returns

GraphValidationResult

graph validation result with graph, publishing order, and detected cycles

throws

  • if - production cycles detected and `throw_on_prod_cycles` is true

validate_gitops_config_module
#

gitops_config.ts view source

(config_module: any, config_path: string): asserts config_module is GitopsConfigModule import {validate_gitops_config_module} from '@fuzdev/fuz_gitops/gitops_config.js';

config_module

type any

config_path

type string

returns

void

VerboseChangesetDetail
#

publishing_plan.ts view source

VerboseChangesetDetail import type {VerboseChangesetDetail} from '@fuzdev/fuz_gitops/publishing_plan.js';

package_name

type string

files

type Array<{filename: string; bump_type: BumpType; summary: string}>

VerboseData
#

publishing_plan.ts view source

VerboseData import type {VerboseData} from '@fuzdev/fuz_gitops/publishing_plan.js';

changeset_details

type Array<VerboseChangesetDetail>

iterations

type Array<VerboseIteration>

propagation_chains

type Array<VerbosePropagationChain>

graph_summary

type VerboseGraphSummary

total_iterations

type number

VerboseGraphSummary
#

publishing_plan.ts view source

VerboseGraphSummary import type {VerboseGraphSummary} from '@fuzdev/fuz_gitops/publishing_plan.js';

package_count

type number

internal_dep_count

type number

prod_peer_edges

type Array<{from: string; to: string; type: 'prod' | 'peer'}>

dev_edges

type Array<{from: string; to: string}>

prod_cycle_count

type number

dev_cycle_count

type number

VerboseIteration
#

publishing_plan.ts view source

VerboseIteration import type {VerboseIteration} from '@fuzdev/fuz_gitops/publishing_plan.js';

iteration

type number

packages

type Array<VerboseIterationPackage>

new_changes

type number

VerboseIterationPackage
#

publishing_plan.ts view source

VerboseIterationPackage import type {VerboseIterationPackage} from '@fuzdev/fuz_gitops/publishing_plan.js';

name

type string

changeset_count

type number

bump_from_changesets

type BumpType | null

required_bump

type BumpType | null

triggering_dep

type string | null

action

type 'publish' | 'auto_changeset' | 'escalation' | 'skip'

version_to

type string | null

is_breaking

type boolean

VerbosePropagationChain
#

publishing_plan.ts view source

VerbosePropagationChain import type {VerbosePropagationChain} from '@fuzdev/fuz_gitops/publishing_plan.js';

source

type string

chain

type Array<{pkg: string; dep_type: 'prod' | 'peer'; action: string}>

VersionChange
#

publishing_plan.ts view source

VersionChange import type {VersionChange} from '@fuzdev/fuz_gitops/publishing_plan.js';

package_name

type string

from

type string

to

type string

bump_type

type BumpType

breaking

type boolean

has_changesets

type boolean

will_generate_changeset?

type boolean

needs_bump_escalation?

type boolean

existing_bump?

type BumpType

required_bump?

type BumpType

VersionStrategy
#

wait_for_package
#

npm_registry.ts view source

(pkg: string, version: string, options?: WaitOptions): Promise<void> import {wait_for_package} from '@fuzdev/fuz_gitops/npm_registry.js';

Waits for package version to propagate to NPM registry.

Uses exponential backoff with jitter to avoid hammering registry. Logs progress every 5 attempts. Respects timeout to avoid infinite waits.

Critical for multi-repo publishing: ensures published packages are available before updating dependent packages.

pkg

type string

version

type string

options

default {}

returns

Promise<void>

throws

  • if - timeout reached or max attempts exceeded

WaitOptions
#

npm_registry.ts view source

WaitOptions import type {WaitOptions} from '@fuzdev/fuz_gitops/npm_registry.js';

log?

type Logger

max_attempts?

type number

initial_delay?

type number

max_delay?

type number

timeout?

type number

walk_repo_files
#

repo_ops.ts view source

(dir: string, options?: WalkOptions | undefined): AsyncGenerator<string, void, undefined> import {walk_repo_files} from '@fuzdev/fuz_gitops/repo_ops.js';

Walk files in a directory, respecting common exclusions. Yields absolute paths to files (and optionally directories).

dir

directory to walk

type string

options?

walk options for exclusions and filtering

type WalkOptions | undefined
optional

returns

AsyncGenerator<string, void, undefined>

WalkOptions
#

repo_ops.ts view source

WalkOptions import type {WalkOptions} from '@fuzdev/fuz_gitops/repo_ops.js';

exclude_dirs?

Additional directories to exclude (merged with defaults)

type Array<string>

exclude_extensions?

Additional extensions to exclude (merged with defaults)

type Array<string>

max_file_size?

Maximum file size in bytes (default: 10MB)

type number

include_dirs?

Include directories in output (default: false)

type boolean

no_defaults?

Use only provided exclusions, ignoring defaults

type boolean