Skip to content

Development instructions

Marcos Antonio Schratzenstaller edited this page Aug 7, 2018 · 4 revisions

Development manual


Automation

In order to help the development and workflow, this repository uses Grunt to automate tasks.

To use the benefits of this tool, you would need to make sure that you have PHP, Composer and npm installed in your local development environment.

Once you have cloned this repository and the Composer is available, you need to run:

composer install.

This will create a new directory called vendor/ which contains the binaries that Grunt will use.

npm install

This will create a directory labeled node_modules including all the dependencies that Grunt will need.

Grunt provides an easy way to automate tasks, and in this repository, there are a couple of tasks automated in 2 scenarios:

default

Running grunt with no argument will trigger the default tasks, which at this moment are:

  • Check the WordPress code standards (PHPCS).

build

IMPORTANT: Before running grunt build, check that the 'version' line in package.json contains the new version number you'd like to release.

By running grunt build, it will start the build tasks, which includes:

  • Checks 'tested up to' header;
  • Check the WordPress code standards (PHPCS);
  • Replace the version number in the main plugin file based on version inside the file package.json;
  • Build a zip file excluding the development files and directories:
    • node_modules/;
    • vendor/;
    • package.json;
    • package-lock.json.
  • The build process also renames the file README.md to readme.txt, allowing us to keep the README.md (which is more acceptable by GitHub).
Clone this wiki locally