MULTI MONOREPO SETUP

Comprehensive guidelines for AI-assisted development within the Editor platform

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)

2. Nx Configuration (nx.json)

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 dev:gograb
# 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

  1. Close unused Cursor windows - Each window spawns multiple language servers
  2. Use Nx daemon - Share computation across projects (useDaemonProcess: true)
  3. Monitor memory - Use Activity Monitor to ensure you're not hitting swap
  4. Regular cleanup - Run yarn nx reset weekly
  5. Stagger builds - Use --parallel=1 for memory-intensive builds

📝 Configuration Files

🔄 Applying to Other Monorepos

Copy these files to your other monorepos:

  1. .vscode/settings.json
  2. scripts/configure-multi-monorepo.js
  3. .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)