{"action":"opened","number":174,"pull_request":{"url":"https://api.github.com/repos/trotzig/import-js/pulls/174","id":57750877,"html_url":"https://github.com/trotzig/import-js/pull/174","diff_url":"https://github.com/trotzig/import-js/pull/174.diff","patch_url":"https://github.com/trotzig/import-js/pull/174.patch","issue_url":"https://api.github.com/repos/trotzig/import-js/issues/174","number":174,"state":"open","locked":false,"title":"Make goto resolution work for aliases that reference packages","user":{"login":"lencioni","id":195534,"avatar_url":"https://avatars.githubusercontent.com/u/195534?v=3","gravatar_id":"","url":"https://api.github.com/users/lencioni","html_url":"https://github.com/lencioni","followers_url":"https://api.github.com/users/lencioni/followers","following_url":"https://api.github.com/users/lencioni/following{/other_user}","gists_url":"https://api.github.com/users/lencioni/gists{/gist_id}","starred_url":"https://api.github.com/users/lencioni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lencioni/subscriptions","organizations_url":"https://api.github.com/users/lencioni/orgs","repos_url":"https://api.github.com/users/lencioni/repos","events_url":"https://api.github.com/users/lencioni/events{/privacy}","received_events_url":"https://api.github.com/users/lencioni/received_events","type":"User","site_admin":false},"body":"If I have an alias like\r\n\r\n  \"Foo\": \"my-foo-package\"\r\n\r\nwhen I use the goto feature on `Foo`, I am taken to an empty file at\r\n`my-foo-package` instead of taken to the package. This commit aims to\r\nimprove this by looking up the package's main file.\r\n\r\nI ended up using a rescue around `File.read` instead of calling\r\n`File.exist?` because in tests we mock out `File.read` but not\r\n`File.exist?` and I didn't want to take the time to make that all work\r\nproperly. We should probably refactor this at some point.\r\n\r\nIn testing this, I noticed that package.json files can reference a\r\ndirectory as the main file, in which case it should resolve to index.js\r\nin that directory, but that's another issue that will need to be fixed\r\nat another time.\r\n\r\nFixes #172.","created_at":"2016-01-30T21:14:39Z","updated_at":"2016-01-30T21:14:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":{"login":"trotzig","id":578277,"avatar_url":"https://avatars.githubusercontent.com/u/578277?v=3","gravatar_id":"","url":"https://api.github.com/users/trotzig","html_url":"https://github.com/trotzig","followers_url":"https://api.github.com/users/trotzig/followers","following_url":"https://api.github.com/users/trotzig/following{/other_user}","gists_url":"https://api.github.com/users/trotzig/gists{/gist_id}","starred_url":"https://api.github.com/users/trotzig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trotzig/subscriptions","organizations_url":"https://api.github.com/users/trotzig/orgs","repos_url":"https://api.github.com/users/trotzig/repos","events_url":"https://api.github.com/users/trotzig/events{/privacy}","received_events_url":"https://api.github.com/users/trotzig/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/trotzig/import-js/milestones/2","html_url":"https://github.com/trotzig/import-js/milestones/1.0.0","labels_url":"https://api.github.com/repos/trotzig/import-js/milestones/2/labels","id":1545468,"number":2,"title":"1.0.0","description":null,"creator":{"login":"lencioni","id":195534,"avatar_url":"https://avatars.githubusercontent.com/u/195534?v=3","gravatar_id":"","url":"https://api.github.com/users/lencioni","html_url":"https://github.com/lencioni","followers_url":"https://api.github.com/users/lencioni/followers","following_url":"https://api.github.com/users/lencioni/following{/other_user}","gists_url":"https://api.github.com/users/lencioni/gists{/gist_id}","starred_url":"https://api.github.com/users/lencioni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lencioni/subscriptions","organizations_url":"https://api.github.com/users/lencioni/orgs","repos_url":"https://api.github.com/users/lencioni/repos","events_url":"https://api.github.com/users/lencioni/events{/privacy}","received_events_url":"https://api.github.com/users/lencioni/received_events","type":"User","site_admin":false},"open_issues":7,"closed_issues":0,"state":"open","created_at":"2016-01-27T01:26:30Z","updated_at":"2016-01-30T21:14:39Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/trotzig/import-js/pulls/174/commits","review_comments_url":"https://api.github.com/repos/trotzig/import-js/pulls/174/comments","review_comment_url":"https://api.github.com/repos/trotzig/import-js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/trotzig/import-js/issues/174/comments","statuses_url":"https://api.github.com/repos/trotzig/import-js/statuses/052ea79bc91d266176446ce0150a1249fbc17a43","head":{"label":"lencioni:goto-alias-package","ref":"goto-alias-package","sha":"052ea79bc91d266176446ce0150a1249fbc17a43","user":{"login":"lencioni","id":195534,"avatar_url":"https://avatars.githubusercontent.com/u/195534?v=3","gravatar_id":"","url":"https://api.github.com/users/lencioni","html_url":"https://github.com/lencioni","followers_url":"https://api.github.com/users/lencioni/followers","following_url":"https://api.github.com/users/lencioni/following{/other_user}","gists_url":"https://api.github.com/users/lencioni/gists{/gist_id}","starred_url":"https://api.github.com/users/lencioni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lencioni/subscriptions","organizations_url":"https://api.github.com/users/lencioni/orgs","repos_url":"https://api.github.com/users/lencioni/repos","events_url":"https://api.github.com/users/lencioni/events{/privacy}","received_events_url":"https://api.github.com/users/lencioni/received_events","type":"User","site_admin":false},"repo":{"id":31670228,"name":"import-js","full_name":"lencioni/import-js","owner":{"login":"lencioni","id":195534,"avatar_url":"https://avatars.githubusercontent.com/u/195534?v=3","gravatar_id":"","url":"https://api.github.com/users/lencioni","html_url":"https://github.com/lencioni","followers_url":"https://api.github.com/users/lencioni/followers","following_url":"https://api.github.com/users/lencioni/following{/other_user}","gists_url":"https://api.github.com/users/lencioni/gists{/gist_id}","starred_url":"https://api.github.com/users/lencioni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lencioni/subscriptions","organizations_url":"https://api.github.com/users/lencioni/orgs","repos_url":"https://api.github.com/users/lencioni/repos","events_url":"https://api.github.com/users/lencioni/events{/privacy}","received_events_url":"https://api.github.com/users/lencioni/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lencioni/import-js","description":"A vim plugin to simplify `require`ing variables, CommonJS-style","fork":true,"url":"https://api.github.com/repos/lencioni/import-js","forks_url":"https://api.github.com/repos/lencioni/import-js/forks","keys_url":"https://api.github.com/repos/lencioni/import-js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lencioni/import-js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lencioni/import-js/teams","hooks_url":"https://api.github.com/repos/lencioni/import-js/hooks","issue_events_url":"https://api.github.com/repos/lencioni/import-js/issues/events{/number}","events_url":"https://api.github.com/repos/lencioni/import-js/events","assignees_url":"https://api.github.com/repos/lencioni/import-js/assignees{/user}","branches_url":"https://api.github.com/repos/lencioni/import-js/branches{/branch}","tags_url":"https://api.github.com/repos/lencioni/import-js/tags","blobs_url":"https://api.github.com/repos/lencioni/import-js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lencioni/import-js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lencioni/import-js/git/refs{/sha}","trees_url":"https://api.github.com/repos/lencioni/import-js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lencioni/import-js/statuses/{sha}","languages_url":"https://api.github.com/repos/lencioni/import-js/languages","stargazers_url":"https://api.github.com/repos/lencioni/import-js/stargazers","contributors_url":"https://api.github.com/repos/lencioni/import-js/contributors","subscribers_url":"https://api.github.com/repos/lencioni/import-js/subscribers","subscription_url":"https://api.github.com/repos/lencioni/import-js/subscription","commits_url":"https://api.github.com/repos/lencioni/import-js/commits{/sha}","git_commits_url":"https://api.github.com/repos/lencioni/import-js/git/commits{/sha}","comments_url":"https://api.github.com/repos/lencioni/import-js/comments{/number}","issue_comment_url":"https://api.github.com/repos/lencioni/import-js/issues/comments{/number}","contents_url":"https://api.github.com/repos/lencioni/import-js/contents/{+path}","compare_url":"https://api.github.com/repos/lencioni/import-js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lencioni/import-js/merges","archive_url":"https://api.github.com/repos/lencioni/import-js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lencioni/import-js/downloads","issues_url":"https://api.github.com/repos/lencioni/import-js/issues{/number}","pulls_url":"https://api.github.com/repos/lencioni/import-js/pulls{/number}","milestones_url":"https://api.github.com/repos/lencioni/import-js/milestones{/number}","notifications_url":"https://api.github.com/repos/lencioni/import-js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lencioni/import-js/labels{/name}","releases_url":"https://api.github.com/repos/lencioni/import-js/releases{/id}","deployments_url":"https://api.github.com/repos/lencioni/import-js/deployments","created_at":"2015-03-04T17:32:31Z","updated_at":"2016-01-18T20:24:18Z","pushed_at":"2016-01-30T21:13:48Z","git_url":"git://github.com/lencioni/import-js.git","ssh_url":"git@github.com:lencioni/import-js.git","clone_url":"https://github.com/lencioni/import-js.git","svn_url":"https://github.com/lencioni/import-js","homepage":null,"size":698,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"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":"trotzig:master","ref":"master","sha":"421a74478f152f9b0684b3f3d34678f79099981e","user":{"login":"trotzig","id":578277,"avatar_url":"https://avatars.githubusercontent.com/u/578277?v=3","gravatar_id":"","url":"https://api.github.com/users/trotzig","html_url":"https://github.com/trotzig","followers_url":"https://api.github.com/users/trotzig/followers","following_url":"https://api.github.com/users/trotzig/following{/other_user}","gists_url":"https://api.github.com/users/trotzig/gists{/gist_id}","starred_url":"https://api.github.com/users/trotzig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trotzig/subscriptions","organizations_url":"https://api.github.com/users/trotzig/orgs","repos_url":"https://api.github.com/users/trotzig/repos","events_url":"https://api.github.com/users/trotzig/events{/privacy}","received_events_url":"https://api.github.com/users/trotzig/received_events","type":"User","site_admin":false},"repo":{"id":27005321,"name":"import-js","full_name":"trotzig/import-js","owner":{"login":"trotzig","id":578277,"avatar_url":"https://avatars.githubusercontent.com/u/578277?v=3","gravatar_id":"","url":"https://api.github.com/users/trotzig","html_url":"https://github.com/trotzig","followers_url":"https://api.github.com/users/trotzig/followers","following_url":"https://api.github.com/users/trotzig/following{/other_user}","gists_url":"https://api.github.com/users/trotzig/gists{/gist_id}","starred_url":"https://api.github.com/users/trotzig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trotzig/subscriptions","organizations_url":"https://api.github.com/users/trotzig/orgs","repos_url":"https://api.github.com/users/trotzig/repos","events_url":"https://api.github.com/users/trotzig/events{/privacy}","received_events_url":"https://api.github.com/users/trotzig/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/trotzig/import-js","description":"A tool to simplify importing JS modules","fork":false,"url":"https://api.github.com/repos/trotzig/import-js","forks_url":"https://api.github.com/repos/trotzig/import-js/forks","keys_url":"https://api.github.com/repos/trotzig/import-js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/trotzig/import-js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/trotzig/import-js/teams","hooks_url":"https://api.github.com/repos/trotzig/import-js/hooks","issue_events_url":"https://api.github.com/repos/trotzig/import-js/issues/events{/number}","events_url":"https://api.github.com/repos/trotzig/import-js/events","assignees_url":"https://api.github.com/repos/trotzig/import-js/assignees{/user}","branches_url":"https://api.github.com/repos/trotzig/import-js/branches{/branch}","tags_url":"https://api.github.com/repos/trotzig/import-js/tags","blobs_url":"https://api.github.com/repos/trotzig/import-js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/trotzig/import-js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/trotzig/import-js/git/refs{/sha}","trees_url":"https://api.github.com/repos/trotzig/import-js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/trotzig/import-js/statuses/{sha}","languages_url":"https://api.github.com/repos/trotzig/import-js/languages","stargazers_url":"https://api.github.com/repos/trotzig/import-js/stargazers","contributors_url":"https://api.github.com/repos/trotzig/import-js/contributors","subscribers_url":"https://api.github.com/repos/trotzig/import-js/subscribers","subscription_url":"https://api.github.com/repos/trotzig/import-js/subscription","commits_url":"https://api.github.com/repos/trotzig/import-js/commits{/sha}","git_commits_url":"https://api.github.com/repos/trotzig/import-js/git/commits{/sha}","comments_url":"https://api.github.com/repos/trotzig/import-js/comments{/number}","issue_comment_url":"https://api.github.com/repos/trotzig/import-js/issues/comments{/number}","contents_url":"https://api.github.com/repos/trotzig/import-js/contents/{+path}","compare_url":"https://api.github.com/repos/trotzig/import-js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/trotzig/import-js/merges","archive_url":"https://api.github.com/repos/trotzig/import-js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/trotzig/import-js/downloads","issues_url":"https://api.github.com/repos/trotzig/import-js/issues{/number}","pulls_url":"https://api.github.com/repos/trotzig/import-js/pulls{/number}","milestones_url":"https://api.github.com/repos/trotzig/import-js/milestones{/number}","notifications_url":"https://api.github.com/repos/trotzig/import-js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/trotzig/import-js/labels{/name}","releases_url":"https://api.github.com/repos/trotzig/import-js/releases{/id}","deployments_url":"https://api.github.com/repos/trotzig/import-js/deployments","created_at":"2014-11-22T16:48:56Z","updated_at":"2016-01-25T22:35:25Z","pushed_at":"2016-01-30T21:14:39Z","git_url":"git://github.com/trotzig/import-js.git","ssh_url":"git@github.com:trotzig/import-js.git","clone_url":"https://github.com/trotzig/import-js.git","svn_url":"https://github.com/trotzig/import-js","homepage":"","size":683,"stargazers_count":60,"watchers_count":60,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":14,"forks":7,"open_issues":14,"watchers":60,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/trotzig/import-js/pulls/174"},"html":{"href":"https://github.com/trotzig/import-js/pull/174"},"issue":{"href":"https://api.github.com/repos/trotzig/import-js/issues/174"},"comments":{"href":"https://api.github.com/repos/trotzig/import-js/issues/174/comments"},"review_comments":{"href":"https://api.github.com/repos/trotzig/import-js/pulls/174/comments"},"review_comment":{"href":"https://api.github.com/repos/trotzig/import-js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/trotzig/import-js/pulls/174/commits"},"statuses":{"href":"https://api.github.com/repos/trotzig/import-js/statuses/052ea79bc91d266176446ce0150a1249fbc17a43"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":8,"additions":160,"deletions":37,"changed_files":6}}