baobao-core

Crates.iobaobao-core
lib.rsbaobao-core
version0.5.0
created_at2025-12-07 15:21:09.198896+00
updated_at2025-12-24 15:35:06.505601+00
descriptionCore utilities for Bao CLI generator
homepagehttps://github.com/roushou/bao
repositoryhttps://github.com/roushou/bao
max_upload_size
id1971769
size26,012
Roushou (roushou)

documentation

README

baobao-core

Core utilities and types for Bao CLI generator.

This crate provides fundamental types and utilities used across the Bao ecosystem.

Features

  • File Operations - Types for managing generated files (File, GeneratedFile, WriteResult)
  • Type Mapping - Argument type definitions (ArgType)
  • Context Types - Database and context field types (ContextFieldType, DatabaseType)
  • String Utilities - Case conversion functions (to_camel_case, to_kebab_case, to_pascal_case, to_snake_case)
  • Version Handling - Semantic version parsing and manipulation (Version)

Usage

This crate is used internally by other baobao-* crates. You typically don't need to use it directly.

use baobao_core::{to_snake_case, to_pascal_case, ArgType, Version};

// Case conversion
assert_eq!(to_snake_case("helloWorld"), "hello_world");
assert_eq!(to_pascal_case("hello_world"), "HelloWorld");

// Version parsing
let version = Version::parse("1.2.3").unwrap();

License

This project is licensed under the MIT license.

Commit count: 0

cargo fmt