dagda1
dagda1

Reputation: 28950

upgrade ember addon on ember-cli 0.2.2

I started developing an addon in on ember-cli 0.2.1 and when I generated my files using the generator, they placed the files in ~/app/ and not ~/addon.

What do I need to do put the files in the right place?

The project contains services, mixins and utils with tests covering them.

Upvotes: 0

Views: 105

Answers (1)

zeppelin
zeppelin

Reputation: 1134

I think it is the default behavior for a good reason: the generators are meant to be used in context of an application. You should consider your addon/ folder being sort of a lib directory, where you can use any file/folder structure that fits the best to your addon. The app/ folder, however, is meant to contain the re-exported modules, so they'll become available on the host app's container automatically.

Browse around a few well-written addons to find out how most people do this, a good example is the ember-radio-button

Notice that an abstact class like radio-button-base is useless by itself, and, therefore, unnecessary to reside on the container, but an addon user would want to import and extend it for his own purposes, which he can do by writing import RadioButtonBase from 'ember-radio-button/components/radio-button-base';

Upvotes: 0

Related Questions