Architecture Decision Records (ADRs)

← Home

Store Composer Patches configuration in composer.patches.json

Introduction

Defining patches in a separate composer.patches.json file will make it easier for the developer to add and maintain patch definitions as they won’t need to search for the patch section of composer.json, and it will also reduce clutter in composer.json. New projects using composer should start with a composer.patches.json file with no patches defined in it.

To make this change, move the patches item in composer.json to composer.patches.json, and replace the patches item in composer.json with the following:


    "patches-file": "composer.patches.json",
  

Decision

We will define patches in a separate file called composer.patches.json rather than composer.json.

Context

In composer, patches can be defined either in the main composer file or in a separate file which is referenced in the main composer file. Patches are the only commonly directly edited section of a composer.json file, so making that section easy to find improved productivity.

Consequences

Exceptions

Additional Resources

None

← See more ADRs