From 4dd0f0b526e4354f799d86dbc1eefde6d6e28093 Mon Sep 17 00:00:00 2001 From: Michael Withagen Date: Sat, 1 Jul 2023 12:37:19 +0200 Subject: [PATCH 1/3] Add new documentation for limitation in dependencies --- docs/getting-started/limitations.md | 46 +++++++++++++++++++++++++++++ docs/getting-started/terminology.md | 2 +- 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 docs/getting-started/limitations.md diff --git a/docs/getting-started/limitations.md b/docs/getting-started/limitations.md new file mode 100644 index 0000000..1c30d18 --- /dev/null +++ b/docs/getting-started/limitations.md @@ -0,0 +1,46 @@ +--- +title: Limitations +weight: 30 +--- + +{{< lead text="Known limitations will be listed here." >}} + +{{< callout title="Create your own plugin" >}} +Be aware that it is possible to create your own plugin to enhance the functionality or overcome known limitations. Additional information may be found in the [Capabilities]({{< relref "capabilities.md" >}}) documentation. +{{< /callout >}} + +## Dependencies with patches + +When installing a dependency with composer that has its own patch for a dependency this patch will not be applied. + +```txt +Root project +|_ dep 1 (containing patch for dep 2) + |_ dep 2 +``` + +### External patch file + +When a dependency defines patches using an external patch file **Composer Patches** will not look into the configuration for patches. + +### Patches configured in `composer.json` + +**Composer Patches** does look at the patches configuration in the `composer.json` for dependencies. +When these patches are local files, **Composer Patches** will be unable to locate the patch files because composer will install all packages in the root of your project. +As a result relative paths pointing to patch files are now incorrect and will not resolve, resulting in an error. + +**Composer Patches** could probable apply patches that are hosted and added via url but this is untested at this point in time. + +### Work around + +When dependencies have configured patches in the `composer.json` configuration using relative paths you can mirror the file structure in the root of your project using symlinks. This will allow **Composer Patches** to resolve the relative paths and patches will be applied to the dependencies. + +```txt +Root project +patches/patch-dep2.patch (symlink -> dep/patches.patch-dep2.patch) +|_ dep + |_ patches/patch-dep2.patch +|_ dep2 +``` + +Alternatively if symlinking is not an option you could choose to copy a patch into your own project and configure your project to apply the patch. diff --git a/docs/getting-started/terminology.md b/docs/getting-started/terminology.md index 8f6039b..8359594 100644 --- a/docs/getting-started/terminology.md +++ b/docs/getting-started/terminology.md @@ -1,6 +1,6 @@ --- title: Terminology -weight: 30 +weight: 40 --- {{< lead text="There are a few terms specific to this plugin. Understanding them before proceeding may help with understanding." >}} From 46f18afa374fce19bcc32d9c44f73c80804c2641 Mon Sep 17 00:00:00 2001 From: Michael Withagen Date: Sat, 1 Jul 2023 12:42:18 +0200 Subject: [PATCH 2/3] Update formatting --- docs/getting-started/limitations.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/getting-started/limitations.md b/docs/getting-started/limitations.md index 1c30d18..7138e33 100644 --- a/docs/getting-started/limitations.md +++ b/docs/getting-started/limitations.md @@ -12,9 +12,11 @@ Be aware that it is possible to create your own plugin to enhance the functional ## Dependencies with patches When installing a dependency with composer that has its own patch for a dependency this patch will not be applied. +For more information in-depth information see [bug report](https://github.com/cweagans/composer-patches/issues/505). ```txt Root project + |_ dep 1 (containing patch for dep 2) |_ dep 2 ``` @@ -37,10 +39,11 @@ When dependencies have configured patches in the `composer.json` configuration u ```txt Root project -patches/patch-dep2.patch (symlink -> dep/patches.patch-dep2.patch) -|_ dep - |_ patches/patch-dep2.patch -|_ dep2 + +| /patches/patch-dep2.patch (symlink -> /dep/patches.patch-dep2.patch) +| /dep +| /patches/patch-dep2.patch +| /dep2 ``` Alternatively if symlinking is not an option you could choose to copy a patch into your own project and configure your project to apply the patch. From b786e8981a11d987692e8ec4b84a2e8e22000d0f Mon Sep 17 00:00:00 2001 From: Michael Withagen Date: Sat, 1 Jul 2023 12:42:50 +0200 Subject: [PATCH 3/3] Fix typo in symlink reference --- docs/getting-started/limitations.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/getting-started/limitations.md b/docs/getting-started/limitations.md index 7138e33..d2edc79 100644 --- a/docs/getting-started/limitations.md +++ b/docs/getting-started/limitations.md @@ -40,7 +40,7 @@ When dependencies have configured patches in the `composer.json` configuration u ```txt Root project -| /patches/patch-dep2.patch (symlink -> /dep/patches.patch-dep2.patch) +| /patches/patch-dep2.patch (symlink -> /dep/patches/patch-dep2.patch) | /dep | /patches/patch-dep2.patch | /dep2