Ember - Code Exchange between Two EAK Projects

I have two emberjs projects that use EAK as the main project structure. There is one common code that I want to share between these two projects: templates, views (and related style sheets), some utility classes, etc. But there are some doubts I want to find out:

  • Should I include common code in a separate eak project?
  • Should I use some kind of package manager (maybe this is possible) to manage the dependency project?
  • EAK uses its own recognizer to search for ember classes under certain directories (views, controllers, etc.), so should I copy the general code into these directories or just expand the recognizer to write my own search logic?

Any push in the right direction will be a huge help! Thank.

+3
source share
2 answers

We have a similar situation. We built Yoman, which means we have a conversation for addictions and grunts for construction. I'm not sure how this relates to EAK, so take it with salt.

, . , grunt, , , ( ), , . , Bower, , , (, ) .

0

. :

var appPath = "apps/ordering/";
var resolver = Ember.DefaultResolver.extend({
  resolveTemplate: function (parsedName) {
    parsedName.fullNameWithoutType = appPath + parsedName.fullNameWithoutType;
    # fallback to raw templates (used for compatibility with non-Ember/emblem templates)
    return this._super(parsedName) ||
      Ember.TEMPLATES[parsedName.fullNameWithoutType + ".raw"]
  }
});

, this._super , .

,

+1

All Articles