-
Notifications
You must be signed in to change notification settings - Fork 16
Closed
Labels
coreCore functionalityCore functionalityenhancementNew feature or requestNew feature or requestphase-1Phase 1: Core FoundationPhase 1: Core Foundation
Description
Port .env file manipulation functionality from bash scripts.
Key Files to Create:
src/lib/EnvironmentManager.tssrc/utils/env.ts
Functions to Port:
-
setEnvVar()fromenv-utils.sh - Port assignment logic (3000 + issue/PR number)
- .env file copying between worktrees
Features:
- Read/write/update .env files
- Set environment variables in target file
- Copy .env files between directories
- Calculate and assign unique ports
- Validate environment configurations
Logging Integration:
- Integrate structured logging using logger utility (see Issue Logging Infrastructure and Output Formatting #27)
Testing Requirements:
- Unit tests for .env file parsing and manipulation
- File system mocking for atomic file operations
- Property-based tests for environment variable validation
- Port calculation tests including conflict detection
- Environment variable validation tests
- Cross-platform file handling tests
- Concurrent access and file locking tests
- Backup and recovery mechanism tests
Acceptance Criteria:
- .env file manipulation works identically to bash scripts verified through regression tests
- Atomic file updates tested with concurrency scenarios
- Port calculation matches existing logic with comprehensive test coverage
- Proper error handling for file operations tested extensively
- File system mock factory working for all scenarios
- Property-based tests revealing no edge cases
- Cross-platform compatibility validated through testing
- Logging integration working
Enhancement Summary: Integrated structured logging using logger utility (see Issue #27).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
coreCore functionalityCore functionalityenhancementNew feature or requestNew feature or requestphase-1Phase 1: Core FoundationPhase 1: Core Foundation