{"action":"created","comment":{"url":"https://api.github.com/repos/appium/appium-uiauto/pulls/comments/34938664","id":34938664,"diff_hunk":"@@ -0,0 +1,82 @@\n+\n+import path from 'path';\n+import _fs from 'fs';\n+import _ from 'lodash';\n+import B from 'bluebird';\n+\n+let fs = {\n+  readFile: B.promisify(_fs.readFile)\n+};\n+\n+let root = path.resolve(__dirname, '../uiauto');\n+\n+// keep a list of files we examine for the purposes of making sure we're\n+// not adding the same file to the collated version twice\n+let filesExamined;\n+\n+// this regex helps us get the file path of an import\n+let importRe = /^#import ('|\")([^('|\")]+)('|\")$/mg;\n+\n+async function getDepsForFile (file, extraImports = []) {\n+  if (_.contains(filesExamined, file)) {\n+    throw new Error(`Re-examining file ${file}; you need to make sure ` +\n+                    `the graph is set up so we don't require files twice`);\n+  }\n+  filesExamined.push(file);\n+  \n+  let data = await fs.readFile(file, 'utf8');\n+  let deps = {\n+    [file]: []\n+  };\n+\n+  let matches = [];\n+  let match = importRe.exec(data);\n+  while (match) {\n+    if (match) {\n+      matches.push(match[2]);\n+    }\n+    match = importRe.exec(data);\n+  }\n+  if (extraImports && extraImports.length > 0) {","path":"lib/build-code.js","position":40,"original_position":40,"commit_id":"99895e78d8a75af4784aa59234e26612f68017c7","original_commit_id":"99895e78d8a75af4784aa59234e26612f68017c7","user":{"login":"imurchie","id":2614354,"avatar_url":"https://avatars.githubusercontent.com/u/2614354?v=3","gravatar_id":"","url":"https://api.github.com/users/imurchie","html_url":"https://github.com/imurchie","followers_url":"https://api.github.com/users/imurchie/followers","following_url":"https://api.github.com/users/imurchie/following{/other_user}","gists_url":"https://api.github.com/users/imurchie/gists{/gist_id}","starred_url":"https://api.github.com/users/imurchie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imurchie/subscriptions","organizations_url":"https://api.github.com/users/imurchie/orgs","repos_url":"https://api.github.com/users/imurchie/repos","events_url":"https://api.github.com/users/imurchie/events{/privacy}","received_events_url":"https://api.github.com/users/imurchie/received_events","type":"User","site_admin":false},"body":"`extraImports` will always exist, and there is no need to check for length as `concat` works reasonably with an empty array. So no need for the conditional.","created_at":"2015-07-17T23:09:52Z","updated_at":"2015-07-17T23:09:52Z","html_url":"https://github.com/appium/appium-uiauto/pull/76#discussion_r34938664","pull_request_url":"https://api.github.com/repos/appium/appium-uiauto/pulls/76","_links":{"self":{"href":"https://api.github.com/repos/appium/appium-uiauto/pulls/comments/34938664"},"html":{"href":"https://github.com/appium/appium-uiauto/pull/76#discussion_r34938664"},"pull_request":{"href":"https://api.github.com/repos/appium/appium-uiauto/pulls/76"}}},"pull_request":{"url":"https://api.github.com/repos/appium/appium-uiauto/pulls/76","id":40174636,"html_url":"https://github.com/appium/appium-uiauto/pull/76","diff_url":"https://github.com/appium/appium-uiauto/pull/76.diff","patch_url":"https://github.com/appium/appium-uiauto/pull/76.patch","issue_url":"https://api.github.com/repos/appium/appium-uiauto/issues/76","number":76,"state":"open","locked":false,"title":"sonia-rewrite resolve dependencies","user":{"login":"syang97","id":8731793,"avatar_url":"https://avatars.githubusercontent.com/u/8731793?v=3","gravatar_id":"","url":"https://api.github.com/users/syang97","html_url":"https://github.com/syang97","followers_url":"https://api.github.com/users/syang97/followers","following_url":"https://api.github.com/users/syang97/following{/other_user}","gists_url":"https://api.github.com/users/syang97/gists{/gist_id}","starred_url":"https://api.github.com/users/syang97/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/syang97/subscriptions","organizations_url":"https://api.github.com/users/syang97/orgs","repos_url":"https://api.github.com/users/syang97/repos","events_url":"https://api.github.com/users/syang97/events{/privacy}","received_events_url":"https://api.github.com/users/syang97/received_events","type":"User","site_admin":false},"body":"I don't pass 9 of the tests :( Probably something to do with my placement of await statements. ","created_at":"2015-07-16T20:53:14Z","updated_at":"2015-07-17T23:09:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"910e6e9a86792832fb30d5f10463257a052e8487","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/appium/appium-uiauto/pulls/76/commits","review_comments_url":"https://api.github.com/repos/appium/appium-uiauto/pulls/76/comments","review_comment_url":"https://api.github.com/repos/appium/appium-uiauto/pulls/comments{/number}","comments_url":"https://api.github.com/repos/appium/appium-uiauto/issues/76/comments","statuses_url":"https://api.github.com/repos/appium/appium-uiauto/statuses/99895e78d8a75af4784aa59234e26612f68017c7","head":{"label":"syang97:soniaresolvedp","ref":"soniaresolvedp","sha":"99895e78d8a75af4784aa59234e26612f68017c7","user":{"login":"syang97","id":8731793,"avatar_url":"https://avatars.githubusercontent.com/u/8731793?v=3","gravatar_id":"","url":"https://api.github.com/users/syang97","html_url":"https://github.com/syang97","followers_url":"https://api.github.com/users/syang97/followers","following_url":"https://api.github.com/users/syang97/following{/other_user}","gists_url":"https://api.github.com/users/syang97/gists{/gist_id}","starred_url":"https://api.github.com/users/syang97/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/syang97/subscriptions","organizations_url":"https://api.github.com/users/syang97/orgs","repos_url":"https://api.github.com/users/syang97/repos","events_url":"https://api.github.com/users/syang97/events{/privacy}","received_events_url":"https://api.github.com/users/syang97/received_events","type":"User","site_admin":false},"repo":{"id":39164818,"name":"appium-uiauto","full_name":"syang97/appium-uiauto","owner":{"login":"syang97","id":8731793,"avatar_url":"https://avatars.githubusercontent.com/u/8731793?v=3","gravatar_id":"","url":"https://api.github.com/users/syang97","html_url":"https://github.com/syang97","followers_url":"https://api.github.com/users/syang97/followers","following_url":"https://api.github.com/users/syang97/following{/other_user}","gists_url":"https://api.github.com/users/syang97/gists{/gist_id}","starred_url":"https://api.github.com/users/syang97/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/syang97/subscriptions","organizations_url":"https://api.github.com/users/syang97/orgs","repos_url":"https://api.github.com/users/syang97/repos","events_url":"https://api.github.com/users/syang97/events{/privacy}","received_events_url":"https://api.github.com/users/syang97/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/syang97/appium-uiauto","description":"Appium uiauto ios driver","fork":true,"url":"https://api.github.com/repos/syang97/appium-uiauto","forks_url":"https://api.github.com/repos/syang97/appium-uiauto/forks","keys_url":"https://api.github.com/repos/syang97/appium-uiauto/keys{/key_id}","collaborators_url":"https://api.github.com/repos/syang97/appium-uiauto/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/syang97/appium-uiauto/teams","hooks_url":"https://api.github.com/repos/syang97/appium-uiauto/hooks","issue_events_url":"https://api.github.com/repos/syang97/appium-uiauto/issues/events{/number}","events_url":"https://api.github.com/repos/syang97/appium-uiauto/events","assignees_url":"https://api.github.com/repos/syang97/appium-uiauto/assignees{/user}","branches_url":"https://api.github.com/repos/syang97/appium-uiauto/branches{/branch}","tags_url":"https://api.github.com/repos/syang97/appium-uiauto/tags","blobs_url":"https://api.github.com/repos/syang97/appium-uiauto/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/syang97/appium-uiauto/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/syang97/appium-uiauto/git/refs{/sha}","trees_url":"https://api.github.com/repos/syang97/appium-uiauto/git/trees{/sha}","statuses_url":"https://api.github.com/repos/syang97/appium-uiauto/statuses/{sha}","languages_url":"https://api.github.com/repos/syang97/appium-uiauto/languages","stargazers_url":"https://api.github.com/repos/syang97/appium-uiauto/stargazers","contributors_url":"https://api.github.com/repos/syang97/appium-uiauto/contributors","subscribers_url":"https://api.github.com/repos/syang97/appium-uiauto/subscribers","subscription_url":"https://api.github.com/repos/syang97/appium-uiauto/subscription","commits_url":"https://api.github.com/repos/syang97/appium-uiauto/commits{/sha}","git_commits_url":"https://api.github.com/repos/syang97/appium-uiauto/git/commits{/sha}","comments_url":"https://api.github.com/repos/syang97/appium-uiauto/comments{/number}","issue_comment_url":"https://api.github.com/repos/syang97/appium-uiauto/issues/comments{/number}","contents_url":"https://api.github.com/repos/syang97/appium-uiauto/contents/{+path}","compare_url":"https://api.github.com/repos/syang97/appium-uiauto/compare/{base}...{head}","merges_url":"https://api.github.com/repos/syang97/appium-uiauto/merges","archive_url":"https://api.github.com/repos/syang97/appium-uiauto/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/syang97/appium-uiauto/downloads","issues_url":"https://api.github.com/repos/syang97/appium-uiauto/issues{/number}","pulls_url":"https://api.github.com/repos/syang97/appium-uiauto/pulls{/number}","milestones_url":"https://api.github.com/repos/syang97/appium-uiauto/milestones{/number}","notifications_url":"https://api.github.com/repos/syang97/appium-uiauto/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/syang97/appium-uiauto/labels{/name}","releases_url":"https://api.github.com/repos/syang97/appium-uiauto/releases{/id}","created_at":"2015-07-15T22:47:22Z","updated_at":"2015-07-15T22:47:22Z","pushed_at":"2015-07-17T22:18:05Z","git_url":"git://github.com/syang97/appium-uiauto.git","ssh_url":"git@github.com:syang97/appium-uiauto.git","clone_url":"https://github.com/syang97/appium-uiauto.git","svn_url":"https://github.com/syang97/appium-uiauto","homepage":"","size":14605,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"appium:2.0","ref":"2.0","sha":"57ddca8bb5dba7cc67413b7f0678e39b367914af","user":{"login":"appium","id":3221291,"avatar_url":"https://avatars.githubusercontent.com/u/3221291?v=3","gravatar_id":"","url":"https://api.github.com/users/appium","html_url":"https://github.com/appium","followers_url":"https://api.github.com/users/appium/followers","following_url":"https://api.github.com/users/appium/following{/other_user}","gists_url":"https://api.github.com/users/appium/gists{/gist_id}","starred_url":"https://api.github.com/users/appium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/appium/subscriptions","organizations_url":"https://api.github.com/users/appium/orgs","repos_url":"https://api.github.com/users/appium/repos","events_url":"https://api.github.com/users/appium/events{/privacy}","received_events_url":"https://api.github.com/users/appium/received_events","type":"Organization","site_admin":false},"repo":{"id":17281799,"name":"appium-uiauto","full_name":"appium/appium-uiauto","owner":{"login":"appium","id":3221291,"avatar_url":"https://avatars.githubusercontent.com/u/3221291?v=3","gravatar_id":"","url":"https://api.github.com/users/appium","html_url":"https://github.com/appium","followers_url":"https://api.github.com/users/appium/followers","following_url":"https://api.github.com/users/appium/following{/other_user}","gists_url":"https://api.github.com/users/appium/gists{/gist_id}","starred_url":"https://api.github.com/users/appium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/appium/subscriptions","organizations_url":"https://api.github.com/users/appium/orgs","repos_url":"https://api.github.com/users/appium/repos","events_url":"https://api.github.com/users/appium/events{/privacy}","received_events_url":"https://api.github.com/users/appium/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/appium/appium-uiauto","description":"Appium uiauto ios driver","fork":false,"url":"https://api.github.com/repos/appium/appium-uiauto","forks_url":"https://api.github.com/repos/appium/appium-uiauto/forks","keys_url":"https://api.github.com/repos/appium/appium-uiauto/keys{/key_id}","collaborators_url":"https://api.github.com/repos/appium/appium-uiauto/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/appium/appium-uiauto/teams","hooks_url":"https://api.github.com/repos/appium/appium-uiauto/hooks","issue_events_url":"https://api.github.com/repos/appium/appium-uiauto/issues/events{/number}","events_url":"https://api.github.com/repos/appium/appium-uiauto/events","assignees_url":"https://api.github.com/repos/appium/appium-uiauto/assignees{/user}","branches_url":"https://api.github.com/repos/appium/appium-uiauto/branches{/branch}","tags_url":"https://api.github.com/repos/appium/appium-uiauto/tags","blobs_url":"https://api.github.com/repos/appium/appium-uiauto/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/appium/appium-uiauto/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/appium/appium-uiauto/git/refs{/sha}","trees_url":"https://api.github.com/repos/appium/appium-uiauto/git/trees{/sha}","statuses_url":"https://api.github.com/repos/appium/appium-uiauto/statuses/{sha}","languages_url":"https://api.github.com/repos/appium/appium-uiauto/languages","stargazers_url":"https://api.github.com/repos/appium/appium-uiauto/stargazers","contributors_url":"https://api.github.com/repos/appium/appium-uiauto/contributors","subscribers_url":"https://api.github.com/repos/appium/appium-uiauto/subscribers","subscription_url":"https://api.github.com/repos/appium/appium-uiauto/subscription","commits_url":"https://api.github.com/repos/appium/appium-uiauto/commits{/sha}","git_commits_url":"https://api.github.com/repos/appium/appium-uiauto/git/commits{/sha}","comments_url":"https://api.github.com/repos/appium/appium-uiauto/comments{/number}","issue_comment_url":"https://api.github.com/repos/appium/appium-uiauto/issues/comments{/number}","contents_url":"https://api.github.com/repos/appium/appium-uiauto/contents/{+path}","compare_url":"https://api.github.com/repos/appium/appium-uiauto/compare/{base}...{head}","merges_url":"https://api.github.com/repos/appium/appium-uiauto/merges","archive_url":"https://api.github.com/repos/appium/appium-uiauto/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/appium/appium-uiauto/downloads","issues_url":"https://api.github.com/repos/appium/appium-uiauto/issues{/number}","pulls_url":"https://api.github.com/repos/appium/appium-uiauto/pulls{/number}","milestones_url":"https://api.github.com/repos/appium/appium-uiauto/milestones{/number}","notifications_url":"https://api.github.com/repos/appium/appium-uiauto/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/appium/appium-uiauto/labels{/name}","releases_url":"https://api.github.com/repos/appium/appium-uiauto/releases{/id}","created_at":"2014-02-28T09:41:28Z","updated_at":"2015-04-28T05:16:43Z","pushed_at":"2015-07-17T22:18:05Z","git_url":"git://github.com/appium/appium-uiauto.git","ssh_url":"git@github.com:appium/appium-uiauto.git","clone_url":"https://github.com/appium/appium-uiauto.git","svn_url":"https://github.com/appium/appium-uiauto","homepage":"","size":14605,"stargazers_count":9,"watchers_count":9,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":28,"mirror_url":null,"open_issues_count":15,"forks":28,"open_issues":15,"watchers":9,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/appium/appium-uiauto/pulls/76"},"html":{"href":"https://github.com/appium/appium-uiauto/pull/76"},"issue":{"href":"https://api.github.com/repos/appium/appium-uiauto/issues/76"},"comments":{"href":"https://api.github.com/repos/appium/appium-uiauto/issues/76/comments"},"review_comments":{"href":"https://api.github.com/repos/appium/appium-uiauto/pulls/76/comments"},"review_comment":{"href":"https://api.github.com/repos/appium/appium-uiauto/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/appium/appium-uiauto/pulls/76/commits"},"statuses":{"href":"https://api.github.com/repos/appium/appium-uiauto/statuses/99895e78d8a75af4784aa59234e26612f68017c7"}}}}