Open danielbachhuber opened 5 years ago
As much as I'd like to switch over, I don't really want to make WP-CLI (and a WP installation?) a required dependency.
Ideally there would be a generic PHP package that could be used by WP-CLI, as a Composer package/script, grunt-wp-i18n, and node-wp-i18n. I'm not sure if it's possible to extract the work done for the WP-CLI command at this point, but that would be killer.
As much as I'd like to switch over, I don't really want to make WP-CLI (and a WP installation?) a required dependency.
Can you explain further? wp i18n make-pot
doesn't require a WordPress installation, and you can slim the installation solely to the framework code and the core command package.
I wasn't sure if WordPress installation was required or not to run that command, but if this becomes a wrapper for wp i18n make-pot
, doesn't that require developers to have WP-CLI installed and available in their system path? Or are you saying it's possible to bundle the necessary code in this package without having to install WP-CLI?
I may not be understanding what's possible since it's been awhile since I've dug through WP-CLI. Can you explain how you envision this working?
For v2.0 of WP-CLI I refactored the package structure so that it works properly with Composer.
All you need is to require the wp-cli/i18n-command
package and it will just work. You can then use it in your Composer scripts through wp i18n ...
or directly via vendor/bin/wp i18n ...
.
Developers don't need to have WP-CLI installed for it to work, and it will also only pull in the minimum required.
@schlessera Very cool! That's pretty much exactly what I've wanted for cases where I use Composer but don't need Node. I'll look into what it will take to switch this over to using that package instead of the old PHP tools.
All you need is to require the
wp-cli/i18n-command
package and it will just work. You can then use it in your Composer scripts throughwp i18n ...
or directly viavendor/bin/wp i18n ...
.
I was also thinking that, if you don't want this Node package to have a dependency on composer
, you could instead create a Phar file that gets bundled directly with this package.
The WordPress project has switched to using
wp i18n make-pot
(docs). It'd be great if this package switched over too, for two specific advantages:cc @schlessera @swissspidy