Skip to content

Commit 68c371c

Browse files
committed
Docs updates
1 parent c19a396 commit 68c371c

File tree

3 files changed

+33
-2
lines changed

3 files changed

+33
-2
lines changed

docs/api/patches-lock-json.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ If the [`COMPOSER`]({{< relref "../usage/configuration.md#composer" >}}) environ
1919
```
2020
* Each patch definition will look like the [expanded format]({{< relref "../usage/defining-patches.md#expanded-format" >}}) that users can put into their `composer.json` or external patches file.
2121
* No _removals_ or _changes_ will be made to the patch definition object. _Additional_ keys may be created, so any JSON parsing you're doing should be tolerant of new keys.
22-
* The `extra` object in each patch definition may contain a number of attributes set by other projects or by the user and should be treated as free-form input.
22+
* The `extra` object in each patch definition may contain a number of attributes set by other projects or by the user and should be treated as free-form input. Currently, Composer Patches uses this attribute to store information about where a patch was defined (in the `provenance` key).

docs/usage/configuration.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,27 @@ Technically, this value can be a path to a file that is nested in a deeper direc
4949

5050
---
5151

52+
### `ignore-dependency-patches`
53+
54+
```json
55+
{
56+
[...],
57+
"extra": {
58+
"composer-patches": {
59+
"ignore-dependency-patches": [
60+
"some/package",
61+
]
62+
}
63+
}
64+
}
65+
```
66+
67+
**Default value**: empty
68+
69+
`ignore-dependency-patches` allows you to ignore patches defined by the listed dependencies. For instance, if your project requires `drupal/core` and `some/package`, and `some/package` defines a patch for `drupal/core`, listing `some/package` in `ignore-dependency-patches` would cause that patch to be ignored. This does _not_ affect the _target_ of those patches. For instance, listing `drupal/core` here would not cause patches _to_ `drupal/core` to be ignored.
70+
71+
---
72+
5273
### `default-patch-depth`
5374

5475
```json
@@ -81,7 +102,8 @@ You probably don't need to change this value. Instead, consider setting a packag
81102
"composer-patches": {
82103
"disable-resolvers": [
83104
"\\cweagans\\Composer\\Resolver\\RootComposer",
84-
"\\cweagans\\Composer\\Resolver\\PatchesFile"
105+
"\\cweagans\\Composer\\Resolver\\PatchesFile",
106+
"\\cweagans\\Composer\\Resolver\\Dependencies"
85107
]
86108
}
87109
}

docs/usage/defining-patches.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,15 @@ If you're defining patches in `patches.json` (or some other separate patches fil
130130
}
131131
```
132132

133+
### Dependencies
134+
135+
Packages required by your project can define patches as well. They can do so by defining patches in their root `composer.json` file. Defining patches in a separate `patches.json` in a dependency is currently unsupported.
136+
137+
{{< callout title="Patch paths are always relative to the root of your project" >}}
138+
Patches defined by a dependency should always use a publicly accessible URL, rather than a local file path. Composer Patches _will not_ attempt to modify file paths so that the patch file can be found within the installed location of a dependency.
139+
{{< /callout >}}
140+
141+
133142
## Duplicate patches
134143

135144
If the same patch is defined in multiple places, the first one added to the patch collection "wins". Subsequent definitions of the same patch will be ignored without emitting an error. The criteria used for determining whether two patches are the same are:

0 commit comments

Comments
 (0)