* refactor: migrate from submodules to multi-root workspace for plugins - Updated LEDMatrix.code-workspace to include all plugin repos as root folders - Removed symlinks from plugin-repos/ and plugins/ directories - Updated .gitignore to reflect new plugin management approach - Added setup_plugin_repos.py script for managing plugin symlinks (if needed) - Added MULTI_ROOT_WORKSPACE_SETUP.md documentation Plugins are now managed as independent repositories via multi-root workspace, allowing for easier development and independent updates without modifying the LEDMatrix project structure. * Fix MULTI_ROOT_WORKSPACE_SETUP.md and add JSON error handling - Remove deprecated clone_plugin_repos.py command reference - Add language tag to directory tree code fence (fixes MD040) - Add JSONDecodeError handling in setup_plugin_repos.py with user-friendly error messages --------- Co-authored-by: Chuck <chuck@example.com>
5.2 KiB
Multi-Root Workspace Setup Guide
This document explains how the LEDMatrix project uses a multi-root workspace to manage plugins as separate Git repositories.
Overview
The LEDMatrix project has been migrated from a git submodule implementation to a multi-root workspace implementation for managing plugins. This allows:
- ✅ Plugins to exist as independent Git repositories
- ✅ Updates to plugins without modifying the LEDMatrix project
- ✅ Easy development workflow with all repos in one workspace
- ✅ Plugin system discovers plugins via symlinks in
plugin-repos/
Directory Structure
/home/chuck/Github/
├── LEDMatrix/ # Main project
│ ├── plugin-repos/ # Symlinks to actual repos (managed automatically)
│ │ ├── ledmatrix-clock-simple -> ../../ledmatrix-clock-simple
│ │ ├── ledmatrix-weather -> ../../ledmatrix-weather
│ │ └── ...
│ ├── LEDMatrix.code-workspace # Multi-root workspace configuration
│ └── ...
├── ledmatrix-clock-simple/ # Plugin repository (actual git repo)
├── ledmatrix-weather/ # Plugin repository (actual git repo)
├── ledmatrix-football-scoreboard/ # Plugin repository (actual git repo)
└── ... # Other plugin repos
How It Works
1. Plugin Repositories
All plugin repositories are cloned to /home/chuck/Github/ (parent directory of LEDMatrix) as regular Git repositories:
ledmatrix-clock-simple/ledmatrix-weather/ledmatrix-football-scoreboard/- etc.
2. Symlinks in plugin-repos/
The LEDMatrix/plugin-repos/ directory contains symlinks pointing to the actual repositories in the parent directory. This allows the plugin system to discover plugins without modifying the project structure.
3. Multi-Root Workspace
The LEDMatrix.code-workspace file configures VS Code/Cursor to open all plugin repositories as separate workspace roots, allowing easy development across all repos.
Setup Scripts
Initial Setup
If you already have plugin repositories cloned, use the setup script:
cd /home/chuck/Github/LEDMatrix
python3 scripts/setup_plugin_repos.py
This script:
- Reads the workspace configuration
- Creates symlinks in
plugin-repos/pointing to actual repos - Verifies all links are created correctly
Updating Plugins
To update all plugin repositories:
cd /home/chuck/Github/LEDMatrix
python3 scripts/update_plugin_repos.py
This script:
- Finds all plugins in the workspace
- Runs
git pullon each repository - Reports which plugins were updated
Configuration
The plugin system is configured in config/config.json:
{
"plugin_system": {
"plugins_directory": "plugin-repos",
"auto_discover": true,
"auto_load_enabled": true
}
}
The plugins_directory points to plugin-repos/, which contains symlinks to the actual repositories.
Workflow
Daily Development
- Open Workspace: Open
LEDMatrix.code-workspacein VS Code/Cursor - All Repos Available: All plugin repos appear as separate folders in the workspace
- Edit Plugins: Edit plugin code directly in their repositories
- Update Plugins: Run
update_plugin_repos.pyto pull latest changes
Adding New Plugins
- Clone Repository: Clone the new plugin repo to
/home/chuck/Github/ - Add to Workspace: Add the plugin folder to
LEDMatrix.code-workspace - Create Symlink: Run
setup_plugin_repos.pyto create the symlink
Updating Individual Plugins
Since plugins are regular Git repositories, you can update them individually:
cd /home/chuck/Github/ledmatrix-weather
git pull origin master
Or update all at once:
cd /home/chuck/Github/LEDMatrix
python3 scripts/update_plugin_repos.py
Benefits
- No Submodule Hassle: No need to update
.gitmodulesor rungit submodule update - Independent Updates: Update plugins independently without touching LEDMatrix
- Clean Separation: Each plugin is a separate repository with its own history
- Easy Development: Multi-root workspace makes it easy to work across repos
- Automatic Discovery: Plugin system automatically discovers plugins via symlinks
Troubleshooting
Symlinks Not Working
If plugins aren't being discovered:
cd /home/chuck/Github/LEDMatrix
python3 scripts/setup_plugin_repos.py
This will recreate all symlinks.
Missing Plugins
If a plugin is in the workspace but not found:
- Check if the repo exists in
/home/chuck/Github/ - Check if the symlink exists in
plugin-repos/ - Run
setup_plugin_repos.pyto recreate symlinks
Plugin Updates Not Showing
If changes to plugins aren't appearing:
- Verify the symlink points to the correct directory:
ls -la plugin-repos/ledmatrix-weather - Check that you're editing in the actual repo, not a copy
- Restart the LEDMatrix service if running
Notes
- The
plugin-repos/directory is tracked in git, but only contains symlinks - Actual plugin code lives in
/home/chuck/Github/ledmatrix-*/ - Each plugin repo can be updated independently via
git pull - The LEDMatrix project doesn't need to be updated when plugins change