roundcube / plugin-installer

A composer installer for Roundcube plugins
26 stars 15 forks source link

Composer asks to activate all plugins when installing a skin #55

Open alecpl opened 1 month ago

alecpl commented 1 month ago

When I do composer require roundcube/larry I'm being asked to activate all plugins. The same if I do composer remove roundcube/larry. A bug or I'm missing something?

@mvorisek any ideas?

mvorisek commented 1 month ago

You should need this one line - https://github.com/roundcube/roundcubemail/blob/f71ae0298aa7075ce09c75b4ccfe335084cb5eef/composer.json#L229 - or do you need more?

alecpl commented 1 month ago

I have this, I think I might need

"config": {
    "roundcube": {
        "enable-plugin": true
    }

but it's annoying to activate core plugins. It's a problem for developers only as these plugins are in required-dev section, but I wonder if we can improve that somehow.

alecpl commented 1 month ago

I think we could just not ask the question if a plugin comes from a repository defined with type:path.

mvorisek commented 3 weeks ago

If so, then we should not ask if the plugin is defined in root package.

alecpl commented 2 weeks ago

Another problem with asking to enable every plugin is that people are inclined to say "Yes" to every question, but... if you enable two attachment handling plugins (we have three in core) there will be an error in logs: "PHP Error: Can use only one plugin for attachments/file uploads! Using 'filesystem_attachments', ignoring others."

We have to solve this or we'll have to remove core plugins from composer.json file.

mvorisek commented 2 weeks ago

Am I right that before https://github.com/roundcube/roundcubemail/commit/1e360999b261002ccdabb353bc951025179fb6e3 the plugins were not active/installed by default?

If so, is there any way to keep the plugins in composer.json but make them disabled by default explicitly?

alecpl commented 2 weeks ago

That's right, plugins were not activated by default. There's two plugins that needs to be always enabled, but we do this here https://github.com/roundcube/roundcubemail/blob/master/program/include/rcmail.php#L110

I suppose the issue will not be a problem on a production, as we remove "require-dev" section in our packages, but still it's a problem for developers.

Some plugins are examples only, activating them also does not make sense.

Plugins distributed with Roundcube do not require any special install procedure, all you have to do is to activate it in the config file (and configure the plugin itself). We also put core plugins' dependencies in the main composer.json file (maybe this should change, I'm not sure).

I think we should make all core plugins disabled by default. Or in other words the plugin-installer should ignore them completely. Or maybe do this only for these in "require-dev" section.

mvorisek commented 2 weeks ago

Can we disable them one by one using our/main composer.json?