Skip to content

Commit 0ae1167

Browse files
committed
feat(web-extension): initial scaffold
1 parent 6d1ed2c commit 0ae1167

20 files changed

+6310
-0
lines changed

.github/workflows/submit.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: "Submit to Web Store"
2+
on:
3+
workflow_dispatch:
4+
defaults:
5+
run:
6+
# change this if your app does not live at the root of the repo
7+
working-directory: apps/web-webextension
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
- name: Cache pnpm modules
14+
uses: actions/cache@v3
15+
with:
16+
path: ~/.pnpm-store
17+
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
18+
restore-keys: |
19+
${{ runner.os }}-
20+
- uses: pnpm/action-setup@v2.2.4
21+
with:
22+
version: latest
23+
run_install: true
24+
- name: Use Node.js 16.x
25+
uses: actions/setup-node@v3.4.1
26+
with:
27+
node-version: 16.x
28+
cache: "pnpm"
29+
- name: Build the extension
30+
run: pnpm build
31+
- name: Package the extension into a zip artifact
32+
run: pnpm package
33+
- name: Browser Platform Publish
34+
uses: PlasmoHQ/bpp@v3
35+
with:
36+
keys: ${{ secrets.SUBMIT_KEYS }}
37+
artifact: build/chrome-mv3-prod.zip

README.md

+12
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,18 @@ pnpm install
2222
pnpm dev
2323
```
2424

25+
### Web Extension
26+
27+
To run the extension locally:
28+
29+
```sh
30+
cd apps/web-extension
31+
pnpm install
32+
pnpm dev
33+
```
34+
35+
To view this extension (with HMR), go to `chrome://extensions` and click `Load unpacked` choosing the `build/chrome-mv3-dev` directory. See the [Plasmo Docs](https://docs.plasmo.com/framework#loading-the-extension-in-chrome) for more detail.
36+
2537
### API
2638

2739
To run the api, first create a virtual environment. We provide a sample `environment.yml` file to use with conda environments:

apps/web-extension/.env.example

Whitespace-only changes.

apps/web-extension/.gitignore

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# dependencies
2+
/node_modules
3+
/.pnp
4+
.pnp.js
5+
6+
# testing
7+
/coverage
8+
9+
#cache
10+
.turbo
11+
.next
12+
.vercel
13+
14+
# debug
15+
npm-debug.log*
16+
yarn-debug.log*
17+
yarn-error.log*
18+
.pnpm-debug.log*
19+
20+
out/
21+
build/
22+
dist/
23+
24+
# plasmo
25+
.plasmo
26+
27+
# bpp
28+
keys.json

apps/web-extension/.prettierignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.yarn/
2+
.cache/
3+
.solid/
4+
.husky/
5+
build/
6+
dist/
7+
node_modules/
8+
pnpm-lock.yaml

apps/web-extension/.prettierrc

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"$schema": "https://json.schemastore.org/prettierrc",
3+
"arrowParens": "avoid",
4+
"bracketSpacing": true,
5+
"endOfLine": "auto",
6+
"htmlWhitespaceSensitivity": "css",
7+
"insertPragma": false,
8+
"jsxBracketSameLine": false,
9+
"jsxSingleQuote": false,
10+
"printWidth": 100,
11+
"proseWrap": "preserve",
12+
"quoteProps": "as-needed",
13+
"requirePragma": false,
14+
"semi": true,
15+
"singleQuote": false,
16+
"tabWidth": 4,
17+
"trailingComma": "none",
18+
"useTabs": false,
19+
"vueIndentScriptAndStyle": false,
20+
"plugins": ["prettier-plugin-packagejson", "prettier-plugin-tailwindcss"]
21+
}

apps/web-extension/README.md

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
This is a [Plasmo extension](https://docs.plasmo.com/) project bootstrapped with [`plasmo init`](https://www.npmjs.com/package/plasmo).
2+
3+
## Getting Started
4+
5+
First, run the development server:
6+
7+
```bash
8+
pnpm dev
9+
# or
10+
npm run dev
11+
```
12+
13+
Open your browser and load the appropriate development build. For example, if you are developing for the chrome browser, using manifest v3, use: `build/chrome-mv3-dev`.
14+
15+
You can start editing the popup by modifying `popup.tsx`. It should auto-update as you make changes. To add an options page, simply add a `options.tsx` file to the root of the project, with a react component default exported. Likewise to add a content page, add a `content.ts` file to the root of the project, importing some module and do some logic, then reload the extension on your browser.
16+
17+
For further guidance, [visit our Documentation](https://docs.plasmo.com/)
18+
19+
## Making production build
20+
21+
Run the following:
22+
23+
```bash
24+
pnpm build
25+
# or
26+
npm run build
27+
```
28+
29+
This should create a production bundle for your extension, ready to be zipped and published to the stores.
30+
31+
## Submit to the webstores
32+
33+
The easiest way to deploy your Plasmo extension is to use the built-in [bpp](https://bpp.browser.market) GitHub action. Prior to using this action however, make sure to build your extension and upload the first version to the store to establish the basic credentials. Then, simply follow [this setup instruction](https://docs.plasmo.com/framework/workflows/submit) and you should be on your way for automated submission!
Binary file not shown.
Binary file not shown.

apps/web-extension/assets/icon.png

20.5 KB
Loading

apps/web-extension/package.json

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"name": "web-extension",
3+
"displayName": "SolidChain",
4+
"version": "0.1.0",
5+
"private": true,
6+
"description": "A web extension for interfacing with LLMs",
7+
"license": "MIT",
8+
"author": "Evan Madill <emadill@outlook.com>",
9+
"scripts": {
10+
"build": "plasmo build",
11+
"dev": "plasmo dev",
12+
"package": "plasmo package"
13+
},
14+
"dependencies": {
15+
"clsx": "^1.2.1",
16+
"plasmo": "0.65.3",
17+
"react": "18.2.0",
18+
"react-dom": "18.2.0"
19+
},
20+
"devDependencies": {
21+
"@tailwindcss/typography": "^0.5.9",
22+
"@types/chrome": "0.0.210",
23+
"@types/node": "18.11.18",
24+
"@types/react": "18.0.27",
25+
"@types/react-dom": "18.0.10",
26+
"autoprefixer": "^10.4.13",
27+
"daisyui": "^2.51.3",
28+
"eslint": "^8.35.0",
29+
"postcss": "^8.4.21",
30+
"prettier": "2.8.3",
31+
"prettier-plugin-packagejson": "^2.4.3",
32+
"prettier-plugin-tailwindcss": "^0.2.4",
33+
"tailwindcss": "^3.2.7",
34+
"typescript": "4.9.4"
35+
},
36+
"packageManager": "pnpm@7.28.0",
37+
"engines": {
38+
"node": ">=16.0.0",
39+
"pnpm": ">=7.20.0"
40+
},
41+
"manifest": {
42+
"permissions": [
43+
"contextMenus"
44+
],
45+
"host_permissions": [
46+
"https://*/*"
47+
]
48+
}
49+
}

0 commit comments

Comments
 (0)