api #

Declarations
#

a tool for managing many repos

184 declarations

BuildOperations
#

operations.ts view source

BuildOperations

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
#

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

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
#

ChangesetInfo
#

ChangesetOperations
#

operations.ts view source

ChangesetOperations

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>

pkg

type string

version

type string

options

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

returns

Promise<boolean>

collect_repo_files
#

repo_ops.ts view source

(dir: string, options?: WalkOptions | undefined): Promise<string[]>

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
#

create_changeset_for_dependency_updates
#

changeset_generator.ts view source

(repo: LocalRepo, updates: DependencyVersionChange[], options?: { log?: Logger | undefined; }): Promise<string>

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

repo

updates

type DependencyVersionChange[]

options

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

returns

Promise<string>

create_dependency_updates
#

changeset_generator.ts view source

(dependencies: Map<string, string>, published_versions: Map<string, PublishedVersion>): DependencyVersionChange[]

dependencies

type Map<string, string>

published_versions

type Map<string, PublishedVersion>

returns

DependencyVersionChange[]

create_empty_gitops_config
#

create_fs_fetch_value_cache
#

fs_fetch_value_cache.ts view source

(name: string, dir?: string): Promise<FetchCache>

Creates file-system backed cache for belt'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
#

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"]

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"]

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

default_fs_operations
#

default_git_operations
#

default_gitops_operations
#

default_npm_operations
#

default_preflight_operations
#

default_process_operations
#

DEFAULT_REPOS_DIR
#

paths.ts view source

".."

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
#

DependencyGraph
#

dependency_graph.ts view source

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.

Uses Kahn's algorithm with alphabetical ordering within tiers for deterministic results. 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

type (): string[][]

returns string[][]

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

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

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

name

type string

version

type string

repo

dependencies

type Map<string, DependencySpec>

dependents

type Set<string>

publishable

type boolean

DependencySpec
#

DependencyType
#

DependencyUpdate
#

publishing_plan.ts view source

DependencyUpdate

dependent_package

type string

updated_dependency

type string

current_version

type string

new_version

type string

type

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

causes_republish

type boolean

DependencyVersionChange
#

changeset_generator.ts view source

DependencyVersionChange

package_name

type string

from_version

type string

to_version

type string

bump_type

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

breaking

type boolean

detect_bump_type
#

version_utils.ts view source

(old_version: string, new_version: string): "major" | "minor" | "patch"

old_version

type string

new_version

type string

returns

"major" | "minor" | "patch"

determine_bump_from_changesets
#

changeset_reader.ts view source

(changesets: ChangesetInfo[], package_name: string): BumpType | null

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

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

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

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

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 belt'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
#

FilterPullRequest
#

find_updates_needed
#

dependency_updater.ts view source

(repo: LocalRepo, published: Map<string, string>): Map<string, { current: string; new: string; type: "dependencies" | "devDependencies" | "peerDependencies"; }>

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>

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>

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[]

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[]

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_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[]

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

File system operations for reading and writing files.

readFile

Reads a file from the file system.

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

writeFile

Writes a file to the file system.

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

generate_changeset_content
#

changeset_generator.ts view source

(package_name: string, updates: DependencyVersionChange[], bump_type: "major" | "minor" | "patch"): string

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

(repos: LocalRepo[], options?: GeneratePlanOptions): Promise<PublishingPlan>

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.

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

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. Switches branches and pulls latest changes 4. Auto-installs deps if package.json changed during pull

Priority for path resolution: - dir argument (explicit override) - Config repos_dir setting - DEFAULT_REPOS_DIR constant

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>

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[]>

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

config_path?

Path to gitops.config.ts (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

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

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

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

version

type string

returns

string

GetGitopsReadyOptions
#

git_add
#

git_operations.ts view source

(files: string | string[], options?: SpawnOptions | undefined): Promise<void>

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>

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>

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>

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>

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>

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_get_changed_files
#

git_operations.ts view source

(options?: SpawnOptions | undefined): Promise<string[]>

Returns list of changed files compared to HEAD.

options?

type SpawnOptions | undefined
optional

returns

Promise<string[]>

git_has_changes
#

git_operations.ts view source

(options?: SpawnOptions | undefined): Promise<boolean>

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>

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>

remote

type string
default 'origin'

options?

type SpawnOptions | undefined
optional

returns

Promise<boolean>

git_push_tag
#

git_operations.ts view source

(tag_name: string, origin?: GitOrigin, options?: SpawnOptions | undefined): Promise<void>

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>

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>

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>

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>

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>

GithubCheckRunsItem
#

GithubPullRequest
#

GithubPullRequests
#

github.ts view source

ZodArray<ZodObject<{ number: ZodNumber; title: ZodString; user: ZodObject<{ login: ZodString; }, $strip>; draft: ZodBoolean; }, $strip>>

GithubRepoInfo
#

github.ts view source

GithubRepoInfo

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

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 if there are any uncommitted changes.

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

get_changed_files

Gets a list of changed files.

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_OUTPUT_DIR
#

GitopsConfig
#

GitopsConfigModule
#

GitopsOperations
#

GitopsRepoConfig
#

gitops_config.ts view source

GitopsRepoConfig

repo_url

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

type Url

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

branch

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

type GitBranch

GraphValidationResult
#

has_changesets
#

changeset_reader.ts view source

(repo: LocalRepo): Promise<boolean>

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
#

install_with_cache_healing
#

npm_install_helpers.ts view source

(repo: LocalRepo, ops: GitopsOperations, log?: Logger | undefined): Promise<void>

Installs npm dependencies with cache healing on ETARGET errors.

Strategy: 1. First attempt: regular npm install 2. On ETARGET error (stale cache): npm cache clean --force then retry 3. On other errors: fail immediately

Why ETARGET errors occur: After publishing a package and waiting for NPM registry propagation, npm's local cache may still have stale "404" metadata. This healing strategy clears the cache to force fresh metadata fetch.

repo

- The repository to install dependencies for

ops

- Gitops operations (for dependency injection)

log?

- Optional logger

type Logger | undefined
optional

returns

Promise<void>

throws

  • Error - if install fails (with details about cache healing attempts)

is_breaking_change
#

version_utils.ts view source

(old_version: string, bump_type: "major" | "minor" | "patch"): boolean

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

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

returns

boolean

is_wildcard
#

load_gitops_config
#

gitops_config.ts view source

(config_path: string): Promise<GitopsConfig | null>

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, }: { local_repo_path: LocalRepoPath; log?: Logger | undefined; git_ops?: GitOperations | undefined; npm_ops?: NpmOperations | undefined; }): Promise<...>

Loads repo data with automatic syncing and dependency management.

Workflow: 1. Records current commit hash (for detecting changes) 2. Switches to target branch if needed (requires clean workspace) 3. Pulls latest changes from remote (skipped for local-only repos) 4. Validates workspace is clean after pull 5. Auto-installs dependencies if package.json changed 6. Imports library_json from src/routes/library.ts 7. Creates Library and extracts dependency maps

This ensures repos are always in sync with their configured branch before being used by gitops commands.

__0

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

returns

Promise<LocalRepo>

throws

  • if - workspace dirty, branch switch fails, install fails, or library.ts missing

local_repo_locate
#

local_repo.ts view source

({ repo_config, repos_dir, }: { repo_config: GitopsRepoConfig; repos_dir: string; }): LocalRepoPath | LocalRepoMissing

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

__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, }: { local_repo_paths: LocalRepoPath[]; log?: Logger | undefined; git_ops?: GitOperations | undefined; npm_ops?: NpmOperations | undefined; }): Promise<...>

__0

type { local_repo_paths: LocalRepoPath[]; log?: Logger | undefined; git_ops?: GitOperations | undefined; npm_ops?: NpmOperations | undefined; }

returns

Promise<LocalRepo[]>

LocalRepo
#

local_repo.ts view source

LocalRepo

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

library

type Library

library_json

type LibraryJson

repo_dir

type string

repo_git_ssh_url

type string

repo_config

dependencies

type Map<string, string>

dev_dependencies

type Map<string, string>

peer_dependencies

type Map<string, string>

LocalRepoMissing
#

local_repo.ts view source

LocalRepoMissing

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

LocalRepoPath
#

local_repo.ts view source

LocalRepoPath

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

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

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

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_list
#

log_helpers.ts view source

(items: string[], header: string, color: "cyan" | "yellow" | "red" | "dim", log: Logger, log_method?: "info" | "warn" | "error"): void

Logs a simple bulleted list with a header. Common pattern for warnings, info messages, and other lists.

items

type string[]

header

type string

color

type "cyan" | "yellow" | "red" | "dim"

log

type Logger

log_method

type "info" | "warn" | "error"
default 'info'

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

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

(plan: PublishingPlan, log: Logger, options?: LogPlanOptions): void

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

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
#

MAX_ITERATIONS
#

constants.ts view source

10

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.

ModulesDetail
#

ModulesNav
#

ModulesPage
#

needs_update
#

version_utils.ts view source

(current: string, new_version: string): boolean

current

type string

new_version

type string

returns

boolean

normalize_gitops_config
#

normalize_version_for_comparison
#

version_utils.ts view source

(version: string): string

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

Example 1
Example 2
Example 3

NpmOperations
#

operations.ts view source

NpmOperations

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_package_available

Checks if a package version is available on NPM.

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

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

cache_clean

Cleans the npm cache. Uses npm cache clean --force to clear stale cache entries.

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

OutputFormat
#

OutputFormatters
#

output_helpers.ts view source

OutputFormatters<T>

generics

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>

pkg

type string

options

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

returns

Promise<boolean>

PackageInfo
#

PageFooter
#

PageHeader
#

parse_changeset_content
#

changeset_reader.ts view source

(content: string, filename?: string): ChangesetInfo | null

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>

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>

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

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

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

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

Process spawning operations for running shell commands.

spawn

Spawns a child process and waits for completion.

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

publish_repos
#

PublishedVersion
#

multi_repo_publisher.ts view source

PublishedVersion

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

PublishingOptions
#

PublishingPlan
#

publishing_plan.ts view source

PublishingPlan

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

PublishingResult
#

multi_repo_publisher.ts view source

PublishingResult

ok

type boolean

published

type Array<PublishedVersion>

failed

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

duration

type number

PullRequestMeta
#

PullRequestsDetail
#

PullRequestsPage
#

RawGitopsConfig
#

RawGitopsRepoConfig
#

read_changesets
#

Repo
#

repo.svelte.ts view source

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

check_runs

type GithubCheckRunsItem | null

pull_requests

type Array<GithubPullRequest> | null

constructor

type new (repo_json: RepoJson): Repo

repo_json

RepoJson
#

repo.svelte.ts view source

RepoJson

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

library_json

type LibraryJson

check_runs

type GithubCheckRunsItem | null

pull_requests

type Array<GithubPullRequest> | null

RepoPath
#

Repos
#

repos_context
#

repo.svelte.ts view source

{ get: (error_message?: string | undefined) => Repos; get_maybe: () => Repos | undefined; set: (value: Repos) => Repos; }

repos_parse
#

repo.svelte.ts view source

(repos: Repo[], homepage_url: string): Repos

repos

type Repo[]

homepage_url

type string

returns

Repos

ReposTable
#

ReposTree
#

ReposTreeNav
#

resolve_gitops_config
#

resolve_gitops_paths
#

ResolvedGitopsConfig
#

resolved_gitops_config.ts view source

ResolvedGitopsConfig

local_repos

type Array<LocalRepoPath | LocalRepoMissing> | null

local_repo_paths

type Array<LocalRepoPath> | null

local_repos_missing

type Array<LocalRepoMissing> | null

ResolveGitopsPathsOptions
#

run_preflight_checks
#

preflight_checks.ts view source

({ repos, preflight_options, git_ops, npm_ops, build_ops, changeset_ops, }: RunPreflightChecksOptions): Promise<PreflightResult>

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
#

Semver
#

semver.ts view source

Semver

major

type number

minor

type number

patch

type number

prerelease

type string

build

type string

semver_bump_version
#

semver.ts view source

(version: string, type: BumpType): string

Bumps a version according to the specified type. Resets lower version numbers per SemVer spec.

version

type string

type

returns

string

semver_compare_versions
#

semver.ts view source

(a: string, b: string): number

Compares two semver versions according to SemVer 2.0.0 spec. Returns -1 if a < b, 0 if a === b, 1 if a > b. Build metadata is ignored in precedence comparison.

a

type string

b

type string

returns

number

serialize_graph
#

SerializedGraph
#

SerializedNode
#

serialization_types.ts view source

SerializedNode

name

type string

version

type string

dependencies

type Array<{ name: string; type: string; version: string; }>

dependents

type Array<string>

publishable

type boolean

SerializedPublishingPlan
#

serialization_types.ts view source

SerializedPublishingPlan

publishing_order

type Array<string>

version_changes

type Array<{ package_name: string; from: string; to: string; bump_type: string; breaking: boolean; has_changesets: boolean; will_generate_changeset?: boolean; needs_bump_escalation?: boolean; existing_bump?: string; required_bump?: string; }>

dependency_updates

type Array<{ dependent_package: string; updated_dependency: string; new_version: string; type: string; causes_republish: boolean; }>

breaking_cascades

type Record<string, Array<string>>

warnings

type Array<string>

errors

type Array<string>

should_exclude_path
#

repo_ops.ts view source

(file_path: string, options?: WalkOptions | undefined): boolean

Check if a path should be excluded based on options.

file_path

type string

options?

type WalkOptions | undefined
optional

returns

boolean

strip_version_prefix
#

version_utils.ts view source

(version: string): string

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

version

type string

returns

string

TablePage
#

to_pull_requests
#

github_helpers.ts view source

(repos: Repo[], filter_pull_request?: FilterPullRequest | undefined): PullRequestMeta[]

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

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

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>

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

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

config_module

type any

config_path

type string

returns

void

VerboseChangesetDetail
#

publishing_plan.ts view source

VerboseChangesetDetail

package_name

type string

files

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

VerboseData
#

publishing_plan.ts view source

VerboseData

changeset_details

type Array<VerboseChangesetDetail>

iterations

type Array<VerboseIteration>

propagation_chains

type Array<VerbosePropagationChain>

graph_summary

total_iterations

type number

VerboseGraphSummary
#

publishing_plan.ts view source

VerboseGraphSummary

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
#

VerboseIterationPackage
#

publishing_plan.ts view source

VerboseIterationPackage

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

source

type string

chain

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

VersionChange
#

publishing_plan.ts view source

VersionChange

package_name

type string

from

type string

to

type string

bump_type

breaking

type boolean

has_changesets

type boolean

will_generate_changeset

type boolean

needs_bump_escalation

type boolean

existing_bump

required_bump

VersionStrategy
#

wait_for_package
#

npm_registry.ts view source

(pkg: string, version: string, options?: WaitOptions): Promise<void>

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

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>

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

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