morph-cli 0.1.0

AST-based codebase migration and codemod tool for JavaScript and TypeScript projects.
Documentation
pub mod cli;
pub mod commands;
pub mod core;
pub mod recipes;
pub mod utils;

// Re-export core execution APIs to provide a stable, minimal library surface.

pub use crate::core::recipe::{
    DetectionReport, FileAnalysis, FileClassification, Recipe, RecipeMetadata, SkippedTransform,
    TransformMode, TransformOptions, TransformReport, UnsupportedPatternReport,
};
pub use crate::core::registry::RecipeRegistry;
pub use crate::core::pipeline::executor::{PipelineExecutor, PipelineSummary};
pub use crate::core::detection::scanner::{Scanner, ScanResult};

// Provide a programmatic entry point for running a recipe.
pub fn run_recipe(
    project_root: std::path::PathBuf,
    recipe_name: &str,
    mode: TransformMode,
    review: bool,
    autofix: bool,
    verbose: bool,
) -> anyhow::Result<PipelineSummary> {
    let registry = RecipeRegistry::new();
    let executor = PipelineExecutor::new(project_root.clone()).add_recipe(recipe_name);
    executor.execute(&project_root, mode, review, autofix, &registry, verbose)
}

pub fn scan_project(
    project_root: std::path::PathBuf,
) -> anyhow::Result<ScanResult> {
    let mut scanner = Scanner::new(project_root);
    Ok(scanner.scan())
}