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
- Publish
Result - Publish result for a single package
- Sync
Report - Result of a sync operation: which entries were rewritten.
- Unified
FmtReport - Structured summary returned by unified workspace text formatting.
- Version
- Parsed version components following semantic versioning
Enums§
- Bump
Version Type - Types of version bumps
- Command
Type - Available commands
- File
Format Kind - Supported text formatting strategy resolved from a file’s name or extension.
- Publish
Error - Error types for publish operation
- Sync
Error - 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
pathbased 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 Codeesbenp.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 publishstderr indicates the package version is already present on the registry (a success case for idempotent re-runs). - is_
rate_ limited - Check whether
cargo publishstderr 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).