? Pending

User tests: Successful: Unsuccessful:

avatar bembelimen
bembelimen
11 Mar 2019

Pull Request for Issue #24144 .

Summary of Changes

  • Correct the SCSS build paths for windows systems
  • Correct the wrong "_" (underscore) test regexp
  • Enforce correct sequence for SCSS compiling

Testing Instructions

  • Delete "media" folder
  • Use "npm i" as before => now all scss files are at the correct position
avatar bembelimen bembelimen - open - 11 Mar 2019
avatar bembelimen bembelimen - change - 11 Mar 2019
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 11 Mar 2019
Category JavaScript Repository
avatar bembelimen
bembelimen - comment - 11 Mar 2019

@dgrammatiko perhaps you have some seconds to look, if you agree with the changes? Thanks!

avatar dgrammatiko
dgrammatiko - comment - 11 Mar 2019

@bembelimen I think is better to continue with a then, like:

  // Loop to get the files that should be compiled via parameter
  folders.forEach((folder) => {
    Recurs(folder, ['*.js', '*.map', '*.svg', '*.png', '*.gif', '*.swf', '*.html', '*.json']).then(
      (filesRc) => {
        filesRc.forEach(
          (file) => {
            // Don't take files with "_" but "file" has the full path, so check via match
            if (file.match(/\.scss$/) && !file.match(/(\/|\\)_[^\/\\]+$/)) {
                files.push(file);
            }
            if (file.match(/\.css/)) {
              // CSS file, we will copy the file and then minify it in place
              // Ensure that the directories exist or create them
              MakeDir.run(Path.dirname(file).replace('/build/media_source/', '/media/').replace('\\build\\media_source\\', '\\media\\'));
              Fs.copyFileSync(file, file.replace('/build/media_source/', '/media/').replace('\\build\\media_source\\', '\\media\\'));
              Fs.writeFileSync(
                file.replace('/build/media_source/', '/media/').replace('\\build\\media_source\\', '\\media\\').replace('.css', '.min.css'),
                UglyCss.processFiles([file], { expandVars: false }),
                { encoding: 'utf8' },
              );

              // eslint-disable-next-line no-console
              console.log(`CSS file copied/minified: ${file}`);
            }
          },
          (error) => {
            // eslint-disable-next-line no-console
            console.error(`something exploded ${error}`);
          },
        );
            
            return files;
      },
    ).then(theFiles => {
        theFiles.forEach((inputFile) => {
            CompileScss.compile(inputFile, options);
        });
    });
  });

Also why the heck are there still GIF files in the media folder? It's 2019...

avatar bembelimen
bembelimen - comment - 11 Mar 2019

@bembelimen I think is better to continue with a then, like:

Thanks, that's exactly the feedback I needed!

Also why the heck are there still GIF files in the media folder? It's 2019...

https://github.com/joomla/joomla-cms/tree/4.0-dev/build/media_source/mod_languages/images

avatar bembelimen bembelimen - change - 11 Mar 2019
Labels Added: ?
avatar infograf768 infograf768 - change - 12 Mar 2019
Title
Fix SCSS build script
[4.0] Fix SCSS build script
avatar infograf768 infograf768 - edited - 12 Mar 2019
avatar brianteeman
brianteeman - comment - 12 Mar 2019

From my logs after running this


Transpiling ES6 file: C:\htdocs\joomla-cms\build\media_source\system\js\fields\passwordview.es6.js
Transpiling ES6 file: C:\htdocs\joomla-cms\build\media_source\system\js\fields\passwordview.es6.js
Transpiling ES6 file: C:\htdocs\joomla-cms\build\media_source\system\js\fields\passwordview.es6.js
Transpiling ES6 file: C:\htdocs\joomla-cms\build\media_source\system\js\fields\passwordview.es6.js

this was what happened for all es6

And on my windows system the paths were being written differently depending on the location

SCSS File compiled: C:\htdocs\joomla-cms\media\plg_installer_webinstaller\css\client.css
SCSS File compiled: C:\htdocs\joomla-cms/installation/template/css/template.css
avatar dgrammatiko
dgrammatiko - comment - 12 Mar 2019

@brianteeman it's fine

avatar wilsonge
wilsonge - comment - 14 Mar 2019

I have tested this item successfully on 366f8c3

Before patch the following files were compiled

SCSS File compiled: /Users/georgewilson/workspace/opensource/joomla-cms/templates/cassiopeia/css/offline.css
SCSS File compiled: /Users/georgewilson/workspace/opensource/joomla-cms/administrator/templates/atum/css/bootstrap.css
SCSS File compiled: /Users/georgewilson/workspace/opensource/joomla-cms/administrator/templates/atum/css/template.css
SCSS File compiled: /Users/georgewilson/workspace/opensource/joomla-cms/administrator/templates/atum/css/font-awesome.css
SCSS File compiled: /Users/georgewilson/workspace/opensource/joomla-cms/administrator/templates/atum/css/template-rtl.css
SCSS File compiled: /Users/georgewilson/workspace/opensource/joomla-cms/templates/cassiopeia/css/template-rtl.css
SCSS File compiled: /Users/georgewilson/workspace/opensource/joomla-cms/templates/cassiopeia/css/template.css
SCSS File compiled: /Users/georgewilson/workspace/opensource/joomla-cms/installation/template/css/template.css
SCSS File compiled: /Users/georgewilson/workspace/opensource/joomla-cms/installation/template/css/template-rtl.css

After patch:

SCSS File compiled: /Users/georgewilson/workspace/opensource/joomla-cms/templates/cassiopeia/css/offline.css
SCSS File compiled: /Users/georgewilson/workspace/opensource/joomla-cms/administrator/templates/atum/css/font-awesome.css
SCSS File compiled: /Users/georgewilson/workspace/opensource/joomla-cms/administrator/templates/atum/css/template.css
SCSS File compiled: /Users/georgewilson/workspace/opensource/joomla-cms/administrator/templates/atum/css/bootstrap.css
SCSS File compiled: /Users/georgewilson/workspace/opensource/joomla-cms/administrator/templates/atum/css/template-rtl.css
SCSS File compiled: /Users/georgewilson/workspace/opensource/joomla-cms/templates/cassiopeia/css/template.css
SCSS File compiled: /Users/georgewilson/workspace/opensource/joomla-cms/media/system/css/fields/joomla-field-simple-color.css
SCSS File compiled: /Users/georgewilson/workspace/opensource/joomla-cms/templates/cassiopeia/css/template-rtl.css
SCSS File compiled: /Users/georgewilson/workspace/opensource/joomla-cms/media/system/css/fields/joomla-field-switcher.css
SCSS File compiled: /Users/georgewilson/workspace/opensource/joomla-cms/media/system/css/fields/joomla-field-permissions.css
SCSS File compiled: /Users/georgewilson/workspace/opensource/joomla-cms/media/system/css/fields/joomla-field-media.css
SCSS File compiled: /Users/georgewilson/workspace/opensource/joomla-cms/media/plg_installer_webinstaller/css/client.css
SCSS File compiled: /Users/georgewilson/workspace/opensource/joomla-cms/installation/template/css/template.css
SCSS File compiled: /Users/georgewilson/workspace/opensource/joomla-cms/installation/template/css/template-rtl.css

So it seemed to find a bunch of extra files so I think this patch works on OSX


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/24169.

avatar wilsonge wilsonge - test_item - 14 Mar 2019 - Tested successfully
avatar wilsonge wilsonge - change - 14 Mar 2019
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2019-03-14 16:24:44
Closed_By wilsonge
avatar wilsonge wilsonge - close - 14 Mar 2019
avatar wilsonge wilsonge - merge - 14 Mar 2019
avatar wilsonge
wilsonge - comment - 14 Mar 2019

Thanks!

Add a Comment

Login with GitHub to post a comment