acquia / df

Demo Framework - mirrored at https://git.drupal.org/project/df.git
https://www.drupal.org/project/df
18 stars 19 forks source link

Add support for pulling JS libraries from Asset Packagist #58

Closed phenaproxima closed 7 years ago

phenaproxima commented 7 years ago

Asset Packagist is going to be adopted by Lightning soon as the main way to pull in libraries from Bower and NPM by way of Composer. Since supporting this requires adding a few things to any composer.json which consumes Lightning as a dependency, this PR is needed for DF -- it adds Asset Packagist as a Composer package repository and configures any Bower or NPM libraries to be dropped into docroot/libraries.

Also see acquia/lightning-project#41 and acquia/lightning#430.

sylus commented 7 years ago

Ah this is an interesting change will this be the official recommended way for Drupal + Composer + 3rd party libraries?

I have been forced currently to do the following throughout all my composer files: https://github.com/drupalwxt/wxt/blob/8.x-2.x/composer.json#L42

phenaproxima commented 7 years ago

@sylus: I don't know how "official" it's going to be, truth be told, but @balsama and I feel it's the most convenient way to pull in our front-end dependencies without asking people to install NPM. We used to do it with NPM, but a build as complex as Lightning or DF really benefits from having fewer moving parts. So that's why we're adopting this.

sylus commented 7 years ago

Thanks for the clarification and makes complete sense to me :)