dg / composer-cleaner

Victor The Cleaner: removes unnecessary files from vendor directory
https://nette.org
134 stars 19 forks source link

Which files are cleaned? #19

Open staabm opened 6 years ago

staabm commented 6 years ago

Would be great to have a few examples or similar of files which this plugins will delete and why...

glensc commented 5 years ago

Yeah, wondered that too, as it's not described at all in the readme. but reading source code of the plugin seems all files that are not defined as an autoloader, get removed, with some hard coded defaults that are never removed.

First I liked the idea that it's done this way, that doesn't have to inspect every package to see what to cleanup, but reading https://github.com/dg/composer-cleaner/issues/16 seems this could be a problem for packages that bundle more than PHP sources.

dg commented 5 years ago

I have added more information to the readme.

glensc commented 5 years ago

(for posterity) link to above changes https://github.com/dg/composer-cleaner/commit/ac989d0364610b016d4ca6533cec99969dfb6d41

glensc commented 5 years ago

does the cleaner support extra.cleaner-ignore from the vendored project composer.json as well? as it would more sense to submit those to upstream projects.

but then again the upstream projects can use .gitattributes if they care about the problem and then cleaner does not need to do that:

in such case those projects should be skipped, perhaps the introduce new key which projects indicate they do not need cleaning (but package extra runtime files required).

glensc commented 5 years ago

aside, maybe introduce commandline support here? to be run manually, i.e when producing release tarball. I'm currently cleaning the vendor using whitelisted patterns to delete. whitelist because not to break every new dependency without analyze what is needed for runtime: