From 431d3d346ce29d61242ae46caaffd15c93d8d0d2 Mon Sep 17 00:00:00 2001 From: rcourtman Date: Sun, 8 Jun 2025 12:33:30 +0100 Subject: [PATCH] feat: implement integrated development mode with automatic CSS rebuilding MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Major Development Environment Improvements ### Integrated Development Mode - Modified systemd service to use 'npm run dev' for complete development stack - Concurrently runs both development server and Tailwind CSS watcher - Automatic CSS rebuilding when Tailwind classes change - Seamless hot reload for frontend, backend, and CSS changes ### Hot Reload Enhancements - Always attempt to load chokidar for development convenience - Enhanced file watcher initialization with better error messaging - Added debug logging for NODE_ENV detection and chokidar availability - Improved development experience with real-time change detection ### Development vs Production Distinction - Development: systemd runs 'npm run dev' with NODE_ENV=development - Production: installer creates service running 'node server/index.js' with NODE_ENV=production - Clear separation between development and production environments - Updated CLAUDE.md with integrated development mode documentation ### UI and Configuration Updates - Removed DEV branding from title and header (development-specific cleanup) - Added CLAUDE.md to .gitignore (development reference file) - Restored proper RC branding for release candidate version ### Development Workflow Optimization - No more manual 'npm run build:css' commands needed - Complete hot reload: frontend JS → browser reload, CSS changes → auto-rebuild → browser reload - Production-ready systemd service management with PolicyKit - Optimal development experience with automatic toolchain management This creates a seamless development environment where any change to Tailwind classes automatically rebuilds CSS and triggers browser reload, while maintaining proper production deployment through the existing install script. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .gitignore | 1 + server/index.js | 13 ++++++------- src/public/index.html | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 5b1ea6782..287738aa4 100644 --- a/.gitignore +++ b/.gitignore @@ -86,6 +86,7 @@ jspm_packages/ RELEASE_CHECKLIST.md AI_WORKFLOW.md AI_WORKFLOW_SETUP.md +CLAUDE.md # Lockfiles # package-lock.json # Usually committed, but ignore if specified elsewhere diff --git a/server/index.js b/server/index.js index 581f0cafc..537f3e7c7 100644 --- a/server/index.js +++ b/server/index.js @@ -63,14 +63,12 @@ const { URL } = require('url'); // <--- ADD: Import URL constructor const axios = require('axios'); const axiosRetry = require('axios-retry').default; // Import axios-retry -// Development specific dependencies +// Hot reload dependencies (always try to load for development convenience) let chokidar; -if (process.env.NODE_ENV === 'development') { - try { - chokidar = require('chokidar'); - } catch (e) { - console.warn('chokidar is not installed. Hot reload requires chokidar: npm install --save-dev chokidar'); - } +try { + chokidar = require('chokidar'); +} catch (e) { + console.warn('chokidar is not installed. Hot reload requires chokidar: npm install chokidar'); } // --- API Client Initialization --- @@ -1639,6 +1637,7 @@ async function startServer() { setupEnvFileWatcher(); // Setup hot reload in development mode + console.log(`[Debug] NODE_ENV: ${process.env.NODE_ENV}, chokidar available: ${!!chokidar}`); if (process.env.NODE_ENV === 'development' && chokidar) { const watchPaths = [ path.join(__dirname, '../src/public'), // Frontend files diff --git a/src/public/index.html b/src/public/index.html index 6f2dde9aa..34074bc97 100644 --- a/src/public/index.html +++ b/src/public/index.html @@ -3,7 +3,7 @@ - Pulse RC - DEV + Pulse RC