ember-cli-module-blueprints
v0.1.0
Published
The default blueprint for ember-cli addons.
Downloads
1
Readme
Ember CLI Module Blueprints
WARNING: This addon is experimental and rely on features that are not yet default in Ember CLI for a reason. Be prepared to update your app if the import
names generated by this addon change.
The goal of this addon is to provide blueprints that contain import
statements targeting modules directly, instead of import
ing Ember
, and then accessing the entity from the Ember
object.
For example, the current component blueprint:
import Ember from 'ember';
export default Ember.Component.extend({
});
Becomes:
import Component from 'ember-component';
export default Component.extend({
});
Blueprints affected: component, controller, helper, mixin, route, service, test-helper.
For the full list of currently available ES6 exports, see the list of ES6 module shims. Using these modules let you import
most of Ember's classes and functions, for example your app code can look like this:
import Component from 'ember-component';
import computed from 'ember-computed';
import service from 'ember-service/inject';
export default Component.extend({
foo: service(), // Same as: `Ember.inject.service()`
hello: computed('foo.bar', function() { // Same as: `Ember.computed`
return this.get('foo.bar');
})
});
Installation
ember install ember-cli-module-blueprints
Running Tests
npm test
(Runsember try:testall
to test your addon against multiple Ember versions)ember test
ember test --server
Building
ember build
For more information on using ember-cli, visit http://ember-cli.com/.