{"action":"created","issue":{"url":"https://api.github.com/repos/ember-cli/ember-cli/issues/3718","labels_url":"https://api.github.com/repos/ember-cli/ember-cli/issues/3718/labels{/name}","comments_url":"https://api.github.com/repos/ember-cli/ember-cli/issues/3718/comments","events_url":"https://api.github.com/repos/ember-cli/ember-cli/issues/3718/events","html_url":"https://github.com/ember-cli/ember-cli/issues/3718","id":65451077,"number":3718,"title":"The `included` hook and nested addons: different application argument","user":{"login":"RSSchermer","id":3153509,"avatar_url":"https://avatars.githubusercontent.com/u/3153509?v=3","gravatar_id":"","url":"https://api.github.com/users/RSSchermer","html_url":"https://github.com/RSSchermer","followers_url":"https://api.github.com/users/RSSchermer/followers","following_url":"https://api.github.com/users/RSSchermer/following{/other_user}","gists_url":"https://api.github.com/users/RSSchermer/gists{/gist_id}","starred_url":"https://api.github.com/users/RSSchermer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RSSchermer/subscriptions","organizations_url":"https://api.github.com/users/RSSchermer/orgs","repos_url":"https://api.github.com/users/RSSchermer/repos","events_url":"https://api.github.com/users/RSSchermer/events{/privacy}","received_events_url":"https://api.github.com/users/RSSchermer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":16,"created_at":"2015-03-31T13:30:20Z","updated_at":"2015-04-08T23:43:57Z","closed_at":null,"body":"I'm in the process of updating 2 related component addons I maintain, [ember-spin-spinner](https://github.com/RSSchermer/ember-spin-spinner) and [ember-spinner-button](https://github.com/RSSchermer/ember-spinner-button) (ember-spinner-button depends on ember-spin-spinner), to ember-cli 0.2.2 (from 0.0.46, upgrading was long overdue).\r\n\r\nI first updated ember-spin-spinner, which was a breeze and when using it as a \"top level\" addon it still works as expectd. However, when updating ember-spinner-button, which uses ember-spin-spinner as a \"second level\" (nested) addon, its `included` hook starts throwing errors during `ember s` and `ember test`:\r\n\r\n```js\r\nincluded: function(app) {\r\n  this._super.included(app);\r\n\r\n  var spinPath = path.join(app.bowerDirectory, 'spin.js');\r\n\r\n  app.import(path.join(spinPath, 'spin.js'));\r\n  app.import(path.join(spinPath, 'jquery.spin.js'));\r\n}\r\n```\r\n\r\nThe `app` argument is not the same when ember-spin-spinner is used as a \"top level\" addon as when used as a \"second level\" (nested) addon. The specific problems in this case are that `app.bowerDirectory` and `app.import` are undefined.\r\n\r\nI did some digging through the issues here and came across [this comment](https://github.com/ember-cli/ember-cli/issues/3531#issuecomment-81133458) by @rwjblue, which seems to indicate that this is intended behavior. \r\n\r\nIn that comment, a distinction also seems to be made between \"top level\" and \"second level\" addons. For ember-spin-spinner the intend was not to make it either a top level or a second level addon, but both: I wanted it to be usable both a standalone addon, as well as a dependency for ember-spinner-button."},"comment":{"url":"https://api.github.com/repos/ember-cli/ember-cli/issues/comments/91069888","html_url":"https://github.com/ember-cli/ember-cli/issues/3718#issuecomment-91069888","issue_url":"https://api.github.com/repos/ember-cli/ember-cli/issues/3718","id":91069888,"user":{"login":"janmisek","id":4329806,"avatar_url":"https://avatars.githubusercontent.com/u/4329806?v=3","gravatar_id":"","url":"https://api.github.com/users/janmisek","html_url":"https://github.com/janmisek","followers_url":"https://api.github.com/users/janmisek/followers","following_url":"https://api.github.com/users/janmisek/following{/other_user}","gists_url":"https://api.github.com/users/janmisek/gists{/gist_id}","starred_url":"https://api.github.com/users/janmisek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janmisek/subscriptions","organizations_url":"https://api.github.com/users/janmisek/orgs","repos_url":"https://api.github.com/users/janmisek/repos","events_url":"https://api.github.com/users/janmisek/events{/privacy}","received_events_url":"https://api.github.com/users/janmisek/received_events","type":"User","site_admin":false},"created_at":"2015-04-08T23:43:57Z","updated_at":"2015-04-08T23:43:57Z","body":"Is there any other/better solution? My usecase is need of low level utilities in `utils-addon` to be shared among more apps and addons. `utils-addon` also uses some no amd libraries.\r\n"}}