albatrosary's blog

UI/UXとエンタープライズシステム

yeomanでAngularジェネレータ作った - AngularJS Advent Calendar 2015

以前にも書きましたがAngularを使ったYEOMANジェネレータを作ってます。このエントリーは「AngularJS Advent Calendar 2015」12月4日の記事です。

albatrosary.hateblo.jp

使い方

$ npm i -g generator-angular-eggs
$ mkdir sampleapp && cd $_
$ yo angular-eggs

構成

  • TingoDB
  • Express
  • Angular 1.5
  • Node

現在の機能

  • Unit Test
  • End-to-End Test
  • Documentation
  • Coverage
  • Metric

SubGenerators

yo angular-eggs:components [name]
yo angular-eggs:service [name]
yo angular-eggs:resource [name]
yo angular-eggs:directives [name]
yo angular-eggs:server [name]

Tasks

grunt serve
grunt serve:dist
grunt build
grunt test
grunt test:watch
grunt test:coverage
grunt e2e
grunt doc
grunt metric
grunt metric:test

追加しているところ

機能追加で以下を入れ中。

  • TypeScript
  • ngRoute
  • ui router
  • yui docからngDocへ変更

最後に

まだ実用的にはAngular1だしAngular1でいいんじゃないの?と言った感じ。ちなみにここで使っているNew Routerはよくない。状況はissueに書いてあって下記の通り

PascalPrecht commented on 25 Sep @alanpurple as the readme states, this repository is on hold since a couple of months, since the development of the component router has been moved to the angular projects itself for easier setup.

You can take a look at the current state right here: https://github.com/angular/angular/tree/master/modules/angular1_router