-
Notifications
You must be signed in to change notification settings - Fork 931
Add documentation on how to install libraries using composer.json #215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The composer.json in the project allows placing components marked as drupal-library in the correct directory, but most libraries are not available to composer by default. We should add documentation on how to add a repository with an example to help get users started.
I think inline package definitions are not a best practice. We should at least mention the limitations. See the blue box on https://getcomposer.org/doc/05-repositories.md#package-2 |
It's a fair point. Even though there are limitations, it is still essential in many cases. You may use bower or npm for your theme but that approach doesn't really work well here where this needs to be present site-wide in libraries directory. I have added the warning with a link back to getcomposer.org. |
I ma finding more and more js libraries available via Composer. Maybe we should mention those as well (use installer-paths to place them in web/libraries) |
Another options is Asset Packagist which makes Bower and NPM available through Composer. I like the idea there are currently some caveats regarding placement that I am not too keen on - hiqdev/asset-packagist#20. Perhaps they can be addressed. |
Trying to figure out how to deal with deleting |
@joelpittet You could try to creata a subclass |
Toying with who will get the responsibility, possibly |
I found a way that can make the installation of external libraries from npmjs.org or bower into the folder /web/libraries/ easier Recently this composer repo was created There is this plugin that add a default type to all packages So we modify this project to add the assets repo, the plugin and write something like the following in the composer.json "installer-types": ["library"],
"installer-paths": {
"web/libraries/{$name}": [
"type:drupal-library",
"vendor:npm-asset",
"vendor:bower-asset"
],
} So we can do things like and it will place the library into /web/libraries/jquery.easing There is another explanation here No need to duplicate js libraries in packagist for a drupal "version". Is it interesting to add this to the drupal composer project? |
I submitted a PR with the idea from last comment I think it will make this one obsolete. |
This pull request/issue has been inactive for over a year and is being closed due to inactivity. If the issue still persists or the contribution is still relevant, please feel free to reopen it or create a new one. Thank you for your understanding and your contributions to the project! |
The composer.json in the project allows placing components marked as drupal-library in the
correct directory, but most libraries are not available to composer by default. We should
add documentation on how to add a repository with an example to help get users started.