Mailspring/internal_packages/github-contact-card
Max Stoiber fe453b02da Fix Github Sidebar Plugin (#2003)
Hopefully fixes #1991

I don't have N1 setup locally, so this is a blind shot–would appreciate somebody who has it set up to pull this and verify this fixes the issue, but as far as I can tell it should.

The gist is:

> Looking at the code, what you do is use the `search/users` endpoint to find users by email and taking the repos from there. You then load the repositories of the username, but we can't sort those by most-starred: "sort string Can be one of `created`, `updated`, `pushed`, `full_name`. Default: `full_name`" *([src](https://developer.github.com/v3/repos/#list-user-repositories))*
> What we could instead do is use the search API, which **allows us to search for repositories by a specific user and sort by most starred**. This is a tiny bit hacky, but works perfectly fine. E.g. this is the URL for my most starred repos: `https://api.github.com/search/repositories?q=user:mxstbr&sort=stars&order=desc`
2016-04-19 16:13:30 -07:00
..
assets fix(examples): examples => packages, move away from installing them 2016-01-07 14:56:34 -08:00
docs fix(examples): examples => packages, move away from installing them 2016-01-07 14:56:34 -08:00
lib Fix Github Sidebar Plugin (#2003) 2016-04-19 16:13:30 -07:00
stylesheets fix(sidebar): minor sidebar style and padding tweaks 2016-03-10 15:06:59 -05:00
icon.png 💄(icon): A delightful seafoam green icon 2016-02-23 10:35:08 -08:00
package.json feat(new-plugins): add open tracking and link tracking plugins 2016-02-19 12:42:56 -08:00
README.md fix(examples): examples => packages, move away from installing them 2016-01-07 14:56:34 -08:00
screenshot.png fix(examples): examples => packages, move away from installing them 2016-01-07 14:56:34 -08:00

Github Contact Card Section

Extends the contact card in the sidebar to show public repos of the people you email. Uses GitHub's public API to look up a GitHub user based on their email address, and then displays public repos and their stars.

This example is a good starting point for plugins that want to display data from external sources in the sidebar.

Install this plugin

  1. Download and run N1

  2. From the menu, select Developer > Install a Plugin Manually... The dialog will default to this examples directory. Just choose the package to install it!

    When you install packages, they're moved to ~/.nylas/packages, and N1 runs apm install on the command line to fetch dependencies listed in the package's package.json