Closed sghoweri closed 7 years ago
@sghoweri Nice work! I can confirm it works, but I bet we can get paths in a more resilient way. I just added commit 0eace9e to this that adds a $kit_path
var that is an absolute path to the styleguide kit folder in the vendor directory, so we should be able to reduce some lines. Can we get it so we don't need that $base
var? Would be nice to not have to rely on the brittleness of /../../../
.
@EvanLovely can you take another look at this when you get a chance?
Unfortunately the $kit_path
variable you added actually points to the /vendor/pattern-lab/styleguidekit-twig-default
package instead of the OTHER styleguideKit we actually need here (styleguidekit-assets-default, or whatever is currently installed).
I consolidated that little bit of logic to now use the baseDir
config option instead which should hopefully be a little less prone to breaking. Lemme know what you think!
Released in v2.8.1 ~ https://github.com/drupal-pattern-lab/patternlab-php-core/releases/tag/v2.8.1
Solves https://github.com/drupal-pattern-lab/patternlab-php-core/issues/14 if we are ok with this only getting triggered if the index.html file is missing in our public directory (vs check if every single styleguidekit asset is in it's proper place).
I'm also not a huge fan of having to hard-code the
dist
folder to guess which specific files need to get copied over but the baked in mechanism getting used in PL to normally handle this is so incredibly tied in with the composer install events, this was the simplest solution I could come up with without trying to impersonate composer (or something even crazier) @_@To test locally, update your composer.json file to point at this feature branch, remove your vendor folder + composer.lock file and go through the steps from the original ticket.
Should now work as expected!
Author's note: OMG TABS & WHITESPACE AHHHHH