tenforce / ember-mu-application-generator

Generator for a full browseable CRUD front-end for a mu-cl-resources back-end.
MIT License
0 stars 3 forks source link

ember-mu-application-generator

Generator for a full browseable CRUD front-end for a mu-cl-resources back-end.

The generator commands can be generated based on a domain.lisp file with the ember-mu-application-generator-generator. This script also generates dispatcher rules to route calls from Ember to mu-cl-resources.

Installation

To install the application via git+https:

ember install https://github.com/tenforce/ember-mu-application-generator.git
ember generate ember-mu-application-generator

The ember generate is needed, because on install the application should install some necessary files (transforms, utils, etc.) and addons (ember-power-select, ember-changeset). If ember installation is done with a git url, ember install cannot find the package name and install the default blueprint (where packagename == blueprintname).

If it's needed, you can modify the url with a tag or a branch:

ember install https://github.com/tenforce/ember-mu-application-generator.git#tag
ember install https://github.com/tenforce/ember-mu-application-generator.git#branch

Ember 2.14

To use the addon with Ember version >=2.14 and <3.0.0, make sure to use the good tag:

ember install https://github.com/tenforce/ember-mu-application-generator.git#ember-2.14

Dependencies

This addon requires the following addons:

If they are not installed with the ember generate ember-mu-application-generator, then please install them manually.

ember install ember-power-select
ember install ember-changeset
ember install ember-datetimepicker

The ember-datetimepicker addon needs jquery-datetimepicker to be able to run. Somehow the addon doesn't ember install it correctly, so make sure to use ember install ember-datetimepicker command!

Design installation

To use the design, you will need ember-cli-sass. You'll have to remove your app.css file to use the app.scss file. This design blueprint will install it for you and generate necessary files:

ember generate mu-application-design

To install ember-cli-sass manually, you can do it like this:

ember install ember-cli-sass

To just include the necessary files in your app.scss:

$mainColor: crimson;
@import "ember-mu-application-generator";

The $mainColor has to be defined! It defines the background of the navbar and all the on hover and focused colors for buttons and input fields.

The default fonts are included in the design files and will be imported in the scss file:

Usage

ember generate mu-resource [resource name] ([attribute name](:[type]))* ([relationship name]:(belongs-to|has-many):[type](~[inverse relationship name]))*

The blueprint takes a flag --readonly which generates the same Ember code but without pages to edit an existing or create a new record of these resources.

Example

ember generate mu-resource taco filling:belongs-to:protein~fills toppings:has-many:toppings name:string price:number misc --readonly

In this example misc will create an untyped attribute: misc: attr()

User documentation

User documentation can be found in the docs folder!

Supported attribute types

Besides the built-in Ember attribute types (string, number, boolean) we have transforms for the followings:

See mu-semtech/ember-mu-transform-helpers

Known issues