Problem/Motivation

Follow-up from #3071906: To really overwrite theme-colors the array needs to be used in theme-options.yml. Ideally, we should use theme-options.yml from parent theme which has good knowledge of default content for theme-options.yml file.

Consider doing the same for gulp-options.yml

Proposed resolution

Try to add default theme-options.yml with nice examples to parent themes and remove hardcoded content in _bs_base_generate_file().

Comments

pivica created an issue. See original summary.

pivica’s picture

Status: Active » Needs review
Issue tags: +next-release
StatusFileSize
new3.37 KB

Here is a patch. Added support for parent_theme/template.theme-options.yml. There is no point of adding support for gulp-options.yml, we need to generate it from scratch.

pivica’s picture

StatusFileSize
new4.61 KB

Let us support a case when parent theme is not defining theme-options.yml - no copy then.

Added minimal bs_bootstrap/theme-options.yml.

pivica’s picture

Status: Needs review » Needs work

Tested a bit and seems it works fine.

Found one minor problem with reporting and using `$this->logger()->info` calls. It seems they will be printed to console only when executing drush with -v option, more details in Consolidation\Log\Logger:

    private $verbosityLevelMap = [
        LogLevel::EMERGENCY => OutputInterface::VERBOSITY_NORMAL,
        LogLevel::ALERT => OutputInterface::VERBOSITY_NORMAL,
        LogLevel::CRITICAL => OutputInterface::VERBOSITY_NORMAL,
        LogLevel::ERROR => OutputInterface::VERBOSITY_NORMAL,
        LogLevel::WARNING => OutputInterface::VERBOSITY_NORMAL,
        LogLevel::NOTICE => OutputInterface::VERBOSITY_VERBOSE,
        LogLevel::INFO => OutputInterface::VERBOSITY_VERY_VERBOSE,
        LogLevel::DEBUG => OutputInterface::VERBOSITY_DEBUG,
        ConsoleLogLevel::SUCCESS => OutputInterface::VERBOSITY_NORMAL,
    ];

which would mean that info will be shown only when you execute `drush -v`.

So with the current patch when you execute update you get next output:

drush bs-tu primer_demo_theme
 [ok] Installing any missing package and rebuilding sass files
 [ok] Rebuilding CSS files

So we are missing some report lines from before. If you add -v switch you are getting

drush -v bs-tu primer_demo_theme
 [info] Updating a primer_demo_theme theme
 [info] No theme updates required.
 [info] Building CSS asset for a primer_demo_theme theme
 [ok] Installing any missing package and rebuilding sass files
 [ok] Rebuilding CSS files

Not sure should we convert all `$this->logger()->info()` calls to `$this->logger()->notice`, then we would have:

drush bs-tu primer_demo_theme   
 [notice] Updating a primer_demo_theme theme
 [notice] No theme updates required.
 [notice] Building CSS asset for a primer_demo_theme theme
 [ok] Installing any missing package and rebuilding sass files
 [ok] Rebuilding CSS files

Also, last two [ok] lines are coming from bs_base which use old log calls, and we can normalize this later when we depreciate Drush 8 and move that code to bs_lib Drush command.

On the end not sure what is the best thing to do, but i guess it make sense to try to keep console logging as before.

primsi’s picture

pivica’s picture

Status: Needs work » Needs review

> I guess this was x-posted. Addressing here

Yeah sorry for that.

pivica’s picture

Status: Needs review » Fixed
Issue tags: -next-release

I accidentally committed this with a wrong commit message for https://www.drupal.org/project/bs_lib/issues/3071090#comment-13424863.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.