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 matching VS Code settings.json.
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_css
Formats CSS (.css, .wxss) matching VS Code Prettier 3.7.4 (singleQuote: true, tabWidth: 2).
format_html
Formats HTML (.html, .htm) including embedded <script> and <style> blocks matching VS Code Prettier 3.7.4.
format_javascript
Formats JavaScript (.js, .mjs, .cjs, .wxs) matching VS Code Prettier 3.7.4 (singleQuote: true, semi: true, tabWidth: 2).
format_json
Formats JSON (.json, tsconfig.json, .vscode/*.json) matching VS Code Prettier 3.7.4 json parser (tabWidth: 2, printWidth: 80, objectWrap: "preserve", allows comments, strips trailing commas).
format_json_stringify
Formats JSON manifests (package.json, package-lock.json, composer.json) matching VS Code Prettier 3.7.4 json-stringify parser.
format_jsonc
Formats JSONC (.jsonc, .cjson) matching VS Code Prettier 3.7.4 jsonc parser (preserving comments and trailingComma: "all").
format_less
Formats Less (.less) matching VS Code Prettier 3.7.4 (singleQuote: true, tabWidth: 2).
format_markdown
Formats Markdown (.md / .markdown / .mdx) matching VS Code esbenp.prettier-vscode (Prettier 3.7.4: tabWidth: 2, singleQuote: true, semi: true, printWidth: 80, 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_scss
Formats SCSS (.scss) matching VS Code Prettier 3.7.4 (singleQuote: true, tabWidth: 2).
format_text_by_path
Formats text content in memory according to the file type inferred from path matching VS Code save behavior.
format_toml
Formats TOML files matching VS Code tamasfe.even-better-toml (Taplo 0.7.0 defaults with 4-space indentation).
format_tsx
Formats TypeScript JSX (.tsx) matching VS Code Prettier 3.7.4 (singleQuote: true, jsxSingleQuote: false, semi: true, tabWidth: 2).
format_typescript
Formats TypeScript (.ts, .mts, .cts) matching VS Code Prettier 3.7.4 (singleQuote: true, semi: true, tabWidth: 2).
format_vue
Formats Vue Single-File Components (.vue) including embedded <script> and <style> blocks matching VS Code Prettier 3.7.4.
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 (Prettier 3.7.4: tabWidth: 2, singleQuote: true, printWidth: 80, bracketSpacing: true, proseWrap: "preserve", 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) in a single pass.
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).