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

Composer installable #119

Merged
merged 23 commits into from
Aug 17, 2017
Merged

Composer installable #119

merged 23 commits into from
Aug 17, 2017

Conversation

ModulesUnraveled
Copy link
Contributor

@ModulesUnraveled ModulesUnraveled commented Aug 7, 2017

This PR does the following:

  • Makes Emulsify composer installable
  • Gets all of the twig functions on composer install
  • Puts the twig functions in place on yarn install (or npm install)

To Review:

If installing Emulsify standalone:

  • Clone emulsify and then run composer install inside it, or just run composer create-project "fourkitchens/emulsify:dev-composer-installable" --stability dev --no-interaction emulsify
  • Run yarn upgrade && yarn install && yarn start
  • Verify the bem and add_attributes functions are copied to components/_twig-components/functions
  • Visit the PL page and verify it loads and stuff

If installing inside a Drupal instance:

  • Install emulsify composer require "fourkitchens/emulsify:dev-composer-installable"
  • Move into the emulsify directory cd web/themes/contrib/emulsify/
  • Run yarn upgrade && yarn install && yarn start
  • Verify the bem and add_attributes functions are copied to components/_twig-components/functions
  • Visit the PL page and verify it loads and stuff

Todo:

  • The child theme needs to get these components as well. Maybe a symlink from the child themes functions folder to the one in Emulsify's vendor directory? (Maybe emulsify should just use a symlink too, instead of copying the file.)
    (I think as long as the package.json is copied, along with the scripts folder, the child theme will get the functions in place.)
  • The functions are placed in the root vendor directory, not emulsify/vendor when installed in a Drupal instance... What do we do?
    (I created a script to check for the vendor directories, so it'll work in both cases)
  • Drush command needs to copy the scripts directory for both regular and --slim

composer.json Outdated
"post-install-cmd": [],
"post-update-cmd": []
"post-install-cmd": [
"drush emulsify"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove

composer.json Outdated
"repositories": {},
"require": {
"drupal/components": "^1.0",
"drupal-pattern-lab/unified-twig-extensions": "dev-develop"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be on drupal.org?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds like it will be on Packagist

@ModulesUnraveled ModulesUnraveled self-assigned this Aug 10, 2017
@ModulesUnraveled ModulesUnraveled changed the base branch from master to develop August 17, 2017 03:37
Copy link
Contributor

@evanmwillhite evanmwillhite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome - I left one comment because it failed inside of my older Drupal install.

# Link contrib twig functions into the components directory

# First we need to find out whether this is inside a Drupal install or standalone Emulsify
if [ -d ../../../../vendor ]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have an older Drupal install that I ran this inside of and it didn't have the /web directory. Should we make this more open-ended to handle that?

Copy link
Contributor

@evanmwillhite evanmwillhite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems good to me following our conversation. Once you add the updates to the readme, :shipit:

README.md Outdated
1. `composer require fourkitchens/emulsify`
2. `cd web/themes/contrib/emulsify/`
3. `npm install` or `yarn install`
4. Optional (but recommeded): Create "child" theme `drush emulsify "Theme Name"` (more details below)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*recommended

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, is it drush emulsify "Theme Name" or drush emulsify site_machine_name

@ModulesUnraveled ModulesUnraveled merged commit cdc5586 into develop Aug 17, 2017
@ModulesUnraveled ModulesUnraveled deleted the composer-installable branch August 17, 2017 20:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants