jeudi 1 janvier 2015

Ember addon namespace not resolving

I have a simple Ember-CLI addon which provides a few helper Mixins. This addon is meant to be consumed by a set of addons which all want to do user-interface things (react to size changes, field validation, etc.).


So in essence there is a three step chain:



  1. Ember CLI Application consumes UI Ember Addon

  2. UI Addon consumes Mixin Addon to gain access to a common features library

  3. Mixin Addon provides a set of Mixins to consumers


If I put the Mixins implementation into the /app/mixins directory than the UI Addon can import these mixins with an import to ../mixins/[mixin-name]. That works but when I try and move back to the actual Ember App it can no longer resolve the mixins.


I guess that's not surprising really and what I want to be able to do instead is reference the mixins directly, like so: ui-mixin-library/mixins/[mixin-name]. Unfortunately the resolver is not able to resolve this.


In order to help achieve this goal I have put all the mixins into the /addon/mixins directory -- and as the Ember-CLI page suggests -- I import and then export these in the corresponding /app/mixins folder. Doesn't seem to help. Not sure if maybe I need to run these mixins through app.import?




For reference purposes, the Mixin Addon can be found here: addon on github





Aucun commentaire:

Enregistrer un commentaire