I am new to both Composer and Git/GitHub so please excuse me if this is a stupid question!
I have built a WordPress plugin which I have in a repository on GitHub and I will use the repository to distribute updates to the plugin using this plugin update checker library: https://github.com/YahnisElsts/plugin-update-checker
The plugin has a number of Composer dependencies that I have installed. I’ve been researching and apparently you aren’t supposed to include the composer vendors directory in your GitHub repository (see here: https://getcomposer.org/doc/faqs/should-i-commit-the-dependencies-in-my-vendor-directory.md) however my confusion is how can I distribute the plugin from GitHub using the update checker if the vendors directory is not included?
What is the correct way to achieve this? Am I missing something obvious?
Thanks a lot in advance, Hayden
2
Answers
add vendor folder to your .gitignore. someone can use (composer install) and (composer dump-autoload) for install your dependencies to project.
The rule of not committing the vendor folder makes sense in the case of a "composer-friendly" project, when running
composer install
is guaranteed by a build or release step and/or it is run manually during development.I did not take a detailed look on the plugin-update-checker library you’re using, but there are 2 cases: