contao / contao-demo

This is an example website for Contao, a powerful open source CMS that allows you to create professional websites and scalable web applications.
https://contao.org
Creative Commons Attribution Share Alike 4.0 International
3 stars 8 forks source link

Add `allow-plugins` #16

Open fritzmg opened 9 months ago

fritzmg commented 9 months ago

The current composer.json is still missing the allow-plugins section of the contao/managed-edition causing prompts when installing via composer create-project.

aschempp commented 8 months ago

hmmm… having this in the composer.json will prevent the Contao Manager von automatically configuring it though 😞

fritzmg commented 8 months ago

We include it for contao/managed-edition as well though, so you don't have to confirm anything when running composer create-project. So I think we should include it here too?

aschempp commented 8 months ago

contao/managed-edition is not used by the Contao Manager though. I agree this is a problem, I don't know how to fix it though 🤔

fritzmg commented 8 months ago

But why is it a problem for the Contao Manager in the first place? If contao/managed-edition and contao/contao-demo (and isotope/isotope-demo for that matter) come with appropriately allowed plugins, no issues should occur during installation?

fritzmg commented 8 months ago

And the Contao Manager can always alter the composer.json afterwards.

aschempp commented 8 months ago

We can never know what plugins a user will install, e.g. php-http/discovery was added in a patch version, and that would now prevent any installation of packages in an existing installation.

And the Contao Manager can always alter the composer.json afterwards.

The Contao Manager does not alter the composer.json user configuration. It is explicitly meant so you can allow or deny plugins if you want to, but the default should be everything is allowed (which is done automatically if the setting is not present).

fritzmg commented 8 months ago

The Contao Manager does not alter the composer.json user configuration.

The Contao Manager for example updates the post-update-cmd and post-install-cmd scripts to use vendor/bin/contao-setup. So why not also remove the allow-plugins section after initial installation?

but the default should be everything is allowed (which is done automatically if the setting is not present).

But then we should add this default everywhere.

Anyway, what other solution do you propose?

aschempp commented 8 months ago

Anyway, what other solution do you propose?

I don't have any other solution 🤷 However, I would also argue that anyone installing the demo through Composer should be aware of Composer features like allowing plugins, and should be able to decide whether a plugin is wanted or not. Not saying that is best user experience but… 😬

aschempp commented 8 months ago

So why not also remove the allow-plugins section after initial installation?

That could be a viable option. But then we can only update this repo once the feature is implemented in the Contao Manager.

fritzmg commented 8 months ago

However, I would also argue that anyone installing the demo through Composer should be aware of Composer features like allowing plugins, and should be able to decide whether a plugin is wanted or not. Not saying that is best user experience but… 😬

Regardless I would argue that

should all work the same and not require different arguments from one another.

sascha-mueller commented 2 months ago

I'm not sure what the best solution is here. Suggestions welcome :-)

zoglo commented 2 months ago

@sascha-mueller just summarized, I think that's more of a tie between manual install vs via Contao Manager but this can't be merged as is because the manager would need to implement this feature first to avoid the discussed problems: https://github.com/contao/contao-demo/pull/16#issuecomment-1951994839

This is simply a consistency problem for installing the demo via composer🤔.

I'd leave this issue open for now, it would ask you to add the mentioned allow-plugins anyways when installing via composer.

zoglo commented 3 weeks ago

Just as a headsup for anyone reading this, that's what I use because it's cumbersome to always allow the same plugins:

composer config --global allow-plugins.contao/manager-plugin true
composer config --global allow-plugins.contao-components/installer true
composer config --global allow-plugins.php-http/discovery true

Whoever uses the same won't have to deal with this and can safely work on the demo if they ever need to without updating the composer.json

fkaminski commented 3 days ago

In connection with local installations via DDEV/Composer and the Contao demo I had to add the mentioned plugins (contao-components/installer & contao/manager-plugin) manually. Therefore, it would certainly be easier for many if this could be taken into account in the .json.

I am not a developer, if there should be fundamental problems with this, at least the “detour” via the Contao Manager works (in a DDEV procedure).