wieni/composer-plugin-patchsets

Installs: 3 168

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 5

Forks: 1

Open Issues: 1

Type:composer-plugin

1.0.0 2023-11-10 12:46 UTC

This package is auto-updated.

Last update: 2024-12-15 12:43:10 UTC


README

Introduction

The wieni/composer-plugin-patchsets is a PHP Composer plugin designed to address the complexities in managing and applying patches within Drupal projects.
This plugin aims to centralize patch management, enabling a consistent approach to applying patches across multiple projects.

Problem Statement

Current practices utilizing cweagans/composer-patches for patch management in projects have introduced several challenges:

  • Lack of uniformity in patch application across different projects leads to inconsistencies in behaviors.
  • Difficulty in identifying and applying the same patches when upgrading versions due to variations in patch creation among different projects.

Objective

The primary goal of the wieni/composer-plugin-patchsets is to enable dependency patch resolution. A feature thas has been deprecated in cweagans/composer-patches.

Functionality

The plugin leverages the new plugin capabilities released by cweagans/composer-patches, allowing it to add patches by registering a custom Resolver.

Usage

  • Create a repository (eg your-org/drupal-patches) that contains a composer.json with patches defined as documented by cweagans/composer-patches.
  • Require the wieni/composer-plugin-patchsets plugin and your new patch repository (your-org/drupal-patches) in your Drupal project.
  • Define the patch repository (your-org/drupal-patches) as a patch set in your composer.json:
{
  "extra": {
    "patchRepositories": [
      "your-org/drupal-patches"
    ]
  }
}

This configuration instructs wieni/composer-plugin-patchsets to apply the patches defined in the your-org/drupal-patches repository.

Advanced Configuration

The plugin supports an advanced configuration allowing the exclusion of specific packages and patches.
This next example demonstrates the exclusion of the "#2907810" patch for drupal/core and all patches for drupal/field_group.

{
  "extra": {
    "patchRepositories": [
      {
        "name": "your-org/drupal-patches",
        "excludedPatches": {
          "drupal/core": [
            "#2907810"
          ],
          "drupal/field_group": ["*"]
        }
      }
    ]
  }
}

Contributing

Contributions, suggestions, and issue reports are welcome. Feel free to fork this repository and submit pull requests.

License

This project is licensed under the MIT License.

Acknowledgments

  • Acknowledgment of cweagans/composer-patches for its pioneering efforts in patch management within Composer.