# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.8.0] - 2025-12-19

### Added

- Cross-platform CLI installation docs, helper scripts (`scripts/install.sh`, `scripts/install.ps1`), and a `just install` recipe so macOS, Windows, and Linux users can install `dtox` directly via `cargo install` without relying on Docker.
- Release automation now updates `README.md` and `INSTALL.md` to reference the freshly published tag, keeping the documented `cargo install --tag ...` commands accurate after every release.

### Removed

- Dropped support for Format B positional metadata parsing along with its paired placeholder fixtures and tests; metadata extraction now relies solely on the canonical single-value/Format A pattern.

### Fixed

- `FOREACH-*` / `IF*` marker parsing now trims down to the first token before stripping `__`, so inline comment decorations no longer break placeholder detection.

## [0.7.0] - 2025-11-05

### Added

- **Case-Preserving Placeholder Transformations**: Automatic case transformation of placeholder values across 7 standard naming conventions
  - **7 Casing Conventions Supported**: PascalCase, camelCase, snake_case, kebab-case, SCREAMING_SNAKE_CASE, lowercase, UPPERCASE
  - **Automatic Variant Generation**: Define once in any convention, use in all conventions
  - **Multi-Value Support**: Works seamlessly with FOREACH-DTO-VALUE blocks
  - **Validation & Error Handling**: Detects mixed casing conflicts with detailed warnings
  - **Built-in Placeholder Support**: Special handling for `__dtoname__` and `__dtoversion__` from filenames
  - **Edge Case Handling**: Unicode characters, numbers, single-letter words, acronyms (XMLParser)
  
### Technical Details

- New module: `src/case_transform/` with 5 submodules (validation, detection, transform, variants)
- Variant generation matrix: Multi-word → 7 variants, Single-word → 3 variants, Fallback → 1 variant
- Lazy evaluation: Variants computed on-demand with caching
- 61 tests passing (17 new case transformation tests)
- Zero performance impact on existing placeholders
- Full backward compatibility maintained
- Clippy clean (no warnings)

### Examples

```protobuf
// DTO file
// __IndexName__ ByUser
```

```csharp
// Template - use any casing convention
public Index<Product> __indexName__Index;      // byUserIndex
public string __index-name__Key = "__index-name__";  // by-user
public const string __INDEX_NAME___CONST = "__INDEX_NAME__";  // BY_USER
```

## [0.6.0] - 2025-11-04

### Added

- **Conditional inclusion markers**: Four new markers for conditionally including template content based on placeholder existence
  - `IFDEF-DTO-VALUE-START`/`IFDEF-DTO-VALUE-END`: Include content only if placeholder exists in DTO
  - `IFANY-DTO-VALUE-START`/`IFANY-DTO-VALUE-END`: Alias for IFDEF (completely interchangeable)
  - `IFNDEF-DTO-VALUE-START`/`IFNDEF-DTO-VALUE-END`: Include content only if placeholder does NOT exist in DTO
  - `IFNO-DTO-VALUE-START`/`IFNO-DTO-VALUE-END`: Alias for IFNDEF (completely interchangeable)
  - All markers work seamlessly inside `FOREACH-DTO` blocks for per-DTO conditional content
  - Ideal for optional features, default values, and fallback implementations
  - Processing order: `FOREACH-UNIQUE-DTO-VALUE` → conditional inclusion → `FOREACH-DTO-VALUE`
  - Comprehensive documentation with real-world examples in README.md

### Technical Details

- Single function handles all four marker types with boolean flag for maintainability
- Minimal performance impact (single content pass)
- 61 tests passing (3 new integration tests for conditional inclusion)
- Full backward compatibility maintained

## [0.5.0] - 2025-11-04

### Added

- **FOREACH-UNIQUE-DTO-VALUE blocks**: Iterate over only unique values, automatically filtering duplicates
  - Use `FOREACH-UNIQUE-DTO-VALUE-START` and `FOREACH-UNIQUE-DTO-VALUE-END` markers in templates
  - Automatic deduplication preserves first-occurrence order for deterministic output
  - Works with paired placeholders (uniqueness determined by primary placeholder)
  - Can be nested inside `FOREACH-DTO` blocks for per-DTO unique iteration
  - Coexists with `FOREACH-DTO-VALUE` in the same template
  - Ideal for enum generation, schema creation, and configuration with unique keys
  - Zero values edge case: entire block omitted when placeholder has no values
  - Graceful error handling for malformed syntax and non-existent placeholders

### Changed

- Code quality improvements: All clippy warnings resolved
- Template processing order: `FOREACH-UNIQUE-DTO-VALUE` → `FOREACH-DTO-VALUE` → regular substitution

### Technical Details

- Deduplication algorithm: O(n) using HashSet for first-occurrence tracking
- Order preservation: Values appear in order they first occur in DTO file
- Error handling: Non-existent placeholders cause block omission (no crash)
- Backward compatibility: All existing functionality preserved
- 58 comprehensive tests (14 new tests for unique value iteration)
- Detailed documentation with real-world enum generation examples

## [0.4.0] - 2025-10-28

### Added

- **FOREACH-DTO-VALUE blocks**: Iterate over multiple values of the same placeholder
  - Define multiple values for a placeholder in DTO files using `// __placeholder__ value` syntax
  - Use `FOREACH-DTO-VALUE-START` and `FOREACH-DTO-VALUE-END` markers in templates
  - Automatic detection of placeholder pairs when defined on the same line (Format B)
  - Support for nesting `FOREACH-DTO-VALUE` inside `FOREACH-DTO` blocks
  - Comprehensive validation with detailed error messages:
    - Placeholder consistency checks (all placeholders on a line must have same occurrence count)
    - Pair order validation (all paired placeholders must appear in consistent order)
    - Line number reporting for all validation errors
  - Examples and documentation in README.md and quickstart.md
  - Example fixtures demonstrating basic usage, paired placeholders, and nesting

### Changed

- Placeholder extraction now supports both single-value and multi-value patterns
- Template processing order updated to handle FOREACH-DTO-VALUE blocks before placeholder substitution

### Technical Details

- Format B extraction: Paired placeholders (`__name1__ __name2__ val1 val2`) are automatically linked
- Validation functions prevent common errors:
  - Missing values for paired placeholders
  - Inconsistent pairing across lines
  - Mismatched placeholder order
- All existing functionality preserved (backward compatibility maintained)
- 74 comprehensive tests covering all scenarios

## [0.3.0] - Previous Release

(Previous changelog entries would go here)
