drupal-pattern-lab / unified-twig-extensions

Share Pattern Lab's custom Twig extensions with Drupal 8
MIT License
9 stars 10 forks source link

Questions for usage with Emulsify #1

Closed evanmwillhite closed 7 years ago

evanmwillhite commented 7 years ago

I don't think this will be an accept as-is kinda PR, but I thought I'd create it as a conversation-starter. I made a couple of tweaks so that we could use it with Emulsify, and specifically a new plugin we created.

I ran into errors when simply using the if (!class_exists('Drupal')) { wrapper - you can see them if you install Emulsify as a theme and turn on this module. So, I added the namespace pl_ to the list of ignored file syntax.

Also, we needed to tweak the directory path as well since we use components instead of the standard PL name source. We've made the path search a glob to cover multiple naming conventions.

What do you think about these changes? I'm very open to different approaches, and would love to get them into this repo instead of running a fork (I just did that so we could test the PR on our end).

sghoweri commented 7 years ago

@christophersmith262 - could you add your two-cents to this as well? After all, you were the one who helped come up with the original idea for this!

sghoweri commented 7 years ago

@evanmwillhite @christophersmith262

One thing I would like to figure out is how we might be able to configure the path in this particular line so this is flexible enough to work with the different Pattern Lab configs people might have (ex. PL might live in any number of different folders like source, styleguide, pattern-lab, components, etc)

evanmwillhite commented 7 years ago

@sghoweri I took a stab at the multiple paths thing. Can you take a look when you get a second?

sghoweri commented 7 years ago

@evanmwillhite Sorry! I'm just now coming up for air after a short marathon of design system sprinting -- lemme take another look at this and I'll get back to you within the next day or so!