# ============================================================================= # jpl-website - Unified Template System Justfile # ============================================================================= # Generated by cargo rustelo v0.1.0 using unified template system # Template: {{template_name}} | Features: {{#each features}}{{this}} {{/each}} # # This justfile supports layered override system with feature-aware commands. # Layer precedence: Local > Feature > Template > Framework # # IMPORTANT: This file is managed by the template system. # Local customizations should go in config/local/justfile (highest precedence). # Set shell for commands set shell := ["bash", "-c"] # Import local overrides from layered system mod? local 'config/local/justfile' {{#each features}} mod? {{this}} 'config/features/{{this}}/justfile' {{/each}} # ============================================================================= # CORE PROJECT TASKS # ============================================================================= # Show available tasks (default) default: @echo "๐Ÿ“‹ jpl-website - Available Tasks:" @just --list # Start development server with hot reload dev: @echo "๐Ÿš€ Starting development server..." cargo rustelo dev # Build for development build: @echo "๐Ÿ”จ Building for development..." cargo rustelo build # Build for production (optimized) build-prod: @echo "๐Ÿ”จ Building for production..." cargo rustelo build --release # Run tests test: @echo "๐Ÿงช Running tests..." cargo test # Check code quality (lint, format, etc.) check: @echo "๐Ÿ” Checking code quality..." cargo check cargo clippy cargo fmt --check # Format code fmt: @echo "โœจ Formatting code..." cargo fmt # Clean build artifacts clean: @echo "๐Ÿงน Cleaning build artifacts..." cargo clean rm -rf target/ rm -rf dist/ # Install/update dependencies deps: @echo "๐Ÿ“ฆ Installing dependencies..." cargo fetch npm install # ============================================================================= # SETUP AND INITIALIZATION TASKS # ============================================================================= # Initial project setup setup: @echo "๐Ÿ”ง Setting up jpl-website..." @if [ -f "scripts/setup/install.sh" ]; then \ chmod +x scripts/setup/*.sh && ./scripts/setup/install.sh; \ else \ echo "โš ๏ธ No setup script found, running basic setup..."; \ just deps; \ fi # Setup development environment setup-dev: @echo "๐Ÿ› ๏ธ Setting up development environment..." @if [ -f "scripts/setup/setup_dev.sh" ]; then \ chmod +x scripts/setup/setup_dev.sh && ./scripts/setup/setup_dev.sh; \ else \ just setup; \ fi # ============================================================================= # ASSET AND BUILD PIPELINE TASKS # ============================================================================= # List asset resolution paths assets-list: @echo "๐Ÿ“ Asset resolution paths:" cargo rustelo assets list # Check for asset conflicts assets-check: @echo "๐Ÿ” Checking for asset conflicts..." cargo rustelo assets check # Organize assets by category assets-organize: @echo "๐Ÿ“‚ Organizing assets by category..." cargo rustelo assets organize ./dist # Update assets from remote source assets-update: @echo "โฌ†๏ธ Updating assets from source..." cargo rustelo assets update # ============================================================================= # DATABASE TASKS (if enabled) # ============================================================================= # Setup database db-setup: @echo "๐Ÿ—„๏ธ Setting up database..." @if [ -f "scripts/database/db-setup.sh" ]; then \ chmod +x scripts/database/db-setup.sh && ./scripts/database/db-setup.sh; \ else \ echo "โš ๏ธ No database setup script found"; \ fi # Run database migrations db-migrate: @echo "๐Ÿ”„ Running database migrations..." @if [ -f "scripts/database/db-migrate.sh" ]; then \ chmod +x scripts/database/db-migrate.sh && ./scripts/database/db-migrate.sh; \ else \ echo "โš ๏ธ No migration script found"; \ fi # Backup database db-backup: @echo "๐Ÿ’พ Creating database backup..." @if [ -f "scripts/database/db-backup.sh" ]; then \ chmod +x scripts/database/db-backup.sh && ./scripts/database/db-backup.sh; \ else \ echo "โš ๏ธ No backup script found"; \ fi # ============================================================================= # FRAMEWORK AND UPDATE TASKS # ============================================================================= # Update framework dependencies (safe) update: @echo "โฌ†๏ธ Updating framework dependencies..." cargo rustelo update # Update with interactive conflict resolution update-interactive: @echo "โฌ†๏ธ Interactive framework update..." cargo rustelo update --interactive # Show framework and project information info: @echo "๐Ÿ“‹ Project Information:" @echo " Name: jpl-website" @echo " Template: content-website" @echo " Generated by: cargo rustelo v0.1.0" @echo " Generation time: 2025-10-28T18:46:17.145459+00:00" @echo " Rust version: $(rustc --version)" @echo " Cargo version: $(cargo --version)" @echo " Node version: $(node --version 2>/dev/null || echo 'Not installed')" @echo " Project root: $(pwd)" # ============================================================================= # DEPLOYMENT AND CROSS-COMPILATION # ============================================================================= # Initialize cross-compilation for Linux cross-init: @echo "๐Ÿ‹ Initializing cross-compilation..." @if [ -f "scripts/build/cross-build.sh" ]; then \ chmod +x scripts/build/cross-build.sh; \ fi cargo rustelo cross init # Build for Linux using Docker (for deployment) cross-build: @echo "๐Ÿ‹ Cross-compiling for Linux..." @if [ -f "scripts/build/cross-build.sh" ]; then \ ./scripts/build/cross-build.sh; \ else \ cargo rustelo cross build; \ fi # Deploy to production (customize as needed) deploy: build-prod @echo "๐Ÿš€ Deploying to production..." @if [ -f "scripts/deploy/deploy.sh" ]; then \ chmod +x scripts/deploy/deploy.sh && ./scripts/deploy/deploy.sh; \ else \ echo "โš ๏ธ Customize this task for your deployment target"; \ echo "๐Ÿ“ Production build available in: target/release/"; \ fi # ============================================================================= # TESTING TASKS # ============================================================================= # Run all tests test-all: @echo "๐Ÿงช Running all tests..." @if [ -f "scripts/testing/page-browser-tester.sh" ]; then \ chmod +x scripts/testing/*.sh; \ fi cargo test @if [ -d "end2end" ] && command -v npm >/dev/null 2>&1; then \ echo "๐ŸŒ Running end-to-end tests..."; \ cd end2end && npm test; \ fi # Run performance tests test-performance: @echo "โšก Running performance tests..." @if [ -f "scripts/testing/page-browser-tester.sh" ]; then \ ./scripts/testing/page-browser-tester.sh --performance; \ else \ echo "โš ๏ธ No performance testing script found"; \ fi # ============================================================================= # FEATURE-SPECIFIC TASKS # ============================================================================= {{#if features.analytics}} # === Analytics Commands === # Start analytics development server analytics-dev: @echo "๐Ÿ“Š Starting analytics development..." cargo run --bin analytics -- dev --port 3001 # Generate analytics report analytics-report hours="24": @echo "๐Ÿ“ˆ Generating analytics report for {{hours}} hours..." cargo run --bin analytics -- report --hours {{hours}} # Run analytics dashboard analytics-dashboard: @echo "๐Ÿ“‹ Starting analytics dashboard..." cargo run --bin analytics -- dashboard --refresh 30 # Test analytics functionality test-analytics: @echo "๐Ÿงช Testing analytics..." cargo test --package analytics --all-features {{/if}} {{#if features.smart-build}} # === Smart Build Commands === # Build with smart caching build-cached: @echo "โšก Building with smart cache..." cargo run --bin smart-build -- build --cached # Clean build cache cache-clean: @echo "๐Ÿงน Cleaning build cache..." cargo run --bin smart-build -- cache clean # Show cache statistics cache-stats: @echo "๐Ÿ“Š Build cache statistics..." cargo run --bin smart-build -- cache stats # Optimize cache cache-optimize: @echo "โšก Optimizing build cache..." cargo run --bin smart-build -- cache optimize {{/if}} {{#if features.debugging-tools}} # === Debugging Commands === # Start debug mode with enhanced logging dev-debug: @echo "๐Ÿ› Starting debug mode..." RUST_LOG=debug cargo leptos watch # Watch debug logs debug-watch: @echo "๐Ÿ‘€ Watching debug logs..." cargo run --bin debugging-tools -- watch --verbose # Capture browser logs debug-browser page="/": @echo "๐ŸŒ Capturing browser logs for {{page}}..." cargo run --bin debugging-tools -- browser {{page}} # Full debugging session debug-full page="/": @echo "๐Ÿ” Starting full debugging session..." cargo run --bin debugging-tools -- full-debug {{page}} {{/if}} {{#if features.content-static}} # === Content Management Commands === # Build static content content-build: @echo "๐Ÿ“ Building static content..." cargo run --bin tools -- content build # Watch content changes content-watch: @echo "๐Ÿ‘€ Watching content changes..." cargo run --bin tools -- content watch # Validate content content-validate: @echo "โœ… Validating content..." cargo run --bin tools -- content validate {{/if}} # === CSS and Styling Commands === # Build CSS with UnoCSS (layered configuration) css-build: @echo "๐ŸŽจ Building CSS with layered configuration..." {{#if has_package_json}} npm run css:build {{else}} cargo run --bin tools -- css build {{/if}} # Watch CSS changes css-watch: @echo "๐Ÿ‘€ Watching CSS changes..." {{#if has_package_json}} npm run css:watch {{else}} cargo run --bin tools -- css watch {{/if}} # Optimize CSS for production css-optimize: @echo "โšก Optimizing CSS for production..." cargo run --bin tools -- css optimize # === Layered Override Management === # List all active overrides list-overrides: @echo "๐Ÿ“‹ Active layered overrides:" cargo rustelo list-overrides # Create local override override type name: @echo "๐ŸŽ›๏ธ Creating local override for {{type}}: {{name}}" cargo rustelo override {{type}} {{name}} # Trace resolution path trace type name: @echo "๐Ÿ” Tracing resolution for {{type}}: {{name}}" cargo rustelo trace {{type}} {{name}} # Remove local override remove-override type name: @echo "๐Ÿ—‘๏ธ Removing local override for {{type}}: {{name}}" cargo rustelo remove-override {{type}} {{name}} --force # ============================================================================= # UNIFIED DEVELOPMENT WORKFLOWS # ============================================================================= # Full development mode (all enabled features) dev-full: @echo "๐Ÿ”ฅ Starting full development mode..." #!/usr/bin/env bash set -euo pipefail # Start development server in background cargo leptos watch & LEPTOS_PID=$! # Start CSS watcher {{#if has_package_json}} npm run css:watch & CSS_PID=$! {{/if}} {{#if features.analytics}} # Start analytics development server just analytics-dev & ANALYTICS_PID=$! {{/if}} {{#if features.debugging-tools}} # Start debug log watcher just debug-watch & DEBUG_PID=$! {{/if}} echo "๐Ÿš€ All services started. Press Ctrl+C to stop all." # Trap Ctrl+C and kill all background processes trap 'kill $LEPTOS_PID {{#if has_package_json}}$CSS_PID{{/if}} {{#if features.analytics}}$ANALYTICS_PID{{/if}} {{#if features.debugging-tools}}$DEBUG_PID{{/if}} 2>/dev/null' INT # Wait for all background processes wait # Quality assurance workflow quality: @echo "โœจ Running comprehensive quality checks..." just fmt just check just test {{#if features.analytics}} just test-analytics {{/if}} {{#if features.smart-build}} just cache-stats {{/if}} cargo audit # ============================================================================= # HELP AND DOCUMENTATION # ============================================================================= # Show detailed help for common workflows help: @echo "๐Ÿš€ jpl-website - Common Workflows:" @echo "" @echo "๐Ÿ”ง Development:" @echo " just setup # Initial project setup" @echo " just dev # Start development server" @echo " just test # Run tests" @echo " just check # Check code quality" @echo "" @echo "๐Ÿ”จ Building:" @echo " just build # Development build" @echo " just build-prod # Production build" @echo " just clean # Clean artifacts" @echo "" @echo "๐Ÿ—„๏ธ Database:" @echo " just db-setup # Setup database" @echo " just db-migrate # Run migrations" @echo " just db-backup # Backup database" @echo "" @echo "๐ŸŽจ Assets:" @echo " just assets-list # Show asset paths" @echo " just assets-check # Check conflicts" @echo " just assets-update# Update from source" @echo "" @echo "โฌ†๏ธ Updates:" @echo " just update # Safe framework update" @echo " just info # Show project info" @echo "" @echo "๐Ÿš€ Deployment:" @echo " just cross-init # Setup cross-compilation" @echo " just cross-build # Build for Linux" @echo " just deploy # Deploy to production" @echo "" @echo "๐Ÿ“– More help:" @echo " cargo rustelo --help # All available commands" @echo " just --list # All available tasks" # Show framework-specific help help-framework: @echo "๐Ÿฆ€ Rustelo Framework Help:" cargo rustelo --help # ============================================================================= # LOCAL CUSTOMIZATION NOTES # ============================================================================= # # To add local tasks without modifying this file: # 1. Create 'local-tasks.just' in this directory # 2. Add your custom tasks there # 3. They will be automatically imported above # # Example local-tasks.just: # ``` # # Custom deployment task # deploy-staging: # @echo "Deploying to staging..." # # Your custom deployment commands # ``` # # This approach keeps your customizations separate from the generated file, # making framework updates safe and preserving your local modifications. # =============================================================================