mirror of
https://github.com/tiennm99/coolify.git
synced 2026-04-17 17:21:04 +00:00
Add automatic shared dependencies for worktrees
Setup Conductor to automatically share node_modules and vendor directories across all git worktrees to save disk space and speed up development. Changes: - Updated conductor-setup.sh to create symlinks to shared dependencies - Added documentation to CLAUDE.md explaining the system - Dependencies now stored in .shared-deps/ in main repository - All worktrees use the same dependency versions automatically Benefits: - Saves hundreds of MBs to GBs of disk space - No need to run npm install/composer install for each worktree - Consistent dependency versions across all worktrees Note: Add .shared-deps/ to .gitignore in the main repository 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
38
CLAUDE.md
38
CLAUDE.md
@@ -10,6 +10,44 @@ This file provides guidance to **Claude Code** (claude.ai/code) when working wit
|
||||
|
||||
Coolify is an open-source, self-hostable platform for deploying applications and managing servers - an alternative to Heroku/Netlify/Vercel. It's built with Laravel (PHP) and uses Docker for containerization.
|
||||
|
||||
## Git Worktree Shared Dependencies
|
||||
|
||||
This repository uses git worktrees for parallel development with **automatic shared dependency setup** via Conductor.
|
||||
|
||||
### How It Works
|
||||
|
||||
The `conductor.json` setup script (`scripts/conductor-setup.sh`) automatically:
|
||||
1. Creates a shared `.shared-deps/` directory in the main repository
|
||||
2. Creates symlinks from `node_modules` and `vendor` to the shared location
|
||||
3. This happens automatically when Conductor creates a new worktree
|
||||
|
||||
### Benefits
|
||||
|
||||
- **Save disk space**: Only one copy of dependencies across all worktrees
|
||||
- **Faster setup**: No need to run `npm install` or `composer install` for each worktree
|
||||
- **Consistent versions**: All worktrees use the same dependency versions
|
||||
- **Auto-configured**: Handled by Conductor's setup script
|
||||
|
||||
### Manual Setup (If Needed)
|
||||
|
||||
If you need to set up symlinks manually or for non-Conductor worktrees:
|
||||
|
||||
```bash
|
||||
# From the worktree directory
|
||||
SHARED_DEPS="../../.shared-deps"
|
||||
mkdir -p "$SHARED_DEPS/node_modules" "$SHARED_DEPS/vendor"
|
||||
rm -rf node_modules vendor
|
||||
ln -sf "$SHARED_DEPS/node_modules" node_modules
|
||||
ln -sf "$SHARED_DEPS/vendor" vendor
|
||||
```
|
||||
|
||||
### Important Notes
|
||||
|
||||
- Dependencies are shared at `$CONDUCTOR_ROOT_PATH/.shared-deps/`
|
||||
- Run `npm install` or `composer install` from any worktree to update all
|
||||
- Ensure `.shared-deps/` is in `.gitignore` (should already be there)
|
||||
- If different branches need different dependency versions, this won't work - remove symlinks and use separate directories
|
||||
|
||||
## Development Commands
|
||||
|
||||
### Frontend Development
|
||||
|
||||
Reference in New Issue
Block a user