tracy icon indicating copy to clipboard operation
tracy copied to clipboard

avoid installing /examples, to avoid treating it as source code

Open TomasVotruba opened this issue 3 years ago • 4 comments

Hi,

this directory seems not part of source code of package, but appears /vendor. That leads to unnecesary download of dev code and crashes tools that expect only source code in /vendor: ref https://github.com/rectorphp/rector-src/pull/1626#issuecomment-1004939693

We can exclude it manually, but this generic solution would help us to use native composer behavior.

TomasVotruba avatar Jan 04 '22 16:01 TomasVotruba

I don't know if that's a good idea, because if someone downloads the zip, he' ll be surprised that it doesn't have the examples that he sees on github.

dg avatar Jan 10 '22 00:01 dg

Technically, that might happen. Yet nowadays it's standard to use composer to install dependencies. This file then makes sure the project using this dependency only containts source code and not maintainer code.

Also, there is already 6 files/dirs that are ignored this way: https://github.com/nette/tracy/blob/79000ea5cb4fbcc148c99be6164a228e17882c1a/.gitattributes#L1-L6

TomasVotruba avatar Jan 10 '22 01:01 TomasVotruba

Alternatively it can be done in composer.json

{
	"archive": {
		"exclude": ["/examples"]
	}
}

mabar avatar Jan 10 '22 01:01 mabar

@TomasVotruba Those ignored files are not expected by anyone, as opposed to the examples.

@mabar This seems to be related to the archive command https://getcomposer.org/doc/03-cli.md#archive

dg avatar Jan 10 '22 08:01 dg