Skip to content
crates-devPublic

About

Unified Rust 2024 Workspace for Core Macros, CLI Tooling, Async Concurrency, Networking, Security & Payments.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

 

History

144 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ctares

Unified Rust 2024 Workspace for Core Macros, CLI Tooling, Async Concurrency, Networking, Security & Payments

CI Status Rust 2024 License: MIT

Workspace Matrix · Architecture · Quick Start · Unified Formatter (crate fmt) · Verification · Agent Governance


Overview

ctares is the foundational monorepo under the crates-dev GitHub organization. It consolidates 35 independently published Rust crates into a single version-synchronized Cargo workspace while preserving each crate's isolated directory layout, unit/integration test suite, and independent crates.io release lifecycle.

It powers upstream developer tooling and shared runtime primitives across the euv, hyperlane, hyperlane-quick-start, and commerce-suite ecosystem.


Architecture

flowchart TB
    CLI["Toolchain & Unified Formatter\ncrate-cli (bump · sync · publish · fmt)"]
    Macros["Macro Suite\nlombok-macros · instrument-level · clonelicious · future-fn · std-macro-extensions"]
    Runtime["Async, Resilience, Logging & Time\ntokio-broadcast · recoverable-spawn · recoverable-thread-pool · atomic-circuit-breaker · token-bucket · jitter-backoff · utc-cron-expr · color-log · color-output · system-time"]
    Data["Encoding, Config, Hashing, IDs, Auth & Payments\nbin-encode-decode · chunkify · compare_version · chinese-identification-card · atomic-snowflake · wildcard-glob · ketama-hash-ring · bloom-bitset · dotenv-typed · hmac-sha256-sign · jwt-service · stripe-pay-*"]
    Net["Networking & Transport\ncidr-radix · tcplane · tcp-request · udp · udp-request"]

    CLI --> Runtime
    Macros --> CLI
    Macros --> Runtime
    Macros --> Data
    Macros --> Net
    Data --> Net
Loading

Workspace Matrix

Toolchain & Unified Formatter

Crate crates.io docs.rs Responsibility
crate-cli crates.io docs.rs Cargo lifecycle CLI (bump, sync, publish, fmt) with VS Code Prettier 3.7.4 & Taplo 0.7.0 aligned unified text and Rust formatting

Procedural & Declarative Macros

Crate crates.io docs.rs Responsibility
lombok-macros crates.io docs.rs Derive macros for Getter, GetterMut, Setter, Data, New, CustomDebug, and DisplayDebug
instrument-level crates.io docs.rs Tracing instrumentation attribute macros by log level (trace, debug, info, warn, error)
clonelicious crates.io docs.rs Concise clone! macro for cloning captured state before closure invocation
future-fn crates.io docs.rs Ergonomic macros for async closures capturing owned values by move
std-macro-extensions crates.io docs.rs Standard library collection, smart pointer, sync primitive, and I/O helper macros

Logging, Console & Async Concurrency

Crate crates.io docs.rs Responsibility
color-output crates.io docs.rs Atomic ANSI colored console output functions and builder API
color-log crates.io docs.rs Sync and Tokio-async logger with custom handlers and size-based log file rotation
tokio-broadcast crates.io docs.rs High-throughput Broadcast and keyed BroadcastMap pub/sub channels over Tokio
recoverable-spawn crates.io docs.rs Panic-catching sync and async task spawners with recovery hooks
recoverable-thread-pool crates.io docs.rs Self-healing worker thread pool built atop recoverable-spawn
atomic-circuit-breaker crates.io docs.rs Zero-dependency lock-free atomic sliding-window circuit breaker with CAS probe gating
token-bucket crates.io docs.rs Zero-dependency lock-free atomic GCRA, Fixed-Window, Token-Bucket & 64-way sharded keyed rate limiter
jitter-backoff crates.io docs.rs Zero-dependency exponential backoff, full/equal/decorrelated jitter, atomic retry budgets & Retry-After parser
utc-cron-expr crates.io docs.rs Zero-dependency 5/6-field cron expression parser, O(1) bitmask matcher & civil-calendar next-run calculator

Data Processing, Auth & Payments

Crate crates.io docs.rs Responsibility
bin-encode-decode crates.io docs.rs Binary encoding and decoding with customizable character sets beyond Base64
chunkify crates.io docs.rs Deterministic byte/file chunk splitting and resumable reassembly
compare_version crates.io docs.rs Semantic version parsing, ordering, and compatibility verification
system-time crates.io docs.rs Locale-aware system clock formatting and timestamp helpers
chinese-identification-card crates.io docs.rs GB 11643 Chinese resident ID validation and checksum verification
atomic-snowflake crates.io docs.rs Zero-dependency lock-free monotonic Snowflake ID, ULID & RFC 9562 UUIDv7 generators with stack codecs
wildcard-glob crates.io docs.rs Zero-dependency zero-allocation compiled wildcard & path glob matcher with brace alternation & GlobSet
ketama-hash-ring crates.io docs.rs Zero-dependency Jump Consistent Hash, weighted Ketama virtual-node rings & Google Maglev O(1) tables
bloom-bitset crates.io docs.rs Zero-dependency cache-line-blocked Bloom filter, 4-bit Counting Bloom filter & HyperLogLog cardinality estimator
dotenv-typed crates.io docs.rs Zero-dependency .env parser, layered typed environment config loader & redacting SecretString
hmac-sha256-sign crates.io docs.rs Zero-dependency pure-Rust SHA-256, midstate HMAC-SHA256, HKDF-SHA256, Base64URL, signed tokens & HOTP/TOTP
jwt-service crates.io docs.rs Async JWT generation, verification, and typed custom claims
stripe-pay-core crates.io docs.rs Shared Stripe payment domain types, money precision, and form encoding
stripe-pay-server crates.io docs.rs Server-side Stripe transport and constant-time HMAC-SHA256 webhook verification
stripe-pay-client crates.io docs.rs Browser/WASM Stripe checkout element configuration over stripe-pay-core

Networking & Transport

Crate crates.io docs.rs Responsibility
cidr-radix crates.io docs.rs Zero-dependency zero-allocation IPv4/IPv6 CIDR parser, matcher & /8-radix IpCidrSet
tcplane crates.io docs.rs Lightweight Tokio async TCP server with hooks and connection lifecycle
tcp-request crates.io docs.rs Raw synchronous TCP request client with redirect and response support
udp crates.io docs.rs Lightweight Tokio async UDP datagram server with request-response hooks
udp-request crates.io docs.rs Raw UDP datagram request/response client

Quick Start

Install the workspace CLI globally or invoke any crate directly from crates.io:

cargo install crate-cli
crate fmt --check

Or add any individual library crate to your project:

cargo add lombok-macros color-output tokio-broadcast

Unified Formatter (crate fmt)

crate-cli provides the ecosystem's single source of truth for multi-language text and Rust formatting, aligned with VS Code's esbenp.prettier-vscode (Prettier 3.7.4: tabWidth: 2, singleQuote: true, semi: true, printWidth: 80, proseWrap: "preserve", bracketSpacing: true, trailingComma: "all", arrowParens: "always", jsxSingleQuote: false, objectWrap: "preserve", vueIndentScriptAndStyle: false, endOfLine: "lf"), tamasfe.even-better-toml (Taplo 0.7.0 tabSize = 4), and rustfmt:

  • Markdown (.md, .markdown, .mdx): YAML frontmatter, CJK/emoji-width-aware GFM tables, lists, blockquotes, Prettier singleQuote: true link titles, empty fenced code blocks, and Prettier-supported embedded fences (js/ts/json/yaml/css/scss/less/html/vue/md, leaving toml/sh/bash/rust verbatim).
  • YAML (.yml, .yaml, .prettierrc): 2-space indentation, single-quoted scalars, 80-column flow wrapping/collapse, verbatim block scalars, GitHub Actions ${{ ... }} preservation, and .prettierrc JSON/YAML auto-detection.
  • JSON / JSON-Stringify / JSONC (.json, package.json, package-lock.json, composer.json, .jsonc, .cjson): objectWrap: "preserve" for .json (with comments allowed and trailing commas stripped for tsconfig.json/.vscode/settings.json), always-expanded json-stringify for package manifests, and comment plus trailing-comma retention for .jsonc/.cjson.
  • TOML (.toml): Taplo 0.7.0 defaults (tabSize = 4, 80-column array/inline-table auto-expand, short-array auto-collapse, allowed_blank_lines = 2, align_comments = true, verbatim fallback on invalid TOML).
  • Web Languages (.js, .mjs, .cjs, .wxs, .ts, .mts, .cts, .tsx, .css, .wxss, .scss, .less, .html, .htm, .vue): Full Prettier 3.7.4 formatting including embedded HTML/Vue <script> and <style> blocks.
  • VS Code No-Op Preservation & .prettierignore: Unformatted text/config/script files (LICENSE, .gitattributes, .gitignore, .dockerignore, .editorconfig, pre-commit, .sh/.bash/.zsh, Makefile, Dockerfile, .env, .txt, .conf, .ini, .xml, .svg, .py, .sql, .jsx, Cargo.lock) are preserved byte-for-byte; workspace-root .prettierignore rules and symlink-loop guards are honored during traversal.
  • Rust (.rs): Deterministic #[derive(...)] sorting + cargo fmt.
  • Library Entry Points: Downstream CLIs (euv fmt, hyperlane fmt) invoke crate_cli::execute_unified_fmt, crate_cli::format_workspace_text_files, and crate_cli::format_text_by_path as their first pass before framework-specific formatting.

Verification

Run the complete local verification suite matching .github/workflows/rust.yml:

cargo run -p crate-cli -- fmt
cargo run -p crate-cli -- fmt --check
cargo fmt --all -- --check
cargo clippy --workspace --all-features --all-targets -- -D warnings
cargo test --workspace --all-features
cargo check --release --workspace --all-features

Documentation & Governance

  • Engineering architecture, crate boundaries, release cascade, and documentation maintenance triggers are defined in AGENTS.md.
  • Project-specific agent workflow standards are maintained in .agents/skills/ctares/SKILL.md.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributing

Contributions are welcome! Please follow the rules in AGENTS.md and open a pull request.

Contact

For inquiries, please contact the author at root@devhub.vip.

About

Unified Rust 2024 Workspace for Core Macros, CLI Tooling, Async Concurrency, Networking, Security & Payments.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages