Skip to main content

alef_core/config/
output.rs

1use serde::{Deserialize, Serialize};
2use std::path::PathBuf;
3
4#[derive(Debug, Clone, Default, Serialize, Deserialize)]
5pub struct ExcludeConfig {
6    #[serde(default)]
7    pub types: Vec<String>,
8    #[serde(default)]
9    pub functions: Vec<String>,
10    /// Exclude specific methods: "TypeName.method_name"
11    #[serde(default)]
12    pub methods: Vec<String>,
13}
14
15#[derive(Debug, Clone, Default, Serialize, Deserialize)]
16pub struct IncludeConfig {
17    #[serde(default)]
18    pub types: Vec<String>,
19    #[serde(default)]
20    pub functions: Vec<String>,
21}
22
23#[derive(Debug, Clone, Default, Serialize, Deserialize)]
24pub struct OutputConfig {
25    pub python: Option<PathBuf>,
26    pub node: Option<PathBuf>,
27    pub ruby: Option<PathBuf>,
28    pub php: Option<PathBuf>,
29    pub elixir: Option<PathBuf>,
30    pub wasm: Option<PathBuf>,
31    pub ffi: Option<PathBuf>,
32    pub go: Option<PathBuf>,
33    pub java: Option<PathBuf>,
34    pub csharp: Option<PathBuf>,
35    pub r: Option<PathBuf>,
36}
37
38#[derive(Debug, Clone, Serialize, Deserialize)]
39pub struct ScaffoldConfig {
40    pub description: Option<String>,
41    pub license: Option<String>,
42    pub repository: Option<String>,
43    pub homepage: Option<String>,
44    #[serde(default)]
45    pub authors: Vec<String>,
46    #[serde(default)]
47    pub keywords: Vec<String>,
48}
49
50#[derive(Debug, Clone, Serialize, Deserialize)]
51pub struct ReadmeConfig {
52    pub template_dir: Option<PathBuf>,
53    pub snippets_dir: Option<PathBuf>,
54    pub config: Option<PathBuf>,
55    pub output_pattern: Option<String>,
56}
57
58#[derive(Debug, Clone, Serialize, Deserialize)]
59pub struct LintConfig {
60    pub format: Option<String>,
61    pub check: Option<String>,
62    pub typecheck: Option<String>,
63}
64
65#[derive(Debug, Clone, Serialize, Deserialize, Default)]
66pub struct TestConfig {
67    /// Command to run unit/integration tests for this language.
68    pub command: Option<String>,
69    /// Command to run e2e tests for this language.
70    pub e2e: Option<String>,
71}
72
73/// A single text replacement rule for version sync.
74#[derive(Debug, Clone, Serialize, Deserialize)]
75pub struct TextReplacement {
76    /// Glob pattern for files to process.
77    pub path: String,
78    /// Regex pattern to search for (may contain `{version}` placeholder).
79    pub search: String,
80    /// Replacement string (may contain `{version}` placeholder).
81    pub replace: String,
82}
83
84/// Configuration for the `sync-versions` command.
85#[derive(Debug, Clone, Serialize, Deserialize, Default)]
86pub struct SyncConfig {
87    /// Extra file paths to update version in (glob patterns).
88    #[serde(default)]
89    pub extra_paths: Vec<String>,
90    /// Arbitrary text replacements applied during version sync.
91    #[serde(default)]
92    pub text_replacements: Vec<TextReplacement>,
93}