spikard_cli/init/mod.rs
1//! Project initialization scaffolding for Spikard
2//!
3//! This module provides the foundation for the `spikard init` command, enabling users
4//! to bootstrap new Spikard projects with language-specific structure, configuration,
5//! and example handlers.
6//!
7//! # Architecture
8//!
9//! The initialization system follows a layered design:
10//!
11//! - **`ProjectScaffolder`**: Language-agnostic trait defining what files and structure
12//! are needed for a new project.
13//! - **`InitEngine`**: Orchestrates the scaffolding process, validates inputs, and
14//! manages file creation.
15//! - **`ScaffoldedFile`**: Represents a file to be written with path and content.
16//!
17//! # Example
18//!
19//! ```ignore
20//! use spikard_cli::init::{InitRequest, InitEngine};
21//! use spikard_cli::codegen::TargetLanguage;
22//! use std::path::PathBuf;
23//!
24//! let request = InitRequest {
25//! project_name: "my_api".to_string(),
26//! language: TargetLanguage::Python,
27//! project_dir: PathBuf::from("."),
28//! schema_path: None,
29//! };
30//!
31//! let response = InitEngine::execute(request)?;
32//! println!("Created {} files", response.files_created.len());
33//! for step in response.next_steps {
34//! println!(" - {}", step);
35//! }
36//! # Ok::<(), anyhow::Error>(())
37//! ```
38
39pub mod elixir;
40pub mod engine;
41pub mod php;
42pub mod python;
43pub mod ruby;
44pub mod rust_lang;
45pub mod scaffolder;
46pub mod typescript;
47
48pub use elixir::ElixirScaffolder;
49pub use engine::{InitEngine, InitError, InitRequest, InitResponse};
50pub use php::PhpScaffolder;
51pub use python::PythonScaffolder;
52pub use ruby::RubyScaffolder;
53pub use rust_lang::RustScaffolder;
54pub use scaffolder::{ProjectScaffolder, ScaffoldedFile};
55pub use typescript::TypeScriptScaffolder;