maennchen/ZipStream-PHP

Update `gitattributes` file

alamirault opened this issue · 5 comments

Description

Hello, I try to optimize my application builds and see we can optimize this package size (a little bit)

Actual size: 388K
If we exclude followings folders it could be: 180K

image

I saw you want keep tests folder in #206, but I think developer can found repo on github and see all files.

What do you think ? (I will submit PR if you're ok)

@alamirault How are you installing it to get all those files?

Composer should not include those files if you’re installing a published package.

My stance on the export ignore in the gitattributes is still the same, it’s unfortunate that this mechanism is used for independent things like a conposer install via git and a GitHub zip download. Those files are part of the project and they should be exported by git, they are just irrelevant for composer.

However, my opinion is not set in stone. If you have good new arguments or we have changed circumstances from the discussion in #206, I‘m open to hearing then.

I installed package with composer require maennchen/zipstream-php

Why don't you want to affect "GitHub zip download" ? If it's for case when dev want download source, it use clone instead no ?

Most of popular packages use it (symfony/, thephpleague/, doctrine/*) and this doesn't seem to be a problem

@alamirault The setting will affect every place on GitHub where you can download the source.

I would very much expect to get all of the source including tests and tooling if I click a link labeled „Source code“ on GitHub.

This starts to sound like an issue that should ve brought up directly with composer.

Basically all package managers I work with allow to specify the included files independently from git archive. In theory composer shouldn’t even care if the repository backing it is a git repo or not.

Composer seems to have a setting for it, which we configured but is somehow not applied:

https://getcomposer.org/doc/04-schema.md#archive

Could you open an issue with composer and see what they think about the topic?

I‘ve found this issue: composer/composer#5367

Based on this thread, it seems clear that composer is not interested in a real solution to this.

Quote:

Composer is a dependency manager. Not a packaging tool.

For packagist this does not seem appropriate since it does both.

One solution would be to use a cleaner plugin like https://github.com/liborm85/composer-vendor-cleaner

I‘d be open to a PR for that.

Thanks for digging in composer.

I will not use the composer plugin but it's interesting.

I close this issue, thanks for your time @maennchen

If anyone is interested, feel free to open a PR 😄