Skip to main content

Crate cuenv_core

Crate cuenv_core 

Source
Expand description

Core types and utilities for cuenv

This crate provides enhanced error handling with miette diagnostics, structured error reporting, and contextual information.

§Type-safe wrappers

This crate provides validated newtype wrappers for common domain types:

  • PackageDir - A validated directory path that must exist and be a directory
  • PackageName - A validated package name following CUE package naming rules

§Examples

use cuenv_core::{PackageDir, PackageName};
use std::path::Path;

// Validate a directory exists and is actually a directory
let pkg_dir = match PackageDir::try_from(Path::new(".")) {
    Ok(dir) => dir,
    Err(e) => {
        eprintln!("Invalid directory: {}", e);
        return;
    }
};

// Validate a package name follows naming rules
let pkg_name = match PackageName::try_from("my-package") {
    Ok(name) => name,
    Err(e) => {
        eprintln!("Invalid package name: {}", e);
        return;
    }
};

Re-exports§

pub use affected::AffectedBy;
pub use affected::matches_pattern;
pub use module::Instance;
pub use module::InstanceKind;
pub use module::ModuleEvaluation;

Modules§

affected
Affected detection utilities for tasks and files.
base
Base schema discovery across monorepo workspaces
ci
config
Configuration types for cuenv
contributors
Contributor engine for task DAG injection
cue
CUE-related utilities.
environment
Environment management for cuenv
lockfile
Lockfile types for cuenv tool management.
manifest
Root Project configuration type
module
Module-wide CUE evaluation types
owners
Code ownership configuration types for cuenv manifests.
paths
Centralized path management for cuenv data directories.
rules
Rules discovery for .rules.cue files.
secrets
Secret and resolver types
shell
Shell type definitions and utilities for cuenv
sync
Sync provider abstraction for file synchronization operations.
tasks
Task execution and management module
tools
Tool provider system for fetching development tools.

Structs§

Limits
Configuration limits
PackageDir
A validated directory path that must exist and be a directory
PackageName
A validated CUE package name

Enums§

DryRun
Type-safe replacement for dry_run: bool function parameters.
Error
Main error type for cuenv operations with enhanced diagnostics
OutputCapture
Type-safe replacement for capture_output: bool function parameters.
PackageDirError
Errors that can occur when validating a PackageDir
PackageNameError
Errors that can occur when validating a PackageName

Constants§

VERSION
Version of the cuenv-core crate (used by task cache metadata)

Type Aliases§

Result
Result type alias for cuenv operations