# Development Module - Development workflows # ========================================== # Show detailed development help @dev-help: echo "๐Ÿ”ง DEVELOPMENT MODULE HELP" echo "==========================" echo "" echo "This module provides development workflows including:" echo "โ€ข Quick development builds" echo "โ€ข Testing utilities and validation" echo "โ€ข Performance benchmarking" echo "โ€ข Development environment management" echo "" echo "RECIPES:" echo " dev-build Quick development build (minimal)" echo " test-build Test build system components" echo " test-dist Test generated distributions" echo " validate-all Validate all system components" echo " benchmark Run comprehensive benchmarks" echo " dev-setup Setup development environment" echo "" echo "TESTING:" echo " test-unit Run unit tests" echo " test-integration Run integration tests" echo " test-e2e Run end-to-end tests" echo "" echo "EXAMPLES:" echo " just dev-build # Quick build for testing" echo " just test-dist # Test generated packages" echo " just benchmark # Performance testing" # Quick development build (minimal variant) @dev-build: echo "โšก Quick development build..." {{nu}} {{tools_dir}}/distribution/generate-distribution.nu quick \ --platform linux \ --variant minimal \ --output-dir {{dist_dir}} echo "โœ… Development build completed" # Test build system components @test-build: echo "๐Ÿงช Testing build system..." {{nu}} {{tools_dir}}/build/compile-platform.nu \ --target {{rust_target}} \ --release \ --output-dir {{dist_dir}}/test \ --verbose echo "โœ… Build system test completed" # Test generated distributions @test-dist: echo "๐Ÿงช Testing distributions..." {{nu}} {{tools_dir}}/build/test-distribution.nu \ --dist-dir {{dist_dir}} \ --test-types basic \ --platform `uname -s | tr '[:upper:]' '[:lower:]'` \ --cleanup \ --verbose={{verbose}} echo "โœ… Distribution testing completed" # Validate all system components @validate-all: echo "๐Ÿ” Validating all components..." {{nu}} {{tools_dir}}/build/validate-kcl.nu --verbose={{verbose}} {{nu}} {{tools_dir}}/package/validate-package.nu {{dist_dir}} --validation-type complete echo "โœ… Component validation completed" # Run comprehensive benchmarks @benchmark: echo "โฑ๏ธ Running build benchmarks..." echo "Starting benchmark at: $(date)" time just build-platform BUILD_MODE=release echo "Build benchmark completed at: $(date)" # Setup development environment @dev-setup: echo "๐Ÿ› ๏ธ Setting up development environment..." just check-tools just create-dirs echo "Installing development dependencies..." {{cargo}} install --locked cargo-watch cargo-audit echo "โœ… Development environment setup completed" # Watch for changes and rebuild (development mode) @dev-watch: echo "๐Ÿ‘๏ธ Watching for changes..." {{cargo}} watch -x "build --release" -w provisioning/platform/orchestrator/src # Run unit tests @test-unit: echo "๐Ÿงช Running unit tests..." {{cargo}} test --workspace --lib echo "โœ… Unit tests completed" # Run integration tests @test-integration: echo "๐Ÿงช Running integration tests..." {{cargo}} test --workspace --test '*' echo "โœ… Integration tests completed" # Run end-to-end tests @test-e2e: echo "๐Ÿงช Running end-to-end tests..." {{nu}} {{tools_dir}}/test/e2e-tests.nu \ --dist-dir {{dist_dir}} \ --cleanup \ --verbose={{verbose}} echo "โœ… End-to-end tests completed" # Run all tests @test-all: test-unit test-integration test-e2e test-dist echo "โœ… All tests completed successfully" # Performance profiling @profile: echo "๐Ÿ“Š Running performance profiling..." {{cargo}} build --release --bin orchestrator echo "Build completed. Run profiler manually on target/release/orchestrator" # Code quality checks @quality: echo "โœจ Running code quality checks..." {{cargo}} fmt --check {{cargo}} clippy --all-targets --all-features -- -D warnings {{cargo}} audit echo "โœ… Code quality checks completed" # Development clean (preserve cache) @dev-clean: echo "๐Ÿงน Development clean..." {{cargo}} clean rm -rf {{dist_dir}}/test echo "โœ… Development artifacts cleaned" # Show development status @dev-status: echo "๐Ÿ”ง DEVELOPMENT STATUS" echo "====================" echo "Git branch: $(git rev-parse --abbrev-ref HEAD)" echo "Git status:" git status --porcelain | head -10 echo "" echo "Rust toolchain:" {{cargo}} --version rustc --version echo "" echo "Build targets:" rustup target list --installed echo "" echo "Development directories:" ls -la {{dist_dir}} 2>/dev/null || echo " No dist directory" # Interactive development shell @dev-shell: echo "๐Ÿš Starting development shell..." {{nu}} -e "use provisioning/core/nulib/main.nu *; print 'Provisioning development environment loaded'"