Yeoman generator to quickly setup a project for implementing an AngularJS 1.x module (not application).
Attribute | Status |
---|---|
Stability | Release Candidate |
Features | Release Candidate |
Test Coverage Summary
Statements : 87.35% ( 221/253 )
Branches : 69.49% ( 41/59 )
Functions : 97.62% ( 41/42 )
Lines : 87.35% ( 221/253 )
- Compatible with
yeoman-generator v2
. - Choice of build systems:
- Grunt
- Gulp (Under development)
- Sub-generators to generate code for:
- Component
- Directive
- Factory
- Service
- The generated code:
- Contains file headers.
- Contains comments compatible with ngdoc.
- Follows IIFE syntax.
- Is automatically committed to
git
repository.- Keeps your changes independent of generated code.
- Optionally generate
bower.json
. - Supports Stylus for stylesheets.
- Uses ESLint for static code checking.
- Uses eslint-plugin-angular for checking code against best practices.
- Uses Karma + Jasmine for unit testing.
- Uses coverage reporter for code coverage.
- Synonyms for build targets
- Adapt to your own, instead of learning new ones.
These features are under active development:
- [ ] Complete support for GulpJS
- [x]
Update dependencies, if necessary - [x]
Migrate fromgrunt-autoprefixer
togrunt-postcss
- [x]
Migrate to yeoman-generator 1.0Migrated to 2.0 - [x]
Migrate to IIFE syntax - [ ] Optimize build steps
- [x]
Commit generated files intogit
as individual commit.
The code associated with these features can be viewed in corresponding branches. The latest code, however, may still be in my local repo.
Install Yeoman, if it isn't already installed:
npm install -g yo
Install this generator:
npm install -g generator-angular-modsmith
Run this command in the directory of your choice:
yo angular-modsmith
As a common convention, values in square brackets below are optional.
Default generator for setting up a new module.
yo angular-modsmith [name-of-module]
Generates code for a component in the module.
yo angular-modsmith:component [name-of-component]
Generates code for a directive in the module.
yo angular-modsmith:directive [name-of-directive]
Generates code for a service in the module.
yo angular-modsmith:service [name-of-service]
Generates code for a factory in the module.
yo angular-modsmith:factory [name-of-factory]
These tasks are available on both Grunt and Gulp (under development).
Perform static type checking of the module sources. It is the default task.
Executes unit tests for the modules and shows code coverage data.
Performs series of tasks required to build the distribution package.
Built package is available in the directory dist
.
Deletes contents of temporary and distribution directories.
Executes these tasks in sequence: clean
, eslint
, test
, build
.
I have been using angular-fullstack-generator v2.1.1 to setup my applications for a few years now. As a result, there may be similarities in the template code.
BSD-3-Clause Copyright Sanjeev Premi