{"action":"created","comment":{"url":"https://api.github.com/repos/juttle/juttle/pulls/comments/56505840","id":56505840,"diff_hunk":"@@ -39,22 +39,58 @@ class FileResolver {\n         }\n     }\n \n-    _search(module_path, module_name, importer_path) {\n+    _canonicalize(filename) {\n+        if (path.extname(filename) !== '.juttle') {\n+            filename = filename + '.juttle';\n+        }\n+\n+        return filename;\n+    }\n+\n+    _search_local_import(module_path, module_name, importer_path) {\n         var self = this;\n \n-        logger.debug(`Resolving module_path=${module_path} module_name=${module_name} importer_path=${importer_path}`);\n+        logger.debug(`searching local module_path=${module_path} module_name=${module_name} importer_path=${importer_path}`);\n+\n+        // Resolve module_path relative to importer_path or the\n+        // current working directory.\n+        let dir = process.cwd();\n+        if (importer_path !== undefined &&\n+            path.isAbsolute(importer_path)) {\n+            dir = path.dirname(importer_path);\n+        }","path":"lib/module-resolvers/file-resolver.js","position":47,"original_position":25,"commit_id":"1605434b770a0e98ffd48732cd3c5e02ed4d0d8a","original_commit_id":"6cbb52690d5dec2d3081834703bba3489182dfa0","user":{"login":"dmajda","id":18821,"avatar_url":"https://avatars.githubusercontent.com/u/18821?v=3","gravatar_id":"","url":"https://api.github.com/users/dmajda","html_url":"https://github.com/dmajda","followers_url":"https://api.github.com/users/dmajda/followers","following_url":"https://api.github.com/users/dmajda/following{/other_user}","gists_url":"https://api.github.com/users/dmajda/gists{/gist_id}","starred_url":"https://api.github.com/users/dmajda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmajda/subscriptions","organizations_url":"https://api.github.com/users/dmajda/orgs","repos_url":"https://api.github.com/users/dmajda/repos","events_url":"https://api.github.com/users/dmajda/events{/privacy}","received_events_url":"https://api.github.com/users/dmajda/received_events","type":"User","site_admin":false},"body":"Would be good to add a comment on when the importer path is non-absolute (basically your [answer here](https://github.com/juttle/juttle/pull/591#discussion_r56397960)).","created_at":"2016-03-17T13:49:22Z","updated_at":"2016-03-17T13:49:22Z","html_url":"https://github.com/juttle/juttle/pull/591#discussion_r56505840","pull_request_url":"https://api.github.com/repos/juttle/juttle/pulls/591","_links":{"self":{"href":"https://api.github.com/repos/juttle/juttle/pulls/comments/56505840"},"html":{"href":"https://github.com/juttle/juttle/pull/591#discussion_r56505840"},"pull_request":{"href":"https://api.github.com/repos/juttle/juttle/pulls/591"}}},"pull_request":{"url":"https://api.github.com/repos/juttle/juttle/pulls/591","id":62783748,"html_url":"https://github.com/juttle/juttle/pull/591","diff_url":"https://github.com/juttle/juttle/pull/591.diff","patch_url":"https://github.com/juttle/juttle/pull/591.patch","issue_url":"https://api.github.com/repos/juttle/juttle/issues/591","number":591,"state":"open","locked":false,"title":"Add support for importing using relative paths","user":{"login":"mstemm","id":13422831,"avatar_url":"https://avatars.githubusercontent.com/u/13422831?v=3","gravatar_id":"","url":"https://api.github.com/users/mstemm","html_url":"https://github.com/mstemm","followers_url":"https://api.github.com/users/mstemm/followers","following_url":"https://api.github.com/users/mstemm/following{/other_user}","gists_url":"https://api.github.com/users/mstemm/gists{/gist_id}","starred_url":"https://api.github.com/users/mstemm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mstemm/subscriptions","organizations_url":"https://api.github.com/users/mstemm/orgs","repos_url":"https://api.github.com/users/mstemm/repos","events_url":"https://api.github.com/users/mstemm/events{/privacy}","received_events_url":"https://api.github.com/users/mstemm/received_events","type":"User","site_admin":false},"body":"See commits for specific changes.\r\n\r\nI'd like feedback on the technique of modifying the ast to handle the case of potentially duplicate import statements with the same relative pathname. Not sure whether this is bad practice or not.\r\n\r\nOne open question--do we want imports of standard library modules to have a 'stdlib' prefix? Currently, the stdlib directory is in the set of search paths so one imports those files with a 'import \"random\" as random\" rather than 'import \"stdlib/random\". I think I'd have to move the lib/stdlib directory somewhere as a part of this change--we don't want lib/ as a search path.\r\n\r\n@demmer @dmajda \r\n\r\nThis fixes #513.\r\n","created_at":"2016-03-14T17:13:57Z","updated_at":"2016-03-17T13:49:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8a9ec2a874a30b0b318a680b431430db33203c96","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/juttle/juttle/pulls/591/commits","review_comments_url":"https://api.github.com/repos/juttle/juttle/pulls/591/comments","review_comment_url":"https://api.github.com/repos/juttle/juttle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/juttle/juttle/issues/591/comments","statuses_url":"https://api.github.com/repos/juttle/juttle/statuses/1605434b770a0e98ffd48732cd3c5e02ed4d0d8a","head":{"label":"juttle:system-user-module-imports","ref":"system-user-module-imports","sha":"1605434b770a0e98ffd48732cd3c5e02ed4d0d8a","user":{"login":"juttle","id":8988633,"avatar_url":"https://avatars.githubusercontent.com/u/8988633?v=3","gravatar_id":"","url":"https://api.github.com/users/juttle","html_url":"https://github.com/juttle","followers_url":"https://api.github.com/users/juttle/followers","following_url":"https://api.github.com/users/juttle/following{/other_user}","gists_url":"https://api.github.com/users/juttle/gists{/gist_id}","starred_url":"https://api.github.com/users/juttle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juttle/subscriptions","organizations_url":"https://api.github.com/users/juttle/orgs","repos_url":"https://api.github.com/users/juttle/repos","events_url":"https://api.github.com/users/juttle/events{/privacy}","received_events_url":"https://api.github.com/users/juttle/received_events","type":"Organization","site_admin":false},"repo":{"id":48260003,"name":"juttle","full_name":"juttle/juttle","owner":{"login":"juttle","id":8988633,"avatar_url":"https://avatars.githubusercontent.com/u/8988633?v=3","gravatar_id":"","url":"https://api.github.com/users/juttle","html_url":"https://github.com/juttle","followers_url":"https://api.github.com/users/juttle/followers","following_url":"https://api.github.com/users/juttle/following{/other_user}","gists_url":"https://api.github.com/users/juttle/gists{/gist_id}","starred_url":"https://api.github.com/users/juttle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juttle/subscriptions","organizations_url":"https://api.github.com/users/juttle/orgs","repos_url":"https://api.github.com/users/juttle/repos","events_url":"https://api.github.com/users/juttle/events{/privacy}","received_events_url":"https://api.github.com/users/juttle/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/juttle/juttle","description":"Juttle dataflow programming language","fork":false,"url":"https://api.github.com/repos/juttle/juttle","forks_url":"https://api.github.com/repos/juttle/juttle/forks","keys_url":"https://api.github.com/repos/juttle/juttle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/juttle/juttle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/juttle/juttle/teams","hooks_url":"https://api.github.com/repos/juttle/juttle/hooks","issue_events_url":"https://api.github.com/repos/juttle/juttle/issues/events{/number}","events_url":"https://api.github.com/repos/juttle/juttle/events","assignees_url":"https://api.github.com/repos/juttle/juttle/assignees{/user}","branches_url":"https://api.github.com/repos/juttle/juttle/branches{/branch}","tags_url":"https://api.github.com/repos/juttle/juttle/tags","blobs_url":"https://api.github.com/repos/juttle/juttle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/juttle/juttle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/juttle/juttle/git/refs{/sha}","trees_url":"https://api.github.com/repos/juttle/juttle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/juttle/juttle/statuses/{sha}","languages_url":"https://api.github.com/repos/juttle/juttle/languages","stargazers_url":"https://api.github.com/repos/juttle/juttle/stargazers","contributors_url":"https://api.github.com/repos/juttle/juttle/contributors","subscribers_url":"https://api.github.com/repos/juttle/juttle/subscribers","subscription_url":"https://api.github.com/repos/juttle/juttle/subscription","commits_url":"https://api.github.com/repos/juttle/juttle/commits{/sha}","git_commits_url":"https://api.github.com/repos/juttle/juttle/git/commits{/sha}","comments_url":"https://api.github.com/repos/juttle/juttle/comments{/number}","issue_comment_url":"https://api.github.com/repos/juttle/juttle/issues/comments{/number}","contents_url":"https://api.github.com/repos/juttle/juttle/contents/{+path}","compare_url":"https://api.github.com/repos/juttle/juttle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/juttle/juttle/merges","archive_url":"https://api.github.com/repos/juttle/juttle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/juttle/juttle/downloads","issues_url":"https://api.github.com/repos/juttle/juttle/issues{/number}","pulls_url":"https://api.github.com/repos/juttle/juttle/pulls{/number}","milestones_url":"https://api.github.com/repos/juttle/juttle/milestones{/number}","notifications_url":"https://api.github.com/repos/juttle/juttle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/juttle/juttle/labels{/name}","releases_url":"https://api.github.com/repos/juttle/juttle/releases{/id}","deployments_url":"https://api.github.com/repos/juttle/juttle/deployments","created_at":"2015-12-18T22:50:40Z","updated_at":"2016-03-17T09:35:47Z","pushed_at":"2016-03-17T10:52:12Z","git_url":"git://github.com/juttle/juttle.git","ssh_url":"git@github.com:juttle/juttle.git","clone_url":"https://github.com/juttle/juttle.git","svn_url":"https://github.com/juttle/juttle","homepage":"","size":5582,"stargazers_count":136,"watchers_count":136,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":9,"mirror_url":null,"open_issues_count":128,"forks":9,"open_issues":128,"watchers":136,"default_branch":"master"}},"base":{"label":"juttle:master","ref":"master","sha":"75a5afecfb6ddb2a4d203f4edc5f3f6b3ea73135","user":{"login":"juttle","id":8988633,"avatar_url":"https://avatars.githubusercontent.com/u/8988633?v=3","gravatar_id":"","url":"https://api.github.com/users/juttle","html_url":"https://github.com/juttle","followers_url":"https://api.github.com/users/juttle/followers","following_url":"https://api.github.com/users/juttle/following{/other_user}","gists_url":"https://api.github.com/users/juttle/gists{/gist_id}","starred_url":"https://api.github.com/users/juttle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juttle/subscriptions","organizations_url":"https://api.github.com/users/juttle/orgs","repos_url":"https://api.github.com/users/juttle/repos","events_url":"https://api.github.com/users/juttle/events{/privacy}","received_events_url":"https://api.github.com/users/juttle/received_events","type":"Organization","site_admin":false},"repo":{"id":48260003,"name":"juttle","full_name":"juttle/juttle","owner":{"login":"juttle","id":8988633,"avatar_url":"https://avatars.githubusercontent.com/u/8988633?v=3","gravatar_id":"","url":"https://api.github.com/users/juttle","html_url":"https://github.com/juttle","followers_url":"https://api.github.com/users/juttle/followers","following_url":"https://api.github.com/users/juttle/following{/other_user}","gists_url":"https://api.github.com/users/juttle/gists{/gist_id}","starred_url":"https://api.github.com/users/juttle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juttle/subscriptions","organizations_url":"https://api.github.com/users/juttle/orgs","repos_url":"https://api.github.com/users/juttle/repos","events_url":"https://api.github.com/users/juttle/events{/privacy}","received_events_url":"https://api.github.com/users/juttle/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/juttle/juttle","description":"Juttle dataflow programming language","fork":false,"url":"https://api.github.com/repos/juttle/juttle","forks_url":"https://api.github.com/repos/juttle/juttle/forks","keys_url":"https://api.github.com/repos/juttle/juttle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/juttle/juttle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/juttle/juttle/teams","hooks_url":"https://api.github.com/repos/juttle/juttle/hooks","issue_events_url":"https://api.github.com/repos/juttle/juttle/issues/events{/number}","events_url":"https://api.github.com/repos/juttle/juttle/events","assignees_url":"https://api.github.com/repos/juttle/juttle/assignees{/user}","branches_url":"https://api.github.com/repos/juttle/juttle/branches{/branch}","tags_url":"https://api.github.com/repos/juttle/juttle/tags","blobs_url":"https://api.github.com/repos/juttle/juttle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/juttle/juttle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/juttle/juttle/git/refs{/sha}","trees_url":"https://api.github.com/repos/juttle/juttle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/juttle/juttle/statuses/{sha}","languages_url":"https://api.github.com/repos/juttle/juttle/languages","stargazers_url":"https://api.github.com/repos/juttle/juttle/stargazers","contributors_url":"https://api.github.com/repos/juttle/juttle/contributors","subscribers_url":"https://api.github.com/repos/juttle/juttle/subscribers","subscription_url":"https://api.github.com/repos/juttle/juttle/subscription","commits_url":"https://api.github.com/repos/juttle/juttle/commits{/sha}","git_commits_url":"https://api.github.com/repos/juttle/juttle/git/commits{/sha}","comments_url":"https://api.github.com/repos/juttle/juttle/comments{/number}","issue_comment_url":"https://api.github.com/repos/juttle/juttle/issues/comments{/number}","contents_url":"https://api.github.com/repos/juttle/juttle/contents/{+path}","compare_url":"https://api.github.com/repos/juttle/juttle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/juttle/juttle/merges","archive_url":"https://api.github.com/repos/juttle/juttle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/juttle/juttle/downloads","issues_url":"https://api.github.com/repos/juttle/juttle/issues{/number}","pulls_url":"https://api.github.com/repos/juttle/juttle/pulls{/number}","milestones_url":"https://api.github.com/repos/juttle/juttle/milestones{/number}","notifications_url":"https://api.github.com/repos/juttle/juttle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/juttle/juttle/labels{/name}","releases_url":"https://api.github.com/repos/juttle/juttle/releases{/id}","deployments_url":"https://api.github.com/repos/juttle/juttle/deployments","created_at":"2015-12-18T22:50:40Z","updated_at":"2016-03-17T09:35:47Z","pushed_at":"2016-03-17T10:52:12Z","git_url":"git://github.com/juttle/juttle.git","ssh_url":"git@github.com:juttle/juttle.git","clone_url":"https://github.com/juttle/juttle.git","svn_url":"https://github.com/juttle/juttle","homepage":"","size":5582,"stargazers_count":136,"watchers_count":136,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":9,"mirror_url":null,"open_issues_count":128,"forks":9,"open_issues":128,"watchers":136,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/juttle/juttle/pulls/591"},"html":{"href":"https://github.com/juttle/juttle/pull/591"},"issue":{"href":"https://api.github.com/repos/juttle/juttle/issues/591"},"comments":{"href":"https://api.github.com/repos/juttle/juttle/issues/591/comments"},"review_comments":{"href":"https://api.github.com/repos/juttle/juttle/pulls/591/comments"},"review_comment":{"href":"https://api.github.com/repos/juttle/juttle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/juttle/juttle/pulls/591/commits"},"statuses":{"href":"https://api.github.com/repos/juttle/juttle/statuses/1605434b770a0e98ffd48732cd3c5e02ed4d0d8a"}}}}