{"action":"closed","number":2,"pull_request":{"url":"https://api.github.com/repos/coderly/ember-micro-addon/pulls/2","id":37541502,"html_url":"https://github.com/coderly/ember-micro-addon/pull/2","diff_url":"https://github.com/coderly/ember-micro-addon/pull/2.diff","patch_url":"https://github.com/coderly/ember-micro-addon/pull/2.patch","issue_url":"https://api.github.com/repos/coderly/ember-micro-addon/issues/2","number":2,"state":"closed","locked":false,"title":"Implement ember micro:component command","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},"body":"* [Asana task: Implement blueprint/command for \"ember micro\"](https://app.asana.com/0/26202368814744/37516293294991)\r\n* [Asana task: ember micro component](https://app.asana.com/0/26202368814744/37516293294992)\r\n\r\n# Description\r\n\r\nThis PR is a work in progress.\r\n\r\nIt will enable the ember micro:component command, which does the following:\r\n\r\n* Creates a `component.js`\r\n* Creates a `template.hbs`\r\n* Creates a `style.scss`\r\n* Creates a `package.json` with the contents required to make it an `ember-addon`\r\n* Creates an `index.js` with the contents required to make the above files work with an ember app in development\r\n\r\nThe most straightforward way to accomplish this is to define a blueprint and then run it via a command. However...\r\n\r\n*  the `ember-generate` command is only available from within existing ember-cli projects (apps or addons).\r\n* `ember new component-name --blueprint ember-micro-addon/blueprints/micro-component --skip-npm --skip-bower --skip-git` works and creates all of the required stuff, but doesn't update name placeholders, we a way around that is needed. I'm currently looking into ways to get around the problem.\r\n\r\n# Major issue\r\n\r\nI tried to get around this for several hours, but it seems it's not possible to expose commands included by an ember-addon globally.\r\n\r\nIn order for addon-included commands to work, **the addon needs to be listed in the project's `package.json` under `devDependencies`.**\r\n\r\n**Only commands packaded with ember-cli are available globally.**\r\n\r\nI'm afraid this means that we likely need some sort of external process to make it work, or look into how a regular npm package would add global commands to the system. The later seems like the better choice, so I will be looking into that for now.\r\n\r\nThat being said, **the work here still isn't wasted.**\r\n\r\n`ember new component-name --blueprint ember-micro-addon/blueprints/micro-component --skip-npm --skip-bower --skip-git` is still the most straightforward way to quickly generate the files we need, so the system command would probably be calling this command internally.\r\n\r\n## Side note - minimal required work to enable custom commands while not going with an external command-line \"app\"\r\n\r\n1. `mkdir my-component`\r\n2. `cd my-component`\r\n3. `npm init`\r\n3. `npm install ember-micro-addon --save-dev`\r\n4. `ember micro:hello` prints out \"Hello World\"\r\n5. `ember init --blueprint ./node_modules/ember-micro-addon/blueprints/micro-component --skip-npm --skip-bower --skip-git` creates the files for a micro-component\r\n6. `ember new component-name --blueprint ./node_modules/ember-micro-addon/blueprints/micro-component --skip-npm --skip-bower --skip-git` creates a folder `component-name` and the files for that micro-component inside the folder.\r\n\r\n\r\nThe package is  pretty small, so it installs within a couple of seconds.","created_at":"2015-06-12T08:26:18Z","updated_at":"2015-06-15T07:40:03Z","closed_at":"2015-06-15T07:40:03Z","merged_at":"2015-06-15T07:40:03Z","merge_commit_sha":"77abcfbaae7fc9193173cb4c63a416e4489033be","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/coderly/ember-micro-addon/pulls/2/commits","review_comments_url":"https://api.github.com/repos/coderly/ember-micro-addon/pulls/2/comments","review_comment_url":"https://api.github.com/repos/coderly/ember-micro-addon/pulls/comments{/number}","comments_url":"https://api.github.com/repos/coderly/ember-micro-addon/issues/2/comments","statuses_url":"https://api.github.com/repos/coderly/ember-micro-addon/statuses/51854db40899516c066bdcbc2684509945f3594e","head":{"label":"coderly:micro-component-command","ref":"micro-component-command","sha":"51854db40899516c066bdcbc2684509945f3594e","user":{"login":"coderly","id":2837781,"avatar_url":"https://avatars.githubusercontent.com/u/2837781?v=3","gravatar_id":"","url":"https://api.github.com/users/coderly","html_url":"https://github.com/coderly","followers_url":"https://api.github.com/users/coderly/followers","following_url":"https://api.github.com/users/coderly/following{/other_user}","gists_url":"https://api.github.com/users/coderly/gists{/gist_id}","starred_url":"https://api.github.com/users/coderly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coderly/subscriptions","organizations_url":"https://api.github.com/users/coderly/orgs","repos_url":"https://api.github.com/users/coderly/repos","events_url":"https://api.github.com/users/coderly/events{/privacy}","received_events_url":"https://api.github.com/users/coderly/received_events","type":"Organization","site_admin":false},"repo":{"id":37308481,"name":"ember-micro-addon","full_name":"coderly/ember-micro-addon","owner":{"login":"coderly","id":2837781,"avatar_url":"https://avatars.githubusercontent.com/u/2837781?v=3","gravatar_id":"","url":"https://api.github.com/users/coderly","html_url":"https://github.com/coderly","followers_url":"https://api.github.com/users/coderly/followers","following_url":"https://api.github.com/users/coderly/following{/other_user}","gists_url":"https://api.github.com/users/coderly/gists{/gist_id}","starred_url":"https://api.github.com/users/coderly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coderly/subscriptions","organizations_url":"https://api.github.com/users/coderly/orgs","repos_url":"https://api.github.com/users/coderly/repos","events_url":"https://api.github.com/users/coderly/events{/privacy}","received_events_url":"https://api.github.com/users/coderly/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/coderly/ember-micro-addon","description":"Command line interface for ember micro addons","fork":false,"url":"https://api.github.com/repos/coderly/ember-micro-addon","forks_url":"https://api.github.com/repos/coderly/ember-micro-addon/forks","keys_url":"https://api.github.com/repos/coderly/ember-micro-addon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/coderly/ember-micro-addon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/coderly/ember-micro-addon/teams","hooks_url":"https://api.github.com/repos/coderly/ember-micro-addon/hooks","issue_events_url":"https://api.github.com/repos/coderly/ember-micro-addon/issues/events{/number}","events_url":"https://api.github.com/repos/coderly/ember-micro-addon/events","assignees_url":"https://api.github.com/repos/coderly/ember-micro-addon/assignees{/user}","branches_url":"https://api.github.com/repos/coderly/ember-micro-addon/branches{/branch}","tags_url":"https://api.github.com/repos/coderly/ember-micro-addon/tags","blobs_url":"https://api.github.com/repos/coderly/ember-micro-addon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/coderly/ember-micro-addon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/coderly/ember-micro-addon/git/refs{/sha}","trees_url":"https://api.github.com/repos/coderly/ember-micro-addon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/coderly/ember-micro-addon/statuses/{sha}","languages_url":"https://api.github.com/repos/coderly/ember-micro-addon/languages","stargazers_url":"https://api.github.com/repos/coderly/ember-micro-addon/stargazers","contributors_url":"https://api.github.com/repos/coderly/ember-micro-addon/contributors","subscribers_url":"https://api.github.com/repos/coderly/ember-micro-addon/subscribers","subscription_url":"https://api.github.com/repos/coderly/ember-micro-addon/subscription","commits_url":"https://api.github.com/repos/coderly/ember-micro-addon/commits{/sha}","git_commits_url":"https://api.github.com/repos/coderly/ember-micro-addon/git/commits{/sha}","comments_url":"https://api.github.com/repos/coderly/ember-micro-addon/comments{/number}","issue_comment_url":"https://api.github.com/repos/coderly/ember-micro-addon/issues/comments{/number}","contents_url":"https://api.github.com/repos/coderly/ember-micro-addon/contents/{+path}","compare_url":"https://api.github.com/repos/coderly/ember-micro-addon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/coderly/ember-micro-addon/merges","archive_url":"https://api.github.com/repos/coderly/ember-micro-addon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/coderly/ember-micro-addon/downloads","issues_url":"https://api.github.com/repos/coderly/ember-micro-addon/issues{/number}","pulls_url":"https://api.github.com/repos/coderly/ember-micro-addon/pulls{/number}","milestones_url":"https://api.github.com/repos/coderly/ember-micro-addon/milestones{/number}","notifications_url":"https://api.github.com/repos/coderly/ember-micro-addon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/coderly/ember-micro-addon/labels{/name}","releases_url":"https://api.github.com/repos/coderly/ember-micro-addon/releases{/id}","created_at":"2015-06-12T07:31:38Z","updated_at":"2015-06-12T14:20:31Z","pushed_at":"2015-06-15T07:40:03Z","git_url":"git://github.com/coderly/ember-micro-addon.git","ssh_url":"git@github.com:coderly/ember-micro-addon.git","clone_url":"https://github.com/coderly/ember-micro-addon.git","svn_url":"https://github.com/coderly/ember-micro-addon","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"coderly:master","ref":"master","sha":"b0c09c4fda060aa1f8070d5c005dbd72a9ac31df","user":{"login":"coderly","id":2837781,"avatar_url":"https://avatars.githubusercontent.com/u/2837781?v=3","gravatar_id":"","url":"https://api.github.com/users/coderly","html_url":"https://github.com/coderly","followers_url":"https://api.github.com/users/coderly/followers","following_url":"https://api.github.com/users/coderly/following{/other_user}","gists_url":"https://api.github.com/users/coderly/gists{/gist_id}","starred_url":"https://api.github.com/users/coderly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coderly/subscriptions","organizations_url":"https://api.github.com/users/coderly/orgs","repos_url":"https://api.github.com/users/coderly/repos","events_url":"https://api.github.com/users/coderly/events{/privacy}","received_events_url":"https://api.github.com/users/coderly/received_events","type":"Organization","site_admin":false},"repo":{"id":37308481,"name":"ember-micro-addon","full_name":"coderly/ember-micro-addon","owner":{"login":"coderly","id":2837781,"avatar_url":"https://avatars.githubusercontent.com/u/2837781?v=3","gravatar_id":"","url":"https://api.github.com/users/coderly","html_url":"https://github.com/coderly","followers_url":"https://api.github.com/users/coderly/followers","following_url":"https://api.github.com/users/coderly/following{/other_user}","gists_url":"https://api.github.com/users/coderly/gists{/gist_id}","starred_url":"https://api.github.com/users/coderly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coderly/subscriptions","organizations_url":"https://api.github.com/users/coderly/orgs","repos_url":"https://api.github.com/users/coderly/repos","events_url":"https://api.github.com/users/coderly/events{/privacy}","received_events_url":"https://api.github.com/users/coderly/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/coderly/ember-micro-addon","description":"Command line interface for ember micro addons","fork":false,"url":"https://api.github.com/repos/coderly/ember-micro-addon","forks_url":"https://api.github.com/repos/coderly/ember-micro-addon/forks","keys_url":"https://api.github.com/repos/coderly/ember-micro-addon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/coderly/ember-micro-addon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/coderly/ember-micro-addon/teams","hooks_url":"https://api.github.com/repos/coderly/ember-micro-addon/hooks","issue_events_url":"https://api.github.com/repos/coderly/ember-micro-addon/issues/events{/number}","events_url":"https://api.github.com/repos/coderly/ember-micro-addon/events","assignees_url":"https://api.github.com/repos/coderly/ember-micro-addon/assignees{/user}","branches_url":"https://api.github.com/repos/coderly/ember-micro-addon/branches{/branch}","tags_url":"https://api.github.com/repos/coderly/ember-micro-addon/tags","blobs_url":"https://api.github.com/repos/coderly/ember-micro-addon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/coderly/ember-micro-addon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/coderly/ember-micro-addon/git/refs{/sha}","trees_url":"https://api.github.com/repos/coderly/ember-micro-addon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/coderly/ember-micro-addon/statuses/{sha}","languages_url":"https://api.github.com/repos/coderly/ember-micro-addon/languages","stargazers_url":"https://api.github.com/repos/coderly/ember-micro-addon/stargazers","contributors_url":"https://api.github.com/repos/coderly/ember-micro-addon/contributors","subscribers_url":"https://api.github.com/repos/coderly/ember-micro-addon/subscribers","subscription_url":"https://api.github.com/repos/coderly/ember-micro-addon/subscription","commits_url":"https://api.github.com/repos/coderly/ember-micro-addon/commits{/sha}","git_commits_url":"https://api.github.com/repos/coderly/ember-micro-addon/git/commits{/sha}","comments_url":"https://api.github.com/repos/coderly/ember-micro-addon/comments{/number}","issue_comment_url":"https://api.github.com/repos/coderly/ember-micro-addon/issues/comments{/number}","contents_url":"https://api.github.com/repos/coderly/ember-micro-addon/contents/{+path}","compare_url":"https://api.github.com/repos/coderly/ember-micro-addon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/coderly/ember-micro-addon/merges","archive_url":"https://api.github.com/repos/coderly/ember-micro-addon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/coderly/ember-micro-addon/downloads","issues_url":"https://api.github.com/repos/coderly/ember-micro-addon/issues{/number}","pulls_url":"https://api.github.com/repos/coderly/ember-micro-addon/pulls{/number}","milestones_url":"https://api.github.com/repos/coderly/ember-micro-addon/milestones{/number}","notifications_url":"https://api.github.com/repos/coderly/ember-micro-addon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/coderly/ember-micro-addon/labels{/name}","releases_url":"https://api.github.com/repos/coderly/ember-micro-addon/releases{/id}","created_at":"2015-06-12T07:31:38Z","updated_at":"2015-06-12T14:20:31Z","pushed_at":"2015-06-15T07:40:03Z","git_url":"git://github.com/coderly/ember-micro-addon.git","ssh_url":"git@github.com:coderly/ember-micro-addon.git","clone_url":"https://github.com/coderly/ember-micro-addon.git","svn_url":"https://github.com/coderly/ember-micro-addon","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/coderly/ember-micro-addon/pulls/2"},"html":{"href":"https://github.com/coderly/ember-micro-addon/pull/2"},"issue":{"href":"https://api.github.com/repos/coderly/ember-micro-addon/issues/2"},"comments":{"href":"https://api.github.com/repos/coderly/ember-micro-addon/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/coderly/ember-micro-addon/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/coderly/ember-micro-addon/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/coderly/ember-micro-addon/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/coderly/ember-micro-addon/statuses/51854db40899516c066bdcbc2684509945f3594e"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"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},"comments":1,"review_comments":0,"commits":8,"additions":118,"deletions":5,"changed_files":13}}