I'm developing a wordpress plugin, and the plugin makes use of a composer package. For reference the plugin I'm developing is here:
https://github.com/tunapanda/wp-h5p-xapi
I'm at the stage where it works locally, and I would like to publish it to the wordpress plugin repository.
In order to use the plugin, I need to run composer install
inside the plugin directory to have the composer package installed. My question is, how does this plays together with the plugin repository and what the best practice to get this to work? Because obviously, if I would just publish the plugin to the repository and if someone would install it from there it would not work, since then the composer package which is a dependency would not be installed.
I see two different ways to deal with this:
Put my
vendor
directory under source control and check it in to the repository. This doesn't feel like an ideal solution since I would lose much of the point of using a package manager such as composer in the first place.Avoid using composer all together, and instead just take the code for the package I need and put that under source control.
So my question is, what is the best practice for this? Anyone who could point me to a reference wordpress plugin that uses external dependencies?