Skip to content
Snippets Groups Projects

UW base Profile: Drupal 8 + PatternLab

Built from Drupal 8 core and Gesso using the code from Forum One and the git hub repository.

Requirements

  1. Node
    • currently version 12.16.1
  2. Gulp
    • currently version 4.0.2
  3. Composer
    • currently version 1.10.1

Notes on theming

UW has taken the approach to use a component based design and has chosen Forum One's pattern-lab instance of Gesso from the git hub repository.

When installing the base profile for the FIRST time you must install both the profile and gesso. On subsequent installs you may chose to bypass installing gesso, however, if there are updates to gesso, those will be missed.

Installing the profile and/or gesso

UW FDSU responsive theme comes with a script that will handling building the theme and/or gesso.

Rebuild script

./rebuild.sh will accept the following switches:

1, 2 or 3 (like build-option, can use either or)
    1 = rebuild profile only
    2 = rebuild profile and gesso
    3 = rebuild gesso only

--build-option [#] (required)
    1 = rebuild profile only
    2 = rebuild profile and gesso
    3 = rebuild gesso only

--gesso-branch-tag [branch/tag] (optional)
    Provide a Git branch or tag name for uw_wcms_gesso.
    Defaults to 8.x-3.x branch.

Usage with parameters

./rebuild.sh --build-option=2 --gesso-branch-tag=8.x-3.x

./rebuild.sh 2 --gesso-branch-tag=8.x-3.x

Usage without parameters

If you simply use ./rebuild.sh then interactivity will begin and ask questions about the build options and gesso branch/tag. If you use at least one switch then there is no interactivity. Example with interactivity:

What would you like to do?
1 = Rebuild profile only.
2 = Rebuild profile and gesso.
3 = Rebuild gesso only.
[x] Exit and do nothing

Build option [1]: 2

Gesso branch/tag: [8.x-3.x]:

Using Pattern-Lab

Once the rebuild is completed, you can visit pattern-lab at: https:///profiles/uw_base_profile/themes/uw_fdsu_theme_resp/uw_wcms_gesso/gesso/pattern-lab.

EXAMPLE:
https://d8alt/fdsu1/profiles/uw_base_profile/themes/uw_fdsu_theme_resp/uw_wcms_gesso/gesso/pattern-lab

If you are doing development, simply navigate in a terminal /profiles/uw_fdsu_theme_resp/uw_wcms_gesso/gesso and run gulp

EXAMPLE:
cd /var/www/drupal8/profiles/uw_fdsu_theme_resp/uw_wcms_gesso/gesso
gulp

Locally-modified modules

imageMagick 8.x-2.x-beta1-uw_wcms

components 8.x-2.0-beta1-uw_wcms1

eck 8.x-1.0-alpha5-uw_wcms1

  • Base: 8.x-1.0-alpha5
    • 801e43d9: Patching updates after 8.7 drupal core

samlauth 8.x-3.0-alpha1-uw_wcms3

webform 8.x-5.6-uw_wcms2

  • Base: 8.x-5.6
    • 5752fc4a: allow webform libraries to use our repos
    • cc6728b1: fix version numbers

Testing

To prepare a Drupal install for testing with PHPUnit, copy DRUPAL_ROOT/core/phpunit.xml.dist to DRUPAL_ROOT/core/phpunit.xml and in that file set:

SIMPLETEST_BASE_URL to the BASE_URL for your site.
SIMPLETEST_DB to the database URL following the pattern in the file.
SYMFONY_DEPRECATIONS_HELPER to "weak".

Tests can be run from the Drupal UI. To run tests from the command line, run this in the DRUPAL_ROOT:

sudo --user www-data vendor/bin/phpunit -c core

Where is like: profiles/uw_base_profile/tests/src/Functional/UwWcmsBasicTest.php

Tests need to run with sudo because they need to run as the user that runs the web server.