Skip to content

Developer guide

mtserve edited this page Sep 23, 2014 · 3 revisions

The stack

This plugin uses composer for auto loading its source code and to get easily access on resources when needed. Bower for assets management and Nodejs+npm for building and task automation.

Code architecture

The src/ folder contains the plugin code.

The spec/ folder contains the specification for BDD.

The dist/ folder will contain the latest build which can be downloaded and installed directly into WP without any developer knowledge needed.

Requirements to develop locally

  • php >= 5.3
  • composer
  • bower
  • nodejs+npm

To start hacking:

  1. Fork (only needed when you want to be able to make pull requests)
  2. Clone and go into the folder.
  3. Run:
  • composer install
  • bower install
  • npm install
  1. Install gulp (if you do not have it already installed)
  • npm install gulp -g

Available gulp tasks:

  • gulp less - compiles LESS files into the src/OnDemandSuiteWP/Assets/less/dist folder.
  • gulp js - JS files for the src/OnDemandSuiteWP/Assets/js/dist folder.
  • gulp docs - builds source code annotation pages into the docs/js/ folder.
  • gulp dist - produces .zip (build) file with all files needed to run the suite under WP and places it into the dist folder.
  • gulp dev - will monitor less and js files for changes and place them in the corresponding places when you develop.

PHPDoc

The project uses Sami for generation of documentation.

vendor/bin/sami.php update sami.docs.php will build the php docs into the docs/php folder.

Specification

The project uses phpspec for BDD.

vendor/bin/phpspec run -f pretty will run the tests.