Skip to content

Commit

Permalink
release 0.0.6 (#222)
Browse files Browse the repository at this point in the history
* Allow users to edit files with Gitpod. (#214)

* Allow users to edit files with Gitpod.

* Provide a command to edit files in Gitpod.

* Provide a Gitpod link in the status bar so it is visible if the notification is closed.

* Document how to invoke Gitpod if the notification is no longer visible.

* Add Gitpod screenshots.

* Fix the image paths.

* chore(deps): bump elliptic from 6.5.3 to 6.5.4 in /extensions/github1s (#219)

Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.3 to 6.5.4.
- [Release notes](https://github.com/indutny/elliptic/releases)
- [Commits](indutny/elliptic@v6.5.3...v6.5.4)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Use SVG logo (#220)

* Add CI support for macOS (#217)

* ci: add macos for github workflows

* ci: add timeout when installing

* ci: reduce timeout value when installing

* ci: config the github token during the install

Co-authored-by: Mike Nikles <mikenikles@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: zvizvi <5633910@gmail.com>
Co-authored-by: Lawrence <lonor@live.com>
  • Loading branch information
5 people authored Mar 12, 2021
1 parent b62e8cd commit f98aa96
Show file tree
Hide file tree
Showing 12 changed files with 112 additions and 31 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ on:

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [14.x, 15.x]
os: [ubuntu-latest, macos-latest]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
Expand All @@ -34,7 +35,9 @@ jobs:
restore-keys: |
${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}-${{ matrix.node-version }}
- run: yarn --frozen-lockfile
- run: yarn --frozen-lockfile --network-timeout 500000
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: yarn eslint
- run: yarn build
- uses: microsoft/playwright-github-action@v1
Expand Down
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![GitHub1s](https://raw.githubusercontent.com/conwnet/github1s/master/resources/images/logo.png)
![GitHub1s](https://raw.githubusercontent.com/conwnet/github1s/master/resources/images/logo.svg)

# github1s

Expand All @@ -22,6 +22,16 @@ Or save the following code snippet as a bookmarklet, you can use it to quickly s
javascript: window.location.href = window.location.href.replace(/github(1s)?.com/, function(match, p1) { return p1 ? 'github.com' : 'github1s.com' })
```

### Develop in the cloud

To edit files, run Docker containers, create pull requests and more, click the "[Gitpod](https://www.gitpod.io) ready-to-code" button at the bottom of your browser once you open your project with github1s.

![Gitpod Notification](https://raw.githubusercontent.com/conwnet/github1s/master/resources/images/gitpod-notification.png)

_Note_: If you already closed the notification, you can find a "Develop your project on Gitpod" button in the status bar. You can also open the Command Palette (default shortcut `Ctrl+Shift+P`) and choose `GitHub1s: Edit files in Gitpod`.

![Gitpod Status Bar](https://raw.githubusercontent.com/conwnet/github1s/master/resources/images/gitpod-statusbar.png)

## Documentation

- [How it works](https://github.com/conwnet/github1s/blob/master/docs/guide.md)
Expand Down
5 changes: 5 additions & 0 deletions extensions/github1s/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@
"command": "github1s.switch-tag",
"title": "Switch to Another Tag",
"category": "GitHub1s"
},
{
"command": "github1s.open-gitpod",
"title": "Edit files in Gitpod",
"category": "GitHub1s"
}
]
},
Expand Down
12 changes: 12 additions & 0 deletions extensions/github1s/src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,15 @@ export const commandSwitchTag = () => {
})
);
};

export const commandOpenGitpod = () => {
return getCurrentAuthority().then((currentAuthority) => {
const [currentOwner, currentRepo] = currentAuthority.split('+');
vscode.commands.executeCommand(
'vscode.open',
vscode.Uri.parse(
`https://gitpod.io/#https://github.com/${currentOwner}/${currentRepo}`
)
);
});
};
8 changes: 7 additions & 1 deletion extensions/github1s/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
commandSwitchBranch,
commandSwitchTag,
commandGetCurrentAuthority,
commandOpenGitpod,
} from '@/commands';
import {
GitHub1sFileSystemProvider,
Expand All @@ -21,8 +22,9 @@ import {
GitHub1sSubmoduleDecorationProvider,
} from '@/providers';
import { showSponsors } from '@/sponsors';
import { showGitpod } from '@/gitpod';

export function activate(context: vscode.ExtensionContext) {
export async function activate(context: vscode.ExtensionContext) {
setExtensionContext(context);

// providers
Expand Down Expand Up @@ -85,7 +87,11 @@ export function activate(context: vscode.ExtensionContext) {
context.subscriptions.push(
vscode.commands.registerCommand('github1s.switch-tag', commandSwitchTag)
);
context.subscriptions.push(
vscode.commands.registerCommand('github1s.open-gitpod', commandOpenGitpod)
);

// sponsors in Status Bar
showSponsors();
await showGitpod();
}
32 changes: 32 additions & 0 deletions extensions/github1s/src/gitpod.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/**
* @file Show Gitpod In Status Bar
* @author mikenikles
*/

import * as vscode from 'vscode';
import { getCurrentAuthority } from '@/helpers/git-ref';

const getGitpodRepoUri = () =>
getCurrentAuthority().then((currentAuthority) => {
const [currentOwner, currentRepo] = currentAuthority.split('+');
return vscode.Uri.parse(
`https://gitpod.io/#https://github.com/${currentOwner}/${currentRepo}`
);
});

export const showGitpod = async () => {
const gitpodRepoUri = await getGitpodRepoUri();

const item = vscode.window.createStatusBarItem(
vscode.StatusBarAlignment.Left,
0
);
item.text = ' $(pencil) Develop your project on Gitpod';
item.tooltip = 'Edit files, open/review PRs, use Docker - all online.';
item.command = {
title: `Open Gitpod`,
command: 'vscode.open',
arguments: [gitpodRepoUri],
};
item.show();
};
32 changes: 16 additions & 16 deletions extensions/github1s/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -405,10 +405,10 @@ bluebird@^3.5.5:
resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f"
integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==

bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.4.0:
version "4.11.9"
resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.9.tgz#26d556829458f9d1e81fc48952493d0ba3507828"
integrity sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==
bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.11.9:
version "4.12.0"
resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88"
integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==

bn.js@^5.0.0, bn.js@^5.1.1:
version "5.1.3"
Expand Down Expand Up @@ -446,7 +446,7 @@ braces@^3.0.1, braces@~3.0.2:
dependencies:
fill-range "^7.0.1"

brorand@^1.0.1:
brorand@^1.0.1, brorand@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f"
integrity sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=
Expand Down Expand Up @@ -874,17 +874,17 @@ duplexify@^3.4.2, duplexify@^3.6.0:
stream-shift "^1.0.0"

elliptic@^6.5.3:
version "6.5.3"
resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.3.tgz#cb59eb2efdaf73a0bd78ccd7015a62ad6e0f93d6"
integrity sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==
version "6.5.4"
resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb"
integrity sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==
dependencies:
bn.js "^4.4.0"
brorand "^1.0.1"
bn.js "^4.11.9"
brorand "^1.1.0"
hash.js "^1.0.0"
hmac-drbg "^1.0.0"
inherits "^2.0.1"
minimalistic-assert "^1.0.0"
minimalistic-crypto-utils "^1.0.0"
hmac-drbg "^1.0.1"
inherits "^2.0.4"
minimalistic-assert "^1.0.1"
minimalistic-crypto-utils "^1.0.1"

emojis-list@^3.0.0:
version "3.0.0"
Expand Down Expand Up @@ -1267,7 +1267,7 @@ hash.js@^1.0.0, hash.js@^1.0.3:
inherits "^2.0.3"
minimalistic-assert "^1.0.1"

hmac-drbg@^1.0.0:
hmac-drbg@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1"
integrity sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=
Expand Down Expand Up @@ -1732,7 +1732,7 @@ minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1:
resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7"
integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==

minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1:
minimalistic-crypto-utils@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a"
integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=
Expand Down
Binary file added resources/images/gitpod-notification.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/gitpod-statusbar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions resources/images/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 19 additions & 10 deletions src/vs/github1s/notification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,30 @@ const NOTIFICATION_STORAGE_KEY = 'GITHUB1S_NOTIFICATION';
// Change this if a new notification should be shown
const NOTIFICATION_STORAGE_VALUE = '20210212';

const notification = {
const getGitpodRepoUrl = () => window.location.pathname.match(/^\/[^\/]+\/[^\/]+/) ? `https://gitpod.io/#https://github.com${window.location.pathname.match(/^\/[^\/]+\/[^\/]+/)![0]}` : '';

const notifications = [{
title: 'ATTENTION: This page is NOT officially provided by GitHub.',
content:
'GitHub1s is an open source project, which is not officially provided by GitHub.',
link: 'https://github.com/conwnet/github1s',
};
}, {
title: `<a class="notification-link" href="${getGitpodRepoUrl()}" alt="Gitpod ready-to-code" target="_blank"><img src="https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod"></a>`,
content:
'Click the button above to develop your project in the cloud.',
}];

const notificationHtml = `
<div class="notification-main">
<div class="notification-title">${notification.title}</div>
<div class="notification-content">
${notification.content}
<a class="notification-link" href="${notification.link}" target="_blank">See more</a>
</div>
</div>
const notificationHtml = `${
notifications.map(notification => (`
<div class="notification-main">
<div class="notification-title">${notification.title}</div>
<div class="notification-content">
${notification.content}
${notification.link ? `<a class="notification-link" href="${notification.link}" target="_blank">See more</a>` : ''}
</div>
</div>`
))
}
<div class="notification-footer">
<button class="notification-confirm-button">OK</button>
<div class="notification-show-me-again">
Expand Down
1 change: 1 addition & 0 deletions src/vs/workbench/contrib/url/browser/trustedDomains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ const github1sDefaultTrustedDomains = [
'*.github1s.com',
'*.vercel.com',
'*.sourcegraph.com',
'*.gitpod.io',
];

export function readStaticTrustedDomains(
Expand Down

1 comment on commit f98aa96

@vercel
Copy link

@vercel vercel bot commented on f98aa96 Mar 12, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.