From a49b22cf836b5b27f81aa46c1bc2064562bd4dd8 Mon Sep 17 00:00:00 2001 From: Mark Gregory Date: Tue, 25 Aug 2026 22:49:46 +0100 Subject: [PATCH] settings updates, fixed --- deploy.php | 36 ++++++++++++++++++++++++++++++++---- package.json | 4 ---- vite.config.js | 12 +----------- 3 files changed, 33 insertions(+), 19 deletions(-) diff --git a/deploy.php b/deploy.php index 87226ea..76634df 100644 --- a/deploy.php +++ b/deploy.php @@ -4,7 +4,6 @@ namespace Deployer; require 'recipe/laravel.php'; -// System Config set('writable_use_sudo', true); set('clear_use_sudo', true); set('cleanup_use_sudo', true); @@ -17,7 +16,6 @@ add('shared_files', ['.env']); add('shared_dirs', ['storage']); add('writable_dirs', ['storage', 'bootstrap/cache']); -// Host Definitions host('main') ->set('hostname', 'helpdesk.absdev.net') ->set('remote_user', 'mag') @@ -30,9 +28,39 @@ host('develop') ->set('branch', 'develop') ->set('deploy_path', '/var/www/helpdesk_dev'); +/* + * Install the root npm tree, then every module that owns its own lock file, + * then run ONE root Vite build. Because Vite is compiling a module source file, + * normal Node resolution finds that module's own node_modules first. + */ task('build', function (): void { - run('export NVM_DIR="$HOME/.nvm" && [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" && nvm use {{node_version}} && cd {{release_path}} && npm ci --no-audit --no-fund'); - run('export NVM_DIR="$HOME/.nvm" && [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" && nvm use {{node_version}} && cd {{release_path}} && npm run build'); + $node = 'export NVM_DIR="$HOME/.nvm"' + .' && [ -s "$NVM_DIR/nvm.sh" ]' + .' && . "$NVM_DIR/nvm.sh"' + .' && nvm use {{node_version}}'; + + run( + $node + .' && cd {{release_path}}' + .' && npm ci --no-audit --no-fund' + ); + + run( + $node + .' && cd {{release_path}}' + .' && for lock in Modules/*/package-lock.json; do' + .' [ -f "$lock" ] || continue;' + .' module_dir="$(dirname "$lock")";' + .' echo "[Modules] npm ci: $module_dir";' + .' (cd "$module_dir" && npm ci --no-audit --no-fund);' + .' done' + ); + + run( + $node + .' && cd {{release_path}}' + .' && npm run build' + ); }); task('queue:restart', function (): void { diff --git a/package.json b/package.json index b11517c..9477b0b 100644 --- a/package.json +++ b/package.json @@ -10,12 +10,8 @@ "@fortawesome/fontawesome-free": "^7.0.0", "@laravel/passkeys": "^0.2.0", "@tailwindcss/vite": "^4.1.11", - "axios": "^1.13.2", "concurrently": "^10.0.3", - "flatpickr": "^4.6.13", - "jquery": "3.7.1", "laravel-vite-plugin": "^3.1", - "select2": "^4.1.0", "tailwindcss": "^4.0.7", "vite": "^8.0.0" }, diff --git a/vite.config.js b/vite.config.js index 4bafea7..f68b60b 100644 --- a/vite.config.js +++ b/vite.config.js @@ -7,16 +7,6 @@ import { join, relative } from 'node:path'; const projectRoot = process.cwd(); -/** - * Compile assets from every Laravel module using the canonical module layout: - * - * Modules//Resources/assets/css/app.css - * Modules//Resources/assets/js/app.js - * - * Only the canonical `Resources` directory is scanned. This avoids duplicate - * entries on case-insensitive macOS filesystems where `Resources` and - * `resources` resolve to the same files. - */ function discoverModuleInputs() { const modulesPath = join(projectRoot, 'Modules'); @@ -33,6 +23,7 @@ function discoverModuleInputs() { continue; } + // Canonical Laravel Modules asset paths only. for (const entry of [ 'Resources/assets/css/app.css', 'Resources/assets/js/app.js', @@ -92,7 +83,6 @@ export default defineConfig({ server: { cors: true, - watch: { ignored: [ '**/storage/framework/views/**',