From f42f26d86bcb67f9279dde50ee834814ab01b206 Mon Sep 17 00:00:00 2001 From: ralf Date: Thu, 21 Apr 2022 13:45:38 +0200 Subject: [PATCH] always generate minified CSS, if grunt is installed - still run other npm tasks (install & build), if grunt is not installed - run "npm install --legacy-peer-deps", to cope with dependency mismatch caused by downgraded grunt-newer --> if developer install should not use minified CSS: remove grunt and the previous generated .min.css files --> if downgraded grunt-newer caused CSS "problems": run once manually: grunt cssmin --- api/src/Framework.php | 7 ++++--- install-cli.php | 8 ++++---- package-lock.json | 6 ++---- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/api/src/Framework.php b/api/src/Framework.php index 395f79a270..b84d43602b 100644 --- a/api/src/Framework.php +++ b/api/src/Framework.php @@ -974,8 +974,9 @@ abstract class Framework extends Framework\Extra { if (file_exists(EGW_SERVER_ROOT.$theme_css)) break; } - $debug_minify = !empty($GLOBALS['egw_info']['server']['debug_minify']) && $GLOBALS['egw_info']['server']['debug_minify'] === 'True'; - if (!$debug_minify && file_exists(EGW_SERVER_ROOT.($theme_min_css = str_replace('.css', '.min.css', $theme_css)))) + // no longer available in config, of you don't want minified CSS on a developer install, don't install grunt/generate the files + //$debug_minify = !empty($GLOBALS['egw_info']['server']['debug_minify']) && $GLOBALS['egw_info']['server']['debug_minify'] === 'True'; + if (/*!$debug_minify &&*/ file_exists(EGW_SERVER_ROOT.($theme_min_css = str_replace('.css', '.min.css', $theme_css)))) { //error_log(__METHOD__."() Framework\CssIncludes::get()=".array2string(Framework\CssIncludes::get())); self::includeCSS($theme_min_css); @@ -1722,4 +1723,4 @@ abstract class Framework extends Framework\Extra } } // Init all static variables -Framework::init_static(); +Framework::init_static(); \ No newline at end of file diff --git a/install-cli.php b/install-cli.php index 0449b2eb68..84d1d6a198 100755 --- a/install-cli.php +++ b/install-cli.php @@ -276,11 +276,11 @@ $cmd = $composer.' install '.implode(' ', $composer_args); run_cmd($cmd, 'composer'); // update npm dependencies, run grunt to minify css and rollup to build javascript -if ($npm && $grunt) +if ($npm) { - run_cmd($npm.' install', 'npm install'); + run_cmd($npm.' install --legacy-peer-deps', 'npm install'); - run_cmd($grunt, 'grunt'); + if ($grunt) run_cmd($grunt, 'grunt'); run_cmd($npm .' run build', 'rollup (npm run build)'); } @@ -427,4 +427,4 @@ function github_api($_url, $data, $method='POST', $upload=null, $content_type=nu curl_close($c); return json_decode($response, true); -} +} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index eab803edba..58aa1ffc32 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8711,8 +8711,7 @@ "version": "0.5.4", "resolved": "https://registry.npmjs.org/grunt-newer/-/grunt-newer-0.5.4.tgz", "integrity": "sha1-HZDR3ynhVTRnbHPIXUR150VtNQo=", - "dev": true, - "requires": {} + "dev": true }, "grunt-terser": { "version": "1.0.0", @@ -10805,8 +10804,7 @@ "version": "7.5.3", "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.3.tgz", "integrity": "sha512-kQ/dHIzuLrS6Je9+uv81ueZomEwH0qVYstcAQ4/Z93K8zeko9gtAbttJWzoC5ukqXY1PpoouV3+VSOqEAFt5wg==", - "dev": true, - "requires": {} + "dev": true }, "yallist": { "version": "4.0.0",