1 line
6.7 KiB
Markdown
Raw Normal View History

# Nushell Plugin Upstream Tracking System\n\nThis system provides automated tracking and management of upstream changes for nushell plugins while preserving your local nu_* dependency modifications.\n\n## 🚀 Quick Start\n\n```bash\n# Check status of all plugins\n./sh/plugin_status.sh\n\n# Check upstream changes for all plugins\n./sh/check_upstream.sh\n\n# Check specific plugin only\n./sh/check_upstream.sh --plugin nu_plugin_highlight\n\n# Merge all pending plugins\n./sh/safe_merge_upstream.sh --all\n```\n\n## 📋 Supported Operations\n\n### ✅ **For ALL Plugins**\n\n```bash\n# Check upstream changes for ALL plugins\n./sh/check_upstream.sh\nnu nu/check_upstream_changes.nu\n\n# Show status of ALL plugins\n./sh/plugin_status.sh\nnu nu/plugin_status.nu\n\n# Merge ALL pending plugins\n./sh/safe_merge_upstream.sh --all\nnu nu/safe_merge_upstream.nu --all\n```\n\n### ✅ **For ONE Specific Plugin**\n\n```bash\n# Check upstream for ONE plugin\n./sh/check_upstream.sh --plugin nu_plugin_highlight\nnu nu/check_upstream_changes.nu --plugin nu_plugin_highlight\n\n# Preview merge for ONE plugin\n./sh/safe_merge_upstream.sh --preview nu_plugin_highlight\nnu nu/safe_merge_upstream.nu --preview nu_plugin_highlight\n\n# Merge ONE plugin\n./sh/safe_merge_upstream.sh nu_plugin_highlight\nnu nu/safe_merge_upstream.nu nu_plugin_highlight\n```\n\n### ✅ **For SEVERAL Plugins** (multiple ways)\n\n#### Method 1: Run multiple commands\n\n```bash\n# Check several plugins individually\n./sh/check_upstream.sh --plugin nu_plugin_highlight\n./sh/check_upstream.sh --plugin nu_plugin_clipboard\n./sh/check_upstream.sh --plugin nu_plugin_tera\n\n# Merge several plugins individually\n./sh/safe_merge_upstream.sh nu_plugin_highlight\n./sh/safe_merge_upstream.sh nu_plugin_clipboard\n./sh/safe_merge_upstream.sh nu_plugin_tera\n```\n\n#### Method 2: Use shell scripting\n\n```bash\n# Check multiple plugins in a loop\nfor plugin in nu_plugin_highlight nu_plugin_clipboard nu_plugin_tera; do\n ./sh/check_upstream.sh --plugin $plugin\ndone\n\n# Merge multiple specific plugins\nfor plugin in nu_plugin_highlight nu_plugin_clipboard; do\n ./sh/safe_merge_upstream.sh $plugin\ndone\n```\n\n#### Method 3: Use the "pending" status to target several\n\n```bash\n# First, check all to mark them as pending\n./sh/check_upstream.sh\n\n# Then merge all pending ones (effectively several plugins)\n./sh/safe_merge_upstream.sh --all\n```\n\n## 🔧 System Components\n\n### Core Files\n\n- `plugin_registry.toml` - Central configuration and status tracking\n- `nu/lib/cargo_toml_diff.nu` - Cargo.toml analysis library\n- `nu/check_upstream_changes.nu` - Main upstream checker with auto-OK logic\n- `nu/plugin_status.nu` - Status dashboard and management\n- `nu/safe_merge_upstream.nu` - Safe merge with rollback capability\n\n### Shell Wrappers (for compatibility)\n\n- `sh/check_upstream.sh` - Shell wrapper for upstream checking\n- `sh/plugin_status.sh` - Shell wrapper for status dashboard\n- `sh/safe_merge_upstream.sh` - Shell wrapper for safe merging\n\n## 🎯 Auto-OK Logic\n\nThe system automatically marks plugins as "OK" when:\n\n- ✅ Only nu_* dependencies changed (nu-plugin, nu-protocol, etc.)\n- ✅ No source code changes (.rs files)\n- ✅ No other dependency changes\n- ✅ Plugin has `auto_ok_on_nu_deps_only = true` in registry\n\n## 📊 Plugin Status Types\n\n| Status | Emoji | Description |\n|--------|-------|-------------|\n| `ok` | ✅ | Synchronized with upstream |\n| `pending` | ⚠️ | Changes detected, needs review |\n| `error` | ❌ | Error during checking/merging |\n| `conflict` | 🔥 | Merge conflicts detected |\n| `unknown` | ❓ | Not yet checked |\n| `local_only` | 🏠 | No upstream repository |\n\n## 💡 Usage Examples\n\n### Daily Workflow\n\n```bash\n# 1. Check all plugins for updates\n./sh/check_upstream.sh\n\n# 2. See what needs attention\n./sh/plugin_status.sh attention\n\n# 3. Merge safe updates automatically\n./sh/safe_merge_upstream.sh --all\n\n# 4. Review any remaining pending plugins manually\n./sh/plugin_status.sh\n```\n\n### Specific Plu