Skip to content
This repository has been archived by the owner on Mar 31, 2023. It is now read-only.

Install (Composer)

Evan Willhite edited this page Dec 6, 2018 · 1 revision

Requirements

  1. PHP 7.1
  2. Node (we recommend NVM)
  3. Gulp
  4. Composer
  5. Optional: Yarn

Prototyping (separate from Drupal, Wordpress, etc.)

Emulsify supports both NPM and YARN.

Install with NPM: composer create-project fourkitchens/emulsify --stability dev --no-interaction emulsify && cd emulsify && npm install

Install with Yarn: composer create-project fourkitchens/emulsify --stability dev --no-interaction emulsify && cd emulsify && yarn install

Committing to Emulsify

  1. Clone the repository and cd into the created directory
  2. composer install
  3. yarn or npm install

Drupal installation

In a Composer-based Drupal install (recommended)

  1. Require emulsify in your project composer require fourkitchens/emulsify
  2. Move into the original emulsify theme cd web/themes/contrib/emulsify/
  3. Create your new theme by cloning emulsify php emulsify.php "THEME NAME" (Run php emulsify.php -h for other available options)
  4. Move into your theme directory cd web/themes/custom/THEME_NAME/
  5. Install the theme dependencies npm install or yarn
  6. Enable your theme and its dependencies drush then THEME_NAME -y && drush en components unified_twig_ext -y

Troubleshooting Installation: See Drupal Installation FAQ.

Note: Once you've created your custom theme, you can remove Emulsify as a dependency of your project. If you'd like to get updates as we push them, solely for educational/best-practice information, feel free to leave it in and receive the updates. Updating Emulsify will not affect your custom theme in any way.

In a non-Composer Drupal install (e.g. tarball download from drupal.org)

  1. cd themes/contrib (You may need to create this directory)
  2. composer create-project fourkitchens/emulsify --stability dev --no-interaction emulsify
  3. Move into the emulsify theme cd emulsify
  4. Create your new theme by cloning emulsify php emulsify.php "THEME NAME" (Run php emulsify.php -h for other available options)
  5. Move into your cloned theme directory cd web/themes/custom/THEME_NAME/
  6. Install the theme dependencies yarn or npm install
  7. Move the Unified Twig Extension module from themes/custom/emulsify/vendor/drupal-pattern-lab/unified-twig-extensions/ to modules/unified-twig-extensions. (You can do this from the Drupal root with cp -r themes/contrib/emulsify/vendor/drupal-pattern-lab/unified-twig-extensions/ modules/unified-twig-extensions)
  8. Enable Emulsify and its dependencies drush then THEME_NAME -y && drush en components unified_twig_ext -y

Drupal installation FAQ

Do I need to run npm install or yarn install on Emulsify if I use the drush command to create my own custom clone?

No. Your new custom theme is not a subtheme of Emulsify, and has no references to the original Emulsify contributed theme. You should do all development on the new cloned theme, including running any npm/gulp tasks or doing any local gulp config. Also, do not enable Emulsify and your cloned them, only your cloned theme.

Do I have to use the drush command or can I just use Emulsify as-is?

You can use Emulsify as your theme!

However, any changes you make to the components will be overwritten if you ever update Emulsify. So, it's recommended that you run the drush command to create a clone, and make your customizations there.