Expand description
§tailwind-rs-scanner
Advanced content scanning for Tailwind-RS Core, providing intelligent class detection and extraction from source files.
This crate provides comprehensive content scanning capabilities:
- Multi-language support (Rust, JavaScript, TypeScript, HTML, etc.)
- Parallel file processing for performance
- Intelligent class extraction with context awareness
- File watching and incremental updates
- Tree-sitter integration for accurate parsing
§Features
- Multi-Language Support: Rust, JS/TS, HTML, Vue, Svelte, and more
- Parallel Processing: Multi-threaded file scanning for speed
- Intelligent Extraction: Context-aware class detection
- File Watching: Real-time file change detection
- Tree-sitter Integration: Accurate AST-based parsing
- Performance: Optimized for large codebases
§Example
use tailwind_rs_scanner::*;
#[tokio::main]
async fn main() -> Result<(), ScannerError> {
let scanner = ContentScanner::new(ScanConfig::default())?;
let classes = scanner.scan_for_classes().await?;
println!("Found {} classes", classes.total_classes());
// Watch for changes
let mut watcher = scanner.watch().await?;
while let Some(update) = watcher.next().await {
println!("Classes updated: {:?}", update);
}
Ok(())
}Re-exports§
pub use cache::CacheEntry;pub use cache::CacheStats;pub use cache::ScanCache;pub use class_extractor::ClassContext;pub use class_extractor::ClassExtractor;pub use class_extractor::ExtractedClass;pub use content_config::ContentConfig;pub use content_config::FilePattern;pub use content_config::ScanConfig;pub use error::Result;pub use error::ScannerError;pub use file_scanner::ClassSet;pub use file_scanner::ContentScanner;pub use file_scanner::FileInfo;pub use file_scanner::FileScanner;pub use file_scanner::FileType;pub use file_watcher::FileWatcher;pub use file_watcher::WatchConfig;pub use file_watcher::WatchEvent;pub use glob_matcher::GlobMatcher;pub use glob_matcher::GlobPattern;pub use parallel_processor::ParallelProcessor;pub use parallel_processor::ProcessingStats;pub use tree_sitter_parser::LanguageSupport;pub use tree_sitter_parser::ParseResult;pub use tree_sitter_parser::TreeSitterParser;
Modules§
- cache
- Caching implementation for content scanning
- class_
extractor - Class extraction implementation
- content_
config - Content configuration for scanning
- error
- Error handling for content scanning
- file_
scanner - File scanner implementation
- file_
watcher - File watching implementation
- glob_
matcher - Glob pattern matching implementation
- parallel_
processor - Parallel processing implementation
- tree_
sitter_ parser - Tree-sitter parser implementation
Constants§
- VERSION
- Version information
Functions§
- default_
config - Default configuration for content scanning
- new_
scanner - Create a new content scanner with default configuration
- scan_
content - Scan content for classes using default configuration