Please cd to wp-content/plugins/ and clone this repo:
git clone git@github.com:kienstra/machine-learningThen, cd to the machine-learning/ directory and run composer install and npm install. This will install dependencies, including wp-dev-lib. It will also install a pre-commit hook.
If you add a new class while developing, add the class name to Plugin::$classes so that it's instantiated:
/**
* This plugin's PHP classes.
*
* @var array
*/
public $classes = array( 'Asset', 'Block' );You may run the PHPUnit tests in an environment where WordPress unit tests are installed, like VVV.
To run tests:
$ phpunitTo run tests with an HTML coverage report:
$ phpunit --coverage-html /tmp/reportIf you've already run npm install, execute npm run dev. This will compile the block JavaScript file.
Assuming you've run composer install and npm install from the development setup, do npm run build. This will create an machine-learning.zip file, and a build/ directory. It will also compile the block JavaScript file.