{"action":"created","issue":{"url":"https://api.github.com/repos/coderly/ember-cli/issues/1","labels_url":"https://api.github.com/repos/coderly/ember-cli/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/coderly/ember-cli/issues/1/comments","events_url":"https://api.github.com/repos/coderly/ember-cli/issues/1/events","html_url":"https://github.com/coderly/ember-cli/pull/1","id":95115709,"number":1,"title":"Micro addon support","user":{"login":"begedin","id":1925540,"avatar_url":"https://avatars.githubusercontent.com/u/1925540?v=3","gravatar_id":"","url":"https://api.github.com/users/begedin","html_url":"https://github.com/begedin","followers_url":"https://api.github.com/users/begedin/followers","following_url":"https://api.github.com/users/begedin/following{/other_user}","gists_url":"https://api.github.com/users/begedin/gists{/gist_id}","starred_url":"https://api.github.com/users/begedin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/begedin/subscriptions","organizations_url":"https://api.github.com/users/begedin/orgs","repos_url":"https://api.github.com/users/begedin/repos","events_url":"https://api.github.com/users/begedin/events{/privacy}","received_events_url":"https://api.github.com/users/begedin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-07-15T06:13:50Z","updated_at":"2015-07-20T17:42:59Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/coderly/ember-cli/pulls/1","html_url":"https://github.com/coderly/ember-cli/pull/1","diff_url":"https://github.com/coderly/ember-cli/pull/1.diff","patch_url":"https://github.com/coderly/ember-cli/pull/1.patch"},"body":"# Description\r\n\r\nThis is a temporary PR where we can keep the discussion and have an overview of changes before the micro addon feature is ready to be merged into ember-cli/ember-cli.\r\n\r\nOnce the feature is ready, we can delete this PR and create a new one against ember-cli/ember-cli#master\r\n\r\n# ToDo\r\n\r\n* [x] Clean up any potentially unnecessary stuff\r\n* [x] Write tests\r\n* [x] Write comments according to convention\r\n* [x] Make sure the rest of the code is up to convention\r\n* [ ] Write a proper PR description, to be used in the actual PR\r\n\r\n# Final PR Description\r\n\r\nThis PR adds support to micro addons to ember-cli.\r\n\r\n## Premise\r\n\r\nThe idea here is to enable usage of a type of ember addon in which the file structure is greatly simplified. Micro-components, micro-helpers and micro-libraries are supported within the current PR.\r\n\r\nUsing [coderly's CLI tool](https://github.com/coderly/ember-micro-addon), we are able to generate a micro-addon of a specific type with a single command.\r\n```\r\nember-micro:<addon-type>\r\n``` \r\nHowever, in order to be able to use such an addon out of the box, we are forced to have a modified `index.js` which uses `treeFor[Name]` hooks in order to make the addon compatible with an Ember-CLI app. Basically, the logic which makes a micro-addon work is exposed.\r\n\r\nMaking Ember-CLI support this feature internally would hide away this logic and open up the road for additional CLI tools.\r\n\r\nFor example, with another command, we can almost instantly publish the micro-addon to github:\r\n\r\n```\r\nember-micro:publish <addonName>\r\n```\r\n\r\nIt is also possible to extract a component, helper or library out of an existing app into a micro-addon. \r\n\r\n```\r\nember-micro:extract <addonType> <addonName> [-d|--destionation <destination>]\r\n```\r\n\r\nFinally, we have a command available which converts a micro-addon into a proper ember-addon\r\n\r\n```\r\nember-micro:build <addonName>\r\n```\r\n\r\nThe output is placed within `/addon-name/dist`.\r\n\r\nThe end result is a greatly simplified and sped up workflow. **We can create and publish a micro-addon in under 20 seconds, or extract part of an ember application into an addon just as quickly.**\r\n\r\n## Implementation\r\n\r\nThe micro-addon files are organized in a completely flat file structure with the following files\r\n\r\n* `package.json` for all addons. Needs to contain `ember-addon` as well as `ember-micro-addon` keywords\r\n* `index.js` for all addons, Looks pretty much the same as `index.js` in a regular ember addon\r\n* `component.js`, template.hbs` and `style.css` in the case of a micro-component\r\n* `helper.js` in the case on a micro-helper\r\n* `library.js` in the case of a micro-library\r\n\r\nAt build time, a micro-addon's files get renamed and moved so the micro-addon temporarily gets a proper addon structure. They are then available for import from the `app/components`, `app/helpers` or `addon/lib` namespace, depending on the type of addon."},"comment":{"url":"https://api.github.com/repos/coderly/ember-cli/issues/comments/122964563","html_url":"https://github.com/coderly/ember-cli/pull/1#issuecomment-122964563","issue_url":"https://api.github.com/repos/coderly/ember-cli/issues/1","id":122964563,"user":{"login":"venkatd","id":220686,"avatar_url":"https://avatars.githubusercontent.com/u/220686?v=3","gravatar_id":"","url":"https://api.github.com/users/venkatd","html_url":"https://github.com/venkatd","followers_url":"https://api.github.com/users/venkatd/followers","following_url":"https://api.github.com/users/venkatd/following{/other_user}","gists_url":"https://api.github.com/users/venkatd/gists{/gist_id}","starred_url":"https://api.github.com/users/venkatd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/venkatd/subscriptions","organizations_url":"https://api.github.com/users/venkatd/orgs","repos_url":"https://api.github.com/users/venkatd/repos","events_url":"https://api.github.com/users/venkatd/events{/privacy}","received_events_url":"https://api.github.com/users/venkatd/received_events","type":"User","site_admin":false},"created_at":"2015-07-20T17:42:59Z","updated_at":"2015-07-20T17:42:59Z","body":"@begedin I would also explain the motivation further: To improve the Ember addon ecosystem by speeding up the process and learning curve for creating addons.\r\n\r\nIt should be possible to create and share an addon within 60 seconds."}}