Please check if the PR fulfills these requirements
[x] The commit message follows our guidelines
[x] Tests for the changes have been added (for bug fixes/features)
[x] Docs have been added/updated (for bug fixes/features)
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
This PR introduces the possibility to configure custom directories and opens up wp-translation-downloader to not restrict the support only for composer.json type "wordpress-core", "wordpress-plugin", "wordpress-theme" and "library".
What is the current behavior? (You can also link to an open issue here)
Currently it is not possible to support different/custom composer.json "types", expect those which are pre-defined by this package.
What is the new behavior (if this is a feature change)?
This Pull Request implements following improvements:
1. New configuration options
Following new configuration options were implemented:
languageRootDir - this will replace in future "directory", but does currently the same: Setting the path to root folder
directories - allows to configure - similar to api a mapping by "type" or "name" to define custom locations.
2. Refactor of Package
Before we had specific implementations like WpCorePackage or LibraryPackage. This was now removed and refactored with an improved TranslatablePackageFactory and a single TranslateablePackage.
3. Root Package support
Additionally this Pull Request adds now on installation the "Root Package" to the collection if packages whcih are being processed. This allows to also download the translations when working directly on a Plugin, which functions as "Root Package".
Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
Yes and no. There were a few classes removed, renamed and moved into a different namespace. But since this composer plugin works isolated and is not being extended / used in external code it's a "no" ;-)
But yes, because i increased the php min version to 7.2, since PHP 7.1 already has EOL since end of 2019. I'll probably increase in future the PHP version to 7.4, since PHP 7.3 also has EOL since end of 2021.
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
This PR introduces the possibility to configure custom directories and opens up
wp-translation-downloader
to not restrict the support only for composer.json type "wordpress-core", "wordpress-plugin", "wordpress-theme" and "library".What is the current behavior? (You can also link to an open issue here)
Currently it is not possible to support different/custom composer.json "types", expect those which are pre-defined by this package.
What is the new behavior (if this is a feature change)?
This Pull Request implements following improvements:
1. New configuration options Following new configuration options were implemented:
languageRootDir
- this will replace in future "directory", but does currently the same: Setting the path to root folderdirectories
- allows to configure - similar toapi
a mapping by "type" or "name" to define custom locations.2. Refactor of
Package
Before we had specific implementations likeWpCorePackage
orLibraryPackage
. This was now removed and refactored with an improvedTranslatablePackageFactory
and a singleTranslateablePackage
.3. Root Package support Additionally this Pull Request adds now on installation the "Root Package" to the collection if packages whcih are being processed. This allows to also download the translations when working directly on a Plugin, which functions as "Root Package".
4. Make use of inpsyde/reusable-workflows Nothing big, but i've added https://github.com/inpsyde/reusable-workflows for PHP Unit and PHPCS to this package.
Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
Yes and no. There were a few classes removed, renamed and moved into a different namespace. But since this composer plugin works isolated and is not being extended / used in external code it's a "no" ;-)
But yes, because i increased the php min version to 7.2, since PHP 7.1 already has EOL since end of 2019. I'll probably increase in future the PHP version to 7.4, since PHP 7.3 also has EOL since end of 2021.