Skip to content

Latest commit

 

History

History
44 lines (30 loc) · 1.41 KB

contributing.md

File metadata and controls

44 lines (30 loc) · 1.41 KB

Augmented Reality Guide To Contributing

Development Setup

Please cd to wp-content/plugins/ and clone this repo:

git clone [email protected]:kienstra/machine-learning

Then, 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' );

PHPUnit Testing

You may run the PHPUnit tests in an environment where WordPress unit tests are installed, like VVV.

To run tests:

$ phpunit

To run tests with an HTML coverage report:

$ phpunit --coverage-html /tmp/report

Compiling The Block JavaScript File

If you've already run npm install, execute npm run dev. This will compile the block JavaScript file.

Creating A Build

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.