Skip to content

Commit b416878

Browse files
CopilotProLoser
andcommitted
Initialize Plasmo project using yarn package manager
Co-authored-by: ProLoser <[email protected]>
1 parent 614b6a6 commit b416878

File tree

10 files changed

+4921
-0
lines changed

10 files changed

+4921
-0
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
*.zip
22
.idea
3+
4+
# Plasmo build artifacts and dependencies
5+
working-plasmo/node_modules/
6+
working-plasmo/build/
7+
working-plasmo/.plasmo/
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

working-plasmo/.gitignore

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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+
# misc
13+
.DS_Store
14+
*.pem
15+
16+
# debug
17+
npm-debug.log*
18+
yarn-debug.log*
19+
yarn-error.log*
20+
.pnpm-debug.log*
21+
22+
# local env files
23+
.env*.local
24+
25+
out/
26+
build/
27+
dist/
28+
29+
# plasmo
30+
.plasmo
31+
32+
# typescript
33+
.tsbuildinfo

working-plasmo/.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+
}

working-plasmo/README.md

Lines changed: 33 additions & 0 deletions
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!

working-plasmo/assets/icon.png

77.9 KB
Loading

working-plasmo/package.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"name": "github-omnibox",
3+
"displayName": "Github omnibox",
4+
"version": "0.0.1",
5+
"description": "Github-powered omnibox for chrome!",
6+
"author": "ProLoser",
7+
"scripts": {
8+
"dev": "plasmo dev",
9+
"build": "plasmo build",
10+
"package": "plasmo package"
11+
},
12+
"dependencies": {
13+
"plasmo": "0.90.5",
14+
"react": "18.2.0",
15+
"react-dom": "18.2.0"
16+
},
17+
"devDependencies": {
18+
"@ianvs/prettier-plugin-sort-imports": "4.1.1",
19+
"@types/chrome": "0.0.258",
20+
"@types/node": "20.11.5",
21+
"@types/react": "18.2.48",
22+
"@types/react-dom": "18.2.18",
23+
"prettier": "3.2.4",
24+
"typescript": "5.3.3"
25+
},
26+
"manifest": {
27+
"host_permissions": [
28+
"https://*/*"
29+
]
30+
}
31+
}

working-plasmo/popup.tsx

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { useState } from "react"
2+
3+
function IndexPopup() {
4+
const [data, setData] = useState("")
5+
6+
return (
7+
<div
8+
style={{
9+
padding: 16
10+
}}>
11+
<h2>
12+
Welcome to your{" "}
13+
<a href="https://www.plasmo.com" target="_blank">
14+
Plasmo
15+
</a>{" "}
16+
Extension!
17+
</h2>
18+
<input onChange={(e) => setData(e.target.value)} value={data} />
19+
<a href="https://docs.plasmo.com" target="_blank">
20+
View Docs
21+
</a>
22+
</div>
23+
)
24+
}
25+
26+
export default IndexPopup

working-plasmo/tsconfig.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"extends": "plasmo/templates/tsconfig.base",
3+
"exclude": [
4+
"node_modules"
5+
],
6+
"include": [
7+
".plasmo/index.d.ts",
8+
"./**/*.ts",
9+
"./**/*.tsx"
10+
],
11+
"compilerOptions": {
12+
"paths": {
13+
"~*": [
14+
"./*"
15+
]
16+
},
17+
"baseUrl": "."
18+
}
19+
}

0 commit comments

Comments
 (0)