{"action":"created","comment":{"url":"https://api.github.com/repos/telerik/mobile-cli-lib/pulls/comments/75467776","id":75467776,"diff_hunk":"@@ -0,0 +1,48 @@\n+import {PluginsSourceBase} from \"./plugins-source-base\";\n+import Future = require(\"fibers/future\");\n+\n+export class NpmPluginsSource extends PluginsSourceBase implements IPluginsSource {\n+\tconstructor(private $childProcess: IChildProcess,\n+\t\tprivate $hostInfo: IHostInfo,\n+\t\tprivate $npmService: INpmService,\n+\t\tprivate $progressIndicator: IProgressIndicator,\n+\t\tprivate $logger: ILogger,\n+\t\tprivate $errors: IErrors) {\n+\t\tsuper();\n+\t}\n+\n+\tpublic initialize(projectDir: string, keywords: string[]): IFuture<void> {\n+\t\treturn (() => {\n+\t\t\tsuper.initialize(projectDir, keywords).wait();\n+\n+\t\t\tlet searchFuture = this.$npmService.search(this._projectDir, keywords);\n+\n+\t\t\tthis.$logger.printInfoMessageOnSameLine(\"Searching for plugins in npm, please wait.\");\n+\n+\t\t\tthis.$progressIndicator.showProgressIndicator(searchFuture, 2000).wait();\n+\n+\t\t\tthis._plugins = searchFuture.isResolved() ? searchFuture.get() : searchFuture.wait();\n+\t\t}).future<void>()();\n+\t}\n+\n+\tpublic getPlugins(page: number, count: number): IFuture<IBasicPluginInformation[]> {\n+\t\treturn ((): IBasicPluginInformation[] => {\n+\t\t\tlet result: IBasicPluginInformation[] = [];\n+\t\t\tlet skip = page * count;\n+\n+\t\t\tresult = _.slice(this._plugins, skip, skip + count);","path":"services/plugins/npm-plugins-source.ts","position":33,"original_position":33,"commit_id":"54374ec7f6a1c002e4c9804502949a46f8d353fd","original_commit_id":"54374ec7f6a1c002e4c9804502949a46f8d353fd","user":{"login":"Mitko-Kerezov","id":6683316,"avatar_url":"https://avatars.githubusercontent.com/u/6683316?v=3","gravatar_id":"","url":"https://api.github.com/users/Mitko-Kerezov","html_url":"https://github.com/Mitko-Kerezov","followers_url":"https://api.github.com/users/Mitko-Kerezov/followers","following_url":"https://api.github.com/users/Mitko-Kerezov/following{/other_user}","gists_url":"https://api.github.com/users/Mitko-Kerezov/gists{/gist_id}","starred_url":"https://api.github.com/users/Mitko-Kerezov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mitko-Kerezov/subscriptions","organizations_url":"https://api.github.com/users/Mitko-Kerezov/orgs","repos_url":"https://api.github.com/users/Mitko-Kerezov/repos","events_url":"https://api.github.com/users/Mitko-Kerezov/events{/privacy}","received_events_url":"https://api.github.com/users/Mitko-Kerezov/received_events","type":"User","site_admin":false},"body":"you can just `return` here without the need of the additional `result` variable","created_at":"2016-08-19T11:40:45Z","updated_at":"2016-08-19T11:40:45Z","html_url":"https://github.com/telerik/mobile-cli-lib/pull/779#discussion_r75467776","pull_request_url":"https://api.github.com/repos/telerik/mobile-cli-lib/pulls/779","_links":{"self":{"href":"https://api.github.com/repos/telerik/mobile-cli-lib/pulls/comments/75467776"},"html":{"href":"https://github.com/telerik/mobile-cli-lib/pull/779#discussion_r75467776"},"pull_request":{"href":"https://api.github.com/repos/telerik/mobile-cli-lib/pulls/779"}}},"pull_request":{"url":"https://api.github.com/repos/telerik/mobile-cli-lib/pulls/779","id":81463062,"html_url":"https://github.com/telerik/mobile-cli-lib/pull/779","diff_url":"https://github.com/telerik/mobile-cli-lib/pull/779.diff","patch_url":"https://github.com/telerik/mobile-cli-lib/pull/779.patch","issue_url":"https://api.github.com/repos/telerik/mobile-cli-lib/issues/779","number":779,"state":"open","locked":false,"title":"Provide a way to find scoped dependencies","user":{"login":"TsvetanMilanov","id":10463529,"avatar_url":"https://avatars.githubusercontent.com/u/10463529?v=3","gravatar_id":"","url":"https://api.github.com/users/TsvetanMilanov","html_url":"https://github.com/TsvetanMilanov","followers_url":"https://api.github.com/users/TsvetanMilanov/followers","following_url":"https://api.github.com/users/TsvetanMilanov/following{/other_user}","gists_url":"https://api.github.com/users/TsvetanMilanov/gists{/gist_id}","starred_url":"https://api.github.com/users/TsvetanMilanov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TsvetanMilanov/subscriptions","organizations_url":"https://api.github.com/users/TsvetanMilanov/orgs","repos_url":"https://api.github.com/users/TsvetanMilanov/repos","events_url":"https://api.github.com/users/TsvetanMilanov/events{/privacy}","received_events_url":"https://api.github.com/users/TsvetanMilanov/received_events","type":"User","site_admin":false},"body":"We need to have a way to find scoped dependencies (e.g. @angular/core).\r\nCurrently the flow is:\r\nCall https://www.npmjs.com/search?q={query}\r\nIf that fails:\r\nIf the query starts with @, we know npm search will fail, so try to get the package details directly from http://registry.npmjs.org. It will only work if the name is exact match, but it's better than nothing.\r\nIf the query does not start with @, fall back to npm search.","created_at":"2016-08-16T12:30:51Z","updated_at":"2016-08-19T11:40:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2ed49f7d9e1ef9cab978b3df6b135ddf70824414","assignee":{"login":"TsvetanMilanov","id":10463529,"avatar_url":"https://avatars.githubusercontent.com/u/10463529?v=3","gravatar_id":"","url":"https://api.github.com/users/TsvetanMilanov","html_url":"https://github.com/TsvetanMilanov","followers_url":"https://api.github.com/users/TsvetanMilanov/followers","following_url":"https://api.github.com/users/TsvetanMilanov/following{/other_user}","gists_url":"https://api.github.com/users/TsvetanMilanov/gists{/gist_id}","starred_url":"https://api.github.com/users/TsvetanMilanov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TsvetanMilanov/subscriptions","organizations_url":"https://api.github.com/users/TsvetanMilanov/orgs","repos_url":"https://api.github.com/users/TsvetanMilanov/repos","events_url":"https://api.github.com/users/TsvetanMilanov/events{/privacy}","received_events_url":"https://api.github.com/users/TsvetanMilanov/received_events","type":"User","site_admin":false},"assignees":[{"login":"TsvetanMilanov","id":10463529,"avatar_url":"https://avatars.githubusercontent.com/u/10463529?v=3","gravatar_id":"","url":"https://api.github.com/users/TsvetanMilanov","html_url":"https://github.com/TsvetanMilanov","followers_url":"https://api.github.com/users/TsvetanMilanov/followers","following_url":"https://api.github.com/users/TsvetanMilanov/following{/other_user}","gists_url":"https://api.github.com/users/TsvetanMilanov/gists{/gist_id}","starred_url":"https://api.github.com/users/TsvetanMilanov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TsvetanMilanov/subscriptions","organizations_url":"https://api.github.com/users/TsvetanMilanov/orgs","repos_url":"https://api.github.com/users/TsvetanMilanov/repos","events_url":"https://api.github.com/users/TsvetanMilanov/events{/privacy}","received_events_url":"https://api.github.com/users/TsvetanMilanov/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/telerik/mobile-cli-lib/pulls/779/commits","review_comments_url":"https://api.github.com/repos/telerik/mobile-cli-lib/pulls/779/comments","review_comment_url":"https://api.github.com/repos/telerik/mobile-cli-lib/pulls/comments{/number}","comments_url":"https://api.github.com/repos/telerik/mobile-cli-lib/issues/779/comments","statuses_url":"https://api.github.com/repos/telerik/mobile-cli-lib/statuses/54374ec7f6a1c002e4c9804502949a46f8d353fd","head":{"label":"telerik:milanov/find-scoped-dependencies","ref":"milanov/find-scoped-dependencies","sha":"54374ec7f6a1c002e4c9804502949a46f8d353fd","user":{"login":"telerik","id":568561,"avatar_url":"https://avatars.githubusercontent.com/u/568561?v=3","gravatar_id":"","url":"https://api.github.com/users/telerik","html_url":"https://github.com/telerik","followers_url":"https://api.github.com/users/telerik/followers","following_url":"https://api.github.com/users/telerik/following{/other_user}","gists_url":"https://api.github.com/users/telerik/gists{/gist_id}","starred_url":"https://api.github.com/users/telerik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/telerik/subscriptions","organizations_url":"https://api.github.com/users/telerik/orgs","repos_url":"https://api.github.com/users/telerik/repos","events_url":"https://api.github.com/users/telerik/events{/privacy}","received_events_url":"https://api.github.com/users/telerik/received_events","type":"Organization","site_admin":false},"repo":{"id":21348075,"name":"mobile-cli-lib","full_name":"telerik/mobile-cli-lib","owner":{"login":"telerik","id":568561,"avatar_url":"https://avatars.githubusercontent.com/u/568561?v=3","gravatar_id":"","url":"https://api.github.com/users/telerik","html_url":"https://github.com/telerik","followers_url":"https://api.github.com/users/telerik/followers","following_url":"https://api.github.com/users/telerik/following{/other_user}","gists_url":"https://api.github.com/users/telerik/gists{/gist_id}","starred_url":"https://api.github.com/users/telerik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/telerik/subscriptions","organizations_url":"https://api.github.com/users/telerik/orgs","repos_url":"https://api.github.com/users/telerik/repos","events_url":"https://api.github.com/users/telerik/events{/privacy}","received_events_url":"https://api.github.com/users/telerik/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/telerik/mobile-cli-lib","description":"Contains common infrastructure for CLIs - mainly AppBuilder, NativeScript, DDB and Proton.","fork":false,"url":"https://api.github.com/repos/telerik/mobile-cli-lib","forks_url":"https://api.github.com/repos/telerik/mobile-cli-lib/forks","keys_url":"https://api.github.com/repos/telerik/mobile-cli-lib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/telerik/mobile-cli-lib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/telerik/mobile-cli-lib/teams","hooks_url":"https://api.github.com/repos/telerik/mobile-cli-lib/hooks","issue_events_url":"https://api.github.com/repos/telerik/mobile-cli-lib/issues/events{/number}","events_url":"https://api.github.com/repos/telerik/mobile-cli-lib/events","assignees_url":"https://api.github.com/repos/telerik/mobile-cli-lib/assignees{/user}","branches_url":"https://api.github.com/repos/telerik/mobile-cli-lib/branches{/branch}","tags_url":"https://api.github.com/repos/telerik/mobile-cli-lib/tags","blobs_url":"https://api.github.com/repos/telerik/mobile-cli-lib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/telerik/mobile-cli-lib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/telerik/mobile-cli-lib/git/refs{/sha}","trees_url":"https://api.github.com/repos/telerik/mobile-cli-lib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/telerik/mobile-cli-lib/statuses/{sha}","languages_url":"https://api.github.com/repos/telerik/mobile-cli-lib/languages","stargazers_url":"https://api.github.com/repos/telerik/mobile-cli-lib/stargazers","contributors_url":"https://api.github.com/repos/telerik/mobile-cli-lib/contributors","subscribers_url":"https://api.github.com/repos/telerik/mobile-cli-lib/subscribers","subscription_url":"https://api.github.com/repos/telerik/mobile-cli-lib/subscription","commits_url":"https://api.github.com/repos/telerik/mobile-cli-lib/commits{/sha}","git_commits_url":"https://api.github.com/repos/telerik/mobile-cli-lib/git/commits{/sha}","comments_url":"https://api.github.com/repos/telerik/mobile-cli-lib/comments{/number}","issue_comment_url":"https://api.github.com/repos/telerik/mobile-cli-lib/issues/comments{/number}","contents_url":"https://api.github.com/repos/telerik/mobile-cli-lib/contents/{+path}","compare_url":"https://api.github.com/repos/telerik/mobile-cli-lib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/telerik/mobile-cli-lib/merges","archive_url":"https://api.github.com/repos/telerik/mobile-cli-lib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/telerik/mobile-cli-lib/downloads","issues_url":"https://api.github.com/repos/telerik/mobile-cli-lib/issues{/number}","pulls_url":"https://api.github.com/repos/telerik/mobile-cli-lib/pulls{/number}","milestones_url":"https://api.github.com/repos/telerik/mobile-cli-lib/milestones{/number}","notifications_url":"https://api.github.com/repos/telerik/mobile-cli-lib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/telerik/mobile-cli-lib/labels{/name}","releases_url":"https://api.github.com/repos/telerik/mobile-cli-lib/releases{/id}","deployments_url":"https://api.github.com/repos/telerik/mobile-cli-lib/deployments","created_at":"2014-06-30T10:54:52Z","updated_at":"2016-06-14T23:16:00Z","pushed_at":"2016-08-19T10:47:55Z","git_url":"git://github.com/telerik/mobile-cli-lib.git","ssh_url":"git@github.com:telerik/mobile-cli-lib.git","clone_url":"https://github.com/telerik/mobile-cli-lib.git","svn_url":"https://github.com/telerik/mobile-cli-lib","homepage":"","size":12902,"stargazers_count":9,"watchers_count":9,"language":"TypeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":6,"forks":5,"open_issues":6,"watchers":9,"default_branch":"master"}},"base":{"label":"telerik:master","ref":"master","sha":"f5936ed6d222167dc51d052cf1c998e654559bd6","user":{"login":"telerik","id":568561,"avatar_url":"https://avatars.githubusercontent.com/u/568561?v=3","gravatar_id":"","url":"https://api.github.com/users/telerik","html_url":"https://github.com/telerik","followers_url":"https://api.github.com/users/telerik/followers","following_url":"https://api.github.com/users/telerik/following{/other_user}","gists_url":"https://api.github.com/users/telerik/gists{/gist_id}","starred_url":"https://api.github.com/users/telerik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/telerik/subscriptions","organizations_url":"https://api.github.com/users/telerik/orgs","repos_url":"https://api.github.com/users/telerik/repos","events_url":"https://api.github.com/users/telerik/events{/privacy}","received_events_url":"https://api.github.com/users/telerik/received_events","type":"Organization","site_admin":false},"repo":{"id":21348075,"name":"mobile-cli-lib","full_name":"telerik/mobile-cli-lib","owner":{"login":"telerik","id":568561,"avatar_url":"https://avatars.githubusercontent.com/u/568561?v=3","gravatar_id":"","url":"https://api.github.com/users/telerik","html_url":"https://github.com/telerik","followers_url":"https://api.github.com/users/telerik/followers","following_url":"https://api.github.com/users/telerik/following{/other_user}","gists_url":"https://api.github.com/users/telerik/gists{/gist_id}","starred_url":"https://api.github.com/users/telerik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/telerik/subscriptions","organizations_url":"https://api.github.com/users/telerik/orgs","repos_url":"https://api.github.com/users/telerik/repos","events_url":"https://api.github.com/users/telerik/events{/privacy}","received_events_url":"https://api.github.com/users/telerik/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/telerik/mobile-cli-lib","description":"Contains common infrastructure for CLIs - mainly AppBuilder, NativeScript, DDB and Proton.","fork":false,"url":"https://api.github.com/repos/telerik/mobile-cli-lib","forks_url":"https://api.github.com/repos/telerik/mobile-cli-lib/forks","keys_url":"https://api.github.com/repos/telerik/mobile-cli-lib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/telerik/mobile-cli-lib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/telerik/mobile-cli-lib/teams","hooks_url":"https://api.github.com/repos/telerik/mobile-cli-lib/hooks","issue_events_url":"https://api.github.com/repos/telerik/mobile-cli-lib/issues/events{/number}","events_url":"https://api.github.com/repos/telerik/mobile-cli-lib/events","assignees_url":"https://api.github.com/repos/telerik/mobile-cli-lib/assignees{/user}","branches_url":"https://api.github.com/repos/telerik/mobile-cli-lib/branches{/branch}","tags_url":"https://api.github.com/repos/telerik/mobile-cli-lib/tags","blobs_url":"https://api.github.com/repos/telerik/mobile-cli-lib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/telerik/mobile-cli-lib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/telerik/mobile-cli-lib/git/refs{/sha}","trees_url":"https://api.github.com/repos/telerik/mobile-cli-lib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/telerik/mobile-cli-lib/statuses/{sha}","languages_url":"https://api.github.com/repos/telerik/mobile-cli-lib/languages","stargazers_url":"https://api.github.com/repos/telerik/mobile-cli-lib/stargazers","contributors_url":"https://api.github.com/repos/telerik/mobile-cli-lib/contributors","subscribers_url":"https://api.github.com/repos/telerik/mobile-cli-lib/subscribers","subscription_url":"https://api.github.com/repos/telerik/mobile-cli-lib/subscription","commits_url":"https://api.github.com/repos/telerik/mobile-cli-lib/commits{/sha}","git_commits_url":"https://api.github.com/repos/telerik/mobile-cli-lib/git/commits{/sha}","comments_url":"https://api.github.com/repos/telerik/mobile-cli-lib/comments{/number}","issue_comment_url":"https://api.github.com/repos/telerik/mobile-cli-lib/issues/comments{/number}","contents_url":"https://api.github.com/repos/telerik/mobile-cli-lib/contents/{+path}","compare_url":"https://api.github.com/repos/telerik/mobile-cli-lib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/telerik/mobile-cli-lib/merges","archive_url":"https://api.github.com/repos/telerik/mobile-cli-lib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/telerik/mobile-cli-lib/downloads","issues_url":"https://api.github.com/repos/telerik/mobile-cli-lib/issues{/number}","pulls_url":"https://api.github.com/repos/telerik/mobile-cli-lib/pulls{/number}","milestones_url":"https://api.github.com/repos/telerik/mobile-cli-lib/milestones{/number}","notifications_url":"https://api.github.com/repos/telerik/mobile-cli-lib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/telerik/mobile-cli-lib/labels{/name}","releases_url":"https://api.github.com/repos/telerik/mobile-cli-lib/releases{/id}","deployments_url":"https://api.github.com/repos/telerik/mobile-cli-lib/deployments","created_at":"2014-06-30T10:54:52Z","updated_at":"2016-06-14T23:16:00Z","pushed_at":"2016-08-19T10:47:55Z","git_url":"git://github.com/telerik/mobile-cli-lib.git","ssh_url":"git@github.com:telerik/mobile-cli-lib.git","clone_url":"https://github.com/telerik/mobile-cli-lib.git","svn_url":"https://github.com/telerik/mobile-cli-lib","homepage":"","size":12902,"stargazers_count":9,"watchers_count":9,"language":"TypeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":6,"forks":5,"open_issues":6,"watchers":9,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/telerik/mobile-cli-lib/pulls/779"},"html":{"href":"https://github.com/telerik/mobile-cli-lib/pull/779"},"issue":{"href":"https://api.github.com/repos/telerik/mobile-cli-lib/issues/779"},"comments":{"href":"https://api.github.com/repos/telerik/mobile-cli-lib/issues/779/comments"},"review_comments":{"href":"https://api.github.com/repos/telerik/mobile-cli-lib/pulls/779/comments"},"review_comment":{"href":"https://api.github.com/repos/telerik/mobile-cli-lib/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/telerik/mobile-cli-lib/pulls/779/commits"},"statuses":{"href":"https://api.github.com/repos/telerik/mobile-cli-lib/statuses/54374ec7f6a1c002e4c9804502949a46f8d353fd"}}}}
{"actor":{"display_login":"Mitko-Kerezov"}}