composer-plugin-exclude-files icon indicating copy to clipboard operation
composer-plugin-exclude-files copied to clipboard

Can the plugin support excluding folders?

Open cxcatir opened this issue 1 year ago • 1 comments
trafficstars

Is your feature request related to a problem? Please describe.

Some folders contain numerous files, making it difficult to list them one by one. Is it possible to implement functionality to exclude certain folders?

Describe the solution you'd like

It might be possible to define such a format in the "extra" section of the composer.json file, allowing for the exclusion of specified folders.

    "extra": {
        "exclude-from-folders": [
            "illuminate/support/"
        ]
    },

cxcatir avatar Apr 22 '24 09:04 cxcatir

That's a good idea. When I have a chance I'll explore possible solutions.

Taking laravel/framework for example, I would probably just add glob support to exclude-from-files:

"extra": {
    "exclude-from-files": [
        "laravel/framework/src/*/helpers.php"
    ]
}

Thanks

mcaskill avatar Apr 25 '24 04:04 mcaskill

@cxcatir Can you test out the main branch (522d75f) and confirm this works as intended?

mcaskill avatar May 04 '24 22:05 mcaskill

@mcaskill The plugin test looks fine. But I think I'm getting something wrong and it's not solving my requirement scenario.

I want to develop a package, and the tests inside pacakge will have a complete application and install the package I'm developing, using the path repository. In the application, composer dump auto load encounters an infinite loop. I thought that using this plugin to exclude the test folder of the test application would solve the problem, but it didn't!

development-package
--test
----application which installs development-package

I think I still need to re-learn how composer works. But thanks for the new glob support!

cxcatir avatar May 06 '24 02:05 cxcatir