Step Guide to install and Run gruntJS
Steps to add this validation in Dotstore Plugins:
- Clone this repo to your PC
- Copy all files from that folder to your plugin folder
- Make changes in the Gruntfile.js file as per below:
- Change the
ZIP_FILE_NAMEvariable with the plugin slug - Prepare the
TEXT_DOMAINarray (if more than one text_domain is used in the plugin) with the plugin slug - Add plugin main root file name with extension to
PLUGIN_MAIN_FILEvariable - Add a pot file name to the
POT_FILE_NAMEvariable (This name will be used when grunt prepares the POT file)
- Change the
- Open the command line and run the below commands:
| Command | Description |
|---|---|
composer install | Download and install packages to run GruntJS PHPCS and PHPStan modules |
npm install | Download and install node packages to run GruntJS's validation module |
npm run prepare | Install a Husky library that can be used while committing changes to GIT. (Basically, run the grunt command with minimal things while committing.) |
Now all set.!
Note
If you face The '"husky/pre-commit' hook, it was ignored because it's not set as executable. type of warning, then run the below command to fix it. Thanks @bhavesh
chmod ug+x .husky/pre-commit