# Nushell Plugins Development Justfile
# Modular task runner with organized command categories

# Set shell to bash for compatibility
set shell := ["bash", "-c"]

# Import all module justfiles
import 'justfiles/alias.just'
import 'justfiles/help.just'
import 'justfiles/build.just'
import 'justfiles/distro.just'
import 'justfiles/full_distro.just'
import 'justfiles/upstream.just'
import 'justfiles/qa.just'
import 'justfiles/tools.just'

# Default recipe - show modular help
[no-cd]
default:
    @just help


# 📊 CORE STATUS COMMANDS (Most frequently used)

# Show plugin status dashboard
[no-cd]
status:
    @echo "📊 Plugin Status Dashboard"
    @{{justfile_directory()}}/scripts/run.sh plugin_status.nu

# Show detailed status for all plugins
[no-cd]
status-all:
    @echo "📊 All Plugins Status"
    @{{justfile_directory()}}/scripts/run.sh plugin_status.nu --all

# Show plugins requiring attention
[no-cd]
status-attention:
    @echo "🚨 Plugins Requiring Attention"
    @{{justfile_directory()}}/scripts/run.sh plugin_status.nu attention

# Update plugin status manually
[no-cd]
status-update PLUGIN STATUS:
    @echo "🔄 Updating {{PLUGIN}} status to {{STATUS}}..."
    @{{justfile_directory()}}/scripts/run.sh plugin_status.nu update {{PLUGIN}} {{STATUS}}

# 🎯 MULTI-MODULE WORKFLOW COMMANDS
# These workflows combine commands from multiple modules

# Complete development workflow: validate → upstream check → build → test → status
[no-cd]
dev-flow:
    @echo "🎯 Running complete development workflow..."
    @just validate-nushell
    @just upstream-check
    @just build
    @just test
    @just status

# Complete release workflow: validate → build → collect → package
[no-cd]
release-flow:
    @echo "🚀 Running complete release workflow..."
    @just validate-nushell
    @just build
    @just collect
    @just pack

# Cross-platform development workflow
[no-cd]
dev-flow-cross:
    @echo "🌍 Running cross-platform development workflow..."
    @just validate-nushell
    @just upstream-check
    @just build-cross-all
    @just status

# CI simulation workflow (what GitHub Actions will run)
[no-cd]
ci-flow:
    @echo "🤖 Simulating CI workflow..."
    @just validate-nushell
    @just fmt-check
    @just lint
    @just build-cross-all
    @just test
    @just collect-all
    @just pack-checksums

# Update workflow: update nushell → fix version → update versions → check upstream
[no-cd]
update-flow:
    @echo "🔄 Running update workflow..."
    @just update-nushell
    @just fix-nushell
    @just update-nu-versions
    @just upstream-check

