generator-angular-plugin

0.2.0 • Public • Published

generator-angular-plugin

Build Status Coverage Status Npm Version Npm License

Yeoman generator for AngularJS plugin

[1] Feature

  • Use gulp
  • Concentrate serveral source files into one plugin file
  • Provide environments for test and eslint
  • Help to build ngdocs
  • Create a simple webserver for example and ngdocs

[2] Usage

Install

Install yo, bower, gulp.

npm install -g yo bower gulp

Install generator-angular-plugin.

npm install -g generator-angular-plugin

Run yo angualr-plugin with appname(option)

yo angular-plugin <appname>

Task

build: Build sources

  • template:source: Convert html files into one template javascript file
  • concat:source: Concentrate source files into one file
  • header:source: Attach a information header to the file
  • uglify:source: Minfiy the plugin file
gulp build /*or npm run build*/
gulp template:source
gulp concat:source
gulp header:source
gulp uglify:source

test: Lint source files and test spec files

  • lint:source: Lint source files with a config in .eslintrc
  • test:spec: Test spec files in test directory by karma and create code coverages with istanbul
gulp test /*or npm test*/
gulp lint:source
gulp test:spec

clean: Clear a dist directory

  • clean:dist: Remove dist folder
gulp clean /*or npm run clean*/

ngdocs: Generate document pages about the plugin

  • build:ngdocs: Create document assets(js, css, html)
gulp ngdocs /*or npm run ngdocs*/

Other tasks

Start a server for documents.

If detects source files changed, generate documents and refresh pages.

gulp webserver:ngdocs 

Start a server for examples

If detects source files changed, build source files and refresh pages.

gulp webserver:example

[3] Structure

├── docs
│
├── example
│   ├── scripts
│   └── styles
│   
├── src
│   ├── common
│   ├── directive
│   ├── service
│   ├── filter
│   └── template
│
└── test

Package Sidebar

Install

npm i generator-angular-plugin

Weekly Downloads

5

Version

0.2.0

License

MIT

Last publish

Collaborators

  • wooooo