The right way to create Ember.js add-ons?

Ember.js has a number of addons , but most of them do not have any installation instructions. I have successfully built sproutcore-routing ( for example ) by checking it in ember. js / packages and hack Rakefile and ember.json to add it to the list of packages, but that doesn't seem like best practice. Is there some kind of agreement that I am missing?

As for creating ember.js: on Ubuntu, I needed sudo aptitude install ruby-1.9.1-full libxml2-dev libxslt1-dev nodejs , then sudo gem install {rake,github-upload,bundler} , then bundle install , then bundle exec rake . This is probably an old Ruby hacker hat, but yuck.

+4
source share
1 answer

Most "official" add-ons have their own Rakefile to create an add-in in much the same way as Ember itself. As you rightly noted, you will need certain dependencies before you can use Rakefile. I think Ruby, RubyGems, Rake, and Node.js should be all you need to install (maybe libxml2-dev and libxslt1-dev), then the โ€œinstall packageโ€ should take care of something else that Rakefile needs .

In the case of sproutcore-routing, there is no Rakefile because the whole add-in is in lib / core.js, so all you have to do is copy this file to sproutcore-routing.js and you are good to go.

0
source

Source: https://habr.com/ru/post/1394543/


All Articles