Skip to main content

Crate crate_cli

Crate crate_cli 

Source
Expand description

crate-cli

A command-line tool for managing Cargo package lifecycles: version bump, workspace dependency sync, members-ordered publish and code formatting.

Structs§

Args
Parsed command line arguments
Logger
Custom logger implementation for the hyperlane-cli.
Package
Package information in monorepo
PublishResult
Publish result for a single package
SyncReport
Result of a sync operation: which entries were rewritten.
UnifiedFmtReport
Structured summary returned by unified workspace text formatting.
Version
Parsed version components following semantic versioning

Enums§

BumpVersionType
Types of version bumps
CommandType
Available commands
FileFormatKind
Supported text formatting strategy resolved from a file’s name or extension.
PublishError
Error types for publish operation
SyncError
Error types for sync operation

Constants§

CARGO_TOML
Manifest file name every Cargo package root is looked up under.

Functions§

char_display_width
Computes the terminal/Prettier column display width of a single Unicode scalar value.
detect_format_kind
Resolves the unified formatting strategy for path based on filename and extension.
execute_bump
Read and update version in Cargo.toml
execute_fmt
Execute fmt command across all workspace text files and Rust sources.
execute_publish
Execute publish command for all packages in workspace
execute_sync
Align every local path entry under [workspace.dependencies] with the workspace root version, and (optionally) the dep alias with the member crate’s actual [package].name.
execute_unified_fmt
Executes the unified text and Rust formatting pipeline (all text files, derive sorting, and cargo fmt) without clippy-fix.
format_json
Formats strict JSON matching Prettier 3.7.4 (tabWidth: 2, printWidth: 80, bracketSpacing: true, LF).
format_jsonc
Formats JSONC (JSON with // or /* */ comments and trailing commas) matching Prettier 3.7.4 (tabWidth: 2, LF).
format_markdown
Formats Markdown (.md / .markdown) matching VS Code esbenp.prettier-vscode (tabWidth: 2, singleQuote: true, proseWrap: "preserve", embeddedLanguageFormatting: "auto", LF).
format_path
Format code or supported text files at a specific path.
format_plain_text
Formats generic plain text files with LF line endings, trimmed trailing whitespace, and a single trailing newline.
format_text_by_path
Formats text content in memory according to the file type inferred from path.
format_toml
Formats TOML files cleanly while preserving key order, dependency grouping, and Taplo/Cargo.toml 4-space array indentation.
format_workspace_text_files
Recursively discovers and formats all supported non-Rust text files under root (or a single file).
format_yaml
Formats YAML / YML content matching VS Code esbenp.prettier-vscode (tabWidth: 2, singleQuote: true, bracketSpacing: true, LF).
is_already_published
Check whether cargo publish stderr indicates the package version is already present on the registry (a success case for idempotent re-runs).
is_rate_limited
Check whether cargo publish stderr reports a registry rate-limit refusal rather than a fault that retrying cannot fix.
normalize_line_endings
Normalizes CRLF and lone CR line endings to LF (\n).
parse_args
Parse command line arguments
parse_rate_limit_wait_secs
Parse the RFC 2822 retry deadline crates.io embeds in a refusal.
print_help
Print help message
print_version
Print version
resolve_publish_order
Resolve the publish order for a workspace: [workspace.members] declaration order, with the root package (if any) placed at its topological position, validated against local dependency constraints.
str_display_width
Computes the Prettier column display width of a string (CJK and emoji wide characters count as 2).