MULTI MONOREPO SETUP
Documentation for Developers
Multi-Monorepo Performance Configuration
This workspace is optimized for powerful machines running 2-3 monorepos simultaneously.
🚀 Applied Optimizations
1. Cursor/VSCode Settings (.vscode/settings.json)
- ✅ TypeScript server max memory: 8GB (was default ~3GB)
- ✅ Large files max memory: 4GB
- ✅ Disabled auto type acquisition for performance
- ✅ Optimized file watchers (excluded dist, cache directories)
2. Nx Configuration (nx.json)
- ✅ Max parallel tasks: 3 (was 1)
- ✅ Max memory: 16GB (was 12GB)
- ✅ Daemon max concurrency: 6
- ✅ Daemon process enabled
3. Node.js Environment Configuration
Option A: Using Shell Profile (Recommended for permanent setup)
Add to your ~/.zshrc or ~/.bashrc:
# Multi-monorepo Node.js configuration
export NODE_OPTIONS="--max-old-space-size=8192 --max-http-header-size=32768"
export UV_THREADPOOL_SIZE=128
export NODE_NO_WARNINGS=1
Then reload: source ~/.zshrc
Option B: Using .nvmrc.env (Per-project)
Source the provided file before starting work:
source .nvmrc.env
4. EventEmitter Max Listeners
Run this before starting development:
yarn configure:multi-monorepo
Or add to your startup scripts:
yarn fix:max-listeners
🔧 Quick Setup Commands
# 1. Configure multi-monorepo support
yarn configure:multi-monorepo
# 2. Reset Nx daemon if experiencing issues
yarn nx reset
# 3. Start your development servers
yarn serve:gograb-space
# or
yarn dev:ecosystem
📊 Resource Allocation
For a machine with 32GB+ RAM running 2-3 monorepos:
| Component | Memory Allocation |
|---|---|
| Each Nx daemon | ~2-3GB |
| Each TypeScript server | ~8GB max |
| Each Angular language server | ~2-4GB |
| Node heap (per process) | 8GB max |
| Total recommended RAM | 32GB+ |
⚠️ Troubleshooting
If you see "MaxListenersExceededWarning"
yarn configure:multi-monorepo
If Cursor becomes slow
# 1. Reset all Nx caches
yarn nx reset
# 2. Close unused Cursor windows
# 3. Restart Cursor
If you need to clean up processes
# Check running Node processes
ps aux | grep node | grep -v grep
# Kill specific Nx daemons (use with caution)
pkill -f "nx/src/daemon"
# Then restart
yarn nx reset
🎯 Best Practices
- Close unused Cursor windows - Each window spawns multiple language servers
- Use Nx daemon - Share computation across projects (
useDaemonProcess: true) - Monitor memory - Use Activity Monitor to ensure you're not hitting swap
- Regular cleanup - Run
yarn nx resetweekly - Stagger builds - Use
--parallel=1for memory-intensive builds
📝 Configuration Files
.vscode/settings.json- Cursor/VSCode settingsnx.json- Nx task runner and daemon settings.nvmrc.env- Node environment variablesscripts/configure-multi-monorepo.js- EventEmitter configuration
🔄 Applying to Other Monorepos
Copy these files to your other monorepos:
.vscode/settings.jsonscripts/configure-multi-monorepo.js.nvmrc.env
Update nx.json with the same tasksRunnerOptions configuration.
🔄 Need to Revert These Changes?
See ROLLBACK-MULTI-MONOREPO.md for complete step-by-step instructions to undo all multi-monorepo optimizations.
Last Updated: October 2025 Machine Profile: Powerful workstation (32GB+ RAM, multi-core CPU)