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 gitignore to allow app within repo #10

Closed zoglo closed 6 months ago

zoglo commented 1 year ago

QoL Developer improvements

TL;DR

This PR improves QoL for developers working on the contao-demo


Description

This PR allows installing Contao within the cloned repository by git-ignoring the usual folders and adding the allowed plugins within composer.json. This allows developers to work within the cloned repository and install the demo within it.

I made sure that the var/backups folder is not excluded, so it allows uploading the backups (contao:backup:restore)


Edit

aschempp commented 1 year ago

I'm not 100% sure this makes sense. Why would you clone that repository? And when using composer create-project contao/contao-demo, wouldn't the .gitignore make sense then as well?

I think it can be suboptimal to include developer stuff in a demo project that is clearly designed to be a "starting point" for people not familiar with the project. Regardless of that, shouldn't the .gitignore file be exactly the same as https://github.com/contao/managed-edition/blob/5.x/.gitignore if we actually add one?

zoglo commented 1 year ago

Why would you clone that repository?

If you are working on updates to the demo, such as bug fixes, but it may be a one-time thing for most.

I'm not 100% sure this makes sense. Why would you clone that repository? And when using composer create-project contao/contao-demo, wouldn't the .gitignore make sense then as well?

I think it can be suboptimal to include developer stuff in a demo project that is clearly designed to be a "starting point" for people not familiar with the project. Regardless of that, shouldn't the .gitignore file be exactly the same as https://github.com/contao/managed-edition/blob/5.x/.gitignore if we actually add one?

You are right on not using the developer files within a demo to help people, but most people install it via composer create-project, hence the .giattributes that ignores the .gitignore, so it'll never be within vendor nor in your root anyway.

What I removed in my latest commit is:

I agree with using the same gitignore as in the Contao project, but it does include lines like:

What we would never want to push would be the following files, that are usually part of my .git/info/exclude but not everyone sets them up:

However, if we let the .gitattributes within this PR, the .gitignore will never appear within vendor nor in the root directory.

Wdyt @aschempp ?

(My initial idea was to add a global gitignore file that would work for most platforms and IDE)

aschempp commented 12 months ago

Maybe we should rather add this to the Contributing section in the readme? Here's what my local .gitignore looks like for developing the demo:

/assets
/bin
/public
/system
/var/*
!/var/backups
/vendor
/composer.lock
/.gitignore
/.env*
zoglo commented 6 months ago

Closing this as I'm using the local variant as well nowadays.