Whenever I start developing a new project, it really takes me quite a lot of time to set up neccessary tools. In this repo, I would like to share the great tools which I have been using to build the WordPress themes. Plus, they were also standardized so that I totally develop the WordPress themes with high quality.
- Travis CI for automatically testing PHP codes, using PHP_CodeSniffer and WordPress-Coding-Standard
- Grunt for compiling LESS to CSS, checking for JS errors, live reloading, concatenating and minifying files
- Bower for front-end package management
- Gitignore for determine which files and directories to ignore, before you make a commit
- Editor Config for configuring the editor according to the same standard
This setup uses Grunt for compiling LESS to CSS, checking for JS errors, live reloading, concatenating and minifying files.
Unfamiliar with npm? Don't have node installed? Download and install node.js before proceeding.
From the command line:
- Install
grunt-cli
globally withnpm install -g grunt-cli
. - Navigate to the theme directory, then run
npm install
. npm will look atpackage.json
and automatically install the necessary dependencies. It will also automatically runbower install
, which installs front-end packages defined inbower.json
.
When completed, you'll be able to run the various Grunt commands provided from the command line.
Available Grunt commands:
grunt dev
— Compile LESS to CSS, concatenate and validate JSgrunt watch
— Compile assets when file changes are madegrunt build
— Create minified assets that are used on non-development environmentsgrunt zip
— Export theme package for WordPress.org
You want Travis CI to work, firstly, you need to sign in at https://travis-ci.org/ via your Github account. Then, just enable your projects by flicking the switch, and push new commit to Github.
Regarding Sublime Text Editor, you can install a plugin named Editor Config Sublime into Sublime via Package Control.