feat: migrate Zsh to new feature folder architecture#60
Merged
Conversation
Migrate Zsh configuration and management to the new self-contained feature structure, following the established pattern from other features. ## Changes ### New Feature Structure - `features/zsh/install.bash` - Zsh installation and shell configuration - `features/zsh/update.bash` - Zsh updates via Homebrew - `features/zsh/utils.bash` - Utility functions for Zsh management - `features/zsh/config/` - Complete Zsh configuration files - `features/zsh/tests/` - Comprehensive test suite with BATS - `features/zsh/README.md` - Feature documentation ### Self-Contained Design - No external dependencies on bin/lib utilities - Self-contained utility functions for installation/validation - Bash-based scripts (converted from original Zsh) - Comprehensive error handling and validation ### Installation Features - Installs Zsh via Homebrew if not present - Adds Zsh to /etc/shells automatically - Changes user default shell to Zsh - Validates installation and configuration - Supports machine-specific configurations ### Testing - Unit tests for utility functions - Integration tests for installation workflow - Update functionality testing - Comprehensive mocking for safe testing ### Configuration Management - Preserves all existing Zsh configuration files - Maintains work-specific configuration support - Integrates with machine detection system - Supports environment-specific settings This migration maintains full backward compatibility while providing a more maintainable, testable, and self-contained feature structure.
This was referenced Jul 27, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migrate Zsh configuration and management to the new self-contained feature structure, following the established pattern from features like
git/,homebrew/,ssh/, andtmux/.This migration transforms the existing
bin/install/zsh.zshscript into a comprehensive, self-contained feature with improved maintainability, testability, and consistency.Changes
🏗️ New Feature Structure
features/zsh/install.bash- Zsh installation and shell configuration (converted from Zsh to Bash)features/zsh/update.bash- Zsh updates via Homebrew with validationfeatures/zsh/utils.bash- Self-contained utility functions for Zsh managementfeatures/zsh/config/- Complete Zsh configuration files (copied fromconfig/zsh/)features/zsh/tests/- Comprehensive test suite using BATS frameworkfeatures/zsh/README.md- Detailed feature documentation🔧 Self-Contained Design
bin/lib/utilities📦 Installation Features
/etc/shells🧪 Comprehensive Testing
test-zsh-utils.bats- Unit tests for utility functions with mockingtest-zsh-installation.bats- Integration tests for installation workflowtest-zsh-update.bats- Update functionality testing with edge cases⚙️ Configuration Management
config/work/IS_WORK, etc.)Benefits
🔄 Consistency
git/,homebrew/, etc.)🛡️ Reliability
🧪 Testability
📚 Maintainability
Backward Compatibility
✅ Fully backward compatible - no breaking changes to existing functionality
✅ Configuration preserved - all existing Zsh configurations maintained
✅ Machine detection intact - work-specific configurations still applied
✅ Installation behavior unchanged - same end result as original script
Testing Strategy
Migration Pattern
This migration follows the established pattern used for other features:
Next Steps
After this PR is merged:
bin/install/zsh.zshscriptTest Plan