inpsyde / wp-translation-downloader

Composer plugin to download WordPress translations
MIT License
46 stars 3 forks source link

Feature custom directories & root package #27

Closed Chrico closed 2 years ago

Chrico commented 2 years ago

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:

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".

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.