generator-mika

0.6.0 • Public • Published

Mika Generator

Code Climate npm version Version Eye

Yeoman generator

V0.6.0

Enterprise Structure Rework

  • Add more customization options to startup
  • Change how yeoman initializes the application making it lots faster and less to carry around
  • Separated modules into view_models/modules/api/interceptors
  • Changes SCSS to be modular so we can compile each file individually
  • Create a utility file that we can import as a common file
  • Create a global file that is used everywhere
  • Rework tasks for gulp to be faster and less buggy
  • Switch 6to5 to babeljs
  • Add a basic apiHelper service that helps with the create of apis
  • Added options for a interceptor service

Getting Started

$ git clone https://github.com/MikaAK/generator-mika 'generator-mika'
 
cd generator-mika
 
$ npm link

Or

NPM Package

To install generator-mika from npm, run:

$ npm install -g generator-mika

Finally, initiate the generator:

$ yo mika
 
# After install 
$ gulp

Currently no subgenerators are working. These will be released with 0.6.1

Important note!

When generating most command that requires two arguments if they are identical can be safely called with one.

IE

# Instead of this: 
yo mika:service user user
# We say: 
yo mika:service user
Controllers:
$ yo mika:controller {featurename}
Factories:
$ yo mika:factory {featurename} {factoryname}
Directives:
$ yo mika:directive {optional:parentFolder} {featurename} {directivename}
Providers:
$ yo mika:provider {featurename} {directivename}
Filters:
$ yo mika:filter {featurename} {filtername}
Services:
$ yo mika:service {featurename} {servicename}
View:
$ yo mika:view {featurename} {viewname}

Vendor Files

Included is a vendor folder, place all .scss files in here if there needed.

EG. Using Foundation

/vendor/foundation.scss /vendor/foundation/_functions.scss /vendor/foundation/_settings.scss /vendor/foundation/components/

Using Gulp

To start the server use:

$ gulp serve

To build the project type:

$ gulp build

Other hookups to consider when creating things

  • When creating a new filetype Directves, Controller, Factory make sure to inject there dependency into the appropriate place.

File Structure

#example
|app
  |-app.js
  |-index.jade
  |-modules/
    |-search/
      |-search_controller.js
      |-search.jade
      |-search.scss
    |-my_directive/
      |-my_direc..._directive.js
      |-my_direc..._controller.js
      |-my_direc..._template.jade
      |-my_direc..._style.scss
    |-navbar/
      |-navbar_directive.js

  |-view_models/
    |-home/
      |-home_controller.js
      |-home.jade
      |-home.scss

  |-interceptors/
    -my_interceptor.js

  |-api/
    |-api.js
    |-api_service/
    |-my_api.js

  |-states/
    |-states.js
    |-app_states.js

  |-vendor/
    |-lodash.js
|-build

Gulp Commands

Commands prefixed with gulp (eg. gulp serve), run these to control the asset pipeline

Main Commands

serve: Restart the server cleaning the .tmp directory this is the default command

build: Build for distribution, minifying and concatenation.

Sub Commands - Used to create main commands

compile

minify

javascript

clean

Troubleshooting

If you are getting injector module errors, make sure that if not creating a new module you dont declare angular.module('x', []) and declare angular.module('x')

If random errors pop up, restart the gulp server

Contributing

There is much to be done still in this project, it still needs tests it still needs optimization and more gulp tasks and Yeoman options, this is supposed to be a highly customizable generator.

If any options are wanted submit a PR and I will happily merge them in. The next big task is cleaning the gulp tasks up as they are a bit messy.

IE

  • Heroku Publishing Capability

  • Cleaning up the gulp tasks

License

The MIT License (MIT)

Copyright (c) 2015 Mika Kalathil

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Package Sidebar

Install

npm i generator-mika

Weekly Downloads

0

Version

0.6.0

License

MIT

Last publish

Collaborators

  • mikaak