Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[feature] allow using dedicated patches.json file instead of nesting in composer.json #25

Open
rmobis opened this issue Sep 25, 2024 · 1 comment

Comments

@rmobis
Copy link

rmobis commented Sep 25, 2024

As outlined in cweagans/composer-patches documentation, the patch list can either be included directly in composer.json or in a dedicated patches.json file - or even any JSON file as long as it is specified in composer.json's extra.patches-file property.

A dedicated file is useful to remove some bloat from composer.json, however, this package seem to always place new patches directly in composer.json. It would be interested if it was possible to override this behavior and even adopt some smart assumptions. So I would propose a few changes to allow that:

  1. Change default behavior when deciding where to add the patch entry:
    • if extra.patches-file is set in composer.json, use that field's value
    • else, if patches.json exists, use that
    • else, fallback to composer.json
  2. Add a --patches-file option that allows overriding default behavior

Default behavior suggestion is based on a) following cweagans/composer-patches configuration and b) assuming if patches.json exist, it must be being used, but I'm open 'to hearing your thoughts on this.

I'd be happy to work on a PR to implement this change, just let me know what you think.

@TomasVotruba
Copy link
Member

Hey, thanks for the proposal

Add a --patches-file option that allows overriding default behavior

Looks good to me. PR is welcomed 👏

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants