code-soup / wordpress-plugin-boilerplate

WordPress plugin boilerplate with Webpack and Composer. Remove repetitive tasks from your workflow, keep it simple and make coding fun again.
GNU General Public License v3.0
14 stars 3 forks source link

Approach to autoload.php/composer packages #69

Closed varffs closed 6 months ago

varffs commented 6 months ago

Hi. Finding this boilerplate very useful so far thanks. Just finishing the first small plugin made with the boilerplate and ran into this issue:

The /vendor folder is in the .gitignore but in run.php L9 require 'vendor/autoload.php'; is in conflict with this. However I do understand that you wouldn't want to include all the dev dependencies when you actually deploy a plugin to production. What is the expected best practice in regard to composer packages and deployment?

Bobz-zg commented 6 months ago

Hi, thanks for feedback and I'm happy you found it useful.

The initial idea was to push the code to github and then run github action which would run

Can't say that's the best way of doing it. Depends on the use case. Maybe yarn:build and composer install should be run only on the server.

Still unsure. If the plugin is to be hosted on WP plugin repo then it needs to include everything so it can be installed trough WP admin