ember.jsember-cliember-cli-addons

Custom Ember CLI addon not installing properly


I've taken a stab at building an Ember CLI addon to share with the world. The purpose of the addon is a Firebase Authenticator for Ember Simple Auth. I've gotten the code working, but after packaging it up as an addon according to the Ember CLI documentation as well as a few tutorials, I'm running into some issues.

First, when I install the addon directly from a repo or from NPM, I get the following output:

jamesdixon$ ember install ember-cli-simple-auth-firebase
version: 0.2.3
Installed packages for tooling via npm.
installing
Installing browser packages via Bower...
  cached git://github.com/simplabs/ember-simple-auth-   component.git#0.7.3
  cached git://github.com/firebase/firebase-bower.git#2.2.3
Installed browser packages via Bower.
installing
The "ember generate" command requires an entity name to be specified. For more details, use "ember help".

After the install, when looking at my application directory, I see that my addon has been installed under npm_modules and that the proper Bower packages have been installed under the bower_components directory. Unfortunately, none of the code under the app directory of my addon has been merged into the app directory of the project as is supposed to happen. I've been through the Ember CLI documentation a number of times in addition to reading through a few tutorials, but no luck.

The full source code can be found here: https://github.com/jamesdixon/ember-cli-simple-auth-firebase

Note that I'm running the latest version of Ember and Ember CLI: 0.11.1 and 0.2.3, respectively.

If there are any other details you need, please let me know.

Thanks in advance!

Best, James


Solution

  • A few things:

    1. The error you're seeing isn't actually stopping things from running - it's a bug that's been reported. Just ignore it for now

    2. The code in your app directory isn't phyiscally merged into the users app directory - it's all in the background. What it means when they say 'merged with the users app directory' is really 'make things available as if they were in the users app directory'.

    So for example adding the following to your app.js file would work:

    import FBAuth from './authenticators/firebase';

    1. You had a few things missing/needing changes in your index.js file (a missing . and you needed to use the amd version of simple-auth) and

    2. You need to manually include the simple-auth initializer - there is no other way it will be run - since this is a bower package just for the purpose of shimming (if I've even used that word correctly) - you don't have any simple-auth ember addon so there is no automatic initializer loading - so you have to load it.

    I've forked your repo and got it working on my machine - just this addon and a new ember application from scratch that loads it. This commmit is basically the only changes I made.