Skip to content

Commit adbf0a4

Browse files
committed
browser extension 2.0
1 parent 4b9e68c commit adbf0a4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+15483
-2285
lines changed

.eslintrc.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"es2021": true
5+
},
6+
"extends": [
7+
"eslint:recommended",
8+
"plugin:@typescript-eslint/recommended",
9+
"plugin:react/recommended"
10+
],
11+
"parser": "@typescript-eslint/parser",
12+
"parserOptions": {
13+
"ecmaVersion": "latest",
14+
"sourceType": "module"
15+
},
16+
"plugins": [
17+
"@typescript-eslint",
18+
"react"
19+
],
20+
"rules": {
21+
}
22+
}

.github/workflows/submit.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: "Submit to Web Store"
2+
on:
3+
workflow_dispatch:
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v3
10+
- name: Cache pnpm modules
11+
uses: actions/cache@v3
12+
with:
13+
path: ~/.pnpm-store
14+
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
15+
restore-keys: |
16+
${{ runner.os }}-
17+
- uses: pnpm/[email protected]
18+
with:
19+
version: latest
20+
run_install: true
21+
- name: Use Node.js 16.x
22+
uses: actions/[email protected]
23+
with:
24+
node-version: 16.x
25+
cache: "pnpm"
26+
- name: Build the extension
27+
run: pnpm build
28+
- name: Package the extension into a zip artifact
29+
run: pnpm package
30+
- name: Browser Platform Publish
31+
uses: PlasmoHQ/bpp@v3
32+
with:
33+
keys: ${{ secrets.SUBMIT_KEYS }}
34+
artifact: build/chrome-mv3-prod.zip

.gitignore

Lines changed: 42 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,42 @@
1-
*.log
2-
dist
3-
gitpod.xpi
4-
node_modules
5-
Gitpod
1+
2+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
3+
4+
# dependencies
5+
node_modules/
6+
/.pnp
7+
.pnp.js
8+
9+
# testing
10+
/coverage
11+
12+
#cache
13+
.turbo
14+
15+
# dev tools
16+
.bin
17+
18+
# misc
19+
.DS_Store
20+
*.pem
21+
22+
# debug
23+
npm-debug.log*
24+
yarn-debug.log*
25+
yarn-error.log*
26+
.pnpm-debug.log*
27+
28+
# local env files
29+
.env*
30+
31+
out/
32+
build/
33+
dist/
34+
35+
# plasmo - https://www.plasmo.com
36+
.plasmo
37+
38+
# bpp - http://bpp.browser.market/
39+
keys.json
40+
41+
# typescript
42+
.tsbuildinfo

.gitpod.yml

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,16 @@
11
image:
22
file: .gitpod.Dockerfile
3+
34
tasks:
4-
- name: Google Chrome
5-
command: >
6-
gp sync-await start &&
7-
gp await-port 6080 &&
8-
for i in `seq 10 -1 1` ; do echo -ne "\rStarting Chrome in $i " && sleep 1 && echo -ne "\r" ; done &&
9-
google-chrome --no-first-run --disable-dev-shm-usage --start-maximized --load-extension=/workspace/browser-extension https://github.com/gitpod-io/template-sveltekit
10-
- name: Webpack Dev Server
11-
init: yarn install && yarn build && yarn package
12-
command: >
13-
gp sync-done start &&
14-
yarn watch
5+
- init: |
6+
pnpm install
7+
pnpm build
8+
pnpm build-dev-tools
9+
pnpm test
10+
command: |
11+
pnpm build
12+
1513
ports:
16-
- name: NoVNC
17-
port: 6080
18-
onOpen: open-preview
19-
- name: Webpack Dev Server
20-
port: 5900
14+
- name: sync
15+
port: 8080
2116
onOpen: ignore

.prettierrc.mjs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/**
2+
* @type {import('prettier').Options}
3+
*/
4+
export default {
5+
printWidth: 80,
6+
tabWidth: 2,
7+
useTabs: false,
8+
semi: false,
9+
singleQuote: false,
10+
trailingComma: "none",
11+
bracketSpacing: true,
12+
bracketSameLine: true,
13+
plugins: ["@ianvs/prettier-plugin-sort-imports"],
14+
importOrder: [
15+
"<BUILTIN_MODULES>", // Node.js built-in modules
16+
"<THIRD_PARTY_MODULES>", // Imports not matched by other special words or groups.
17+
"", // Empty line
18+
"^@plasmo/(.*)$",
19+
"",
20+
"^@plasmohq/(.*)$",
21+
"",
22+
"^~(.*)$",
23+
"",
24+
"^[./]"
25+
]
26+
}

README.md

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,34 @@ This is the browser extension for Gitpod. It supports Chrome (see [Chrome Web St
55

66
![Gitpodify](./docs/github-injected.png "Gitpodify")
77

8-
9-
## Contributing
10-
11-
Contributions to this project are welcome!
12-
138
### Issues
149

1510
We are currently tracking all issues related to the browser extension in the [`gitpod-io/gitpod`](https://github.com/gitpod-io/gitpod) repository.
1611
You can use the [`component: browser-extension`](https://github.com/gitpod-io/gitpod/issues?q=is%3Aissue+is%3Aopen+extension+label%3A%22component%3A+browser-extension%22) label to search for relevant issues including feature proposals and bug reports.
1712

1813
### Development
1914

20-
To make changes and test them, the easiest way is using Gitpod itself. The `.gitpod.yml` configuration for this project installs Google Chrome and runs a VNC server to allow users to see the Desktop of the Docker container. When a workspace starts, Google Chrome is started with the Gitpod extension automatically built from source and pre-installed, therefore you can preview your changes in the ephemeral Chrome browser. 🤯
21-
22-
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/gitpod-io/browser-extension)
15+
To make changes and test them using Gitpod itself:
16+
17+
- add test cases to the [unit test](https://github.com/gitpod-io/browser-extension/blob/se/plasmo/test/src/button-contributions.spec.ts#L39)
18+
- try out changes like this:
19+
1. run `pnpm build`
20+
1. run `pnpm watch-prod` and download the built binary for your system (local machine)
21+
1. run the binary aywhere on your local machine tosync the extension folder locally.
22+
1. open Chrome and go to `chrome://extensions/`
23+
1. enable `Developer mode` (top right)
24+
1. click `Load unpacked` (top left) and select the folder you just downloaded
25+
1. now you can test your changes
26+
1. repeat step 1 and 2 and [reload the extension](chrome://extensions/) whenever you want to test new changes
2327

2428
#### Build
2529

2630
The build happens automatically when you start a workspace but if you want to build explicitly, use these commands:
2731

2832
```
29-
yarn install
30-
yarn build
31-
yarn package
33+
pnpm install
34+
pnpm build
35+
pnpm package
3236
```
3337

3438
### Testing
File renamed without changes.

css/gitpodify.css

Lines changed: 0 additions & 58 deletions
This file was deleted.

dev/build.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
ROOT=/workspace/browser-extension
4+
cd $ROOT/dev/http-file-sync
5+
6+
echo "building binaries ..."
7+
go build -o $ROOT/.bin/watch-sync
8+
GOARCH=amd64 GOOS=darwin go build -o $ROOT/.bin/watch-sync-osx-x86_64
9+
GOARCH=arm64 GOOS=darwin go build -o $ROOT/.bin/watch-sync-osx-arm64

dev/http-file-sync/go.mod

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
module gitpod.io/http-file-sync
2+
3+
go 1.19
4+
5+
require (
6+
github.com/fsnotify/fsnotify v1.6.0
7+
github.com/spf13/cobra v1.7.0
8+
)
9+
10+
require (
11+
github.com/inconshreveable/mousetrap v1.1.0 // indirect
12+
github.com/spf13/pflag v1.0.5 // indirect
13+
golang.org/x/sys v0.12.0 // indirect
14+
)

0 commit comments

Comments
 (0)