1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
//! Configuration module for package tools settings and management.
//!
//! **What**: Provides comprehensive configuration management for all package tools functionality,
//! including changesets, versioning, dependencies, upgrades, changelog, and audit settings.
//!
//! **How**: This module integrates with `sublime_standard_tools` configuration system to load
//! settings from TOML files, environment variables, and programmatic sources. It provides
//! validation, merging, and type-safe access to all configuration options.
//!
//! **Why**: To enable flexible, environment-specific configuration that supports both simple
//! single-package projects and complex monorepo setups, with sensible defaults and clear
//! validation rules.
//!
//! # Features
//!
//! - **Hierarchical Configuration**: Load from multiple sources with priority ordering
//! - **Environment Overrides**: Override settings via environment variables
//! - **Validation**: Validate configuration before use
//! - **Merging**: Merge configurations from different sources
//! - **Type Safety**: Strongly-typed configuration structures
//! - **Documentation**: Comprehensive inline documentation for all settings
//! - **Sensible Defaults**: Work out of the box with minimal configuration
//!
//! # Example
//!
//! ```rust,ignore
//! use sublime_pkg_tools::config::PackageToolsConfig;
//! use sublime_standard_tools::config::ConfigManager;
//!
//! # async fn example() -> Result<(), Box<dyn std::error::Error>> {
//! // Load from file with defaults
//! let config = ConfigManager::<PackageToolsConfig>::builder()
//! .with_defaults(PackageToolsConfig::default())
//! .with_file_optional("package-tools.toml")
//! .with_env_prefix("PKG_TOOLS")
//! .build()
//! .await?
//! .load()
//! .await?;
//!
//! // Access configuration
//! println!("Changeset path: {}", config.changeset.path);
//! println!("Version strategy: {:?}", config.version.strategy);
//! # Ok(())
//! # }
//! ```
//!
//! # Configuration File Format
//!
//! Configuration is typically stored in a TOML file:
//!
//! ```toml
//! [package_tools.changeset]
//! path = ".changesets"
//! history_path = ".changesets/history"
//! available_environments = ["development", "staging", "production"]
//! default_environments = ["production"]
//!
//! [package_tools.version]
//! strategy = "independent"
//! default_bump = "patch"
//! snapshot_format = "{version}-{branch}.{timestamp}"
//!
//! [package_tools.dependency]
//! propagation_bump = "patch"
//! propagate_dependencies = true
//! propagate_dev_dependencies = false
//! propagate_peer_dependencies = true
//! max_depth = 10
//! fail_on_circular = true
//!
//! [package_tools.upgrade]
//! auto_changeset = true
//! changeset_bump = "patch"
//!
//! [package_tools.upgrade.registry]
//! default_registry = "https://registry.npmjs.org"
//! timeout_secs = 30
//! retry_attempts = 3
//!
//! [package_tools.changelog]
//! enabled = true
//! format = "keep-a-changelog"
//! include_commit_links = true
//! repository_url = "https://github.com/org/repo"
//!
//! [package_tools.audit]
//! enabled = true
//! min_severity = "warning"
//! ```
//!
//! # Environment Variables
//!
//! Settings can be overridden using environment variables with the configured prefix:
//!
//! ```bash
//! export PKG_TOOLS_CHANGESET_PATH=".custom-changesets"
//! export PKG_TOOLS_VERSION_STRATEGY="unified"
//! export PKG_TOOLS_DEPENDENCY_PROPAGATION_BUMP="minor"
//! ```
//!
//! # Configuration Validation
//!
//! All configuration structures implement validation:
//!
//! ```rust,ignore
//! use sublime_pkg_tools::config::PackageToolsConfig;
//! use sublime_standard_tools::config::Configurable;
//!
//! # fn example() -> Result<(), Box<dyn std::error::Error>> {
//! let config = PackageToolsConfig::default();
//!
//! // Validate configuration
//! config.validate()?;
//!
//! println!("Configuration is valid");
//! # Ok(())
//! # }
//! ```
//!
//! # Module Structure
//!
//! This module will contain:
//! - `package_tools`: Main `PackageToolsConfig` structure
//! - `changeset`: Changeset-specific configuration
//! - `version`: Versioning strategy and options
//! - `dependency`: Dependency propagation settings
//! - `upgrade`: Upgrade detection and application settings
//! - `changelog`: Changelog generation configuration
//! - `audit`: Audit and health check settings
//! - `git`: Git integration settings
//! - `execute`: Command execution timeout and parallelism settings
// Configuration modules
// Tests module
// Re-export all configuration types
pub use ;
pub use ;
pub use ChangesetConfig;
pub use DependencyConfig;
pub use ExecuteConfig;
pub use GitConfig;
pub use ConfigFormat;
pub use PackageToolsConfig;
pub use ;
pub use ;
pub use VersionConfig;
pub use WorkspaceConfig;
// Re-export VersioningStrategy from types module for convenience
pub use crateVersioningStrategy;