最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

third party applications - Release a plugin with composer installed packages

programmeradmin0浏览0评论

Here I'm looking for an answer about releasing a plugin version with 3rd party packages installed by composer.

In my custom plugin I installed Sentry with composer and checked the error logs in my Sentry account. It's working. Everything looks fine. But my biggest concern is that it installed a lot of packages in the vendor folder while I try to install Sentry and Sentry sdk with composer.

What will happen if I want to do a version release of my plugin with all this files and folders? Would that create any problem or how should I do a version release now? I also checked the woocommerce plugin. It seems they are also using composer.

By the way, I'm new with composer and before Sentry integration I didn't use composer for my plugin at all and my plugin already live.

Here I'm looking for an answer about releasing a plugin version with 3rd party packages installed by composer.

In my custom plugin I installed Sentry with composer and checked the error logs in my Sentry account. It's working. Everything looks fine. But my biggest concern is that it installed a lot of packages in the vendor folder while I try to install Sentry and Sentry sdk with composer.

What will happen if I want to do a version release of my plugin with all this files and folders? Would that create any problem or how should I do a version release now? I also checked the woocommerce plugin. It seems they are also using composer.

By the way, I'm new with composer and before Sentry integration I didn't use composer for my plugin at all and my plugin already live.

Share Improve this question edited Oct 9, 2019 at 15:33 Tom J Nowell 61.2k7 gold badges79 silver badges150 bronze badges asked Oct 9, 2019 at 14:42 DeveloperDeveloper 1354 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 5

What will happen if I want to do a version release of my plugin with all this files and folders?

You need to upload your complete vendors directory to SVN. Nothing more and nothing less.

For the plugin registry, the files composer installed do not have any other meaning than any other files you manually created. It doesn't care* about them and happily hosts them for you.

* as long as these files pass the automatic linting - but with the recent bump to PHP 7.2 it shouldn't be a problem

So what to do if you want to release now?

  1. Delete vendors folder
  2. Run composer install --optimize-autoloader --no-dev
  3. Upload your files to SVN as you used to.

I suggest this, so you do not upload more files than necessary (ie. dev dependencies) and get the benefit of the optimized autoloader.

side note: Welcome to the world of Composer! Please consider setting the type to wordpress-plugin in your composer.json, in order for better WPackagist integration. Other's are already doing this, eg. YOAST.

发布评论

评论列表(0)

  1. 暂无评论