Skip to content

Commit

Permalink
mvp version
Browse files Browse the repository at this point in the history
  • Loading branch information
idoubi committed Sep 1, 2023
0 parents commit 6e8f01e
Show file tree
Hide file tree
Showing 22 changed files with 6,141 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/submit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: "Submit to Web Store"
on:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache pnpm modules
uses: actions/cache@v3
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-
- uses: pnpm/[email protected]
with:
version: latest
run_install: true
- name: Use Node.js 16.x
uses: actions/[email protected]
with:
node-version: 16.x
cache: "pnpm"
- name: Build the extension
run: pnpm build
- name: Package the extension into a zip artifact
run: pnpm package
- name: Browser Platform Publish
uses: PlasmoHQ/bpp@v3
with:
keys: ${{ secrets.SUBMIT_KEYS }}
artifact: build/chrome-mv3-prod.zip
39 changes: 39 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@

# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

#cache
.turbo

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# local env files
.env*

out/
build/
dist/

# plasmo - https://www.plasmo.com
.plasmo

# bpp - http://bpp.browser.market/
keys.json

# typescript
.tsbuildinfo
26 changes: 26 additions & 0 deletions .prettierrc.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/**
* @type {import('prettier').Options}
*/
export default {
printWidth: 80,
tabWidth: 2,
useTabs: false,
semi: false,
singleQuote: false,
trailingComma: "none",
bracketSpacing: true,
bracketSameLine: true,
plugins: ["@ianvs/prettier-plugin-sort-imports"],
importOrder: [
"<BUILTIN_MODULES>", // Node.js built-in modules
"<THIRD_PARTY_MODULES>", // Imports not matched by other special words or groups.
"", // Empty line
"^@plasmo/(.*)$",
"",
"^@plasmohq/(.*)$",
"",
"^~(.*)$",
"",
"^[./]"
]
}
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
## What's this

Explain is a Chrome extension used to explain anything you selected in a web page.

## How to use

- install from source code

```shell
cd path-to-source

pnpm install

pnpm dev
```

- import local extension

open `chrome://extensions/`

import unzip dir `path-to-source/build/chrome-mv3-dev`

- custom env variables

open or new a file named `path-to-source/.env`

change to your custom variables

```
PLASMO_PUBLIC_OPENAI_API_KEY=YOUR-OPENAI-API-KEY
```

- use Explain in web page

refresh a web page

select something, right click your mouse

you will see a menu named 'Explain it', click it to Explain what you selected.

## Reference

[plasmo](https://docs.plasmo.com/framework)
Binary file added assets/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 40 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"name": "explain",
"displayName": "Explain",
"version": "0.0.1",
"description": "explain anything you're curious about.",
"author": "idoubi <[email protected]>",
"scripts": {
"dev": "plasmo dev",
"build": "plasmo build",
"package": "plasmo package"
},
"dependencies": {
"@plasmohq/messaging": "^0.5.0",
"openai": "^4.3.1",
"plasmo": "0.82.1",
"react": "18.2.0",
"react-dom": "18.2.0"
},
"devDependencies": {
"@ianvs/prettier-plugin-sort-imports": "4.1.0",
"@types/chrome": "0.0.243",
"@types/node": "20.5.0",
"@types/react": "18.2.20",
"@types/react-dom": "18.2.7",
"autoprefixer": "^10.4.15",
"postcss": "^8.4.29",
"prettier": "3.0.2",
"tailwindcss": "^3.3.3",
"typescript": "5.1.6"
},
"manifest": {
"host_permissions": [
"https://*/*"
],
"permissions": [
"tabs",
"contextMenus"
]
}
}
Loading

0 comments on commit 6e8f01e

Please sign in to comment.