rayrutjes / wp-plugin-git-svn-sync

☄️ Zero config synchronizing of Git repository with SVN for publishing WordPress plugins.
83 stars 7 forks source link

Build hooks #10

Open kierzniak opened 7 years ago

kierzniak commented 7 years ago

Hi, some of our plugins need build script to be executed before being deployed to wordpress.org plugin repository. Maybe you can provide some kind of event system to subscribe into particular part of the script e.g after/before git clone/checkout.

For a start I can propose such a cli options --after-git-clone="./build.sh", --after-git-checkout="./build.sh"

rayrutjes commented 7 years ago

Hey @kierzniak , thanks a lot for your interesting feature request.

I am under the impression that having "build" scripts is often not recommended in the WP eco-system. A user must be able to clone the repo and be up & running, or even be able to use a composer setup to install your plugin.

I also personally don't like committing minified assets and stuff, but I guess it's a compromise for easing the DX.

What are your thoughts on this? I'm far from being an expert on WP tooling and I'd gladly continue the discussion as I'm not sold on anything.

What I do know is that I plan to separate the current script into several smaller scoped re-usable scripts in order for developers to only use what they need.

Speak soon!

kierzniak commented 7 years ago

Thank you for your response. You may have right that WP ecosystem is not adapted to such a case. I'm trying to apply modern and best standards to have best product and keep up with php community.

Minified assets are not the worst. I'm including composer libraries which are different for production and development e.g phpunit, phing which obviously are not desired in production release. I'm trying to reduce dependencies to minimum, but for some libraries this is reinventing the wheel.

Git clone case is not bothering me, for such a problem we have github releases which should contain all required libraries and assets. I'm using composer setup for my WP projects and I use https://wpackagist.org/ where plugins are downloaded from wordpress.org repository.

Nevertheless your propose for separate script should fit my needs.