Submit A Plugin To Octobercms Market With Composer Requirements; Must The Vendor Map Be Included?

- 1 answer

As an developer I want to submit a plugin to the OC Market. My plugin has composer requirements defined in composer.json.

On dev machine everything works well, the dependencies are included with composer update executed in the root of the project. So all dependencies are in the main root vendor map.

I already have submitted my plugin to the OC Market, from within the account/plugin/create page. The plugin was uploaded as ZIP file without(!) vendor map. The dependencies were only defined in a composer.json file, but not actually included in the ZIP file.

When I now install my plugin in a fresh OC install, a 'vendor' map is included in the plugin folder. Like this: 'plugins/author/foo/vendor'. The plugin is installed from within the CMS (url: backend/system/updates/install), and also as a second test on cli with $ artisan plugin:install Both times the installation went correct.

  1. How is this vendor map got in the folder where the plugin reside?
  2. Is it good practice to add or not add a vendor map in the ZIP file on submitting to OC Market?


The marketplace build process pulls in the plugin’s dependencies into a vendor directory under the plugin’s own directory and then removes composer.lock and composer.json from the package that gets generated. This is to support users that don’t use composer while also supporting users that use both marketplace plugins and composer-based plugins.

If we left the composer.json in the plugin during the build process and then the user were to run composer update from the project root on that marketplace plugin, suddenly they would have duplicated dependencies which was causing a lot of issues.

All of this to say: Don't include your vendor directory when submitting a plugin to the marketplace, the marketplace will take care of that. Do include your composer.json file though.

In regards to RainLab.GoogleAnalytics, the build on the marketplace appears to be broken which means that it needs to be rebuilt on the marketplace. This could be triggered by pushing an update to the Github repository, unfortunately for some reason that repository is massively broken for my Github account and I don't even have the ability to comment on issues. Thus, I'm unable to trigger a rebuild of the plugin. However, if you remind me on Slack or IRC to talk to @spunky (creator of October) about it then I can do that and perhaps he can trigger a rebuild.