# Version Update Commands # Semi-automated Nushell version update workflows # ๐Ÿ”„ VERSION UPDATE WORKFLOWS # Update to new Nushell version - ALL-IN-ONE (downloads, builds, updates plugins, creates distributions) [no-cd] [group('version-update')] complete-update VERSION="": #!/usr/bin/env bash if [ -z "{{VERSION}}" ]; then echo "โŒ Error: VERSION parameter required" echo "Usage: just complete-update 0.108.0" echo " just complete-update 0.108.0 --auto-approve # Skip prompts" echo " just complete-update 0.108.0 --fix # Auto-fix issues" exit 1 fi echo "๐Ÿš€ Complete Nushell Update (ALL-IN-ONE) - RUNNER" echo "Note: Using built nu 0.108.0 binary (system nu may be broken)" echo "" cd "{{justfile_directory()}}" SCRIPT_DIR="{{justfile_directory()}}/scripts" # Use newly built nu binary instead of broken system nu NU_BIN="{{justfile_directory()}}/nushell/target/release/nu" echo "Step 1/7: Downloading Nushell {{VERSION}}..." echo " ๐Ÿ“ Command: $NU_BIN $SCRIPT_DIR/download_nushell.nu {{VERSION}}" "$NU_BIN" "$SCRIPT_DIR/download_nushell.nu" "{{VERSION}}" || exit 1 echo "" echo "Step 2/7: Analyzing features..." echo " ๐Ÿ“ Command: $NU_BIN $SCRIPT_DIR/analyze_nushell_features.nu --validate" $NU_BIN "$SCRIPT_DIR/analyze_nushell_features.nu" --validate || exit 1 echo "" echo "Step 3/7: Building Nushell..." # Check if binary already exists with correct version if [ -f "nushell/target/release/nu" ]; then BUILT_VERSION=$("nushell/target/release/nu" --version 2>/dev/null || echo "") if [ "$BUILT_VERSION" = "{{VERSION}}" ]; then echo "โœ… Nushell {{VERSION}} already built - skipping build" else echo " ๐Ÿ“ Command: cd nushell && cargo build --release --workspace --features \"mcp,plugin,sqlite,trash-support,system-clipboard,rustls-tls\"" (cd nushell && cargo build --release --workspace --features "mcp,plugin,sqlite,trash-support,system-clipboard,rustls-tls") || exit 1 fi else echo " ๐Ÿ“ Command: cd nushell && cargo build --release --workspace --features \"mcp,plugin,sqlite,trash-support,system-clipboard,rustls-tls\"" (cd nushell && cargo build --release --workspace --features "mcp,plugin,sqlite,trash-support,system-clipboard,rustls-tls") || exit 1 fi echo "" echo "Step 4/7: Updating plugins..." echo " ๐Ÿ“ Command: $NU_BIN $SCRIPT_DIR/update_all_plugins.nu {{VERSION}} --auto-approve" $NU_BIN "$SCRIPT_DIR/update_all_plugins.nu" "{{VERSION}}" --auto-approve || exit 1 echo "" echo "Step 5/7: Building plugins..." # Check if plugins need rebuilding PLUGINS_NEED_BUILD=false for plugin in nu_plugin_*; do if [ -d "$plugin" ]; then # Check if binary exists BINARY="$plugin/target/release/$plugin" if [ ! -f "$BINARY" ]; then PLUGINS_NEED_BUILD=true break fi # Check if Cargo.toml is newer than binary if [ "$plugin/Cargo.toml" -nt "$BINARY" ]; then PLUGINS_NEED_BUILD=true break fi fi done if [ "$PLUGINS_NEED_BUILD" = false ]; then echo "โœ… All plugins already built - skipping rebuild" else echo " ๐Ÿ“ Command: for each plugin dir: cd && cargo build --release" for plugin in nu_plugin_*; do if [ -d "$plugin" ]; then (cd "$plugin" && cargo build --release) || exit 1 fi done fi echo "" echo "Step 6/7: Creating distributions..." echo " ๐Ÿ“ Command: $NU_BIN $SCRIPT_DIR/create_full_distribution.nu" $NU_BIN "$SCRIPT_DIR/create_full_distribution.nu" || exit 1 echo "" echo "Step 7/7: Validating..." echo " ๐Ÿ“ Command: $NU_BIN $SCRIPT_DIR/update_all_plugins.nu check" $NU_BIN "$SCRIPT_DIR/update_all_plugins.nu" check || exit 1 echo "" echo "โœ… Complete Nushell Update Finished!" # Update to new Nushell version WITH prompts (ask before updating plugins) [no-cd] [group('version-update')] complete-update-interactive VERSION="": #!/usr/bin/env bash if [ -z "{{VERSION}}" ]; then echo "โŒ Error: VERSION parameter required" echo "Usage: just complete-update-interactive 0.108.0" exit 1 fi echo "๐Ÿš€ Complete Nushell Update (INTERACTIVE MODE)" echo "Note: Using built nu binary (system nu may be broken)" echo "" cd "{{justfile_directory()}}" SCRIPT_DIR="{{justfile_directory()}}/scripts" NU_BIN="{{justfile_directory()}}/nushell/target/release/nu" echo "Step 1/7: Downloading Nushell {{VERSION}}..." "$NU_BIN" "$SCRIPT_DIR/download_nushell.nu" "{{VERSION}}" || exit 1 echo "" echo "Step 2/7: Analyzing features..." $NU_BIN "$SCRIPT_DIR/analyze_nushell_features.nu" --validate || exit 1 echo "" echo "Step 3/7: Building Nushell..." if [ -f "nushell/target/release/nu" ]; then BUILT_VERSION=$("nushell/target/release/nu" --version 2>/dev/null || echo "") if [ "$BUILT_VERSION" = "{{VERSION}}" ]; then echo "โœ… Nushell {{VERSION}} already built - skipping build" else (cd nushell && cargo build --release --workspace --features "mcp,plugin,sqlite,trash-support,system-clipboard,rustls-tls") || exit 1 fi else (cd nushell && cargo build --release --workspace --features "mcp,plugin,sqlite,trash-support,system-clipboard,rustls-tls") || exit 1 fi echo "" echo "Step 4/7: Updating plugins..." $NU_BIN "$SCRIPT_DIR/update_all_plugins.nu" "{{VERSION}}" || exit 1 echo "" echo "Step 5/7: Building plugins..." # Check if plugins need rebuilding PLUGINS_NEED_BUILD=false for plugin in nu_plugin_*; do if [ -d "$plugin" ]; then # Check if binary exists BINARY="$plugin/target/release/$plugin" if [ ! -f "$BINARY" ]; then PLUGINS_NEED_BUILD=true break fi # Check if Cargo.toml is newer than binary if [ "$plugin/Cargo.toml" -nt "$BINARY" ]; then PLUGINS_NEED_BUILD=true break fi fi done if [ "$PLUGINS_NEED_BUILD" = false ]; then echo "โœ… All plugins already built - skipping rebuild" else echo " ๐Ÿ“ Command: for each plugin dir: cd && cargo build --release" for plugin in nu_plugin_*; do if [ -d "$plugin" ]; then (cd "$plugin" && cargo build --release) || exit 1 fi done fi echo "" echo "Step 6/7: Creating distributions..." echo " ๐Ÿ“ Command: $NU_BIN $SCRIPT_DIR/create_full_distribution.nu" $NU_BIN "$SCRIPT_DIR/create_full_distribution.nu" || exit 1 echo "" echo "Step 7/7: Validating..." echo " ๐Ÿ“ Command: $NU_BIN $SCRIPT_DIR/update_all_plugins.nu check" $NU_BIN "$SCRIPT_DIR/update_all_plugins.nu" check || exit 1 echo "" echo "โœ… Complete Nushell Update Finished!" # Update to latest Nushell version - ALL-IN-ONE [no-cd] [group('version-update')] update-latest: @echo "๐Ÿš€ Updating to latest Nushell version" @nu {{justfile_directory()}}/scripts/complete_update.nu --latest # Download and build Nushell core only (downloads, builds, validates) [no-cd] [group('version-update')] download-and-build VERSION="": #!/usr/bin/env bash if [ -z "{{VERSION}}" ]; then echo "โŒ Error: VERSION parameter required" echo "Usage: just download-and-build 0.108.0" exit 1 fi echo "๐Ÿ“ฅ Downloading and building Nushell {{VERSION}}" nu {{justfile_directory()}}/scripts/update_nushell_version.nu {{VERSION}} # Update all plugin dependencies to match Nushell version [no-cd] [group('version-update')] update-plugins VERSION="": #!/usr/bin/env bash if [ -z "{{VERSION}}" ]; then echo "โŒ Error: VERSION parameter required" echo "Usage: just update-plugins 0.108.0" exit 1 fi echo "๐Ÿ“ฆ Updating all plugin dependencies to {{VERSION}}" nu {{justfile_directory()}}/scripts/update_all_plugins.nu {{VERSION}} # Update plugins to match nushell submodule version (auto-sync) [no-cd] [group('version-update')] sync-plugins: @echo "๐Ÿ”„ Syncing plugin versions with nushell submodule" @nu {{justfile_directory()}}/scripts/update_all_plugins.nu sync # Check plugin version consistency [no-cd] [group('version-update')] check-versions: @echo "๐Ÿ” Checking plugin version consistency" @nu {{justfile_directory()}}/scripts/update_all_plugins.nu check # List current plugin versions [no-cd] [group('version-update')] list-versions: @echo "๐Ÿ“‹ Plugin Version List" @nu {{justfile_directory()}}/scripts/update_all_plugins.nu --list # ๐Ÿ“ฆ DISTRIBUTION CREATION # Create complete distribution packages (nushell + all plugins) # This runs the full workflow: collect binaries โ†’ create packages โ†’ create bin archives [no-cd] [group('version-update')] create-distribution: @echo "๐Ÿ“ฆ Creating complete distribution packages" @just collect-full @{{justfile_directory()}}/scripts/run.sh create_full_distribution.nu # Alias: cd = create-distribution [no-cd] [group('version-update')] cd: @just create-distribution # Create distributions for all platforms [no-cd] [group('version-update')] create-distribution-all: @echo "๐Ÿ“ฆ Creating distributions for all platforms" @just collect-full-all @{{justfile_directory()}}/scripts/run.sh create_full_distribution.nu --all-platforms --checksums # Create plugin-only bin archives [no-cd] [group('version-update')] create-bin-archives: @echo "๐Ÿ“ฆ Creating bin archives (plugins only)" @{{justfile_directory()}}/scripts/run.sh create_full_distribution.nu --bin-only # Rebuild everything and create fresh distributions [no-cd] [group('version-update')] rebuild-all: @echo "๐Ÿ”จ Rebuild all and create distributions" @nu {{justfile_directory()}}/scripts/create_full_distribution.nu rebuild # Show distribution status [no-cd] [group('version-update')] dist-status: @echo "๐Ÿ“Š Distribution Status" @nu {{justfile_directory()}}/scripts/create_full_distribution.nu status # ๐Ÿ” FEATURE ANALYSIS # Analyze available Nushell features [no-cd] [group('version-update')] analyze-features: @echo "๐Ÿ” Analyzing Nushell features" @nu {{justfile_directory()}}/scripts/analyze_nushell_features.nu --validate # Show all available features [no-cd] [group('version-update')] show-features: @echo "๐Ÿ“‹ All Available Features" @nu {{justfile_directory()}}/scripts/analyze_nushell_features.nu --show-all # Show feature dependency tree [no-cd] [group('version-update')] feature-tree FEATURE="mcp": @echo "๐ŸŒฒ Feature Dependency Tree for {{FEATURE}}" @nu {{justfile_directory()}}/scripts/analyze_nushell_features.nu tree {{FEATURE}} # Generate build command with desired features [no-cd] [group('version-update')] build-cmd: @echo "๐Ÿ”ง Generate Build Command" @nu {{justfile_directory()}}/scripts/analyze_nushell_features.nu build-cmd # ๐Ÿ” DEPENDENCY AUDITING # Audit plugin dependencies for version mismatches (advanced analysis) [no-cd] [group('version-update')] audit-versions: @echo "๐Ÿ” Auditing plugin dependency versions" @nu {{justfile_directory()}}/scripts/audit_crate_dependencies.nu --export # Audit specific plugin dependency versions [no-cd] [group('version-update')] audit-plugin-versions PLUGIN: @echo "๐Ÿ” Auditing {{PLUGIN}} dependency versions" @nu {{justfile_directory()}}/scripts/audit_crate_dependencies.nu --plugin {{PLUGIN}} # Show dependency matrix (which plugins use which crates) [no-cd] [group('version-update')] dependency-matrix: @echo "๐Ÿ“Š Dependency Matrix" @nu {{justfile_directory()}}/scripts/audit_crate_dependencies.nu matrix # ๐Ÿšจ BREAKING CHANGE DETECTION # Detect breaking changes for current version [no-cd] [group('version-update')] detect-breaking: @echo "๐Ÿšจ Detecting breaking changes" @nu {{justfile_directory()}}/scripts/detect_breaking_changes.nu --scan-plugins --export # ๐Ÿ“ฅ DOWNLOAD & BUILD # Download Nushell source from GitHub tags [no-cd] [group('version-update')] download-source VERSION="": #!/usr/bin/env bash if [ -z "{{VERSION}}" ]; then echo "โŒ Error: VERSION parameter required" echo "Usage: just download-source 0.108.0" exit 1 fi echo "๐Ÿ“ฅ Downloading Nushell source {{VERSION}}" nu {{justfile_directory()}}/scripts/download_nushell.nu {{VERSION}} # Download latest Nushell source [no-cd] [group('version-update')] download-latest: @echo "๐Ÿ“ฅ Downloading latest Nushell" @nu {{justfile_directory()}}/scripts/download_nushell.nu --latest # Build Nushell with all features (MCP, plugin, sqlite, etc.) [no-cd] [group('version-update')] build-nu: @echo "๐Ÿ”จ Building Nushell with all features" @nu {{justfile_directory()}}/scripts/build_nushell.nu # ๐Ÿ“Š STATUS & VALIDATION # Check update system status [no-cd] [group('version-update')] update-status: @echo "๐Ÿ“Š Update System Status" @nu {{justfile_directory()}}/scripts/complete_update.nu status # Validate code rules against binary [no-cd] [group('version-update')] validate-code: @echo "โœ… Validating code rules" @nu {{justfile_directory()}}/scripts/validate_code_rules.nu # ๐Ÿงน CLEANUP # Clean up temporary update files [no-cd] [group('version-update')] clean-update: @echo "๐Ÿงน Cleaning update temporary files" @nu {{justfile_directory()}}/scripts/update_nushell_version.nu clean # ๐Ÿ“š DOCUMENTATION & HELP # Show version update documentation [no-cd] [group('version-update')] update-docs: @echo "๐Ÿ“š Version Update Documentation" @echo "" @echo "Complete Guide:" @echo " guides/COMPLETE_VERSION_UPDATE_GUIDE.md" @echo "" @echo "Version-Specific Docs:" @echo " updates/108/ (for each version)" @echo "" @echo " โ€ข NUSHELL_0.108_UPDATE_SUMMARY.md - Complete summary" @echo " โ€ข MIGRATION_0.108.0.md - Migration guide" @echo " โ€ข NUSHELL_UPDATE_AUTOMATION.md - Automation details" @echo "" @echo "Quick Reference:" @echo " just complete-update 0.108.0 - Update everything" @echo " just update-latest - Update to latest" @echo " just update-plugins 0.108.0 - Update plugins only" @echo " just create-distribution - Create packages" # Quick reference for version update commands [no-cd] [group('version-update')] update-help: @echo "๐Ÿ”„ Version Update Quick Reference" @echo "" @echo "Complete Workflows:" @echo " just complete-update 0.108.0 - All-in-one (automatic, no prompts)" @echo " just complete-update-interactive 0.108.0 - All-in-one (with confirmation)" @echo " just update-latest - Update to latest release" @echo " just rebuild-all - Rebuild & redistribute" @echo "" @echo "Arguments & Flags:" @echo " just show-arguments - Show all available commands and modes" @echo "" @echo "Step-by-Step:" @echo " just download-source 0.108.0 - 1. Download source" @echo " just build-nu - 2. Build nushell" @echo " just update-plugins 0.108.0 - 3. Update plugins" @echo " just create-distribution - 4. Create packages" @echo "" @echo "Analysis & Validation:" @echo " just check-versions - Check version consistency" @echo " just audit-versions - Audit dependency versions" @echo " just detect-breaking - Find breaking changes" @echo " just analyze-features - Show available features" @echo "" @echo "Status & Info:" @echo " just update-status - Show update status" @echo " just dist-status - Show distribution status" @echo " just list-versions - List plugin versions" @echo "" @echo "Documentation:" @echo " just update-docs - Show documentation paths" @echo " cat guides/COMPLETE_VERSION_UPDATE_GUIDE.md" # ๐Ÿ“‹ ARGUMENTS REFERENCE # Available flags for version update commands [no-cd] [group('version-update')] show-arguments: @echo "๐Ÿ“‹ Version Update Commands - Arguments Reference" @echo "" @echo "๐Ÿš€ AUTOMATIC MODE (Recommended - No Prompts)" @echo "Usage: just complete-update VERSION" @echo " Automatically skips all confirmation prompts" @echo " Example: just complete-update 0.108.0" @echo "" @echo "๐Ÿค” INTERACTIVE MODE (Ask Before Updates)" @echo "Usage: just complete-update-interactive VERSION" @echo " Prompts for confirmation before updating plugins" @echo " Example: just complete-update-interactive 0.108.0" @echo "" @echo "Parameters:" @echo " VERSION Required. Nushell version to update to (e.g., 0.108.0)" @echo "" @echo "7 Steps in Both Modes:" @echo " Step 1: Download Nushell source from GitHub" @echo " (skipped if version already exists)" @echo " Step 2: Analyze available features (MCP, plugin, sqlite, etc.)" @echo " Step 3: Build Nushell with all features" @echo " (skipped if already built and version matches)" @echo " Step 4: Update all plugin dependencies to match version" @echo " (automatic mode: skips prompt | interactive: asks)" @echo " Step 5: Build all plugins for distribution" @echo " Step 6: Create distribution packages" @echo " Step 7: Validate installation and plugin registration" @echo "" @echo "Comparison:" @echo " Automatic: just complete-update 0.108.0" @echo " No prompts, ideal for CI/CD" @echo "" @echo " Interactive: just complete-update-interactive 0.108.0" @echo " Asks before updating plugins" # ๐Ÿ”ง HELPER FUNCTIONS (private recipes) # Note: Parameter validation is done inline in each recipe that requires VERSION