Skip to content

Latest commit

 

History

History
44 lines (30 loc) · 1.5 KB

contributing.md

File metadata and controls

44 lines (30 loc) · 1.5 KB

Augmented Reality Guide To Contributing

Development Setup

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

git clone git@github.com:kienstra/augmented-reality

Then, cd to the augmented-reality/ 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, run composer dump-autoload -o in order to add the class to the composer autoloader. Also, 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 augmented-reality.zip file, and a build/ directory. It will also compile the block JavaScript file.