Get unlimited public & private packages + team-based management with npm Teams.Learn more »

generator-gruntfile-yii

0.1.5 • Public • Published

Gruntfile for Yii Generator Build Status

Yeoman generator or creating a package.json and Gruntfile.js with relevant tools and questions for a Yii project.

The generator is based on Addy Osmani's great gruntfile Generator as well as using the yo generator scaffold.

I adapted my own Yii Gruntfile which carries out tasks such as PHP static analysis of your Yii code, CSS linting and JS linting specific to the layout of a Yii project.

Installation

Be sure to run these in your web root folder.

npm install generator-gruntfile-yii

yo gruntfile-yii

You'll be asked a series of questions to help setup your Gruntfile and package.json before it goes and creates it for you.

This will install the Gruntfile.js and package.json into your web directory. The same directory that contains the "protected" and "assets" directories. Then npm install will install all the required node modules. Be sure to have the prerequisites below as it will expect them.

Prerequisites

Depending on your answers in the generator you may need the following:

Usage

In your Yii root folder (the one containing index.php and protected folder) run this command:

  • grunt -h show tasks
  • grunt run all tasks
  • grunt phpcs run phpcs tool on all compnents, controller & models
  • grunt phpcs:models as above but only on models
  • grunt phpmd run PHP Mess Detector on all compnents, controller & models
  • Many more - check the grunt file and feel free to edit to your needs.

Contributions

This is my first generator - please report any bugs or issues you find All are very welcome and I'm very happy for you to submit bug reports, feature requesats and even better - pull requests.

Thank you!

Install

npm i generator-gruntfile-yii

DownloadsWeekly Downloads

2

Version

0.1.5

License

MIT

Last publish

Collaborators

  • avatar