0
votes

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 author.foo. 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?
2
Please anyone. If my question is unclear I am more than willing to try to be more clear.Ametad

2 Answers

1
votes

The octobercms.com 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.

0
votes

October fetchs the composer depencies on plugin install or php artisan october:up

For example in my plugin:

{
    "name" : "Tschallacka/dynamic-pages-plugin",
    "type" : "october-plugin",
    "description" : "DynamicPages plugin for October CMS",
    "homepage" : "",
    "keywords" : [
        "october",
        "octobercms",
        "pages",
        "exit"
    ],
    "authors" : [{
            "name" : "Tschallacka",
            "email" : "tsch@",
            "role" : "Developer"
        }
    ],
    "require" : {
        "php" : ">=7.0",
        "composer/installers" : "~1.0",
        "webpatser/laravel-uuid" : "^2.0",
        "paragonie/random_compat" : "^2.0"
    },
    "minimum-stability" : "dev"
}

If I supply it without the vendor folder, then when I do october:up or install it via october backend, the vendor folder (residing here plugins/author/myplugin/vendor) will be populated with the required files, so I end up with the composer, webpatser and paragonie folders in my vendor dir.