Skip to content

Commit 67cda49

Browse files
committed
Add plugin management.
1 parent 1125a21 commit 67cda49

File tree

5 files changed

+310
-9
lines changed

5 files changed

+310
-9
lines changed

CHANGELOG.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Changelog
2+
3+
All notable changes to TVM (Terminus Version Manager) will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
### Added
11+
- **Version-Specific Plugin Management**: Automatic management of plugin directories per Terminus major version
12+
- Plugin directories organized by major version (e.g., `~/.terminus/plugins-3.x`, `~/.terminus/plugins-4.x`)
13+
- Automatic symlink management when switching Terminus versions
14+
- Environment variables set for Terminus plugin discovery (`TERMINUS_PLUGINS_DIR`, `TERMINUS_DEPENDENCIES_DIR`)
15+
- One-time migration of existing plugins to version-specific structure
16+
- **New Commands**:
17+
- `tvm plugins:status` - Show current plugin environment status
18+
- `tvm plugins:migrate` - Manually trigger plugin migration (runs automatically on first use)
19+
- **Enhanced Help Documentation**: Updated help text to include plugin management information
20+
- **Improved Test Coverage**: Added tests for plugin management functionality
21+
22+
### Changed
23+
- **Plugin Directory Structure**: Plugins are now isolated per Terminus major version
24+
- **Automatic Environment Setup**: Plugin environment is configured automatically when switching versions
25+
- **Enhanced Version Switching**: `tvm use` now also sets up the appropriate plugin environment
26+
27+
### Fixed
28+
- **Plugin Compatibility Issues**: Resolved conflicts when switching between Terminus versions with incompatible plugins
29+
- **Shared Plugin Directory Problems**: Eliminated issues caused by shared plugin directories across versions
30+
31+
## [1.0.0] - Previous Release
32+
33+
### Added
34+
- Initial TVM implementation
35+
- Version management for Terminus PHARs
36+
- Command aliases (`tvm`, `terminus`, `terminus-vm`)
37+
- Smart command routing
38+
- Environment variable support
39+
- Installation script
40+
- Comprehensive test suite
41+
- CI/CD pipeline
42+
43+
### Features
44+
- Install and switch between multiple Terminus versions
45+
- Automatic version resolution (latest, major.minor, exact)
46+
- Import existing Terminus installations
47+
- Bulk version installation
48+
- Cross-platform compatibility (macOS, Linux)

README.md

Lines changed: 63 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,18 @@
22

33
> **Switch Pantheon Terminus versions in a snap**
44
5-
Never get locked into a specific Terminus version again. Switch between Terminus 2.x, 3.x, and 4.x without breaking your workflows or dealing with Homebrew conflicts.
5+
Switch between Terminus 2.x, 3.x, and 4.x without breaking your workflows or dealing with Homebrew conflicts.
66

77
[![Tests](https://github.com/lcatlett/tvm/actions/workflows/test.yml/badge.svg)](https://github.com/lcatlett/tvm/actions/workflows/test.yml)
8-
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
8+
99

1010
## ✨ Why Choose TVM
11-
- **📋 Reproduce exact Terminus context alongside application conxtext.** for scripts, CI/CD pipelines, or local testing
12-
- **🎯 Crutial for mixed and many-site portfolios** managing multiple Pantheon projects with different Terminus requirements
11+
- **📋 Reproduce exact Terminus context alongside application context** for scripts, CI/CD pipelines, or local testing
12+
- **🎯 Crucial for mixed and many-site portfolios** managing multiple Pantheon projects with different Terminus requirements
1313
- **⚡ Zero downtime** switching between versions - no reinstalls, no conflicts
1414
- **🔒 CI/CD ready** - pin exact versions for consistent deployments
1515
- **🛡️ Risk-free testing** - try new Terminus features without breaking production workflows
16+
- **🔌 Version-specific plugin management** - plugins automatically switch with Terminus versions
1617
- Also streamlines terminus plugin and terminus core development and testing
1718

1819
## 📋 Table of Contents
@@ -28,6 +29,7 @@ Never get locked into a specific Terminus version again. Switch between Terminus
2829
- [💡 Usage Examples](#-usage-examples)
2930
- [Basic Version Management](#basic-version-management)
3031
- [Advanced Usage](#advanced-usage)
32+
- [Plugin Management](#plugin-management)
3133
- [Team Workflows](#team-workflows)
3234
- [🎯 Why Use TVM?](#-why-use-tvm)
3335
- [**Version Lock-in Issues**](#version-lock-in-issues)
@@ -50,6 +52,7 @@ Never get locked into a specific Terminus version again. Switch between Terminus
5052
- [Test Coverage](#test-coverage)
5153
- [CI/CD Pipeline](#cicd-pipeline)
5254
- [Contributing](#contributing)
55+
- [📝 Changelog](#-changelog)
5356
- [⚠️ Disclaimer](#️-disclaimer)
5457

5558
## 🚀 Quick Start
@@ -68,9 +71,12 @@ tvm use latest # Use newest available
6871

6972
# 4. List installed versions
7073
tvm list
74+
75+
# 5. Check plugin environment (optional)
76+
tvm plugins:status
7177
```
7278

73-
TVM handles the rest automatically.
79+
TVM handles version switching and plugin management automatically.
7480

7581
## 📦 Installation
7682

@@ -162,6 +168,36 @@ export TERMINUS_VM_DIR="$HOME/my-terminus-versions"
162168
tvm install latest
163169
```
164170

171+
### Plugin Management
172+
173+
TVM automatically manages version-specific plugin directories to prevent compatibility issues:
174+
175+
```bash
176+
# Check current plugin environment
177+
tvm plugins:status
178+
179+
# View plugin directories for current version
180+
tvm plugins:status
181+
# Output:
182+
# Current Terminus version: 3.6.2
183+
# Major version: 3.x
184+
# Plugin directory: ~/.terminus/plugins-3.x
185+
# Dependencies directory: ~/.terminus/dependencies-3.x
186+
187+
# Switch versions - plugins automatically switch too
188+
tvm use 4.0.3 # Now uses plugins-4.x directory
189+
tvm use 3.6.2 # Now uses plugins-3.x directory
190+
191+
# Manually trigger plugin migration (runs automatically on first use)
192+
tvm plugins:migrate
193+
```
194+
195+
**How Plugin Management Works:**
196+
- **Version-specific directories**: `~/.terminus/plugins-3.x`, `~/.terminus/plugins-4.x`, etc.
197+
- **Automatic switching**: Plugin environment changes when you switch Terminus versions
198+
- **Symlink management**: `~/.terminus/plugins` points to the correct version-specific directory
199+
- **Seamless migration**: Existing plugins are automatically moved to version-specific directories
200+
165201
### Team Workflows
166202

167203
```bash
@@ -207,6 +243,11 @@ terminus auth:login --machine-token=$PANTHEON_TOKEN
207243
- **TVM Solution**: Standardize on specific versions per project with easy switching
208244
- **Use Case**: Ensure all developers use the same Terminus version for a given project
209245

246+
### **Plugin Compatibility Issues**
247+
- **Problem**: Terminus plugins may not be compatible across major versions, causing conflicts or failures
248+
- **TVM Solution**: Automatic version-specific plugin management prevents cross-version conflicts
249+
- **Use Case**: Use different plugin versions for Terminus 3.x vs 4.x without manual directory management
250+
210251
## 🔧 How It Works
211252

212253
**Simple and Transparent:**
@@ -215,10 +256,18 @@ terminus auth:login --machine-token=$PANTHEON_TOKEN
215256
- Smart command routing: TVM commands vs. Terminus passthrough
216257
- Zero-overhead execution via your system PHP binary
217258

259+
**Plugin Management:**
260+
- Version-specific plugin directories: `~/.terminus/plugins-3.x`, `~/.terminus/plugins-4.x`
261+
- Automatic symlink management: `~/.terminus/plugins` → version-specific directory
262+
- Environment variables set for Terminus plugin discovery
263+
- One-time migration of existing plugins to version-specific structure
264+
218265
**Environment Variables:**
219266
- `TERMINUS_VM_DIR` — Custom storage location (default: `~/.terminus/phars`)
220267
- `TERMINUS_PHP` — PHP binary to use (default: `php`)
221268
- `GITHUB_TOKEN` — Avoid API rate limits (optional)
269+
- `TERMINUS_PLUGINS_DIR` — Set automatically to version-specific plugin directory
270+
- `TERMINUS_DEPENDENCIES_DIR` — Set automatically to version-specific dependencies directory
222271

223272
## 🔗 Command Aliases
224273

@@ -237,6 +286,10 @@ terminus-vm list # Direct access
237286
# All show installed versions:
238287
* 3.6.2 (current)
239288
4.0.3
289+
290+
# Plugin management commands (TVM-specific):
291+
tvm plugins:status # Show current plugin environment
292+
tvm plugins:migrate # Migrate existing plugins (runs automatically)
240293
```
241294

242295
## ⚠️ Important Limitations
@@ -296,10 +349,11 @@ make clean
296349

297350
### Test Coverage
298351

299-
The test suite includes **14 test cases** with **24+ assertions** covering:
352+
The test suite includes **14+ test cases** with **24+ assertions** covering:
300353

301354
- **Core Functionality**: Script existence, permissions, help commands
302355
- **Version Management**: Install, switch, list, path operations
356+
- **Plugin Management**: Version-specific plugin directories, symlink management
303357
- **Command Aliases**: `terminus`, `terminus-vm`, and `tvm` command functionality
304358
- **Environment Handling**: Custom directories, PHP binaries
305359
- **Error Scenarios**: Invalid commands, missing versions
@@ -324,6 +378,9 @@ The test suite includes **14 test cases** with **24+ assertions** covering:
324378
6. **Push** to the branch: `git push origin feature/amazing-feature`
325379
7. **Open** a Pull Request
326380

381+
## 📝 Changelog
382+
383+
See [CHANGELOG.md](CHANGELOG.md) for a detailed history of changes, including the major plugin management enhancement.
327384

328385
## ⚠️ Disclaimer
329386

0 commit comments

Comments
 (0)