dg / composer-cleaner

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

Swap behaviour completely #16

Open dakujem opened 6 years ago

dakujem commented 6 years ago

Description

I suggest reversing the "mode of operation" of this package, so that it only cleans packages that are included not packages that are excluded. This issue takes the idea a step further than #13.

The current mode of operation can be turned on so that it is obvious by looking at the composer.json that there is indeed a cleaner doing stuff. But the default should be not-cleaning-anything!

Steps To Reproduce

  1. install this package into a project
  2. wait about 1 year and forget about it
  3. install another package with assets and other stuff outside of src directory into the project
  4. wonder:
    • why the assets are removed before they get copied intu public dir
    • where is that bower.json that should be there
    • why are there no other files besides src dir and composer.json
    • where is the readme of that other package that would be helpful now
  5. bang your head into a wall
  6. composer remove dg/composer-cleaner

Sorry, I'm no expert on everything. First i thought it was a feature of composer itself. There was no trace of it. No google results, nothing. Then I searched my composer.json for a configuration that would suggest something why the files are being removed. I noticed they are actually being removed. First I thought they are not even downloaded. In the end I discovered this package. I had not known that it was possible to have a package register a cleaning procedure. Sorry for that. But I believe there are others who might be misfortunate enough to install this package and forget that it's sitting there eating away all the assets, package-management scripts, readmes and all.