Skip to content

Commit a7f004b

Browse files
authored
feat: add sponsor link for vercel (conwnet#204)
1 parent c7bcb19 commit a7f004b

6 files changed

Lines changed: 58 additions & 2 deletions

File tree

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ javascript: window.location.href = window.location.href.replace(/github(1s)?.com
2929

3030
## Enabling Private Repositories
3131

32-
If you want to view non-public repositories, you need to add an OAuth token. The token is stored only in your browser, and only send to GitHub when fetching your repository's files. Click on the icon near the bottom of the left-hand row of icons, and the dialog box will prompt you for it, and even take you to your GitHub settings page to generate one, if needed.
32+
If you want to view non-public repositories, you need to add an OAuth token. The token is stored only in your browser, and only send to GitHub when fetching your repository's files. Click on the icon near the bottom of the left-hand row of icons, and the dialog box will prompt you for it, and even take you to your GitHub settings page to generate one, if needed.
3333

3434
![VS Code - GitHub1s](https://raw.githubusercontent.com/timbaileyjones/github1s/master/resources/images/auth-token.png)
3535

@@ -101,6 +101,16 @@ $ yarn build
101101

102102
- If you have a question, [discuss on gitter](https://gitter.im/conwnet/github1s)
103103

104+
## Project Sponsors
105+
106+
The continued development and maintenance of GitHub1s is made possible by these generous sponsors:
107+
108+
<br />
109+
<a href="https://vercel.com/?utm_source=vscode-github1s&utm_campaign=oss">
110+
<img src="https://raw.githubusercontent.com/conwnet/github1s/master/resources/images/vercel-logo.svg">
111+
</a>
112+
<br /><br />
113+
104114
## Third-party Related Projects
105115

106116
### Chrome Extensions

docs/guide.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ According to the above, obviously, the core concept of GitHub1s is to implement
1010

1111
_We may switch to the GitHub GraphQL API for more friendly user experience in the future, thanks to @xcv58 and @kanhegaonkarsaurabh. See details at [Issue 12](https://github.com/conwnet/github1s/issues/12)._
1212

13-
GitHub1s is a purely static web app (because it really doesn't need a backend service, does it?). So we just deploy it on [GitHub Pages](https://pages.github.com/) now (the `gh-pages` branch of this repository), and it is free. The service of GitHub1s could be reliable (GitHub is very reliable) because nobody needs to pay the web hosting bills.
13+
~~GitHub1s is a purely static web app (because it really doesn't need a backend service, does it?). So we just deploy it on [GitHub Pages](https://pages.github.com/) now (the `gh-pages` branch of this repository), and it is free. The service of GitHub1s could be reliable (GitHub is very reliable) because nobody needs to pay the web hosting bills.~~
14+
15+
We deploy GitHub1s on [Vercel](https://vercel.com/) now for minimize delays in loading and better developer experience. Thanks for the wonderful service provide by Vercel.
1416

1517
# Rate Limit
1618

extensions/github1s/src/extension.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import {
2020
GitHub1sTextSearchProvider,
2121
GitHub1sSubmoduleDecorationProvider,
2222
} from '@/providers';
23+
import { showSponsors } from '@/sponsors';
2324

2425
export function activate(context: vscode.ExtensionContext) {
2526
setExtensionContext(context);
@@ -84,4 +85,7 @@ export function activate(context: vscode.ExtensionContext) {
8485
context.subscriptions.push(
8586
vscode.commands.registerCommand('github1s.switch-tag', commandSwitchTag)
8687
);
88+
89+
// sponsors in Status Bar
90+
showSponsors();
8791
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/**
2+
* @file Show Sponsors In Status Bar
3+
* @author netcon
4+
*/
5+
6+
import * as vscode from 'vscode';
7+
8+
const sponsors = [
9+
{
10+
name: 'Vercel',
11+
link: 'https://vercel.com/?utm_source=vscode-github1s&utm_campaign=oss',
12+
description: 'Develop. Preview. Ship.',
13+
},
14+
];
15+
16+
export const showSponsors = () => {
17+
const titleItem = vscode.window.createStatusBarItem(
18+
vscode.StatusBarAlignment.Left,
19+
0
20+
);
21+
titleItem.text = ' $(heart) Sponsors:';
22+
titleItem.show();
23+
24+
sponsors.forEach((sponsor) => {
25+
const sponsorItem = vscode.window.createStatusBarItem(
26+
vscode.StatusBarAlignment.Left,
27+
0
28+
);
29+
sponsorItem.text = sponsor.name;
30+
sponsorItem.tooltip = sponsor.description;
31+
sponsorItem.command = {
32+
title: `Visit ${sponsor.name}`,
33+
command: 'vscode.open',
34+
arguments: [vscode.Uri.parse(sponsor.link)],
35+
};
36+
sponsorItem.show();
37+
});
38+
};

resources/images/vercel-logo.svg

Lines changed: 1 addition & 0 deletions
Loading

src/vs/workbench/contrib/url/browser/trustedDomains.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,7 @@ const github1sDefaultTrustedDomains = [
305305
'*.github.com',
306306
'*.microsoft.com',
307307
'*.github1s.com',
308+
'*.vercel.com',
308309
];
309310

310311
export function readStaticTrustedDomains(

0 commit comments

Comments
 (0)